Files
Drew T 4f7c3b64a3 docs(phase-33): commit-map + citations resolved to the rewritten history (C4–C7 — the tip commit)
- docs/commit-map.tsv: 4,032 rows (ordinal of the ORIGINAL main -> rewritten hash, author/committer dates, subject);
  1 pruned row of zeros (ordinal 1712, "session archive update"); 0 old hashes asserted; ordinal 1 unchanged by the
  rewrite (byte-identical)
- resolve_tokens: 1,238 commit:NNNN tokens -> shortest-unique new hashes in 98 files (docs, phase-ends, logs, tool
  docstrings, 2 C comments, the A5 evidence logs); residue left as tokens: commit:1712 x4 (the pruned commit),
  commit:orphan-24 x2, commit:orphan-26, commit:orphan-35 (cited commits that exist in no lineage)
- the rewrite (C4): filter-repo 2.47.0 on a bare clone of the C2 tip, 311 s, exactly 1 pruned, main 4,032 -> 4,031;
  the pre-rewrite history is mirrored in the private archive repo and in the local bundle
- the proof (C5): verify_rewrite 4,031 pairs / 0 failures; absent_scan 0 offenders; gate_scan 0 offenders on the clone
- adoption (C6): 100 text files differ at the tip, 0 purge paths, 0 added/deleted; leftover refs dropped; no gc yet
- resolver skips tools/public_rewrite/ (its self-test fixtures are the token grammar, not citations); repo-local
  identity is the GitHub noreply address from here on; CURRENT_PHASE: C4–C7 logged, checkpoint -> NEXT = C8
2026-09-06 23:28:39 -06:00

56 lines
2.4 KiB
Python

#!/usr/bin/env python3
"""Refuse to launch a drafting agent at a target that is ALREADY BANKED (P31 S71, R43/R45).
`wave_args.py` asserts a target is open AT DRAW TIME. A wave's payload then sits on disk while gates
run, so by launch time some of its targets are banked — and an agent handed one burns a full run to
report "STALE CARD — already banked today", with no `.s` left to even score against. Measured S71:
`ov_SC01_006/func_8017F9F8` was banked by gate `27cc083de` and drafted afterwards from a payload
built before it.
The open oracle is the same one everything else uses: a bank REMOVES the INCLUDE_ASM stub, so
`corpus.stubs(binary)` not containing the symbol IS the bank.
python3 tools/launch_check.py <binary> <fn> # exit 0 = still open, 2 = already banked
python3 tools/launch_check.py --payload p.json # filter a {wave,targets} payload in place
"""
import argparse, json, os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import corpus
def is_open(binary, fn):
try:
return fn in {s.symbol for s in corpus.stubs(binary).values()}
except Exception as e: # an unreadable binary is not a verdict (R40)
print('launch_check: corpus refused %s (%s) — treating as OPEN' % (binary, e),
file=sys.stderr)
return True
def main():
ap = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument('binary', nargs='?'); ap.add_argument('fn', nargs='?')
ap.add_argument('--payload')
a = ap.parse_args()
if a.payload:
d = json.load(open(a.payload))
keep, drop = [], []
for t in d.get('targets', []):
(keep if is_open(t['binary'], t.get('name') or t.get('fn')) else drop).append(t)
d['targets'] = keep
json.dump(d, open(a.payload, 'w'), indent=1)
print('launch_check: %d open, %d ALREADY BANKED and dropped%s'
% (len(keep), len(drop),
(': ' + ' '.join('%s:%s' % (t['binary'], t['name']) for t in drop)) if drop else ''))
return 0 if keep else 2
if not (a.binary and a.fn):
ap.error('give <binary> <fn> or --payload')
ok = is_open(a.binary, a.fn)
print('%s:%s %s' % (a.binary, a.fn, 'OPEN' if ok else 'ALREADY BANKED — do not launch'))
return 0 if ok else 2
if __name__ == '__main__':
sys.exit(main())