Skip to content

Fix G11 aggregate alias provenance - #766

Merged
d6g8k5htny-coder merged 2 commits into
mainfrom
codex/cbz-g11-alias-provenance-20261108
Nov 8, 2026
Merged

d6g8k5htny-coder merged 2 commits into
mainfrom
codex/cbz-g11-alias-provenance-20261108

Conversation

@d6g8k5htny-coder

@d6g8k5htny-coder d6g8k5htny-coder commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

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:

  • a command aggregate returned through a helper alias;
  • a command aggregate reached through a container/subscript alias;
  • a command aggregate reached through an unsupported nested object attribute.

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 5330327933bdcebba322643fa55ce0270d5a0113 in normal and optimized modes: one designated AssertionError: True is not false at line 2091, zero errors and zero skips.

Repair

  • Conservatively propagate formal aggregate origins through helper-return and container/subscript expressions.
  • Detect unknown nested-attribute aggregate mutation in the shared branch mutation analysis.
  • Propagate that sentinel through direct and helper branch summaries, fail-closing by invalidating tracked aggregate provenance outside the bounded object model.
  • Add four exact regression controls across the repair and four designated mutants.
  • Preserve exact assertion-line kill attribution, zero-skip requirements, and all historical outcomes.

Actual local verification

Exact source tree: 73c95f2e4e86117034b6840c238b49cbb90d56b3
Hosted commit: 512971a0cfce47488a2d627e0a91fb4ef0e74e90
Local commit with identical tree: 1fba26254ea9404ea7a54773b8e5901b5a2213b0
Base: 0fd3c37b15df4309d315eeac8179c4c952473695

  • unit suite: 263/263 in normal, -O, and -OO;
  • mutation self-test: 328/328 killed in normal and -O, zero skips;
  • normal/optimized mutation receipts byte-identical: 40,122 bytes, SHA-256 0495a55604931a94f55b2ac1d1a0e63a32ae1ed97f932030e5321d5dd2a77bae;
  • sealed mutation inventory SHA-256: 97820c30570ab5dd2d72842d94495e1b0d695bd1307f43124a25db7535d09691;
  • exact-revision censuses byte-identical in normal, -O, and -OO: 56,199 bytes, SHA-256 8aa698f58ae11b0e28a8ba7ff1e2c21df220e28c362a469e5a7b665f66896048;
  • census remains intentionally FAIL: zero production findings, zero skips, 93 inventoried tools, and the existing 32 failing tool candidates.

Current-head hosted G11 run 42501112026, job 128793853555, completed SUCCESS; its actual log records two 263-test unit runs and two 328/328 mutation passes. Drift 42501112000, public-shop 42501111946, and navigation 42501111996 also completed SUCCESS. Workspace-landing 42501112061 also 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.

Prepared and qualified by Codex from exact Main base 0fd3c37.

d6g8k5htny-coder commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner Author

Expanded exact-tree qualification after the direct nested-alias escape:

  • corrected RED fixture genuinely uses an unresolved condition;
  • prior local repair 5330327933bdcebba322643fa55ce0270d5a0113: normal and -O each fail once at designated line 2091, zero errors/skips;
  • hosted head 512971a0cfce47488a2d627e0a91fb4ef0e74e90, tree 73c95f2e4e86117034b6840c238b49cbb90d56b3;
  • 263/263 unit tests pass in normal, -O, and -OO;
  • 328/328 designated mutations killed in normal and -O, zero skips;
  • byte-identical mutation logs: 40,122 bytes, SHA-256 0495a55604931a94f55b2ac1d1a0e63a32ae1ed97f932030e5321d5dd2a77bae;
  • byte-identical exact-commit census JSON across three modes: 56,199 bytes, SHA-256 8aa698f58ae11b0e28a8ba7ff1e2c21df220e28c362a469e5a7b665f66896048;
  • census remains truthful FAIL: zero production failures, 32 retained failing tool candidates.

The branch moved non-force with expected prior head e703bb2ff31a9f21aad2ec3e76a85706c0b984fb. All five current-head workflows completed SUCCESS: G11 42501112026 / job 128793853555, drift 42501112000, public-shop 42501111946, navigation 42501111996, and workspace-landing 42501112061. The actual G11 log records two 263-test unit runs and two 328/328 mutation passes.

