From c5591de12435906e5198a9f30294fd6db566ed4d Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Wed, 30 Sep 2026 19:03:25 -0600 Subject: [PATCH] router: T6 done --- phase-ends/current/PHASE_PLAN.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phase-ends/current/PHASE_PLAN.md b/phase-ends/current/PHASE_PLAN.md index 83530d9a87..833eb01b98 100644 --- a/phase-ends/current/PHASE_PLAN.md +++ b/phase-ends/current/PHASE_PLAN.md @@ -77,7 +77,7 @@ C0507 (§458 struct spelling per-access dial), C0508 (§459 declaration-layer by - T5 | superseded | expert-opus55 | title: long tail — one definition per type | coder: opus55 | effort: medium | files: src/shared/engine_types.h, src/shared/**, src/**/*.c, tools/lift_types.py | done-when: remaining duplicate classes folded via `lift_types.py --apply` and rung-L cycles; 40 variant camps uniquified; dead canonical names deleted; the 26 legacy `pad` names renamed to `unkHEX`/`pad_` form; PsyQ layouts carry Sony's SDK names; layout twins without evidence left apart and listed; `--check-structs` gating counts dup_classes/outside_canon/dead/variants/pad_names all 0 | verify: `.venv/bin/python tools/type_census.py --out-dir .run/P38/census --check-structs; make clean && make extract-all JOBS=16 && make check-all JOBS=16` | reads: tasks/T2.md, tasks/T3.md, tasks/T4.md | deps: T4 | est-ctx: 130k | review: no | wait-for: — `lift_types.py --candidates` → dry-run → `--apply` per type list; C0067's three laws and C0224 (typedef before every splice point). A tool defect in `lift_types.py` is fixed in this task (product tooling). Commit per batch (R42) before the next gate. - T5.1 | done | expert-opus55 | coder: opus55 | effort: medium | title: long tail — one definition per type (gate reading fixed) | files: src/shared/engine_types.h, include/struct_types.h, src/**, tools/lift_types.py, tools/type_census.py, docs/struct-twins.md, docs/struct-map-decisions.md | done-when: dead: type_census counts identifier uses inside the canonical headers (a canon type used as member/alias/typedef by a live canon type is not dead) and identifiers of any length; +1 selftest (member-only canon type not dead); residual dead names deleted or each listed with its invisible-use cause; dup_classes: tier-1 classes gate unchanged; a tier-2 (all-placeholder) class gates unless listed in docs/struct-twins.md with its lhash, names and a per-class cause citing struct_map base objects/addresses; census reads the file, fails on a stale lhash, prints non-gating twins_listed=N; outside_canon: a block-scope definition that declares an object in the same statement (stack frame) and sits in no gating dup class is reported non-gating as block_frames=N; every other body (ov/md/main file-scope, per-function shared headers, other headers) relocated to the canonical files (lift_types.py extended beyond ov file-scope); PsyQ layouts carry Sony SDK names; the Unkstruct_800B5CB8 split/union call made from T4's kept units (DIFFERS 29, pad3C 3) and recorded in docs/struct-map-decisions.md; --check-structs gating counts dup_classes/outside_canon/dead/variants/pad_names all 0; R22 green | verify: .venv/bin/python tools/type_census.py --selftest && .venv/bin/python tools/type_census.py --out-dir .run/P38/census --no-cache --check-structs; make clean && make extract-all JOBS=16 && make check-all JOBS=16 | reads: tasks/T2.md, tasks/T4.md, tasks/T5.md | deps: T4 | est-ctx: 130k | review: no | wait-for: — -- T6 | queued | expert-opus55 | title: declaration layer on the canonical types | coder: opus55 | effort: medium | files: src/**/*.c, src/**/*.h, src/800.c | done-when: `restruct.py --redraw DECL-KEPT:type` (type-not-visible) and `DECL-KEPT:conflicting` redrawn to exhaustion and the remainder bucketed; `--check-structs` parse_error_decls = 0; the 13 `src/800.c` syntax-error units and the 45 TU-CONFLICT rows each resolved or kept with a named cause; summary reports before/after for types-floor lying (1,537), conflicting types (417), TU-CONFLICT (45) | verify: `.venv/bin/python tools/type_census.py --out-dir .run/P38/census --check-structs; .venv/bin/python tools/restruct.py --check-ledger && make clean && make extract-all JOBS=16 && make check-all JOBS=16` | reads: tasks/T1.md, tasks/T5.md | deps: T5 | est-ctx: 110k | review: no | wait-for: — +- T6 | done | expert-opus55 | title: declaration layer on the canonical types | coder: opus55 | effort: medium | files: src/**/*.c, src/**/*.h, src/800.c | done-when: `restruct.py --redraw DECL-KEPT:type` (type-not-visible) and `DECL-KEPT:conflicting` redrawn to exhaustion and the remainder bucketed; `--check-structs` parse_error_decls = 0; the 13 `src/800.c` syntax-error units and the 45 TU-CONFLICT rows each resolved or kept with a named cause; summary reports before/after for types-floor lying (1,537), conflicting types (417), TU-CONFLICT (45) | verify: `.venv/bin/python tools/type_census.py --out-dir .run/P38/census --check-structs; .venv/bin/python tools/restruct.py --check-ledger && make clean && make extract-all JOBS=16 && make check-all JOBS=16` | reads: tasks/T1.md, tasks/T5.md | deps: T5 | est-ctx: 110k | review: no | wait-for: — Out of scope (other phases): jr-merged callers (3.44), void-def/`$v0` and zero-arg `$a0` callers, return-type lies (3.40), cast sites (3.39). Grep callers before any signature unit. - T7 | queued | expert-opus55 | title: milestone gate and record | coder: none | effort: medium | files: docs/struct-map.md, docs/levers.md, cookbook/, phase-ends/current/ | done-when: `--check-structs` exit 0 on a fresh census; R22 218/218 at the closing commit; `type_census --selftest`, `restruct --selftest --real`, `lever_progress --check` OK; `docs/struct-map.md` regenerated; cookbook §396(a) correction and the phase's generalizable gotchas added via `tools/cookbook_add.sh` | verify: `.venv/bin/python tools/type_census.py --out-dir .run/P38/census --no-cache --check-structs && make clean && make extract-all JOBS=16 && make check-all JOBS=16` | reads: tasks/T1.md, tasks/T4.md, tasks/T5.md, tasks/T6.md | deps: T6 | est-ctx: 60k | review: no | wait-for: — - T8 | queued | expert-opus55 | coder: opus55 | effort: medium | title: docs/formats.md: LIST.CD verified on US, runtime reader, repack note (issue #2) | files: docs/formats.md | done-when: docs/formats.md §2.3 marked verified on US (8 tables in order, 0xE40 bytes); §2.1 names LoaderInitFileTable (0x8001971C) and cdFileLocTable (0x800AE830) as the runtime reader; a note says repacking must rebuild LIST.CD and the ISO directory; docs link check passes; no ROM bytes added (R74) | verify: — | reads: — | deps: — | est-ctx: — | review: no | wait-for: — @@ -103,3 +103,4 @@ C0507 (§458 struct spelling per-access dial), C0508 (§459 declaration-layer by - 2026-09-30 router: developer: milestone reading for --check-structs: dup_classes gates tier-1 plus unlisted tier-2 (docs/struct-twins.md with per-class evidence); outside_canon excludes object-declaring block-scope stack frames (reported block_frames=N); dead counts intra-canon uses. Header line unchanged; verified by exit 0 under this reading - 2026-09-30 developer: T8 also corrects docs/formats.md §4.4 (the game does NOT expect a zero-filled LZSS ring: the ring lives in scratchpad 0x1F800000 and is never cleared, so a valid stream must not read an unwritten slot) and adds to §4.6 the rule that a type-4 stream's terminator must land in the same 2048-byte sector as in the retail file (the decoder drops the rest of that sector and the loader then checks the next sector for the PAC magic; e.g. SC01.CD sub-file 1 stream must be 407,553-409,600 bytes); evidence: src/800.c LzssDecodeSector ~5465-5515, sector callback ~7198/7315, discussion of issue #2 - 2026-09-30 router: T5.1 next -> done +- 2026-09-30 router: T6 next -> done