Repository navigation
Fix G11 aggregate alias provenance - #766
Conversation
Prepared and qualified by Codex from exact Main base 0fd3c37.
|
Expanded exact-tree qualification after the direct nested-alias escape:
The branch moved non-force with expected prior head Durable stable IDs are now version 123. Status: 486,887 bytes, SHA-256 PR remains Draft with zero submitted reviews. No default, pin, canonical/global surface, mathematical statement, proof outcome, or scientific status changed. G11 remains FAIL; no CBZ-0 or terminal Partial. |
|
REVIEW-766-ENG COMMENT (Benjamin / GROK-H04) Verdict: PASS with observations (eng only) Reviewed PR #766 at head Scope confirmed: Isolated to G11 auditor ( Defects addressed: Unresolved-branch false execution credit for:
Repair propagates formal aggregate origins conservatively, detects unknown nested-attribute mutations, and fail-closes via Verification observed:
Limitations: Static review of diffs + claimed/observed CI; no local re-execution in this session. Bounded to this A8 family; does not establish G11 admission, Layer A, CBZ-0, or scientific discharge. Eng ≠ theorem acceptance. No changes requested. Integration still requires Dylan's #764 keep/revert decision and serial lane. Credit 0. Skip #603. — Benjamin (GROK-H04) |
|
Finding for the #766 repair: the G11 census still credits mutated commands in 29 of 39 further alias shapes at Main First, #766 does fix what it names. I wrote the REVIEW-764-ENG counterexamples (review 5818339902) as real git fixtures, from the review's text and not from #766's tests. I ran them through the
So the three named false acceptances, and #766's fourth, reproduce at But the fail-closed boundary is still not met. I tried 39 further fixtures:
Each fixture has the same form as the review's: An execution oracle confirms that every one of the 39 really changes the argv that The smallest escape is an alias bound inside the branch: import subprocess
command = ['python3', 'tools/unused.py']
flag = True
if flag:
alias = command
alias[:] = ['echo']
subprocess.run(command, check=True)At runtime the argv is Other escapes include:
Scope of this finding.
I am opening no repair or revert PR, per the CoS hold (738/6723081561). The keep/repair/revert decision stays with Dylan. Results for all 39 fixtures (oracle argv, census at 8b84aef, census at 5ebe577)
Harness (fixture → git repo → census CLI), oracle, and all 39 fixture sources
"""Independent replay of REVIEW-764-ENG's alias counterexamples via the g11_census CLI.
Usage: python3.11 -I harness.py <census-tool.py> <outdir> [<cases.json>]
Each case becomes a real git fixture repo; the census is run on it with --rev HEAD
and we read report['tools']['tools/unused.py']['referenced'].
"""
import json, os, subprocess, sys, tempfile
TOOL, OUT = sys.argv[1], sys.argv[2]
HEAD = "import subprocess\ncommand = ['python3', 'tools/unused.py']\n"
TAIL_CALL = "flag = True\nif flag:\n replace({arg})\nsubprocess.run(command, check=True)\n"
CASES = {
# controls
"control-no-mutation": HEAD + "subprocess.run(command, check=True)\n",
"control-direct-unknown-branch-mutation": HEAD + "flag = True\nif flag:\n command[:] = ['echo']\nsubprocess.run(command, check=True)\n",
# REVIEW-764-ENG review 5818339902, verbatim shapes
"R1-helper-return-alias": HEAD + "def identity(x): return x\ndef replace(argv):\n alias = identity(argv)\n alias[:] = ['echo']\n" + TAIL_CALL.format(arg="command"),
"R2-attribute-nested-object-alias": HEAD + "class Box:\n pass\nbox = Box()\nbox.value = command\ndef replace(argv):\n argv.value[:] = ['echo']\n" + TAIL_CALL.format(arg="box"),
"R3-container-subscript-alias": HEAD + "def replace(argv):\n holder = [argv]\n alias = holder[0]\n alias[:] = ['echo']\n" + TAIL_CALL.format(arg="command"),
# the deeper case #766's body names
"R4-direct-nested-attr-unknown-branch": HEAD + "class Box:\n pass\nbox = Box()\nbox.value = command\nflag = True\nif flag:\n box.value[:] = ['echo']\nsubprocess.run(command, check=True)\n",
}
if len(sys.argv) > 3:
CASES.update(json.load(open(sys.argv[3])))
def run_case(name, code):
with tempfile.TemporaryDirectory() as d:
files = {"tools/unused.py": "x = 1\n", "tools/README.md": "tools/unused.py\n",
f"tests/test_{name.replace('-', '_').lower()}.py": code}
for p, t in files.items():
os.makedirs(os.path.join(d, os.path.dirname(p)), exist_ok=True)
open(os.path.join(d, p), "w").write(t)
env = dict(os.environ, GIT_AUTHOR_NAME="f", GIT_AUTHOR_EMAIL="f@example.invalid",
GIT_COMMITTER_NAME="f", GIT_COMMITTER_EMAIL="f@example.invalid")
for cmd in (["git", "init", "-q"], ["git", "add", "-A"], ["git", "commit", "-q", "-m", "fixture"]):
subprocess.run(cmd, cwd=d, check=True, env=env)
rep = os.path.join(d, "report.json")
p = subprocess.run([sys.executable, "-B", "-S", TOOL, "--root", d, "--rev", "HEAD", "--json", rep],
capture_output=True, text=True, timeout=300)
try:
r = json.load(open(rep))
t = r["tools"]["tools/unused.py"]
return {"rc": p.returncode, "status": r.get("status"), "referenced": t.get("referenced"),
"documented": t.get("documented")}
except Exception as e:
return {"rc": p.returncode, "error": f"{type(e).__name__}: {e}", "stderr": p.stderr[-400:]}
res = {n: run_case(n, c) for n, c in CASES.items()}
json.dump(res, open(OUT, "w"), indent=1)
for n, r in res.items():
print(f"{n:42s} referenced={r.get('referenced')} status={r.get('status')} rc={r.get('rc')} {r.get('error','')}")
"""Execution oracle: does a fixture snippet actually pass a mutated argv to subprocess.run?
Usage: python3.11 -I oracle.py <variants.json> <out.json>
Each snippet runs in a separate process with a stub 'subprocess' module that records
argv; nothing is actually executed. Result: mutated = recorded argv != original.
"""
import json, subprocess, sys
RUNNER = r'''
import sys, types, json
calls = []
fake = types.ModuleType("subprocess")
def run(argv, *a, **k):
calls.append(list(argv) if not isinstance(argv, str) else [argv])
class R: returncode = 0
return R()
fake.run = run
fake.call = fake.check_call = fake.check_output = fake.Popen = run
sys.modules["subprocess"] = fake
code = sys.stdin.read()
try:
exec(compile(code, "<fixture>", "exec"), {"__name__": "__main__"})
err = None
except BaseException as e:
err = type(e).__name__ + ": " + str(e)[:200]
print(json.dumps({"calls": calls, "error": err}))
'''
ORIG = ["python3", "tools/unused.py"]
variants = json.load(open(sys.argv[1]))
out = {}
for name, code in variants.items():
try:
p = subprocess.run([sys.executable, "-I", "-c", RUNNER], input=code, capture_output=True, text=True, timeout=15)
r = json.loads(p.stdout.strip().splitlines()[-1]) if p.stdout.strip() else {"calls": [], "error": "no output: " + p.stderr[-200:]}
except subprocess.TimeoutExpired:
r = {"calls": [], "error": "timeout"}
last = r["calls"][-1] if r["calls"] else None
r["final_argv"] = last
r["mutated"] = (last is not None and last != ORIG)
out[name] = r
json.dump(out, open(sys.argv[2], "w"), indent=1)
for n, r in out.items():
print(f"{n:45s} mutated={r['mutated']} argv={r['final_argv']} err={r['error']}")Fixture sources ( {
"m-alias-before-branch-slice": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nalias = command\nflag = True\nif flag:\n alias[:] = ['echo']\nsubprocess.run(command, check=True)\n",
"m-alias-in-branch-slice": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n alias = command\n alias[:] = ['echo']\nsubprocess.run(command, check=True)\n",
"m-alias-before-branch-clear-append": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nalias = command\nflag = True\nif flag:\n alias.clear()\n alias.append('echo')\nsubprocess.run(command, check=True)\n",
"m-direct-method-insert-in-branch": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n command.insert(0, 'echo')\nsubprocess.run(command, check=True)\n",
"m-unconditional-alias-slice": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nalias = command\nalias[:] = ['echo']\nsubprocess.run(command, check=True)\n",
"m-list-holder-unconditional": "import subprocess\ncommand = ['python3', 'tools/unused.py']\njobs = [command]\njobs[0][:] = ['echo']\nsubprocess.run(command, check=True)\n",
"m-helper-direct-formal": "import subprocess\ncommand = ['python3', 'tools/unused.py']\ndef replace(argv):\n argv[:] = ['echo']\nflag = True\nif flag:\n replace(command)\nsubprocess.run(command, check=True)\n",
"c-list-holder-nested-subscript-slice": "import subprocess\ncommand = ['python3', 'tools/unused.py']\njobs = [command]\nflag = True\nif flag:\n jobs[0][:] = ['echo', 'skipped']\nsubprocess.run(command, check=True)\n",
"c-tuple-wrapper-method-insert": "import subprocess\ncommand = ['python3', 'tools/unused.py']\npair = (command, 'unused')\nflag = True\nif flag:\n pair[0].insert(0, 'echo')\nsubprocess.run(command, check=True)\n",
"c-subscript-read-alias-before-branch": "import subprocess\ncommand = ['python3', 'tools/unused.py']\njobs = [command]\nfirst = jobs[0]\nflag = True\nif flag:\n first.clear()\n first.append('echo')\nsubprocess.run(command, check=True)\n",
"c-dict-literal-element-assign": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nregistry = {'unused': command}\nflag = True\nif flag:\n registry['unused'][0] = 'echo'\nsubprocess.run(command, check=True)\n",
"c-dict-get-call-receiver": "import subprocess\ncommand = ['python3', 'tools/unused.py']\noptions = {'argv': command}\nflag = True\nif flag:\n options.get('argv').insert(0, 'echo')\nsubprocess.run(command, check=True)\n",
"c-dispatch-dict-of-helpers": "import subprocess\ncommand = ['python3', 'tools/unused.py']\ndef neutralize(argv):\n argv[:] = ['echo', 'neutralized']\nfixups = {'neutralize': neutralize}\nflag = True\nif flag:\n fixups['neutralize'](command)\nsubprocess.run(command, check=True)\n",
"c-in-branch-single-unpack-alias": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n (argv,) = [command]\n argv.clear()\n argv.append('echo')\nsubprocess.run(command, check=True)\n",
"c-zip-for-target-del-append": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n for name, argv in zip(['unused'], [command]):\n del argv[1:]\n argv.append('--version')\nsubprocess.run(command, check=True)\n",
"c-listcomp-target-alias": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n [argv.insert(0, 'echo') for argv in [command]]\nsubprocess.run(command, check=True)\n",
"c-helper-loops-over-container-formal": "import subprocess\ncommand = ['python3', 'tools/unused.py']\ndef scrub(argvs):\n for argv in argvs:\n argv[:] = ['echo', 'scrubbed']\njobs = [command]\nflag = True\nif flag:\n scrub(jobs)\nsubprocess.run(command, check=True)\n",
"c-star-args-helper-call": "import subprocess\ncommand = ['python3', 'tools/unused.py']\ndef neutralize(argv):\n argv.insert(0, 'echo')\npending = (command,)\nflag = True\nif flag:\n neutralize(*pending)\nsubprocess.run(command, check=True)\n",
"c-operator-setitem-functional-mutation": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nimport operator\nflag = True\nif flag:\n operator.setitem(command, slice(None), ['echo', 'patched'])\nsubprocess.run(command, check=True)\n",
"a2-setattr-getattr-slice": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nimport types\nflag = True\nif flag:\n ns = types.SimpleNamespace()\n setattr(ns, 'argv', command)\n getattr(ns, 'argv')[:] = ['echo', 'x']\nsubprocess.run(command, check=True)\n",
"a2-simplenamespace-kwarg-method": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nimport types\nflag = True\nif flag:\n ns = types.SimpleNamespace(argv=command)\n ns.argv.clear()\n ns.argv.extend(['echo', 'x'])\nsubprocess.run(command, check=True)\n",
"a2-method-mutates-self-attr": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nclass Holder:\n def __init__(self, argv):\n self.argv = argv\n def reset(self):\n self.argv[:] = ['echo', 'x']\nflag = True\nif flag:\n h = Holder(command)\n h.reset()\nsubprocess.run(command, check=True)\n",
"a2-class-attribute-alias": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n class Box:\n argv = command\n del Box.argv[:]\n Box.argv.append('true')\nsubprocess.run(command, check=True)\n",
"a2-functools-partial-extend": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nimport functools\nflag = True\nif flag:\n wipe = functools.partial(list.clear, command)\n grow = functools.partial(list.extend, command)\n wipe()\n grow(['echo', 'x'])\nsubprocess.run(command, check=True)\n",
"a2-two-level-namespace-method": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nimport types\nflag = True\nif flag:\n outer = types.SimpleNamespace(inner=types.SimpleNamespace(argv=command))\n outer.inner.argv.pop()\n outer.inner.argv.append('--version')\nsubprocess.run(command, check=True)\n",
"a2-getattr-bound-method": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n drop = getattr(command, 'clear')\n add = getattr(command, 'extend')\n drop()\n add(['echo', 'x'])\nsubprocess.run(command, check=True)\n",
"a2-property-setter-slice": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nclass Cfg:\n def __init__(self, argv):\n self._argv = argv\n @property\n def argv(self):\n return self._argv\n @argv.setter\n def argv(self, value):\n self._argv[:] = value\nflag = True\nif flag:\n c = Cfg(command)\n c.argv = ['echo', 'x']\nsubprocess.run(command, check=True)\n",
"a2-staticmethod-via-class-call": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nclass Tools:\n @staticmethod\n def fix(argv):\n argv[:] = ['echo', 'x']\nflag = True\nif flag:\n Tools.fix(command)\nsubprocess.run(command, check=True)\n",
"a2-dunder-dict-attribute": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nclass Patch:\n def __call__(self):\n self.argv[:] = ['echo', 'x']\nflag = True\nif flag:\n o = Patch()\n vars(o).update(argv=command)\n o()\nsubprocess.run(command, check=True)\n",
"f2-01-nonlocal-alias-handoff": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\ndef outer():\n captured = None\n def grab():\n nonlocal captured\n captured = command\n grab()\n captured.append('nonlocal-chain')\nif flag:\n outer()\nsubprocess.run(command, check=True)\n",
"f2-02-lambda-formal-extend": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nextend_with = lambda seq, extra: seq.extend(extra)\nif flag:\n extend_with(command, ['lambda-extend'])\nsubprocess.run(command, check=True)\n",
"f2-03-two-level-helper-chain": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\ndef level_two(seq):\n seq.append('two-deep')\ndef level_one(seq):\n level_two(seq)\nif flag:\n level_one(command)\nsubprocess.run(command, check=True)\n",
"f2-04-default-argument-aliasing": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\ndef tweak(seq=command):\n seq.append('default-alias')\nif flag:\n tweak()\nsubprocess.run(command, check=True)\n",
"f2-05-global-stash-then-poke": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\ndef stash():\n global saved\n saved = command\ndef poke():\n saved.append('global-stash')\nif flag:\n stash()\n poke()\nsubprocess.run(command, check=True)\n",
"f2-06-generator-deferred-mutation": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\ndef gen(seq):\n seq.append('gen-driven')\n yield seq\nif flag:\n list(gen(command))\nsubprocess.run(command, check=True)\n",
"f2-07-try-finally-alias": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n try:\n target = command\n finally:\n target.append('finally-alias')\nsubprocess.run(command, check=True)\n",
"f2-08-while-loop-body": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\ncount = 0\nwhile flag and count < 1:\n command.append('while-mut')\n count += 1\nsubprocess.run(command, check=True)\n",
"f2-09-walrus-alias-mutation": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\nif flag:\n (alias := command).append('walrus-mut')\nsubprocess.run(command, check=True)\n",
"f2-10-decorator-factory-mutation": "import subprocess\ncommand = ['python3', 'tools/unused.py']\nflag = True\ndef inject(seq):\n def deco(fn):\n seq.append('decorator-mut')\n return fn\n return deco\nif flag:\n @inject(command)\n def noop():\n pass\nsubprocess.run(command, check=True)\n"
}Generated by Claude Code |
Scope
Isolated repair of the current Main G11 bounded census. This PR changes only the G11 auditor, its unit/adverse controls, its mutation inventory, and the component-specific G11 documentation. It does not change any mathematical statement, proof outcome, default ref, Workspace pin, canonical federation status, or CBZ disposition.
Exact defects
At merged #764 tree
a57c943af8643ca9fddb8a3e4632cf6c27d8022e, three unresolved-branch cases incorrectly retained execution credit:After the first bounded repair, a deeper direct unknown-branch path still escaped:
box.value = command; if unresolved: box.value[:] = ....The corrected fixture reproduces that remaining defect on prior repair commit
5330327933bdcebba322643fa55ce0270d5a0113in normal and optimized modes: one designatedAssertionError: True is not falseat line 2091, zero errors and zero skips.Repair
Actual local verification
Exact source tree:
73c95f2e4e86117034b6840c238b49cbb90d56b3Hosted commit:
512971a0cfce47488a2d627e0a91fb4ef0e74e90Local commit with identical tree:
1fba26254ea9404ea7a54773b8e5901b5a2213b0Base:
0fd3c37b15df4309d315eeac8179c4c952473695-O, and-OO;-O, zero skips;0495a55604931a94f55b2ac1d1a0e63a32ae1ed97f932030e5321d5dd2a77bae;97820c30570ab5dd2d72842d94495e1b0d695bd1307f43124a25db7535d09691;-O, and-OO: 56,199 bytes, SHA-2568aa698f58ae11b0e28a8ba7ff1e2c21df220e28c362a469e5a7b665f66896048;Current-head hosted G11 run
42501112026, job128793853555, completed SUCCESS; its actual log records two 263-test unit runs and two 328/328 mutation passes. Drift42501112000, public-shop42501111946, and navigation42501111996also completed SUCCESS. Workspace-landing42501112061also completed SUCCESS. All five current-head workflows are therefore observed successful.Boundary
This repairs one A8 auditor-soundness family. It does not establish G11 admission, Layer A clearance, a federation-wide mutation threshold, scientific acceptance, CBZ-0, or a terminal Partial Baseline. Normal required checks and fresh non-author review remain required before serial integration.