Files
BFM-decomp/decomp-architect/corpus/record
Drew T 861dd0651c phase-36: T7 toolify a1 — generator R15, the sink (agent a1's crack made mechanical; reproduces it from the pre-bank text at score 0)
The harvest half of the one-at-a-time loop (R16): agent a1's reading of func_80156044 is now a move the engine can make
on any body, so the remaining head classes get it for free.

- R15 sinks the statement AFTER an if/else chain into every arm and deletes the variables it consumed:
  `if (c) { v = e1; } else { v = e2; } w = f(v);` -> `if (c) { w = f(e1); } else { w = f(e2); }`.
- it is a REGISTER move, not a scheduling one. A value set in every arm and read after the merge is a cross-block pseudo
  local-alloc never gives a quantity (local-alloc.c:472, next_qty reset at :517), so the arm holds two quantities and
  takes block_alloc's unrolled case 2 (:1499-1502, qty_compare :1578-1596). Sinking makes it a third block-local
  quantity, and case 3 (:1491-1496) falls through into case 2 and applies that comparison a second time, undoing its own
  exchange — the two caller-saved colours swap. It also takes the value out of global.c, where set_preference
  (global.c:1535+) had given it a copy preference through the merge result's argument copy.
- applicability is checked, never assumed: each consumed variable must be assigned exactly once in every arm by a simple
  statement, appear in the merge statement, and occur nowhere else in the function.
- if_chains() counts a line's CLOSING braces before its opening ones. On a `} else if (...) {` line the two net to zero
  and the first version's depth counter never closed the arm — the generator found 0 candidates on the very body it was
  written from. Caught by running it on that known-true case before believing it.
- ranked third in REG-caller / REG-mixed / COUNT; the engine selftest's "R5 in the first three" assertion widened to
  "R5 and R15 in the first four" rather than de-ranking the new move.
- verified: delever --selftest OK (3 new controls: a variable read after the merge, a variable one arm does not set, the
  brace walk's three arms); delever_search --selftest OK; and the known-true check — R15 run on func_80156044's
  pre-bank text emits the agent's crack and `--try` scores it
  `score 0 (OTHER; mine 74 ins, target 74) — MATCH`.
- SETUP row rewritten (R21), kit corpus regenerated, tool_census --check OK (371 copies + 30 pointers, 0 gaps).
- no src/ change in this commit; the sweep of the other 56 head classes follows.
2026-09-10 00:45:15 -06:00
..

The inherited record — the source project's distilled records and its phase-by-phase record, verbatim

The files beside this page are copied byte for byte from the source project by its census tool and asserted equal on every health check; nothing here is edited by hand. The kit's rules, kernels and methodology were DISTILLED from these files; this folder is the source they were distilled from, so that a reader can go back to the evidence instead of trusting the summary. Read this page first; it says what each file is and how to read it.

What is here

Folder / file What it is How to read it
how-to/ (13 chapters) the transferable method written for the next project: governance, the byte gate, the bootstrap order, oracles and instruments, cards/lanes/waves, the knowledge base, the compiler's source, models and budgets, the economics as measured, integration and propagation, publishing, and the failure museum in order, from chapter 00; it is the long form of the kit's methodology, with the measurements
docs/decision-log.md the WHY of every strategic pivot, appended while it hurt: context and belief → what failed → the pivot → the measurement-grounded why → a hindsight "better path" by date or by the phase named in a heading; the hindsight sections are what the retrospective mined
docs/accelerators.md what was learned late that a future project should know on day one — each entry with when it was found, when it could have been found, and what it would have saved whole; every entry is cited by a kernel or dispositioned (the kit's coverage check asserts this)
docs/retrospective.md what was believed, what failed, what it cost, what to do sooner — mined by tool from the decision log's hindsight bullets and every phase-end's deviations table whole
docs/story.md the narrative, phase by phase, for a reader who was not there whole, once
docs/wave-playbook.md THE procedure for a drafting wave — draw, cards, packs, draft, gate, twin sweep, harvest, checkpoint — each guard paired with the measurement behind it when you run your first wave; the kit's playbook skeleton is this file with the measurement column emptied
docs/effort-map.md the effort doctrine as it was actually operated: which task gets the deepest reasoning, which gets breadth, and why before your first phase plan
docs/gen3-standards.md, docs/gen3-handoff.md the readability charter (the community's bar, the four house rules, the use-of-AI conduct, a definition of done) and the census of what 100% looked like before it when you set your own bar — the kit's Part C inversions come from here
phase-ends/DIGEST.md one page per phase (what it delivered, its key finding, its rules) and every rule of the source project in full the entry point to the phase record: read a synopsis, then the PhaseEnd it names
build/tools-health.mk the source project's HEALTH CHAIN — the ordered tools-health (and audit-digest) recipe of its Makefile, extracted verbatim by the census tool, a comment per rung naming the incident that earned it: signatures fresh, the corpus oracle, the declaration audit, the binary census, the report and its lint, the digest freshness, the wall-clock and work-evidence guards, the docs and kit checks when you build your own health target (Phase 3 onward): keep the ORDER and the reasons, swap in your tools rung by rung as they exist; sample by default, keep the exhaustive form behind its own name
phase-ends/PhaseEnd_*.md (every phase) the durable record of each phase: the build log, the literal verification results, the milestone and its proof, the deviations from the plan, the rules proposed, and — from the later phases — "what we believed, what failed, what we would do sooner" on demand, never whole: the digest names the phase; open that file for the detail

What is deliberately NOT here

  • The phase worklogs (the source project's phase-ends/logs/, some 30,000 lines). They are the raw per-task trail and are on-demand archives even in the source project. Their lessons reached the records above at the time (its rule: capture while it hurts), and a dedicated pass at the end read every log once more for anything that had not — those findings were banked into the kernels and the accelerators, so nothing in the logs is missing from this folder's distillation.
  • The cookbook, its symptom index and the codegen map — the sibling folder ../cookbook/ (its own front page says what transfers per compiler). The tools — ../tools/ with its need-keyed index.
  • The project-specific references (the memory map, the disc formats, the environment reference, the symbol files): they describe one game and one machine and do not transfer.

The vocabulary you will meet

These files are the source project's and use its names: its rules by number, its phases and sessions, its tools by file name, its functions by address, its binaries by alias. The kit's rules (templates/registry-E.decomp.md) and kernels (decomp-kernels.md) are the translation; each carries a provenance: line pointing back into this record.