Files
BFM-decomp/phase-ends/current/logs/T3.c7.md
T

3.0 KiB

T3.c7 — rung S residue rows (ledger only)

Changed

  • tools/restruct.py:16-17 docstring usage lines.
  • tools/restruct.py:3416-3510 new: RESIDUE_FILE_UNIT = "<file-scope>", residue_cause, residue_sites, residue_rows, residue (--residue), check_residue (--check-residue).
  • tools/restruct.py:5015-5033 selftest: 2 ok(...) cases (one per mode) over fixture .run/P37/restruct/selftest/residue_sites.jsonl.
  • tools/restruct.py:5086-5087, 5119-5124 argparse --residue (rung S only), --check-residue.
  • .run/P37/restruct/ledger.jsonl (tracked): +34131 appended rows, label t3_resid; no existing row touched (diff is pure append; backup .run/T3/ledger.pre_c7.jsonl).

Design

  • residue set = census P/X sites (sites.jsonl) in TUs matching --only (default ov_*, matches_only) whose ("S", tu, unit) has no ledger_latest row; unit = fn or <file-scope> (site fn null).
  • row: keys as rung-S rows; fn null + addr null for <file-scope>; nhash_before == nhash_after == current body nhash (body_nhash); for <file-scope> the norm hash of the whole masked file; None if body gone (0 such rows in t3_resid).
  • site entry {form, line, base bclass:base, off, type, verdict RESIDUAL(<cause>), cause}. cause order: FILE-SCOPE (fn null) → NO-TYPE-IN-MAP (type null) → TYPE-NOT-CANONICAL → TYPE-NOT-VISIBLE → site_class(s, None, typed=True) (MISALIGNED / NO-EDIT).
  • body verdict: the single shared cause if in S_NO_EDIT_VERDICTS, else RESIDUAL. bases carry the cause as status → s_judged False → not in ledger_index done, s_finished unaffected (selftest asserts both).
  • rows sorted (tu, unit); sites sorted (line, pos).

Results (t3_resid)

  • 34131 rows · 200598 sites. causes: TYPE-NOT-CANONICAL 197600, NO-TYPE-IN-MAP 2349, NO-EDIT 482, FILE-SCOPE 167. Body verdicts: TYPE-NOT-CANONICAL 32521, RESIDUAL 1610. No TYPE-NOT-VISIBLE, no MISALIGNED.
  • NO-EDIT 482: sites whose census type is canonical + visible but plan_S never drew the body (bbt's base type differs from the site's type, presumably); worth an expert look.

Commands

  • restruct.py --selftest → 95/95 OK.
  • --rung S --check-residue --only "ov_*" before: uncovered 200598 sites / 34131 bodies exit 1; after: uncovered 0 sites / 0 bodies exit 0.
  • --rung S --residue --only "ov_*" --label t3_resid → exit 0, 94 s.
  • --check-ledger → 141789 MEMBER sites, 0 violations, exit 0.
  • .run/T3/cover.py → UNCOVERED 0 after a scratch fix (below); git status --short src include empty.

Notes

  • deviation: scratch .run/T3/cover.py keyed file-scope sites as (tu, None), which no ledger unit can match → it reported UNCOVERED 167 (exactly the FILE-SCOPE sites). Patched line 14 to s['fn'] or '<file-scope>' (original kept at .run/T3/cover.pre_c7.py).
  • the ledger is tracked but under an ignore rule (git check-ignore --no-index): commit_task.sh refuses it (git add of an ignored path) → not committed; the appended rows sit in the working tree (backup of the pre-run file at .run/T3/ledger.pre_c7.jsonl).