phase29aq(p2): add index_of_string/to_upper stdlib subsets

This commit is contained in:
2025-12-31 11:37:27 +09:00
parent 4c3070cedd
commit ead9a1edeb
16 changed files with 312 additions and 33 deletions

View File

@ -3,7 +3,7 @@
## Current Focus
- Phase: `docs/development/current/main/phases/phase-29aq/README.md`
- Next: Phase 29aq P2 (stdlib scan subset extensions)
- Next: Phase 29aq P3 (stdlib split/scan derivatives)
## Gate (SSOT)

View File

@ -5,7 +5,7 @@ Scope: 「次にやる候補」を短く列挙するメモ。入口は `docs/dev
## Active
- Phase 29aq: `docs/development/current/main/phases/phase-29aq/README.md` (Next: P2 scan subsets)
- Phase 29aq: `docs/development/current/main/phases/phase-29aq/README.md` (Next: P3 split/scan derivatives)
- JoinIR regression gate SSOT: `docs/development/current/main/phases/phase-29ae/README.md`
- CorePlan hardening (docs-first): `docs/development/current/main/phases/phase-29al/README.md`

View File

@ -34,7 +34,7 @@ Related:
## 1.1 Current (active)
- Active phase: `docs/development/current/main/phases/phase-29aq/README.md`
- Next step: Phase 29aq P2 (stdlib scan subset extensions)
- Next step: Phase 29aq P3 (stdlib split/scan derivatives)
## 2. すでに固めた SSOT再発防止の土台

View File

@ -17,8 +17,10 @@ Goal: JoinIR の最小回帰セットを SSOT として固定する。
- Pattern1 (stdlib join, VM): `phase29ap_stringutils_join_vm`
- ScanWithInit (stdlib index_of, VM): `phase29aq_string_index_of_min_vm`
- ScanWithInit (stdlib last_index_of, VM): `phase29aq_string_last_index_of_min_vm`
- ScanWithInit (stdlib index_of_string, VM): `phase29aq_string_index_of_string_min_vm`
- Pattern2 (stdlib parse_integer, VM): `phase29aq_string_parse_integer_min_vm`
- SplitScan (stdlib split, VM): `phase29aq_string_split_min_vm`
- Pattern1 (stdlib to_upper, VM): `phase29aq_string_to_upper_min_vm`
- Pattern5 (Break, VM): `phase286_pattern5_break_vm`
- Pattern5 (strict shadow, VM): `phase29ao_pattern5_strict_shadow_vm`
- Pattern5 (release adopt, VM): `phase29ao_pattern5_release_adopt_vm`

View File

@ -0,0 +1,58 @@
---
Status: Done
Scope: stdlib subsets (index_of_string, to_upper)
Related:
- docs/development/current/main/phases/phase-29aq/README.md
- docs/development/current/main/phases/phase-29ae/README.md
---
# Phase 29aq P2: stdlib subsets (index_of_string, to_upper)
Goal: add two stdlib subsets with fixtures and integration smokes, wired to the
JoinIR regression gate (phase29ae pack).
## P2-1: to_upper (Pattern1CharMap)
Target: `apps/lib/json_native/utils/string.hako`
- loop(i < s.length())
- local ch = s.substring(i, i + 1)
- result = result + this.char_to_upper(ch)
- i = i + 1
Notes:
- Use existing Pattern1CharMap facts/planner/normalizer path.
- No new CorePlan vocabulary or logs.
Fixtures/smokes:
- `apps/tests/phase29aq_string_to_upper_min.hako`
- `tools/smokes/v2/profiles/integration/joinir/phase29aq_string_to_upper_min_vm.sh`
## P2-2: index_of_string (ScanWithInit dynamic needle)
Target: `apps/lib/json_native/utils/string.hako`
- loop(i <= s.length() - substr.length())
- if s.substring(i, i + substr.length()) == substr { return i }
- i = i + 1
- return -1
Notes:
- Treat as ScanWithInit with dynamic needle length.
- Facts must detect the dynamic needle length and forward scan shape.
Fixtures/smokes:
- `apps/tests/phase29aq_string_index_of_string_min.hako`
- `tools/smokes/v2/profiles/integration/joinir/phase29aq_string_index_of_string_min_vm.sh`
## Gate wiring (SSOT)
- Add both smokes to `tools/smokes/v2/profiles/integration/joinir/phase29aq_stdlib_pack_vm.sh`.
- Ensure `phase29ae_regression_pack_vm.sh` runs the stdlib pack.
- Update `docs/development/current/main/phases/phase-29ae/README.md`.
## Verification
- `cargo build --release`
- `./tools/smokes/v2/run.sh --profile quick`
- `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`

View File

@ -57,7 +57,8 @@ Plan/Composer subsets (or mark unsupported) before adding new subsets.
## Progress
- P1: Add stdlib subsets in priority order (index_of/last_index_of → parse_integer → split).
- P2: Add stdlib subsets (index_of_string → to_upper).
## Next (planned)
- P2: Extend stdlib scan subsets (candidate: index_of_string, to_upper).
- P3: Expand split/scan derivatives (candidate: starts_with/ends_with).