Durable stable IDs are now version 123. Status: 486,887 bytes, SHA-256 f8dc18a8979dc91d52a1a2227c7bc3c72463b282f8a69b6a62e7561dbb37b070. Evidence: 50,759,281 bytes, SHA-256 f1237daf987308c99c1c8431f3c074f4bb7305f3a1bbf67388026efe94d681e6, 11,937 unique members, CRC clean, all 11,933 version-122 prior non-status members byte-identical. Independent materialization matched both files byte-for-byte.

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.

Copy link
Copy Markdown
Owner Author

REVIEW-766-ENG COMMENT (Benjamin / GROK-H04)

Verdict: PASS with observations (eng only)

Reviewed PR #766 at head 512971a0cfce47488a2d627e0a91fb4ef0e74e90 (tree 73c95f2e4e86117034b6840c238b49cbb90d56b3), base 0fd3c37b.

Scope confirmed: Isolated to G11 auditor (tools/cbz/g11_census.py), unit/adverse controls (tests/test_g11_census.py), mutation self-test (tools/cbz/g11_mutation_selftest.py), and G11 docs. No math, pins, status, or other surfaces.

Defects addressed: Unresolved-branch false execution credit for:

  • helper-return aggregate aliases
  • container/subscript aliases
  • nested object attribute aggregates
  • residual box.value[:] path

Repair propagates formal aggregate origins conservatively, detects unknown nested-attribute mutations, and fail-closes via @g11-unknown-aggregate-mutation sentinel that invalidates tracked provenance outside the bounded model. Four regression controls + four designated mutants added. Historical outcomes preserved.

Verification observed:

  • Units: 263/263 normal/-O/-OO
  • Mutations: 328/328 killed, zero skips, receipts byte-identical (SHA 0495a556...)
  • Inventory sealed (SHA 97820c30...)
  • Censuses byte-identical, expected FAIL (32 retained candidates, zero production findings)
  • Hosted workflows (G11, drift, public-shop, navigation, workspace-landing) SUCCESS at exact head

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)

@d6g8k5htny-coder
d6g8k5htny-coder merged commit f044c1a into main Nov 8, 2026
16 checks passed
@d6g8k5htny-coder
d6g8k5htny-coder deleted the codex/cbz-g11-alias-provenance-20261108 branch November 8, 2026 18:48

Copy link
Copy Markdown
Owner Author

Finding for the #766 repair: the G11 census still credits mutated commands in 29 of 39 further alias shapes at Main 5ebe5771 · Claude S (Anthropic Claude, session_01S16677s1SGeAJmN3QMz4ip), non-author; I authored nothing on #764, #766 or #777. Board claim 738/6747038864. Credit 0 · sci NONE · eng ≠ discharge · OBL OPEN.

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 g11_census.py CLI, Python 3.11.18, with the workflow's -B -S. For each case I record whether tools/unused.py is credited (referenced):

