Commit Graph

2 Commits

Author SHA1 Message Date
Drew T f8d8f13b98 feat(phase-29): fix_header_decl v2 (--reconcile-externs) + SESSION-13 cont checkpoint
v2 generalizes v1: also reconciles CALLEE decls in shared headers that a
byte-perfect draft declares differently than engine_core.h (sources the byte-true
sig from the draft's `extern` line; reuses v1's compatible/build_decl machinery).
--check validated: func_80174CB0 -> func_80012C6C s32->s16 (all SAFE); v1 unbroken
(func_8014CD80 ALREADY-OK). The byte-gate + R22 arbitrate scalar-width changes.

Known limitation (byte-gate caught it, fail-closed, nothing banked): v2 fixes only
src/shared/*.h, not per-overlay-local decls — func_80174CB0 stays blocked by a local
decl of func_80012C6C in ov_SC07_006_jr_8015C32C.c:8523. v3 = extend to the overlay
split .c (carried in the checkpoint).

Also in flight (checkpoint): crack wave w9lidyi5b (24 fresh LIVE=138 families,
running) + permuter winner func_8014D12C (score-0, staged) — both gate-on-completion.
2026-07-23 12:42:43 -06:00
Drew T cbb52ebce1 feat(phase-29): fix_header_decl.py — automate the fresh-138 def-side header reconcile (§63)
Builds + self-tests the tool that reconciles a shared-header forward-decl to a
function's byte-true signature — the integration half of the proven func_8014CD80
x138 pipeline.

- tools/fix_header_decl.py: --fn --draft [--check|--apply]. Parses the byte-true
  def sig, canon-compares (typedef-aware int==s32, unsigned short*==u16* -> skip
  ALREADY-OK), REFUSES ABI-changing rewrites (param-count / ptr<->scalar / scalar
  class), preserves the macro `\` continuation, snapshots + prints the git-restore
  (§61: undo = restore, validate fleet-wide by R22).
- 4 self-tests pass: (1) idempotent on the already-fixed func_8014CD80; (2) correct
  rewrite + `\` preserved; (3) REFUSE on a 2-vs-3-param ABI mismatch; (4) end-to-end
  --apply on func_8014D12C turned the `conflicting types` PLUMBING into a clean
  codegen DIFF (plumbing dissolved; its body is a near-miss so no bank), reverted
  clean. The self-test CAUGHT two fleet-corrupting bugs before any apply (a dropped
  macro `\`, and non-idempotent int/s32).
- cookbook §63 + CURRENT_PHASE. NEXT: fresh-family wave over the 38-family market
  -> fix_header_decl --apply -> harvest_verify -> dedup_propagate -> R22.
2026-07-23 12:15:49 -06:00