2025-12-31 08:41:59 +09:00
|
|
|
---
|
|
|
|
|
Status: Active
|
|
|
|
|
Scope: stdlib trim/parse loop inventory (docs-first)
|
|
|
|
|
Related:
|
|
|
|
|
- docs/development/current/main/design/coreplan-migration-roadmap-ssot.md
|
|
|
|
|
- docs/development/current/main/phases/phase-29ae/README.md
|
|
|
|
|
- docs/development/current/main/phases/phase-29ap/README.md
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# Phase 29aq: stdlib trim/parse loop inventory (docs-first)
|
|
|
|
|
|
|
|
|
|
Goal: inventory loop shapes in json_native stdlib and map them to conservative
|
|
|
|
|
Plan/Composer subsets (or mark unsupported) before adding new subsets.
|
|
|
|
|
|
|
|
|
|
## Ok(None) / Freeze boundary (SSOT)
|
|
|
|
|
|
|
|
|
|
- Ok(None): non-matching shapes (default).
|
|
|
|
|
- Freeze: only when a shape is explicitly gated and contradictory; do not add
|
|
|
|
|
new Freeze cases in P0.
|
|
|
|
|
|
|
|
|
|
## Fixture / smoke naming (SSOT)
|
|
|
|
|
|
|
|
|
|
- Fixtures: `apps/tests/phase29aq_<area>_<func>_<shape>_min.hako`
|
|
|
|
|
- Smokes: `tools/smokes/v2/profiles/integration/joinir/phase29aq_<area>_<func>_<shape>_vm.sh`
|
|
|
|
|
- Gate: wire into `phase29ae_regression_pack_vm.sh` when a subset is added.
|
|
|
|
|
|
|
|
|
|
## Inventory (stdlib json_native)
|
|
|
|
|
|
|
|
|
|
### StringUtils (`apps/lib/json_native/utils/string.hako`)
|
|
|
|
|
|
|
|
|
|
| Function | Loop summary | Provisional bucket | Notes |
|
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
|
| `trim_start` | scan until non-whitespace, `break` | Pattern2Break | Subset already exists (Phase 29ap P6) |
|
|
|
|
|
| `trim_end` | reverse scan until non-whitespace, `break` | Pattern2Break | Subset already exists (Phase 29ap P6) |
|
|
|
|
|
| `index_of` | scan, early `return` on match | ScanWithInit | Needs return-in-loop handling |
|
|
|
|
|
| `last_index_of` | reverse scan, early `return` | ScanWithInit | Needs return-in-loop handling |
|
|
|
|
|
| `index_of_string` | scan substrings, early `return` | SplitScan | Candidate subset |
|
|
|
|
|
| `to_upper` | scan + accumulate | ScanWithInit | Candidate subset |
|
|
|
|
|
| `to_lower` | scan + accumulate | Pattern1 subset | Already migrated (Phase 29ap P2) |
|
|
|
|
|
| `join` | array join with `if i > 0` separator | Pattern1 subset | Already migrated (Phase 29ap P3) |
|
|
|
|
|
| `split` | scan + push segments | SplitScan | Candidate subset |
|
|
|
|
|
| `is_integer` | scan digits, early `return false` | Unsupported | Return-heavy; needs design |
|
|
|
|
|
| `parse_integer` | scan digits, `break` on invalid | Pattern2Break | Candidate subset |
|
|
|
|
|
|
|
|
|
|
### Lexer / Parser (out of scope for P0)
|
|
|
|
|
|
|
|
|
|
| File | Loop summary | Provisional bucket | Notes |
|
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
|
| `lexer/scanner.hako` | scan loops with nested loops (string/number) | Unsupported | Multiple nested scans |
|
|
|
|
|
| `lexer/tokenizer.hako` | tokenize loop with `break`/`continue` | Unsupported | Control-flow heavy |
|
|
|
|
|
| `parser/parser.hako` | `loop(true)` object/array parse | Unsupported | Structured parse loop |
|
|
|
|
|
| `utils/escape.hako` | escape/unescape scans | Unsupported | Nested scan/branching |
|
|
|
|
|
| `core/node.hako` | collection iteration loops | Unsupported | Not a parsing scan |
|
|
|
|
|
|
|
|
|
|
## Next (planned)
|
|
|
|
|
|
2025-12-31 11:02:01 +09:00
|
|
|
## Progress
|
|
|
|
|
|
2025-12-31 10:46:25 +09:00
|
|
|
- P1: Add stdlib subsets in priority order (index_of/last_index_of → parse_integer → split).
|
2025-12-31 11:02:01 +09:00
|
|
|
|
|
|
|
|
## Next (planned)
|
|
|
|
|
|
|
|
|
|
- P2: Extend stdlib scan subsets (candidate: index_of_string, to_upper).
|