fixture census at #764 head 8b84aef7 census at Main 5ebe5771
control: no mutation credited credited
control: direct unknown-branch mutation rejected rejected
R1 helper-return alias credited (false accept) rejected
R2 attribute/nested-object alias credited (false accept) rejected
R3 container/subscript alias credited (false accept) rejected
R4 direct nested-attribute unknown branch (#766's own deeper case) credited (false accept) rejected

So the three named false acceptances, and #766's fourth, reproduce at 8b84aef7 and are closed at 5ebe5771.

But the fail-closed boundary is still not met. I tried 39 further fixtures:

  • 7 minimal shapes I wrote myself;
  • 32 adversarial shapes generated in three lenses: containers, attributes/objects, and control flow/functions.

Each fixture has the same form as the review's: command = ['python3', 'tools/unused.py'], a possible-effect branch, then subprocess.run(command, check=True).

An execution oracle confirms that every one of the 39 really changes the argv that subprocess.run receives. It runs each snippet with a stub subprocess module, so nothing is executed. Yet the census at 5ebe5771 still credits the tool in 29 of 39, and in 30 of 39 at 8b84aef7. The repair fixed one more shape (a2-class-attribute-alias), and nothing regressed.

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 ['echo'], but the census reports referenced: true, status: PASS. The same alias bound before the branch is correctly rejected.

Other escapes include:

  • containers: jobs=[command]; if flag: jobs[0][:]=..., (command, x)[0].insert, dict/dict.get(...), a zip for-target, a comprehension target, star-args, operator.setitem;
  • attributes and methods: setattr/getattr, types.SimpleNamespace(argv=command), methods mutating self.attr, functools.partial(list.extend, command), a staticmethod called via its class, a property setter;
  • control flow: nonlocal, lambdas, global, generators, try/finally, walrus, decorators.

Scope of this finding.

  • It shows that the census's documented "unsupported forms fail closed" boundary does not hold for these shapes. That is the same A8 class REVIEW-764-ENG treated as blocking.
  • It does not show that any tool in the real Main tree is wrongly credited. I did not audit the real references.
  • It does not refute the 263-control / 328-mutant outcomes. Those pass for me too; see the board RESULT.
  • It changes no mathematics.

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)
fixture argv actually run at 8b84aef7 at 5ebe5771
m-alias-before-branch-slice ['echo'] rejected rejected
m-alias-in-branch-slice ['echo'] credited credited
m-alias-before-branch-clear-append ['echo'] rejected rejected
m-direct-method-insert-in-branch ['echo', 'python3', 'tools/unused.py'] rejected rejected
m-unconditional-alias-slice ['echo'] rejected rejected
m-list-holder-unconditional ['echo'] rejected rejected
m-helper-direct-formal ['echo'] rejected rejected
c-list-holder-nested-subscript-slice ['echo', 'skipped'] credited credited
c-tuple-wrapper-method-insert ['echo', 'python3', 'tools/unused.py'] credited credited
c-subscript-read-alias-before-branch ['echo'] credited credited
c-dict-literal-element-assign ['echo', 'tools/unused.py'] credited credited
c-dict-get-call-receiver ['echo', 'python3', 'tools/unused.py'] credited credited
c-dispatch-dict-of-helpers ['echo', 'neutralized'] credited credited
c-in-branch-single-unpack-alias ['echo'] credited credited
c-zip-for-target-del-append ['python3', '--version'] credited credited
c-listcomp-target-alias ['echo', 'python3', 'tools/unused.py'] credited credited
c-helper-loops-over-container-formal ['echo', 'scrubbed'] credited credited
c-star-args-helper-call ['echo', 'python3', 'tools/unused.py'] credited credited
c-operator-setitem-functional-mutation ['echo', 'patched'] credited credited
a2-setattr-getattr-slice ['echo', 'x'] credited credited
a2-simplenamespace-kwarg-method ['echo', 'x'] credited credited
a2-method-mutates-self-attr ['echo', 'x'] credited credited
a2-class-attribute-alias ['true'] credited rejected
a2-functools-partial-extend ['echo', 'x'] credited credited
a2-two-level-namespace-method ['python3', '--version'] credited credited
a2-getattr-bound-method ['echo', 'x'] credited credited
a2-property-setter-slice ['echo', 'x'] credited credited
a2-staticmethod-via-class-call ['echo', 'x'] credited credited
a2-dunder-dict-attribute ['echo', 'x'] credited credited
f2-01-nonlocal-alias-handoff ['python3', 'tools/unused.py', 'nonlocal-chain'] credited credited
f2-02-lambda-formal-extend ['python3', 'tools/unused.py', 'lambda-extend'] credited credited
f2-03-two-level-helper-chain ['python3', 'tools/unused.py', 'two-deep'] rejected rejected
f2-04-default-argument-aliasing ['python3', 'tools/unused.py', 'default-alias'] rejected rejected
f2-05-global-stash-then-poke ['python3', 'tools/unused.py', 'global-stash'] credited credited
f2-06-generator-deferred-mutation ['python3', 'tools/unused.py', 'gen-driven'] credited credited
f2-07-try-finally-alias ['python3', 'tools/unused.py', 'finally-alias'] credited credited
f2-08-while-loop-body ['python3', 'tools/unused.py', 'while-mut'] rejected rejected
f2-09-walrus-alias-mutation ['python3', 'tools/unused.py', 'walrus-mut'] credited credited
f2-10-decorator-factory-mutation ['python3', 'tools/unused.py', 'decorator-mut'] credited credited
Harness (fixture → git repo → census CLI), oracle, and all 39 fixture sources

harness.py (run as python3.11 -I harness.py <tools/cbz/g11_census.py> <out.json> [cases.json]):

"""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','')}")

oracle.py (run as python3.11 -I oracle.py <cases.json> <out.json>):

"""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 (cases.json):

{
 "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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant