From c16fd3cf532eb517bf1ef4d32e244c5c604fa096 Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Tue, 1 Sep 2026 22:35:56 -0600 Subject: [PATCH] fix(warm-start): ANY foreign symbol disqualifies a same-named prior draft (law 1c) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit api_agent.prior_draft's law-1c guard had two holes, both measured live in the S70 wave where FOUR independent agents reported discarding the warm-start as "a different function entirely": * `len(syms) >= 2` exempted every body referencing 0 or 1 symbols — exactly the small-function case. func_80182438 (21 ins, ONE symbol) sailed through carrying ov_SC02_028's body for the SAME ADDRESS, and its agent reported that as the reason its PRIOR attempt failed outright. * requiring a strict majority foreign let a body sharing half its symbols pass. A correct draft can only reference what the target's .s actually relocates, so ANY foreign symbol disqualifies. NEGATIVE CONTROL over all 50 S70 targets: 46 admitted -> 42, and the 4 rejected are exactly the bodies the agents flagged (func_80182438 foreign func_801330E0, func_800D0664, func_801831D0 foreign func_80182570, func_80185F4C). No collateral. Cost of the hole: every agent reading a poisoned warm-start burns compiles discarding it, and a weaker model follows it instead. R48 again — never key by bare function name. --- tools/api_agent.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/api_agent.py b/tools/api_agent.py index 75bca46ea..3847ed870 100644 --- a/tools/api_agent.py +++ b/tools/api_agent.py @@ -660,7 +660,19 @@ def prior_draft(t): continue if tgt is not None: syms = set(re.findall(r'\b(?:func_|D_|jtbl_|a[A-Z0-9]+_)[0-9A-Fa-f]{8}\b', body)) - {t['name']} - if len(syms) >= 2 and len(syms & tgt) * 2 < len(syms): + # TIGHTENED (P31 S70). The old test was `len(syms) >= 2 and overlap*2 < len(syms)` + # and had TWO holes, both measured live in the S70 wave: + # * `len(syms) >= 2` exempted every body referencing 0 or 1 symbols — exactly the + # small-function case. func_80182438 (21 ins, ONE symbol) sailed through carrying + # ov_SC02_028's body for the same address, and its agent reported that as the + # reason its PRIOR attempt failed. + # * needing a strict majority foreign meant a body sharing half its symbols passed. + # A correct draft can only reference what the target's .s actually relocates, so ANY + # foreign symbol disqualifies. Negative-controlled over all 50 S70 targets: admits 42, + # rejects 4 — and the 4 are precisely the bodies four independent agents reported as + # "a different function entirely" (func_80182438, func_800D0664, func_801831D0, + # func_80185F4C). No collateral rejections. R48: never key by bare function name. + if syms - tgt: skipped += 1 continue # another overlay's same-named function — not this body best, where = body, p