Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1.4 KiB
1.4 KiB
Phase 20.34 — P1/P2 Sweep (JsonFrag/PatternUtil, loop_form using)
Status: Completed (2025-11-03)
Scope
- P1: Replace ad‑hoc JSON scans with JsonFragBox and unify reverse lookups via PatternUtilBox.
- P2: Remove
includefrom loop_form lowers and rely onusingonly.
Changes
- JsonFragBox adoption
- Use
read_int_after(text, kv+8),read_bool_after(text, kv+8),read_string_after(text, k+5)consistently. - Locate keys with
index_of_from(text, "\"key\":", pos).
- Use
- PatternUtilBox adoption
find_local_int_before(text, name, before_pos)andfind_local_bool_before(...)for reverse lookups.- Optional:
map_cmpfor operator mapping (<, >, <=, >=, ==, != → Lt, Gt, ...).
- loop_form lowers
lower_loop_simple/count_param/sum_bc: removeincludeof loop_form; keepusing selfhost.shared.mir.loopform as LoopFormBox.
Verification
- Internal lowers canaries: PASS (structure, value paths). Logical Var/Var lower (direct) is green.
- Emit→Core rc verification: use
verify_mir_rcwithHAKO_VERIFY_PRIMARY=hakovmwhile Core rc line is being normalized. - Test runner fixes: guard unset
prefile; JSON extraction viajqwith leading noise stripping.
Policy
- Behavior invariant (fail‑fast). New toggles default OFF. Minimal, localized diffs only.
Next
- Continue registry migration for MirBuilder (toggle‑guarded).
- Migrate remaining non‑internal
includesites in a separate PR.