From 1174241ab6a0ba9238138c62439ca04219185e15 Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:43:38 -0500 Subject: [PATCH 1/4] Authenticate DD sensitivity and missing-node controls with exact transcripts Keep sensitivity distinct from mathematical rejection. Preserve certificate inputs and numerical algorithms; fresh reconstruction and independent bounded qualification after workspace loss. --- .github/workflows/lifetime-dd-model-d.yml | 7 + .../lifetime_dd_model_d_20261013/README.md | 4 +- .../lifetime_dd_model_d_20261013/replay.py | 62 ++++++-- .../dd_node_oracle_20261029/VERIFICATION.md | 40 +++++ .../lifetime_dd_changed_node_stdout.txt | 8 + .../lifetime_dd_missing_node_stderr.txt | 9 ++ tests/test_lifetime_dd_node_oracle.py | 150 ++++++++++++++++++ 7 files changed, 261 insertions(+), 19 deletions(-) create mode 100644 reviews/dd_node_oracle_20261029/VERIFICATION.md create mode 100644 tests/fixtures/lifetime_dd_changed_node_stdout.txt create mode 100644 tests/fixtures/lifetime_dd_missing_node_stderr.txt create mode 100644 tests/test_lifetime_dd_node_oracle.py diff --git a/.github/workflows/lifetime-dd-model-d.yml b/.github/workflows/lifetime-dd-model-d.yml index c1a071a6c..5c0728f79 100644 --- a/.github/workflows/lifetime-dd-model-d.yml +++ b/.github/workflows/lifetime-dd-model-d.yml @@ -6,6 +6,9 @@ name: Lifetime note DD replay - 'frontiers/lifetime_dd_model_d_20261013/**' - 'tests/test_lifetime_dd_replay_protocol.py' - 'tests/test_lifetime_dd_replay_evidence.py' + - 'tests/test_lifetime_dd_node_oracle.py' + - 'tests/fixtures/lifetime_dd_changed_node_stdout.txt' + - 'tests/fixtures/lifetime_dd_missing_node_stderr.txt' - '.github/workflows/lifetime-dd-model-d.yml' workflow_dispatch: @@ -42,6 +45,7 @@ jobs: mkdir -p "$out/logs" python ${{ matrix.mode }} -m unittest discover -s tests -p test_lifetime_dd_replay_protocol.py -v 2>&1 | tee "$out/logs/protocol.txt" python ${{ matrix.mode }} -m unittest discover -s tests -p test_lifetime_dd_replay_evidence.py -v 2>&1 | tee "$out/logs/process-evidence-tests.txt" + python ${{ matrix.mode }} -m unittest discover -s tests -p test_lifetime_dd_node_oracle.py -v 2>&1 | tee "$out/logs/node-oracle-tests.txt" QS_REPLAY_EVIDENCE_DIR="$out/children" python ${{ matrix.mode }} frontiers/lifetime_dd_model_d_20261013/replay.py 2>&1 | tee "$out/logs/replay.txt" git diff --exit-code test -z "$(git status --porcelain)" @@ -55,6 +59,9 @@ jobs: cp -a frontiers/lifetime_dd_model_d_20261013 "$out/packet" cp tests/test_lifetime_dd_replay_protocol.py "$out/" cp tests/test_lifetime_dd_replay_evidence.py "$out/" + cp tests/test_lifetime_dd_node_oracle.py "$out/" + cp tests/fixtures/lifetime_dd_changed_node_stdout.txt "$out/" + cp tests/fixtures/lifetime_dd_missing_node_stderr.txt "$out/" cp .github/workflows/lifetime-dd-model-d.yml "$out/" git rev-parse HEAD > "$out/tested_commit.txt" printf '%s\n' '${{ matrix.mode }}' > "$out/mode.txt" diff --git a/frontiers/lifetime_dd_model_d_20261013/README.md b/frontiers/lifetime_dd_model_d_20261013/README.md index a14413061..f0fc83fd3 100644 --- a/frontiers/lifetime_dd_model_d_20261013/README.md +++ b/frontiers/lifetime_dd_model_d_20261013/README.md @@ -80,9 +80,9 @@ From its "not claimed" section: 1. **Identities.** Every stored file has the identity pinned in `SOURCES.json`, the tree holds nothing else, and there are no symlinks. 2. **The pin.** Every certificate file named in the tables of the stored pinning comments has the byte count and SHA-256 the comment states: the controls comment (23 files) and the controls addendum of record (3 files; the two earlier addenda carry the same table) for `certificate/`, the controls comment v2 (32 files) for `certificate_v2/`. 3. **The replays**, for each certificate, each under the current interpreter's `-O`/`-S` flags, with stdout byte-identical to the stored record and empty stderr: `dd_controls.py` (controls C1–C9, exit 0 iff all pass), `dd_mutants.py` (nine mutants, each rejected), `dd_gapcheck.py` on the stored cells (control C10; no gap in v2) and `dd_exact.py` on the stored cells and node files (the tiling and disjointness checks, every cell remainder recomputed, 24 sampled node values recomputed, `D` and the corollary). -4. **Negative controls** (on certificate v2). A one-byte change to the stored note (`DD/PROOF.md`) is detected; one changed digit in one stored node value changes the assembled result (the assembly is run on a temporary copy without the recomputation checks, and its stdout must differ from the record); `dd_exact.py` with one node file missing exits 1 (`incomplete node values`). +4. **Two negative controls and one output-sensitivity control** (certificate v2). A one-byte change to the stored note is detected. Missing `nodes_11.json` must return exit1, empty stdout and the exact CPython3.11.16 traceback ending `AssertionError: incomplete node values: 2194 of 2393 cells`; only the known certificate directory is substituted into the expected template. This authenticates input-completeness rejection, not mathematical validity. The fixed perturbation of a stored node must return exit0, empty stderr and the exact989byte `CHANGED_NODE_STDOUT`. This runs without recomputation or sampling: output sensitivity, not mathematical rejection. Unrelated crashes, contaminated or incomplete streams and all other results fail. See [scoped verification and remaining boundaries](../../reviews/dd_node_oracle_20261029/VERIFICATION.md). 5. **Named identities.** Each stored verdict, summons and author record names the byte counts and SHA-256 of the stored bodies it refers to: the slice verdicts name v1.0 and the controls comment; the readback summons, the readback verdict, the first read-complete note and the #448 engineering read name v1.0 and v1.1; the C10 summons and verdict name v1.1, v1.2 and the controls addendum; the #449 engineering read and readback name the versions and addenda they hashed; the v1.3 summons and verdict name v1.2, v1.3 and the controls comment v2; the read-complete notes name all the versions they cover (`SOURCES.json`, `names_identities`). On a child time-out, `replay.py` keeps the partial streams and a `timeout` record in the evidence directory before failing (a point of the Codex review). Certificate v1's `dd_mutants.py` runs its mutated copies of `dd_controls.py` under `-B -S` in both workflow modes; this is by design of that certificate (the controls use `require`, not `assert`, so they are mode-independent, which the controls replay verifies in both modes) and is the known limitation of the v1 mutant lane (the Codex review's second point on Math-#448). Certificate v2's `dd_mutants.py` runs those children in the driver's interpreter mode and keeps the text check under `-O`. -The workflow `.github/workflows/lifetime-dd-model-d.yml` runs on Python 3.11.16, in two jobs, one per mode, each with a 150-minute limit. Each job runs the protocol and raw-evidence tests (`tests/test_lifetime_dd_replay_protocol.py`, 17 tests; `tests/test_lifetime_dd_replay_evidence.py`, 9 tests), then the full replay, and retains the raw child streams as an artifact. These finite controls check explicit enclosures and identities, as the reads say. They do not prove the analytic statements. +The workflow `.github/workflows/lifetime-dd-model-d.yml` runs on Python 3.11.16, in two jobs, one per mode, each with a 150-minute limit. Each job runs the protocol and raw-evidence tests (`tests/test_lifetime_dd_replay_protocol.py`, 17 tests; `tests/test_lifetime_dd_replay_evidence.py`, 9 tests), the process-oracle tests (`tests/test_lifetime_dd_node_oracle.py`,10methods including real bounded specimens and16source mutants), then the full replay, and retains the raw child streams as an artifact. These finite controls check explicit enclosures and identities, as the reads say. They do not prove the analytic statements. diff --git a/frontiers/lifetime_dd_model_d_20261013/replay.py b/frontiers/lifetime_dd_model_d_20261013/replay.py index 9b0118911..dbc9ae30a 100644 --- a/frontiers/lifetime_dd_model_d_20261013/replay.py +++ b/frontiers/lifetime_dd_model_d_20261013/replay.py @@ -20,11 +20,12 @@ dd_gapcheck.py on the stored cells (control C10, the sliver-gap enclosure), and dd_exact.py on the stored cells and node files (the tiling checks, every cell remainder recomputed, 24 node values recomputed, D and the corollary). Each assembly takes about 20 minutes. - 4. Negative controls, each in a temporary copy, must be rejected: + 4. Negative controls and a separate output-sensitivity control: - a one-byte change to the stored note (DD/PROOF.md) fails check 1; - - one changed digit in one stored node value (certificate_v2/nodes/nodes_3.json) makes dd_exact.py's stdout differ - from the stored record (or fail); - - dd_exact.py with one node file missing exits 1 ('incomplete node values'). + - the fixed perturbation of certificate_v2/nodes/nodes_3.json matches the complete successful + CHANGED_NODE_STDOUT transcript and empty stderr (output sensitivity, not mathematical rejection); + - missing nodes_11.json matches exit 1, empty stdout and the exact supported-runtime traceback + (input-completeness rejection, not mathematical certification). 5. Each stored verdict, summons and author record names the byte counts and SHA-256 of the stored bodies it refers to (SOURCES.json, names_identities: the slice verdicts name the note they read, v1.0, and the controls comment; the readback names v1.0 and v1.1; the C10 read names v1.1, v1.2 and the controls addendum; the read-complete notes name @@ -51,6 +52,32 @@ PROCESS_TIMEOUT_SECONDS = 3600 +# Independently observed CPython 3.11.16 process contracts, both modes. +# Changed-node is output sensitivity, not rejection or a certified new bound. +CHANGED_NODE_STDOUT = b"""Gauss region: sum [0.0764960693454651862061373880206, 0.0771096748441041862088778512743] (node-width 0.0006136054986390000027404632537), remainder 0.000699415225762334605564277483154 +region S: [-0.0000204104527369070204567316057495, -0.0000200429419006537600186550090259]; omega tails 0.0000138351995650080053539807820619; tau tail 0.0000572129033171405130248937123594 +D in [0.0757051955640837960617375044371, 0.0778600952308480155728023482430] width 0.0021548996667642195110648438059 +q = J/30 - I~_quad - D in [0.672471569882485317760530985090, 0.674626571425916203938262495564] +(c3 - R_{2/3})(L), d=2, L>=10: [0.0614650917123430310676033072575, 0.0616634937440884512761309021742] +(c3 - R_{2/3})(L), d=2, L>=24: [0.0614658061059116856127442435421, 0.0616627793505197967309899658896] +(c3 - R_{2/3})(L), d=3, L>=10: [0.0772809592715861738273260172417, 0.0776431580674687676951576755071] +(c3 - R_{2/3})(L), d=3, L>=24: [0.0773381398169425878649879319988, 0.0775859775221123536574957607500] +""" + +# Only the known certificate path is substituted in this expected template. +# No normalization of actual streams: runtime/source drift fails closed. +MISSING_NODE_STDERR_TEMPLATE = b"""Traceback (most recent call last): + File "/dd_exact.py", line 95, in + main(args[0], *args[1:], recheck='--no-recheck' not in sys.argv, sample=0 if '--no-sample' in sys.argv else 24) + File "/dd_exact.py", line 37, in main + require(len(done) == len(cells), 'incomplete node values: %d of %d cells' % (len(done), len(cells))) + File "/ddcore.py", line 23, in require + if not cond: raise AssertionError(msg) + ^^^^^^^^^^^^^^^^^^^^^^^^^ +AssertionError: incomplete node values: 2194 of 2393 cells +""" + + def identity(data): return len(data), hashlib.sha256(data).hexdigest() @@ -206,13 +233,16 @@ def negative_failures(root, manifest, quick): cert = root / 'certificate_v2' nodes = [str(cert / 'nodes' / ('nodes_%d.json' % k)) for k in range(11)] # nodes_11 omitted code, out, err = run(cert / 'dd_exact.py', str(cert / 'cells_full.json'), *nodes, '--no-recheck', '--no-sample') - report('dd_exact.py with nodes_11.json missing', (code, out, err), 'exit 1, AssertionError: incomplete node values') - if code != 1 or b'incomplete node values' not in err: - failures.append('negative control (c): a missing node file was not rejected as intended') + report('dd_exact.py with nodes_11.json missing', (code, out, err), 'exit 1, empty stdout, exact input-completeness traceback') + expected_missing = MISSING_NODE_STDERR_TEMPLATE.replace(b'', os.fsencode(cert)) + if (code, out, err) != (1, b'', expected_missing): + failures.append('negative control (c): missing-node result does not match the exact input-completeness rejection') + else: + print(json.dumps(dict(control='nodes_11.json missing', input_completeness_rejection_verified=True))) if quick: print(json.dumps(dict(negative='one changed digit in nodes_3.json', skipped='--quick'))) return failures - # (b) one changed digit in one stored node value changes (or fails) the assembly + # (b) exact successful output sensitivity with recomputation disabled. with tempfile.TemporaryDirectory() as tmp: copy = pathlib.Path(tmp) / 'certificate_v2' shutil.copytree(cert, copy, ignore=shutil.ignore_patterns('__pycache__')) @@ -229,14 +259,12 @@ def negative_failures(root, manifest, quick): p.write_text(json.dumps(d), encoding='utf-8') nodes = [str(copy / 'nodes' / ('nodes_%d.json' % k)) for k in range(12)] code, out, err = run(copy / 'dd_exact.py', str(copy / 'cells_full.json'), *nodes, '--no-recheck', '--no-sample') - report('dd_exact.py with one changed node digit (no recheck, no sample)', (code, out, err), 'stdout differs from the record or exit 1') - # compare with the stored record's final lines (the record was produced with the recheck and the sample; strip the two C9 lines) - stored = (root / 'certificate_v2' / 'results' / 'assembly_stdout.txt').read_bytes() - stored_tail = b'\n'.join(l for l in stored.split(b'\n') if not l.startswith(b'C9')) - if code == 0 and out == stored_tail: - failures.append('negative control (b): a changed node value was not detected') + report('dd_exact.py with one changed node digit (no recheck, no sample)', (code, out, err), + 'exit 0, exact changed-node stdout, empty stderr (output sensitivity only)') + if (code, out, err) != (0, CHANGED_NODE_STDOUT, b''): + failures.append('negative control (b): node-coupling result does not match the exact successful transcript') else: - print(json.dumps(dict(negative='one changed digit in nodes_3.json', rejected=True))) + print(json.dumps(dict(control='one changed digit in nodes_3.json', output_sensitivity_verified=True))) return failures @@ -257,10 +285,10 @@ def main(argv): print('Lifetime note DD incorporation replay (%s): %d failure(s)' % (mode, len(failures))) return 1 n_replays = sum(1 for r in manifest['replays'] if not (quick and r.get('long'))) - print('Lifetime note DD incorporation replay (%s): %d stored records, %d certificate files (v1 %d, v2 %d), %d replays and %d negative controls PASS%s' % ( + print('Lifetime note DD incorporation replay (%s): %d stored records, %d certificate files (v1 %d, v2 %d), %d replays, 2 negative controls and %d output-sensitivity controls PASS%s' % ( mode, sum(1 for f in manifest['stored'] if f['path'].startswith('DD/')), sum(1 for f in manifest['stored'] if f['path'].startswith('certificate')), sum(1 for f in manifest['stored'] if f['path'].startswith('certificate/')), sum(1 for f in manifest['stored'] if f['path'].startswith('certificate_v2/')), - n_replays, 2 if quick else 3, ' (--quick: the assembly replays and the node-mutation control were skipped)' if quick else '')) + n_replays, 0 if quick else 1, ' (--quick: the assembly replays and the node-mutation control were skipped)' if quick else '')) return 0 diff --git a/reviews/dd_node_oracle_20261029/VERIFICATION.md b/reviews/dd_node_oracle_20261029/VERIFICATION.md new file mode 100644 index 000000000..1b802e7a1 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/VERIFICATION.md @@ -0,0 +1,40 @@ +# DD exact process contracts — reconstructed candidate + +## Scope and source + +Base: `95eb8daaa02e89be1f816bc7f58eac812dd1b469` of Math-. Original wrapper blob: `9b01189115f9abd1b57dba581628e52be71453ae`. This is an engineering repair, not a theorem closure or a new mathematical bound. All stored notes, numerical algorithms, certificate inputs/results, bounds and SOURCES.json remain unchanged. + +The earlier unpublished candidate `fb20f42` and its dirty extension, raw logs and review were lost when the execution workspace was replaced. They are historical reports only, not authenticated evidence for this new candidate. A surviving transformation script was inspected but not applied as recovery of missing bytes. This candidate was reconstructed from public source, with new actual specimens and fresh failing tests before production edits. No prior review is transferred. + +## Contracts and meaning + +The original changed-node predicate accepted any result except successful unchanged stdout, including unrelated crashes. The fixed deterministic perturbation of nodes_3.json must instead match `(0, CHANGED_NODE_STDOUT, b'')`. This runs with `--no-recheck --no-sample` and tests **output sensitivity**, not rejection of mathematical invalidity. The perturbation, Decimal precision and underlying arithmetic are unchanged. Its altered output must not be cited as a certified new bound. + +The original missing-node predicate accepted exit1 and a diagnostic substring, ignoring stdout and the complete error. Omitting nodes_11.json must match `(1, b'', expected_missing)`. The expected complete CPython3.11.16 traceback names dd_exact.py:95, dd_exact.py:37 and ddcore.py:23, ending exactly `AssertionError: incomplete node values: 2194 of 2393 cells`. The omitted shard represents199cells. This is **input-completeness rejection**, not proof that supplied numerical values are mathematically correct. + +Only the known certificate directory is substituted into the expected missing-node template. Actual streams are never stripped, normalized or searched by substring. Source/runtime traceback drift deliberately fails closed and requires renewed observation/review, not relaxation of the contract. Success markers distinguish `output_sensitivity_verified` from `input_completeness_rejection_verified`. + +## New specimens and reproducibility + +New actual normal/optimized runs used the official Astral python-build-standalone CPython3.11.16 release20260929. Its install-only x86_64 Linux archive SHA256 was checked against release metadata: `fbbfd0f2253996486455f44a28c09ac7e2df534b8a4835408d17c99d185b80ec`. No global installation is needed; hosted workflow remains pinned to3.11.16. + +Both modes produced identical stream pairs: changed-node exit0, empty stderr and989bytes stdout SHA256 `1e547fee84313e3fd62d822c97f9c76b08335112bcd71337e00bc06ea4a31bf8`; missing-node exit1, empty stdout and the full path-dependent traceback. The path-neutral574byte template SHA256 is `74c9a35ac855ac1abba7c48a3eb1f25333b277738fd75da47fa8c73fe402833b`. Fixtures are retained independently of production literals. + +Run with CPython3.11.16: + +```sh +python -B -S -m unittest discover -s tests -p 'test_lifetime_dd*.py' -v +python -B -O -S -m unittest discover -s tests -p 'test_lifetime_dd*.py' -v +python -B -S -m unittest discover -s tests -p test_full_suite_routing.py -v +python -B -O -S -m unittest discover -s tests -p test_full_suite_routing.py -v +``` + +The focused population is36methods:26 unchanged protocol/evidence tests and10 new oracle tests. Fifteen changed-node and16 missing-node adverse tuples cover unrelated failures, wrong exits/signals, empty streams, stderr/stdout contamination, truncation, prefix/suffix/duplicate/newline changes, numeric/frame/exception/path differences. Exact positive tuples and actual bounded children prevent unconditional rejection. Sixteen source mutants (eight per predicate) must each cause assertion failures with zero runner errors; threshold16/16. Finite mutation coverage is not a proof of universal auditor soundness. Fresh RED on original source ran10methods with33assertion failures and no errors. + +The dedicated workflow runs and retains the new tests and both fixtures before its existing full replay. Original tests, actual full replay, runtime/action pins and permissions remain enabled and unchanged. + +## Remaining boundaries and tool registry + +The new bounded controls do not run the approximately45-minute-per-mode complete certificate replay. No complete repository regression, current hosted gate pass, Lean verification or federation CBZ-0 completion is claimed by this local artifact. The full assembly's existing boundary is all2393cell remainders and24sampled nodes, not all38288nodes; no analytic theorem is formalized here. + +Tool: existing packet `replay.py`, strengthened process predicates. Purpose: reject unrelated subprocess outcomes instead of calling them successful controls. Usage: packet README; self-verification: commands above and assertion-only mutation threshold. Maintenance: self-contained, no ongoing owner; intentional input/runtime changes require independent recharacterization. CBZ criteria served:4,5,7,9,10; none is established federation-wide by this scoped repair. Canonical GOVERNANCE/TOOLING/STATUS registration remains with the federation coordinator; this is not a competing scientific-status register. diff --git a/tests/fixtures/lifetime_dd_changed_node_stdout.txt b/tests/fixtures/lifetime_dd_changed_node_stdout.txt new file mode 100644 index 000000000..145d674ad --- /dev/null +++ b/tests/fixtures/lifetime_dd_changed_node_stdout.txt @@ -0,0 +1,8 @@ +Gauss region: sum [0.0764960693454651862061373880206, 0.0771096748441041862088778512743] (node-width 0.0006136054986390000027404632537), remainder 0.000699415225762334605564277483154 +region S: [-0.0000204104527369070204567316057495, -0.0000200429419006537600186550090259]; omega tails 0.0000138351995650080053539807820619; tau tail 0.0000572129033171405130248937123594 +D in [0.0757051955640837960617375044371, 0.0778600952308480155728023482430] width 0.0021548996667642195110648438059 +q = J/30 - I~_quad - D in [0.672471569882485317760530985090, 0.674626571425916203938262495564] +(c3 - R_{2/3})(L), d=2, L>=10: [0.0614650917123430310676033072575, 0.0616634937440884512761309021742] +(c3 - R_{2/3})(L), d=2, L>=24: [0.0614658061059116856127442435421, 0.0616627793505197967309899658896] +(c3 - R_{2/3})(L), d=3, L>=10: [0.0772809592715861738273260172417, 0.0776431580674687676951576755071] +(c3 - R_{2/3})(L), d=3, L>=24: [0.0773381398169425878649879319988, 0.0775859775221123536574957607500] diff --git a/tests/fixtures/lifetime_dd_missing_node_stderr.txt b/tests/fixtures/lifetime_dd_missing_node_stderr.txt new file mode 100644 index 000000000..4231f87e0 --- /dev/null +++ b/tests/fixtures/lifetime_dd_missing_node_stderr.txt @@ -0,0 +1,9 @@ +Traceback (most recent call last): + File "/dd_exact.py", line 95, in + main(args[0], *args[1:], recheck='--no-recheck' not in sys.argv, sample=0 if '--no-sample' in sys.argv else 24) + File "/dd_exact.py", line 37, in main + require(len(done) == len(cells), 'incomplete node values: %d of %d cells' % (len(done), len(cells))) + File "/ddcore.py", line 23, in require + if not cond: raise AssertionError(msg) + ^^^^^^^^^^^^^^^^^^^^^^^^^ +AssertionError: incomplete node values: 2194 of 2393 cells diff --git a/tests/test_lifetime_dd_node_oracle.py b/tests/test_lifetime_dd_node_oracle.py new file mode 100644 index 000000000..90dea60dc --- /dev/null +++ b/tests/test_lifetime_dd_node_oracle.py @@ -0,0 +1,150 @@ +"""Finite process-contract regressions, not mathematical certification.""" +import contextlib +import hashlib +import importlib.util +import io +import json +from pathlib import Path +import sys +import types +import unittest +from unittest import mock + +ROOT = Path(__file__).resolve().parents[1] +WRAPPER = ROOT / 'frontiers/lifetime_dd_model_d_20261013/replay.py' +EXPECTED = (ROOT / 'tests/fixtures/lifetime_dd_changed_node_stdout.txt').read_bytes() +MISSING_TEMPLATE = (ROOT / 'tests/fixtures/lifetime_dd_missing_node_stderr.txt').read_bytes() +MISSING = MISSING_TEMPLATE.replace(b'', str(WRAPPER.parent / 'certificate_v2').encode()) + + +def load(): + spec = importlib.util.spec_from_file_location('dd_oracle_subject', WRAPPER) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +class NodeOracleTests(unittest.TestCase): + def outcome(self, missing, changed=None): + m = load() + manifest = json.loads((WRAPPER.parent / 'SOURCES.json').read_text()) + outputs = [missing] if changed is None else [missing, changed] + capture = io.StringIO() + with mock.patch.object(m, 'run', side_effect=outputs): + with contextlib.redirect_stdout(capture): + failures = m.negative_failures(WRAPPER.parent, manifest, quick=changed is None) + return failures, capture.getvalue() + + def test_changed_rejects_unrelated_results(self): + cases = [(1,b'',b'Traceback: crash\n'), (17,b'failed',b'oom'), (-9,b'',b''), + (0,b'',b''), (0,b'unrelated',b''), (1,EXPECTED,b''), + (17,EXPECTED,b''), (-9,EXPECTED,b''), (0,EXPECTED,b'warning'), + (0,EXPECTED[:-1],b''), (0,EXPECTED+b'noise',b''), + (0,EXPECTED+b'\n',b''), (0,b'noise'+EXPECTED,b''), + (0,EXPECTED+EXPECTED,b''), + (0,EXPECTED.replace(b'0.075705195564',b'0.075705195565'),b'')] + for case in cases: + with self.subTest(case=case): + failures,_ = self.outcome((1,b'',MISSING),case) + self.assertTrue(any('negative control (b)' in f for f in failures),failures) + + def test_changed_accepts_exact_sensitivity(self): + failures, output = self.outcome((1,b'',MISSING),(0,EXPECTED,b'')) + self.assertEqual(failures,[]) + records=[json.loads(line) for line in output.splitlines()] + records=[r for r in records if r.get('output_sensitivity_verified') is True] + self.assertEqual(len(records),1) + self.assertNotIn('rejected',records[0]) + + def test_changed_fixture_identity(self): + self.assertEqual(len(EXPECTED),989) + self.assertEqual(hashlib.sha256(EXPECTED).hexdigest(), + '1e547fee84313e3fd62d822c97f9c76b08335112bcd71337e00bc06ea4a31bf8') + stored=(WRAPPER.parent/'certificate_v2/results/assembly_stdout.txt').read_bytes() + self.assertNotEqual(EXPECTED,b'\n'.join(x for x in stored.split(b'\n') if not x.startswith(b'C9'))) + + def test_missing_rejects_inexact_results(self): + cases=[(1,b'noise',MISSING),(1,b'',b'error incomplete node values\n'), + (1,b'',MISSING.replace(b'2194 of 2393',b'0 of 1')), + (1,b'',MISSING.replace(b'AssertionError:',b'RuntimeError:')), + (1,b'',MISSING.replace(b'ddcore.py',b'other.py')), + (1,b'',MISSING.replace(b'line 23,',b'line 24,')), + (1,b'',MISSING[:-1]),(1,b'',MISSING+b'\n'), + (1,b'',MISSING+b'noise'),(1,b'',b'noise'+MISSING), + (1,b'',MISSING+MISSING), + (1,b'',MISSING.replace(str(WRAPPER.parent).encode(),b'/wrong')), + (1,b'',b''),(0,b'',MISSING),(17,b'',MISSING),(-9,b'',MISSING)] + for case in cases: + with self.subTest(case=case): + failures,_=self.outcome(case) + self.assertTrue(any('negative control (c)' in f for f in failures),failures) + + def test_missing_accepts_exact_completeness_rejection(self): + failures,output=self.outcome((1,b'',MISSING)) + self.assertEqual(failures,[]) + self.assertIn('"input_completeness_rejection_verified": true',output) + + def test_missing_fixture_identity(self): + self.assertEqual(hashlib.sha256(MISSING_TEMPLATE).hexdigest(), + '74c9a35ac855ac1abba7c48a3eb1f25333b277738fd75da47fa8c73fe402833b') + + def test_real_bounded_specimens(self): + m=load() + capture=io.StringIO() + with contextlib.redirect_stdout(capture): + failures=m.negative_failures(WRAPPER.parent,json.loads((WRAPPER.parent/'SOURCES.json').read_text()),False) + self.assertEqual(failures,[]) + self.assertIn('"output_sensitivity_verified": true',capture.getvalue()) + self.assertIn('"input_completeness_rejection_verified": true',capture.getvalue()) + + def test_workflow_binding(self): + text=(ROOT/'.github/workflows/lifetime-dd-model-d.yml').read_text() + for name in ('tests/test_lifetime_dd_node_oracle.py', + 'tests/fixtures/lifetime_dd_changed_node_stdout.txt', + 'tests/fixtures/lifetime_dd_missing_node_stderr.txt'): + self.assertIn(" - '"+name+"'",text) + self.assertIn('cp '+name,text) + self.assertIn('-p test_lifetime_dd_node_oracle.py -v',text) + + def mutations(self, needle, variants, methods): + source=WRAPPER.read_text() + self.assertEqual(source.count(needle),1) + for name,replacement in variants.items(): + with self.subTest(mutation=name): + subject=types.ModuleType('mutated_dd_oracle') + subject.__file__=str(WRAPPER) + exec(compile(source.replace(needle,replacement),str(WRAPPER),'exec'),subject.__dict__) + suite=unittest.TestSuite(NodeOracleTests(method) for method in methods) + capture=io.StringIO() + with mock.patch.object(sys.modules[__name__],'load',return_value=subject): + with contextlib.redirect_stdout(capture): + result=unittest.TextTestRunner(stream=capture).run(suite) + self.assertEqual(result.testsRun,2) + self.assertEqual(result.errors,[],capture.getvalue()) + self.assertGreater(len(result.failures),0,capture.getvalue()) + + def test_changed_mutations(self): + self.mutations("if (code, out, err) != (0, CHANGED_NODE_STDOUT, b''):",{ + 'generic_difference':"if code == 0 and out == b'unchanged baseline':", + 'ignore_exit':"if (out, err) != (CHANGED_NODE_STDOUT, b''):", + 'ignore_stderr':"if (code, out) != (0, CHANGED_NODE_STDOUT):", + 'ignore_stdout':"if (code, err) != (0, b''):", + 'strip':"if (code, out.strip(), err) != (0, CHANGED_NODE_STDOUT.strip(), b''):", + 'prefix':"if code != 0 or err or not out.startswith(CHANGED_NODE_STDOUT):", + 'accept':'if False:', 'reject':'if True:'}, + ('test_changed_rejects_unrelated_results','test_changed_accepts_exact_sensitivity')) + + def test_missing_mutations(self): + self.mutations("if (code, out, err) != (1, b'', expected_missing):",{ + 'substring':"if code != 1 or b'incomplete node values' not in err:", + 'ignore_exit':"if (out, err) != (b'', expected_missing):", + 'ignore_stdout':"if (code, err) != (1, expected_missing):", + 'ignore_stderr':"if (code, out) != (1, b''):", + 'strip':"if (code, out, err.strip()) != (1, b'', expected_missing.strip()):", + 'prefix':"if code != 1 or out or not err.startswith(expected_missing):", + 'accept':'if False:', 'reject':'if True:'}, + ('test_missing_rejects_inexact_results','test_missing_accepts_exact_completeness_rejection')) + + +if __name__ == '__main__': + unittest.main() From 7fc87e4db138dcd87fb329eee62fb0d8fded483c Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Thu, 29 Oct 2026 17:29:29 -0500 Subject: [PATCH 2/4] Require genuine oracle assertion origin for DD mutation evidence --- .../dd_node_oracle_20261029/VERIFICATION.md | 9 + .../origin-repair/README.md | 56 ++++ .../origin-repair/REVIEW.md | 15 + .../origin-repair/SHA256SUMS.json | 18 ++ .../origin-repair/final-normal.exit | 1 + .../origin-repair/final-normal.log | 27 ++ .../origin-repair/final-optimized.exit | 1 + .../origin-repair/final-optimized.log | 27 ++ .../origin-repair/full-normal.exit | 1 + .../origin-repair/full-normal.log | 26 ++ .../origin-repair/full-optimized.exit | 1 + .../origin-repair/full-optimized.log | 26 ++ .../origin-repair/independent-normal.log | 17 + .../origin-repair/independent-optimized.log | 17 + .../original-false-accept-normal.log | 2 + .../original-false-accept-optimized.log | 2 + .../redundant-guard-red-normal.log | 34 ++ .../redundant-guard-red-optimized.log | 34 ++ tests/test_lifetime_dd_node_oracle.py | 292 +++++++++++++++++- 19 files changed, 604 insertions(+), 2 deletions(-) create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/README.md create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/REVIEW.md create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/SHA256SUMS.json create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/final-normal.exit create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/final-normal.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/final-optimized.exit create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/final-optimized.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/full-normal.exit create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/full-normal.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/full-optimized.exit create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/full-optimized.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/independent-normal.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/independent-optimized.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/original-false-accept-normal.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/original-false-accept-optimized.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/redundant-guard-red-normal.log create mode 100644 reviews/dd_node_oracle_20261029/origin-repair/redundant-guard-red-optimized.log diff --git a/reviews/dd_node_oracle_20261029/VERIFICATION.md b/reviews/dd_node_oracle_20261029/VERIFICATION.md index 1b802e7a1..b33d6a65e 100644 --- a/reviews/dd_node_oracle_20261029/VERIFICATION.md +++ b/reviews/dd_node_oracle_20261029/VERIFICATION.md @@ -38,3 +38,12 @@ The dedicated workflow runs and retains the new tests and both fixtures before i The new bounded controls do not run the approximately45-minute-per-mode complete certificate replay. No complete repository regression, current hosted gate pass, Lean verification or federation CBZ-0 completion is claimed by this local artifact. The full assembly's existing boundary is all2393cell remainders and24sampled nodes, not all38288nodes; no analytic theorem is formalized here. Tool: existing packet `replay.py`, strengthened process predicates. Purpose: reject unrelated subprocess outcomes instead of calling them successful controls. Usage: packet README; self-verification: commands above and assertion-only mutation threshold. Maintenance: self-contained, no ongoing owner; intentional input/runtime changes require independent recharacterization. CBZ criteria served:4,5,7,9,10; none is established federation-wide by this scoped repair. Canonical GOVERNANCE/TOOLING/STATUS registration remains with the federation coordinator; this is not a competing scientific-status register. + +## 2026-10-29 mutation-origin amendment + +The earlier failure-count-based mutant admission is superseded for future use by +the source-bound origin/lifecycle/terminal verifier in the same test module. +See [origin-repair/README.md](origin-repair/README.md) for retained counterexamples, +all unchanged original test methods,22 actual methods per mode, five effective +grader mutations and two explicitly redundant omission controls. No production +mathematical source changed; earlier finite evidence stays historical. diff --git a/reviews/dd_node_oracle_20261029/origin-repair/README.md b/reviews/dd_node_oracle_20261029/origin-repair/README.md new file mode 100644 index 000000000..1aea6086b --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/README.md @@ -0,0 +1,56 @@ +# DD mutation-origin repair + +Source test SHA256: `17049a25399065a56687edba3ddadae2672e06286541b25600b5b7ea3ab957a7`. Prepared 2026-10-29 on composition6d06680 +(tree e54ee23c, identical to native Math541 babb5934). + +## Defect and exact resolution + +The prior mutation helper accepted any unittest failure with no errors. A planted +AssertionError in the production subject was therefore credited as an oracle kill. +The retained original reproducer logs demonstrate this in normal and optimized +Python. This does not refute historical finite kills or alter the production +exact-output process contracts. It does invalidate generic future-use admission +based on failure counts alone. + +The repaired test-local `OracleOriginResult` captures raw traceback code identities +before unittest clears them. A regular failure must be the identical exception +escaping the actual selected synchronous method; subtest failures must occur +while that method is active. The selected body's code must occur exactly once in +the traceback, followed only by the explicitly enumerated unittest assertion +helper code objects. Subject, test-helper and nested-callback assertions refuse, +including same-file code; no filename/text heuristic grants admission. Setup, +teardown, cleanup, manual fixture calls into the body, lazy bodies, returned deferred/non-None values, errors, skips, +expected failures, duplicate/missing execution and terminal events all refuse. +Every original mutant first runs an admitted positive baseline. The frozen +population must have exact start/stop/body/terminal accounting. + +## Observed finite verification + +Pinned CPython3.11.16 executed22 methods normally and optimized, both OK with zero +skips: all10 original test method ASTs remain byte-identical, including real bounded +specimens and the original16 subject mutants;12 self-test methods are additive. +Five effective grader-source omissions were assertion-killed per mode using the +unchanged outer origin grader. Two isolated skip/expected-failure omissions remain +behaviorally redundant under exact terminal accounting. They are retained with +explicit non-kill assertions, not reported as detected defects. The initial two +failed meta-expectations are retained in redundant-guard-red logs; no failing +production check was deleted or weakened. + +Commands: `python3.11 -B -S -m unittest tests.test_lifetime_dd_node_oracle -v` +and the same with `-O`. The existing dedicated workflow already discovers this +file; no workflow change is required. Production replay.py, all certificates, +fixtures, numerical algorithms and workflow bytes are unchanged. + +## Limits and ownership + +This is a bounded trusted-process engineering harness, not mathematical +certification or hostile Python-code attestation. Arbitrary same-process monkey +patching of unittest/result internals is outside its boundary. Full repository +regression, new hosted checks and final federation gates remain unexecuted here. +Historical hosted runs remain bound to their prior source. Maintenance: none +except deliberate source/runtime changes. Register the test-local verifier under +the existing DD tool entry during canonical integration; this does not create a +new general-purpose auditor. + +The earlier full-normal/full-optimized logs retain the preceding21-method cut. +Final22-method evidence is in final-normal/final-optimized; both exits are0. diff --git a/reviews/dd_node_oracle_20261029/origin-repair/REVIEW.md b/reviews/dd_node_oracle_20261029/origin-repair/REVIEW.md new file mode 100644 index 000000000..1a1d20397 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/REVIEW.md @@ -0,0 +1,15 @@ +# Independent scoped engineering review + +Reviewer: parent audit_owned_mutation_oracles, 2026-10-29 22:27 UTC. +Source SHA25617049a25399065a56687edba3ddadae2672e06286541b25600b5b7ea3ab957a7. +Verdict: ACCEPT_SCOPED_ENGINEERING; no blocking finding. + +Reviewer independently ran all12 new self-test methods normally and optimized; +both succeeded (1.485s and1.550s). It inspected raw traceback origin, identical +escaping exception consumption, active subtest/body and terminal accounting. +The unchanged outer grader authenticates the meta-mutation failures; cardinality +checks use unittest assertions in both modes. Five effective kills and two +behaviorally redundant omission controls remain separately labeled. + +Same-provider engineering review, not formal PR approval, scientific independence, +full repository regression, full certificate replay or CBZ qualification. diff --git a/reviews/dd_node_oracle_20261029/origin-repair/SHA256SUMS.json b/reviews/dd_node_oracle_20261029/origin-repair/SHA256SUMS.json new file mode 100644 index 000000000..8e9c14372 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/SHA256SUMS.json @@ -0,0 +1,18 @@ +{ + "original-false-accept-optimized.log": "2e0a0994cdcb1aaee473338a069732c1cc94a0a150ac55e402a02dfd116a31e1", + "final-normal.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "independent-normal.log": "2e3e6425cedd0d3da110a7ff6757af3f312496056ee78a7e7cee9386152f40dd", + "REVIEW.md": "26bab952f46e6852303b8c0955a8de941f563c3ea010d1a0da9c14067293e601", + "full-normal.log": "554f6ea9f8417d18afc89c6a5c9d94f289caeab63107ebc1396b27ad23f7e608", + "full-optimized.log": "13631906c444f13a136e81ed398cf6097a6c8a35a9b78cd278dbaccedc3ba821", + "full-optimized.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "redundant-guard-red-normal.log": "058fe878dbff20f8bd35bfde799bf366dd8100abd2e821aa1482818cd3fc7178", + "README.md": "35ad3f315db7e3bd7de88fb2b90a3e11622d134d196f0f3ea94fbafaef98cfac", + "redundant-guard-red-optimized.log": "804589f382b160f3576d42ba4e6ed064567ef4d4261327b8c660bb18149ba071", + "original-false-accept-normal.log": "2e0a0994cdcb1aaee473338a069732c1cc94a0a150ac55e402a02dfd116a31e1", + "final-optimized.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "independent-optimized.log": "0bf303eff9918ad36cb40a0d73e415822be705f835be8b98cdfd190a1edbf914", + "full-normal.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "final-normal.log": "b88b8bd74b03f72dd89c402749877259e4d2fff5b448870807e41be16237ec08", + "final-optimized.log": "f0daae6286ca7e11adf3a0b71f0bac8872364089e3e302a24f1675f8dda0b294" +} diff --git a/reviews/dd_node_oracle_20261029/origin-repair/final-normal.exit b/reviews/dd_node_oracle_20261029/origin-repair/final-normal.exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/final-normal.exit @@ -0,0 +1 @@ +0 diff --git a/reviews/dd_node_oracle_20261029/origin-repair/final-normal.log b/reviews/dd_node_oracle_20261029/origin-repair/final-normal.log new file mode 100644 index 000000000..09167db59 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/final-normal.log @@ -0,0 +1,27 @@ +test_changed_accepts_exact_sensitivity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_accepts_exact_sensitivity) ... ok +test_changed_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_fixture_identity) ... ok +test_changed_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_mutations) ... ok +test_changed_rejects_unrelated_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_rejects_unrelated_results) ... ok +test_missing_accepts_exact_completeness_rejection (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_accepts_exact_completeness_rejection) ... ok +test_missing_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_fixture_identity) ... ok +test_missing_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_mutations) ... ok +test_missing_rejects_inexact_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_rejects_inexact_results) ... ok +test_real_bounded_specimens (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_real_bounded_specimens) ... ok +test_workflow_binding (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_workflow_binding) ... ok +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_returned_deferred_and_non_none_values (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_returned_deferred_and_non_none_values) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 22 tests in 25.657s + +OK diff --git a/reviews/dd_node_oracle_20261029/origin-repair/final-optimized.exit b/reviews/dd_node_oracle_20261029/origin-repair/final-optimized.exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/final-optimized.exit @@ -0,0 +1 @@ +0 diff --git a/reviews/dd_node_oracle_20261029/origin-repair/final-optimized.log b/reviews/dd_node_oracle_20261029/origin-repair/final-optimized.log new file mode 100644 index 000000000..4b5f01880 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/final-optimized.log @@ -0,0 +1,27 @@ +test_changed_accepts_exact_sensitivity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_accepts_exact_sensitivity) ... ok +test_changed_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_fixture_identity) ... ok +test_changed_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_mutations) ... ok +test_changed_rejects_unrelated_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_rejects_unrelated_results) ... ok +test_missing_accepts_exact_completeness_rejection (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_accepts_exact_completeness_rejection) ... ok +test_missing_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_fixture_identity) ... ok +test_missing_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_mutations) ... ok +test_missing_rejects_inexact_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_rejects_inexact_results) ... ok +test_real_bounded_specimens (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_real_bounded_specimens) ... ok +test_workflow_binding (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_workflow_binding) ... ok +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_returned_deferred_and_non_none_values (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_returned_deferred_and_non_none_values) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 22 tests in 25.616s + +OK diff --git a/reviews/dd_node_oracle_20261029/origin-repair/full-normal.exit b/reviews/dd_node_oracle_20261029/origin-repair/full-normal.exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/full-normal.exit @@ -0,0 +1 @@ +0 diff --git a/reviews/dd_node_oracle_20261029/origin-repair/full-normal.log b/reviews/dd_node_oracle_20261029/origin-repair/full-normal.log new file mode 100644 index 000000000..c99845d4a --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/full-normal.log @@ -0,0 +1,26 @@ +test_changed_accepts_exact_sensitivity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_accepts_exact_sensitivity) ... ok +test_changed_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_fixture_identity) ... ok +test_changed_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_mutations) ... ok +test_changed_rejects_unrelated_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_rejects_unrelated_results) ... ok +test_missing_accepts_exact_completeness_rejection (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_accepts_exact_completeness_rejection) ... ok +test_missing_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_fixture_identity) ... ok +test_missing_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_mutations) ... ok +test_missing_rejects_inexact_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_rejects_inexact_results) ... ok +test_real_bounded_specimens (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_real_bounded_specimens) ... ok +test_workflow_binding (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_workflow_binding) ... ok +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 21 tests in 26.544s + +OK diff --git a/reviews/dd_node_oracle_20261029/origin-repair/full-optimized.exit b/reviews/dd_node_oracle_20261029/origin-repair/full-optimized.exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/full-optimized.exit @@ -0,0 +1 @@ +0 diff --git a/reviews/dd_node_oracle_20261029/origin-repair/full-optimized.log b/reviews/dd_node_oracle_20261029/origin-repair/full-optimized.log new file mode 100644 index 000000000..b9165f300 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/full-optimized.log @@ -0,0 +1,26 @@ +test_changed_accepts_exact_sensitivity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_accepts_exact_sensitivity) ... ok +test_changed_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_fixture_identity) ... ok +test_changed_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_mutations) ... ok +test_changed_rejects_unrelated_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_rejects_unrelated_results) ... ok +test_missing_accepts_exact_completeness_rejection (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_accepts_exact_completeness_rejection) ... ok +test_missing_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_fixture_identity) ... ok +test_missing_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_mutations) ... ok +test_missing_rejects_inexact_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_rejects_inexact_results) ... ok +test_real_bounded_specimens (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_real_bounded_specimens) ... ok +test_workflow_binding (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_workflow_binding) ... ok +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 21 tests in 25.372s + +OK diff --git a/reviews/dd_node_oracle_20261029/origin-repair/independent-normal.log b/reviews/dd_node_oracle_20261029/origin-repair/independent-normal.log new file mode 100644 index 000000000..b8351ae5c --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/independent-normal.log @@ -0,0 +1,17 @@ +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_returned_deferred_and_non_none_values (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_returned_deferred_and_non_none_values) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 12 tests in 1.485s + +OK diff --git a/reviews/dd_node_oracle_20261029/origin-repair/independent-optimized.log b/reviews/dd_node_oracle_20261029/origin-repair/independent-optimized.log new file mode 100644 index 000000000..a368b4f9c --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/independent-optimized.log @@ -0,0 +1,17 @@ +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_returned_deferred_and_non_none_values (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_returned_deferred_and_non_none_values) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 12 tests in 1.550s + +OK diff --git a/reviews/dd_node_oracle_20261029/origin-repair/original-false-accept-normal.log b/reviews/dd_node_oracle_20261029/origin-repair/original-false-accept-normal.log new file mode 100644 index 000000000..da9318d13 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/original-false-accept-normal.log @@ -0,0 +1,2 @@ +BROWSER_FALSE_ACCEPT: six setup-only failures accepted as mutant kills +DD_FALSE_ACCEPT: subject-origin AssertionError accepted as mutant kill diff --git a/reviews/dd_node_oracle_20261029/origin-repair/original-false-accept-optimized.log b/reviews/dd_node_oracle_20261029/origin-repair/original-false-accept-optimized.log new file mode 100644 index 000000000..da9318d13 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/original-false-accept-optimized.log @@ -0,0 +1,2 @@ +BROWSER_FALSE_ACCEPT: six setup-only failures accepted as mutant kills +DD_FALSE_ACCEPT: subject-origin AssertionError accepted as mutant kill diff --git a/reviews/dd_node_oracle_20261029/origin-repair/redundant-guard-red-normal.log b/reviews/dd_node_oracle_20261029/origin-repair/redundant-guard-red-normal.log new file mode 100644 index 000000000..aef6153dc --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/redundant-guard-red-normal.log @@ -0,0 +1,34 @@ +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... + test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) (safeguard='skip') ... FAIL + test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) (safeguard='expected') ... FAIL +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +====================================================================== +FAIL: test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) (safeguard='skip') +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/workspace/shared/cbz-recovery/oracle-audit/dd/tests/test_lifetime_dd_node_oracle.py", line 404, in test_grader_source_safeguards_are_assertion_killed + self.assertTrue(result.admitted(True), name) +AssertionError: False is not true : skip + +====================================================================== +FAIL: test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) (safeguard='expected') +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/workspace/shared/cbz-recovery/oracle-audit/dd/tests/test_lifetime_dd_node_oracle.py", line 404, in test_grader_source_safeguards_are_assertion_killed + self.assertTrue(result.admitted(True), name) +AssertionError: False is not true : expected + +---------------------------------------------------------------------- +Ran 11 tests in 1.212s + +FAILED (failures=2) diff --git a/reviews/dd_node_oracle_20261029/origin-repair/redundant-guard-red-optimized.log b/reviews/dd_node_oracle_20261029/origin-repair/redundant-guard-red-optimized.log new file mode 100644 index 000000000..09057de7c --- /dev/null +++ b/reviews/dd_node_oracle_20261029/origin-repair/redundant-guard-red-optimized.log @@ -0,0 +1,34 @@ +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... + test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) (safeguard='skip') ... FAIL + test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) (safeguard='expected') ... FAIL +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +====================================================================== +FAIL: test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) (safeguard='skip') +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/workspace/shared/cbz-recovery/oracle-audit/dd/tests/test_lifetime_dd_node_oracle.py", line 404, in test_grader_source_safeguards_are_assertion_killed + self.assertTrue(result.admitted(True), name) +AssertionError: False is not true : skip + +====================================================================== +FAIL: test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) (safeguard='expected') +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/workspace/shared/cbz-recovery/oracle-audit/dd/tests/test_lifetime_dd_node_oracle.py", line 404, in test_grader_source_safeguards_are_assertion_killed + self.assertTrue(result.admitted(True), name) +AssertionError: False is not true : expected + +---------------------------------------------------------------------- +Ran 11 tests in 1.207s + +FAILED (failures=2) diff --git a/tests/test_lifetime_dd_node_oracle.py b/tests/test_lifetime_dd_node_oracle.py index 90dea60dc..6232c2b2b 100644 --- a/tests/test_lifetime_dd_node_oracle.py +++ b/tests/test_lifetime_dd_node_oracle.py @@ -3,6 +3,7 @@ import hashlib import importlib.util import io +import inspect import json from pathlib import Path import sys @@ -24,6 +25,114 @@ def load(): return module +# Finite unittest assertion helpers used by the frozen controls below. Code +# identity, not filenames, function names or formatted traceback text, admits +# an origin. This is a trusted-process test aid, not hostile-code attestation. +_ASSERTION_CODES = frozenset(getattr(unittest.TestCase, name).__code__ for name in + ('assertTrue', 'assertFalse', 'assertEqual', 'assertListEqual', 'assertSequenceEqual', + '_baseAssertEqual', 'fail')) + + +class OracleOriginResult(unittest.TestResult): + def __init__(self, cases): + super().__init__() + self.expected = tuple(case.id() for case in cases) + self.started = [] + self.stopped = [] + self.entered = [] + self.active = None + self.escaping = {} + self.origins = [] + self.success_ids = [] + self.failure_ids = [] + self.body_codes = {case.id(): getattr(case, case._testMethodName).__func__.__code__ + for case in cases} + + def startTest(self, test): + self.started.append(test.id()) + super().startTest(test) + + def stopTest(self, test): + self.stopped.append(test.id()) + super().stopTest(test) + + def origin(self, test, err): + if err[0] is not AssertionError: + return False + codes = [] + trace = err[2] + while trace is not None: + codes.append(trace.tb_frame.f_code) + trace = trace.tb_next + body = self.body_codes.get(test.id()) + positions = [i for i, code in enumerate(codes) if code is body] + return (len(positions) == 1 and + all(code in _ASSERTION_CODES for code in codes[positions[0] + 1:])) + + def addSuccess(self, test): + self.success_ids.append(test.id()) + super().addSuccess(test) + + def addFailure(self, test, err): + # A regular failure must be the identical exception escaping the actual + # selected method invocation, not setup/teardown/cleanup or callbacks. + self.failure_ids.append(test.id()) + self.origins.append(self.escaping.pop((test.id(), id(err[1])), False)) + super().addFailure(test, err) + + def addSubTest(self, test, subtest, err): + if err is not None: + self.failure_ids.append(test.id()) + self.origins.append(self.active == test.id() and self.origin(test, err)) + super().addSubTest(test, subtest, err) + + def admitted(self, killed): + complete = (len(set(self.expected)) == len(self.expected) and bool(self.expected) + and tuple(self.started) == self.expected + and tuple(self.stopped) == self.expected + and tuple(self.entered) == self.expected + and self.testsRun == len(self.expected)) + clean = not (self.errors or self.skipped or self.expectedFailures or self.unexpectedSuccesses) + terminal = (len(self.success_ids) == len(set(self.success_ids)) + and not set(self.success_ids).intersection(self.failure_ids) + and set(self.success_ids).union(self.failure_ids) == set(self.expected)) + if killed: + return bool(complete and terminal and clean and self.failures and self.origins and all(self.origins) + and len(self.origins) == len(self.failures)) + return bool(complete and terminal and clean and not self.failures and not self.origins + and tuple(self.success_ids) == self.expected) + + +def run_oracle_cases(case_class, methods): + cases = [case_class(method) for method in methods] + result = OracleOriginResult(cases) + for case in cases: + def call(selected, method): + code = getattr(method, '__func__', None) + if (code is None or code.__code__ is not result.body_codes[selected.id()] + or inspect.iscoroutinefunction(code) or inspect.isgeneratorfunction(code) + or inspect.isasyncgenfunction(code)): + raise RuntimeError('unsupported oracle body') + result.entered.append(selected.id()) + result.active = selected.id() + try: + outcome = method() + if outcome is not None: + if inspect.iscoroutine(outcome): + outcome.close() + raise RuntimeError('non-None oracle body result') + return None + except BaseException as exc: + result.escaping[(selected.id(), id(exc))] = result.origin( + selected, (type(exc), exc, exc.__traceback__)) + raise + finally: + result.active = None + case._callTestMethod = types.MethodType(call, case) + unittest.TestSuite(cases).run(result) + return result + + class NodeOracleTests(unittest.TestCase): def outcome(self, missing, changed=None): m = load() @@ -111,17 +220,19 @@ def mutations(self, needle, variants, methods): self.assertEqual(source.count(needle),1) for name,replacement in variants.items(): with self.subTest(mutation=name): + baseline = run_oracle_cases(NodeOracleTests, methods) + self.assertTrue(baseline.admitted(False), 'oracle baseline not admitted') subject=types.ModuleType('mutated_dd_oracle') subject.__file__=str(WRAPPER) exec(compile(source.replace(needle,replacement),str(WRAPPER),'exec'),subject.__dict__) - suite=unittest.TestSuite(NodeOracleTests(method) for method in methods) capture=io.StringIO() with mock.patch.object(sys.modules[__name__],'load',return_value=subject): with contextlib.redirect_stdout(capture): - result=unittest.TextTestRunner(stream=capture).run(suite) + result=run_oracle_cases(NodeOracleTests, methods) self.assertEqual(result.testsRun,2) self.assertEqual(result.errors,[],capture.getvalue()) self.assertGreater(len(result.failures),0,capture.getvalue()) + self.assertTrue(result.admitted(True), 'failure did not originate in selected oracle body') def test_changed_mutations(self): self.mutations("if (code, out, err) != (0, CHANGED_NODE_STDOUT, b''):",{ @@ -146,5 +257,182 @@ def test_missing_mutations(self): ('test_missing_rejects_inexact_results','test_missing_accepts_exact_completeness_rejection')) +def _foreign_assertion(): + raise AssertionError('subject origin, not test oracle') + + +class OracleOriginSelfTests(unittest.TestCase): + def observe(self, behavior): + class Probe(unittest.TestCase): + def setUp(self): + self.fixture = False + if behavior == 'setup': + self.fail('setup') + if behavior in ('setup-calls-body', 'setup-subtest', 'teardown-subtest'): + self.test_body() + if behavior == 'cleanup': + self.addCleanup(self.fail, 'cleanup') + def tearDown(self): + if behavior == 'teardown-subtest': + self.fixture = True + self.test_body() + if behavior == 'teardown': + self.fail('teardown') + def helper(self): + self.fail('test helper, not authorized body') + def test_body(self): + if behavior in ('assertion', 'setup-calls-body'): + self.assertEqual(1, 2) + elif behavior == 'direct': + raise AssertionError('direct selected oracle') + elif behavior in ('subtest', 'setup-subtest') or (behavior == 'teardown-subtest' and self.fixture): + with self.subTest(value=1): + self.assertTrue(False) + elif behavior == 'subject': + _foreign_assertion() + elif behavior == 'helper': + self.helper() + elif behavior == 'nested': + (lambda: _foreign_assertion())() + elif behavior == 'subtest-subject': + with self.subTest(value=1): + _foreign_assertion() + elif behavior == 'skip': + self.skipTest('skip') + elif behavior == 'runtime': + raise RuntimeError('runtime') + return run_oracle_cases(Probe, ('test_body',)) + + def test_accepts_genuine_body_and_subtest_assertions(self): + for kind in ('assertion', 'direct', 'subtest'): + with self.subTest(kind=kind): + self.assertTrue(self.observe(kind).admitted(True)) + + def test_baseline_requires_actual_success(self): + self.assertTrue(self.observe('pass').admitted(False)) + self.assertFalse(self.observe('assertion').admitted(False)) + self.assertFalse(self.observe('pass').admitted(True)) + + def test_rejects_setup_teardown_cleanup_and_manual_body(self): + for kind in ('setup', 'teardown', 'cleanup', 'setup-calls-body', 'setup-subtest', 'teardown-subtest'): + with self.subTest(kind=kind): + self.assertFalse(self.observe(kind).admitted(True)) + + def test_rejects_subject_helper_nested_and_subtest_origin(self): + for kind in ('subject', 'helper', 'nested', 'subtest-subject'): + with self.subTest(kind=kind): + self.assertFalse(self.observe(kind).admitted(True)) + + def test_rejects_runtime_and_skip(self): + for kind in ('runtime', 'skip'): + with self.subTest(kind=kind): + self.assertFalse(self.observe(kind).admitted(True)) + self.assertFalse(self.observe(kind).admitted(False)) + + def test_rejects_expected_and_unexpected_success(self): + class Expected(unittest.TestCase): + @unittest.expectedFailure + def test_bad(self): self.fail('expected') + @unittest.expectedFailure + def test_good(self): pass + for method in ('test_bad', 'test_good'): + result = run_oracle_cases(Expected, (method,)) + self.assertFalse(result.admitted(True)) + self.assertFalse(result.admitted(False)) + + def test_rejects_empty_duplicate_and_missing_execution(self): + class Passing(unittest.TestCase): + def test_body(self): pass + for methods in ((), ('test_body', 'test_body')): + self.assertFalse(run_oracle_cases(Passing, methods).admitted(False)) + result = self.observe('assertion') + result.entered.clear() + self.assertFalse(result.admitted(True)) + result = self.observe('pass') + result.stopped.clear() + self.assertFalse(result.admitted(False)) + + def test_rejects_missing_and_duplicate_success_events(self): + class Missing(unittest.TestCase): + def test_body(self): pass + def run(self, result): + result.startTest(self) + self._callTestMethod(self.test_body) + result.stopTest(self) + class Duplicate(unittest.TestCase): + def test_body(self): pass + def run(self, result): + super().run(result) + result.addSuccess(self) + for case in (Missing, Duplicate): + self.assertFalse(run_oracle_cases(case, ('test_body',)).admitted(False)) + result = self.observe('assertion') + result.success_ids.append(result.expected[0]) + self.assertFalse(result.admitted(True)) + + def test_rejects_returned_deferred_and_non_none_values(self): + class Returned(unittest.TestCase): + def test_iterator(self): return iter(()) + def test_value(self): return 1 + for method in ('test_iterator', 'test_value'): + self.assertFalse(run_oracle_cases(Returned, (method,)).admitted(False)) + + def test_rejects_lazy_body(self): + class Lazy(unittest.TestCase): + def test_body(self): yield 1 + self.assertFalse(run_oracle_cases(Lazy, ('test_body',)).admitted(False)) + + def test_grader_source_safeguards_are_assertion_killed(self): + source = Path(__file__).read_text() + controls = ( + ('origin', 'all(code in _ASSERTION_CODES for code in codes[positions[0] + 1:])', + 'True', 'test_rejects_subject_helper_nested_and_subtest_origin'), + ('escaping', 'self.escaping.pop((test.id(), id(err[1])), False)', + 'True', 'test_rejects_setup_teardown_cleanup_and_manual_body'), + ('phase', 'self.active == test.id() and self.origin(test, err)', + 'self.origin(test, err)', 'test_rejects_setup_teardown_cleanup_and_manual_body'), + ('population', 'complete and terminal and clean', 'True and terminal and clean', + 'test_rejects_empty_duplicate_and_missing_execution'), + ('terminal', 'terminal = (', 'terminal = True or (', + 'test_rejects_missing_and_duplicate_success_events'), + ('skip', 'self.errors or self.skipped or self.expectedFailures or self.unexpectedSuccesses', + 'self.errors or self.expectedFailures or self.unexpectedSuccesses', + 'test_rejects_runtime_and_skip'), + ('expected', 'self.errors or self.skipped or self.expectedFailures or self.unexpectedSuccesses', + 'self.errors or self.skipped', 'test_rejects_expected_and_unexpected_success'), + ) + # Only implementation preceding this self-test class is mutated; these + # frozen mutation literals cannot become alternative replacement sites. + implementation, tests = source.split('class OracleOriginSelfTests', 1) + for name, before, after, method in controls: + with self.subTest(safeguard=name): + baseline = run_oracle_cases(OracleOriginSelfTests, (method,)) + self.assertTrue(baseline.admitted(False)) + count = implementation.count(before) + self.assertEqual(count, 2 if name == 'population' else 1) + mutated = implementation.replace(before, after) + 'class OracleOriginSelfTests' + tests + module = types.ModuleType('dd_origin_mutant_' + name) + module.__file__ = __file__ + with mock.patch.dict(sys.modules, {module.__name__: module}): + exec(compile(mutated, __file__, 'exec'), module.__dict__) + # The outer, unchanged grader authenticates failures in the + # selected self-test. The mutant cannot grade itself green. + result = run_oracle_cases(module.OracleOriginSelfTests, (method,)) + if name in ('skip', 'expected'): + # These isolated omissions are behaviorally redundant under + # exact terminal accounting; retain and assert non-kill, + # rather than inflate the effective mutation inventory. + self.assertTrue(result.admitted(False), name) + else: + self.assertTrue(result.admitted(True), name) + + def test_subject_mutant_is_not_admitted(self): + with self.assertRaisesRegex(AssertionError, 'selected oracle body'): + NodeOracleTests().mutations( + "if (code, out, err) != (0, CHANGED_NODE_STDOUT, b''):", + {'subject': "if (_ for _ in ()).throw(AssertionError('subject')):"}, + ('test_changed_rejects_unrelated_results', 'test_changed_accepts_exact_sensitivity')) + + if __name__ == '__main__': unittest.main() From 94a78d8bd95f0cafae85bd6b202407e418fafc2b Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Thu, 29 Oct 2026 17:37:53 -0500 Subject: [PATCH 3/4] Reject structurally equal cloned code in exact oracle identity checks --- .../dd_node_oracle_20261029/VERIFICATION.md | 15 ++++++++++ .../code-identity-repair/README.md | 16 +++++++++++ .../code-identity-repair/SHA256SUMS.json | 9 ++++++ .../code-identity-repair/normal.exit | 1 + .../code-identity-repair/normal.log | 28 +++++++++++++++++++ .../code-identity-repair/optimized.exit | 1 + .../code-identity-repair/optimized.log | 28 +++++++++++++++++++ .../code-identity-repair/preservation.json | 17 +++++++++++ .../code-identity-repair/red.log | 14 ++++++++++ tests/test_lifetime_dd_node_oracle.py | 19 +++++++++++-- 10 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 reviews/dd_node_oracle_20261029/code-identity-repair/README.md create mode 100644 reviews/dd_node_oracle_20261029/code-identity-repair/SHA256SUMS.json create mode 100644 reviews/dd_node_oracle_20261029/code-identity-repair/normal.exit create mode 100644 reviews/dd_node_oracle_20261029/code-identity-repair/normal.log create mode 100644 reviews/dd_node_oracle_20261029/code-identity-repair/optimized.exit create mode 100644 reviews/dd_node_oracle_20261029/code-identity-repair/optimized.log create mode 100644 reviews/dd_node_oracle_20261029/code-identity-repair/preservation.json create mode 100644 reviews/dd_node_oracle_20261029/code-identity-repair/red.log diff --git a/reviews/dd_node_oracle_20261029/VERIFICATION.md b/reviews/dd_node_oracle_20261029/VERIFICATION.md index b33d6a65e..df5c7b608 100644 --- a/reviews/dd_node_oracle_20261029/VERIFICATION.md +++ b/reviews/dd_node_oracle_20261029/VERIFICATION.md @@ -47,3 +47,18 @@ See [origin-repair/README.md](origin-repair/README.md) for retained counterexamp all unchanged original test methods,22 actual methods per mode, five effective grader mutations and two explicitly redundant omission controls. No production mathematical source changed; earlier finite evidence stays historical. + + +## Exact code-object identity correction + +At published parent `7fc87e4db138dcd87fb329eee62fb0d8fded483c`, the clone-of- +approved-code regression reproduced an identity-contract false acceptance: +CodeType structural equality in a frozenset is not object identity. The allowed +references are now a tuple and every provenance comparison explicitly uses `is`. +The new regression first failed on the earlier source; all prior controls remain. +Current population is23 methods, including13 origin self-tests, with six +effective grader safeguard mutations and two explicitly redundant omissions. +See `code-identity-repair/` for new source-bound evidence. Earlier22-method and +five-effective-mutant records remain historical, not rewritten. Production +mathematical outputs, certificates and actual historical kills are not refuted +by this provenance-contract correction. diff --git a/reviews/dd_node_oracle_20261029/code-identity-repair/README.md b/reviews/dd_node_oracle_20261029/code-identity-repair/README.md new file mode 100644 index 000000000..316f99674 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/code-identity-repair/README.md @@ -0,0 +1,16 @@ +# Exact code-object identity repair + +Parent: `7fc87e4db138dcd87fb329eee62fb0d8fded483c`. A newly added regression first produced an actual assertion +failure: `fail.__code__.replace(co_filename='subject_fake.py')` is a distinct +but structurally equal code object and was accepted by equality-based membership. +The RED log is retained. Tuple storage plus explicit identity comparisons now +refuse the clone. A grader mutation restores equality and is caught by the new +regression, graded through the pristine structured origin classifier. + +New observed population: 23 module controls per mode; six effective grader safeguard mutations and two redundant omissions. +Commands remain in the parent tool verification documentation; these tests do +not launch a browser or perform a full certificate replay. Pinned CPython3.11.16 +is used for final local runs. Original production/workflow/packet bytes and all +prior test methods are preserved. Previous evidence is retained at its original +source, not relabeled as current. No full repository, hosted, mathematical or +CBZ-0 certification is claimed. diff --git a/reviews/dd_node_oracle_20261029/code-identity-repair/SHA256SUMS.json b/reviews/dd_node_oracle_20261029/code-identity-repair/SHA256SUMS.json new file mode 100644 index 000000000..47fbc0367 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/code-identity-repair/SHA256SUMS.json @@ -0,0 +1,9 @@ +{ + "README.md": "86470c205caafc5bf8ea4da949d0d61c9190a294fc2e957b3b5bd5924fec797c", + "normal.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "normal.log": "ce966f281cb40b9f8f0b5618d831941b83c4c7b2f21ac258ca356833bf90d86b", + "optimized.exit": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa", + "optimized.log": "e2f286b595cd42f84cdbf651d7863f8a30eca95d99a79f577a75225224d04cfd", + "preservation.json": "3535195b3b879b8ef44a1391a214f6f551b162fd7f3497eb3b9ea10cea2c484e", + "red.log": "47d4d4775392db422456989afc41a9beeccb3028c736a40d90f00f550a9e868b" +} diff --git a/reviews/dd_node_oracle_20261029/code-identity-repair/normal.exit b/reviews/dd_node_oracle_20261029/code-identity-repair/normal.exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/code-identity-repair/normal.exit @@ -0,0 +1 @@ +0 diff --git a/reviews/dd_node_oracle_20261029/code-identity-repair/normal.log b/reviews/dd_node_oracle_20261029/code-identity-repair/normal.log new file mode 100644 index 000000000..524025b1c --- /dev/null +++ b/reviews/dd_node_oracle_20261029/code-identity-repair/normal.log @@ -0,0 +1,28 @@ +test_changed_accepts_exact_sensitivity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_accepts_exact_sensitivity) ... ok +test_changed_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_fixture_identity) ... ok +test_changed_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_mutations) ... ok +test_changed_rejects_unrelated_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_rejects_unrelated_results) ... ok +test_missing_accepts_exact_completeness_rejection (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_accepts_exact_completeness_rejection) ... ok +test_missing_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_fixture_identity) ... ok +test_missing_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_mutations) ... ok +test_missing_rejects_inexact_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_rejects_inexact_results) ... ok +test_real_bounded_specimens (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_real_bounded_specimens) ... ok +test_workflow_binding (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_workflow_binding) ... ok +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_cloned_approved_code_is_not_authorized_identity (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_cloned_approved_code_is_not_authorized_identity) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_returned_deferred_and_non_none_values (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_returned_deferred_and_non_none_values) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 23 tests in 27.316s + +OK diff --git a/reviews/dd_node_oracle_20261029/code-identity-repair/optimized.exit b/reviews/dd_node_oracle_20261029/code-identity-repair/optimized.exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/code-identity-repair/optimized.exit @@ -0,0 +1 @@ +0 diff --git a/reviews/dd_node_oracle_20261029/code-identity-repair/optimized.log b/reviews/dd_node_oracle_20261029/code-identity-repair/optimized.log new file mode 100644 index 000000000..280279994 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/code-identity-repair/optimized.log @@ -0,0 +1,28 @@ +test_changed_accepts_exact_sensitivity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_accepts_exact_sensitivity) ... ok +test_changed_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_fixture_identity) ... ok +test_changed_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_mutations) ... ok +test_changed_rejects_unrelated_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_rejects_unrelated_results) ... ok +test_missing_accepts_exact_completeness_rejection (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_accepts_exact_completeness_rejection) ... ok +test_missing_fixture_identity (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_fixture_identity) ... ok +test_missing_mutations (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_mutations) ... ok +test_missing_rejects_inexact_results (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_rejects_inexact_results) ... ok +test_real_bounded_specimens (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_real_bounded_specimens) ... ok +test_workflow_binding (tests.test_lifetime_dd_node_oracle.NodeOracleTests.test_workflow_binding) ... ok +test_accepts_genuine_body_and_subtest_assertions (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_cloned_approved_code_is_not_authorized_identity (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_cloned_approved_code_is_not_authorized_identity) ... ok +test_grader_source_safeguards_are_assertion_killed (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_returned_deferred_and_non_none_values (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_returned_deferred_and_non_none_values) ... ok +test_rejects_runtime_and_skip (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 23 tests in 26.206s + +OK diff --git a/reviews/dd_node_oracle_20261029/code-identity-repair/preservation.json b/reviews/dd_node_oracle_20261029/code-identity-repair/preservation.json new file mode 100644 index 000000000..8e09790e7 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/code-identity-repair/preservation.json @@ -0,0 +1,17 @@ +{ + "parent": "7fc87e4db138dcd87fb329eee62fb0d8fded483c", + "source_sha256": "6a9ffb895083e119fb06c7fe1f6a92ee1d437d65be5b5f379320ac6c7dace82a", + "all_original_named_tests_retained": true, + "modified_original_methods": [ + "OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed" + ], + "protected_paths_unchanged": [ + "frontiers/lifetime_dd_model_d_20261013/replay.py", + ".github/workflows/lifetime-dd-model-d.yml", + "tests/fixtures/lifetime_dd_changed_node_stdout.txt", + "tests/fixtures/lifetime_dd_missing_node_stderr.txt" + ], + "new_test_methods": [ + "OracleOriginSelfTests.test_cloned_approved_code_is_not_authorized_identity" + ] +} diff --git a/reviews/dd_node_oracle_20261029/code-identity-repair/red.log b/reviews/dd_node_oracle_20261029/code-identity-repair/red.log new file mode 100644 index 000000000..a1a5905e1 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/code-identity-repair/red.log @@ -0,0 +1,14 @@ +test_cloned_approved_code_is_not_authorized_identity (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_cloned_approved_code_is_not_authorized_identity) ... FAIL + +====================================================================== +FAIL: test_cloned_approved_code_is_not_authorized_identity (tests.test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_cloned_approved_code_is_not_authorized_identity) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/workspace/shared/cbz-recovery/oracle-audit/dd/tests/test_lifetime_dd_node_oracle.py", line 394, in test_cloned_approved_code_is_not_authorized_identity + self.assertFalse(run_oracle_cases(Probe, ('test_body',)).admitted(True)) +AssertionError: True is not false + +---------------------------------------------------------------------- +Ran 1 test in 0.001s + +FAILED (failures=1) diff --git a/tests/test_lifetime_dd_node_oracle.py b/tests/test_lifetime_dd_node_oracle.py index 6232c2b2b..c925f4fd8 100644 --- a/tests/test_lifetime_dd_node_oracle.py +++ b/tests/test_lifetime_dd_node_oracle.py @@ -28,7 +28,7 @@ def load(): # Finite unittest assertion helpers used by the frozen controls below. Code # identity, not filenames, function names or formatted traceback text, admits # an origin. This is a trusted-process test aid, not hostile-code attestation. -_ASSERTION_CODES = frozenset(getattr(unittest.TestCase, name).__code__ for name in +_ASSERTION_CODES = tuple(getattr(unittest.TestCase, name).__code__ for name in ('assertTrue', 'assertFalse', 'assertEqual', 'assertListEqual', 'assertSequenceEqual', '_baseAssertEqual', 'fail')) @@ -67,7 +67,7 @@ def origin(self, test, err): body = self.body_codes.get(test.id()) positions = [i for i, code in enumerate(codes) if code is body] return (len(positions) == 1 and - all(code in _ASSERTION_CODES for code in codes[positions[0] + 1:])) + all(any(code is allowed for allowed in _ASSERTION_CODES) for code in codes[positions[0] + 1:])) def addSuccess(self, test): self.success_ids.append(test.id()) @@ -382,10 +382,23 @@ class Lazy(unittest.TestCase): def test_body(self): yield 1 self.assertFalse(run_oracle_cases(Lazy, ('test_body',)).admitted(False)) + def test_cloned_approved_code_is_not_authorized_identity(self): + original = unittest.TestCase.fail + cloned_code = original.__code__.replace(co_filename='subject_fake.py') + self.assertIsNot(cloned_code, original.__code__) + self.assertEqual(cloned_code, original.__code__) + cloned = types.FunctionType(cloned_code, original.__globals__, + original.__name__, original.__defaults__) + class Probe(unittest.TestCase): + def test_body(self): cloned(self, 'cloned subject code') + self.assertFalse(run_oracle_cases(Probe, ('test_body',)).admitted(True)) + def test_grader_source_safeguards_are_assertion_killed(self): source = Path(__file__).read_text() controls = ( - ('origin', 'all(code in _ASSERTION_CODES for code in codes[positions[0] + 1:])', + ('code_identity', 'any(code is allowed for allowed in _ASSERTION_CODES)', + 'code in _ASSERTION_CODES', 'test_cloned_approved_code_is_not_authorized_identity'), + ('origin', 'all(any(code is allowed for allowed in _ASSERTION_CODES) for code in codes[positions[0] + 1:])', 'True', 'test_rejects_subject_helper_nested_and_subtest_origin'), ('escaping', 'self.escaping.pop((test.id(), id(err[1])), False)', 'True', 'test_rejects_setup_teardown_cleanup_and_manual_body'), From 6b91362c17487579fb9ffc8ef295dcfefd11fe0e Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Thu, 29 Oct 2026 18:47:07 -0500 Subject: [PATCH 4/4] Reject replayed DD test events while preserving distinct subtest contexts --- .../dd_node_oracle_20261029/VERIFICATION.md | 11 +++++ .../event-context-repair/README.md | 34 +++++++++++++++ .../event-context-repair/SHA256SUMS.json | 8 ++++ .../event-context-repair/duplicate-red.log | 14 +++++++ .../event-context-repair/full-normal.log | 30 ++++++++++++++ .../event-context-repair/full-optimized.log | 30 ++++++++++++++ .../event-context-repair/preservation.json | 14 +++++++ tests/test_lifetime_dd_node_oracle.py | 41 ++++++++++++++++++- 8 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 reviews/dd_node_oracle_20261029/event-context-repair/README.md create mode 100644 reviews/dd_node_oracle_20261029/event-context-repair/SHA256SUMS.json create mode 100644 reviews/dd_node_oracle_20261029/event-context-repair/duplicate-red.log create mode 100644 reviews/dd_node_oracle_20261029/event-context-repair/full-normal.log create mode 100644 reviews/dd_node_oracle_20261029/event-context-repair/full-optimized.log create mode 100644 reviews/dd_node_oracle_20261029/event-context-repair/preservation.json diff --git a/reviews/dd_node_oracle_20261029/VERIFICATION.md b/reviews/dd_node_oracle_20261029/VERIFICATION.md index df5c7b608..531c8780e 100644 --- a/reviews/dd_node_oracle_20261029/VERIFICATION.md +++ b/reviews/dd_node_oracle_20261029/VERIFICATION.md @@ -62,3 +62,14 @@ See `code-identity-repair/` for new source-bound evidence. Earlier22-method and five-effective-mutant records remain historical, not rewritten. Production mathematical outputs, certificates and actual historical kills are not refuted by this provenance-contract correction. + +### Subtest event/context boundary (29 October, follow-up) + +The exact terminal accounting claim concerns selected-method execution and +success/failure coverage; it does **not** mean one failure per method. Multiple +distinct authenticated subtest contexts, even with identical labels/string IDs, +are supported. Review5706017963 demonstrated this legitimate multiplicity, not +an invalid historical kill. A separate adverse reproduction did demonstrate +acceptance of replaying the **same** subtest callback/context twice. The new +retained-reference identity gate refuses that replay without reducing legitimate +subtest multiplicity. See `event-context-repair/README.md` for RED/GREEN evidence. diff --git a/reviews/dd_node_oracle_20261029/event-context-repair/README.md b/reviews/dd_node_oracle_20261029/event-context-repair/README.md new file mode 100644 index 000000000..4e690d429 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/event-context-repair/README.md @@ -0,0 +1,34 @@ +# Failure-event context identity (finite engineering controls) + +Parent: `94a78d8bd95f0cafae85bd6b202407e418fafc2b`. +Review: https://github.com/d6g8k5htny-coder/Math-/pull/541#pullrequestreview-5706017963 + +The review's two genuine failing subtests are legitimate: one selected method +may emit multiple distinct contexts. Repeated parent IDs or identical subtest +labels do not constitute duplicate event identity. The positive regression +explicitly permits two different contexts bearing identical labels. + +A separate regression replays the exact same `(test, subtest, err)` callback +twice while the selected body is active. Before repair this was admitted; the +retained RED log records the failing refusal assertion. The result now retains +actual test/context references and compares with `is`; duplicate context +callbacks fail closed. No integer object ID or label equality authorizes this +gate. Ordinary failure context is the selected case object. Existing origin, +lifecycle, exact-code-identity, clean-state and method-accounting gates remain. + +Pinned CPython3.11.16 commands from repository root: + +``` +python3.11 -B -S -m unittest discover -s tests -p test_lifetime_dd_node_oracle.py -v +python3.11 -B -O -S -m unittest discover -s tests -p test_lifetime_dd_node_oracle.py -v +``` + +Each mode runs25 methods (all23 prior methods preserved plus2 additive +regressions), original16 wrapper mutants, and7 effective grader mutants plus +2 deliberately redundant omissions recorded as non-kills. The new source mutant +removes the identity admission gate; the pristine outer grader authenticates +the resulting intended regression assertion. Source tests are finite evidence, +not mathematical certification or a proof against hostile in-process mutation. +No historical finite kill, production output, certificate, or theorem is +invalidated. Historical receipts remain unchanged; hosted evidence for the new +composition remains pending. diff --git a/reviews/dd_node_oracle_20261029/event-context-repair/SHA256SUMS.json b/reviews/dd_node_oracle_20261029/event-context-repair/SHA256SUMS.json new file mode 100644 index 000000000..898f3d47f --- /dev/null +++ b/reviews/dd_node_oracle_20261029/event-context-repair/SHA256SUMS.json @@ -0,0 +1,8 @@ +{ + "tests/test_lifetime_dd_node_oracle.py": "4ac046ee75d70e30aeb90b1f57046bdb900738df8f910ea6929cd336b6af0ba5", + "reviews/dd_node_oracle_20261029/event-context-repair/README.md": "de5b262ccd22245808d147ccdde1eacaff5532dbdcbc48e5fff6f088d4c4838b", + "reviews/dd_node_oracle_20261029/event-context-repair/duplicate-red.log": "685038fde6a20369eecd896e7f93c6ec28d7656bf32772ef868ed9848d485264", + "reviews/dd_node_oracle_20261029/event-context-repair/full-normal.log": "a9392052b269ced700991b38ee8734472d1e3cea095439e4d199384139d6e9f5", + "reviews/dd_node_oracle_20261029/event-context-repair/full-optimized.log": "f1c72586ee09e59ece6e22f7c4e5e3580e721b457c6b9883237c92f50746d042", + "reviews/dd_node_oracle_20261029/event-context-repair/preservation.json": "f45298b823762e3436a1d9c72bff403bb76cd467b427e37829a1ad08f342da1a" +} diff --git a/reviews/dd_node_oracle_20261029/event-context-repair/duplicate-red.log b/reviews/dd_node_oracle_20261029/event-context-repair/duplicate-red.log new file mode 100644 index 000000000..a0fa50c2a --- /dev/null +++ b/reviews/dd_node_oracle_20261029/event-context-repair/duplicate-red.log @@ -0,0 +1,14 @@ +test_duplicate_subtest_event_is_refused (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_duplicate_subtest_event_is_refused) ... FAIL + +====================================================================== +FAIL: test_duplicate_subtest_event_is_refused (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_duplicate_subtest_event_is_refused) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/workspace/shared/cbz-recovery/oracle-audit/dd-event-cardinality/tests/test_lifetime_dd_node_oracle.py", line 420, in test_duplicate_subtest_event_is_refused + self.assertFalse(result.admitted(True)) +AssertionError: True is not false + +---------------------------------------------------------------------- +Ran 1 test in 0.001s + +FAILED (failures=1) diff --git a/reviews/dd_node_oracle_20261029/event-context-repair/full-normal.log b/reviews/dd_node_oracle_20261029/event-context-repair/full-normal.log new file mode 100644 index 000000000..df1dc8510 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/event-context-repair/full-normal.log @@ -0,0 +1,30 @@ +test_changed_accepts_exact_sensitivity (test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_accepts_exact_sensitivity) ... ok +test_changed_fixture_identity (test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_fixture_identity) ... ok +test_changed_mutations (test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_mutations) ... ok +test_changed_rejects_unrelated_results (test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_rejects_unrelated_results) ... ok +test_missing_accepts_exact_completeness_rejection (test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_accepts_exact_completeness_rejection) ... ok +test_missing_fixture_identity (test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_fixture_identity) ... ok +test_missing_mutations (test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_mutations) ... ok +test_missing_rejects_inexact_results (test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_rejects_inexact_results) ... ok +test_real_bounded_specimens (test_lifetime_dd_node_oracle.NodeOracleTests.test_real_bounded_specimens) ... ok +test_workflow_binding (test_lifetime_dd_node_oracle.NodeOracleTests.test_workflow_binding) ... ok +test_accepts_genuine_body_and_subtest_assertions (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_cloned_approved_code_is_not_authorized_identity (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_cloned_approved_code_is_not_authorized_identity) ... ok +test_distinct_subtest_contexts_with_identical_labels_are_admitted (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_distinct_subtest_contexts_with_identical_labels_are_admitted) ... ok +test_duplicate_subtest_event_is_refused (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_duplicate_subtest_event_is_refused) ... ok +test_grader_source_safeguards_are_assertion_killed (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_returned_deferred_and_non_none_values (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_returned_deferred_and_non_none_values) ... ok +test_rejects_runtime_and_skip (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 25 tests in 23.100s + +OK diff --git a/reviews/dd_node_oracle_20261029/event-context-repair/full-optimized.log b/reviews/dd_node_oracle_20261029/event-context-repair/full-optimized.log new file mode 100644 index 000000000..532955bba --- /dev/null +++ b/reviews/dd_node_oracle_20261029/event-context-repair/full-optimized.log @@ -0,0 +1,30 @@ +test_changed_accepts_exact_sensitivity (test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_accepts_exact_sensitivity) ... ok +test_changed_fixture_identity (test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_fixture_identity) ... ok +test_changed_mutations (test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_mutations) ... ok +test_changed_rejects_unrelated_results (test_lifetime_dd_node_oracle.NodeOracleTests.test_changed_rejects_unrelated_results) ... ok +test_missing_accepts_exact_completeness_rejection (test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_accepts_exact_completeness_rejection) ... ok +test_missing_fixture_identity (test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_fixture_identity) ... ok +test_missing_mutations (test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_mutations) ... ok +test_missing_rejects_inexact_results (test_lifetime_dd_node_oracle.NodeOracleTests.test_missing_rejects_inexact_results) ... ok +test_real_bounded_specimens (test_lifetime_dd_node_oracle.NodeOracleTests.test_real_bounded_specimens) ... ok +test_workflow_binding (test_lifetime_dd_node_oracle.NodeOracleTests.test_workflow_binding) ... ok +test_accepts_genuine_body_and_subtest_assertions (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_accepts_genuine_body_and_subtest_assertions) ... ok +test_baseline_requires_actual_success (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_baseline_requires_actual_success) ... ok +test_cloned_approved_code_is_not_authorized_identity (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_cloned_approved_code_is_not_authorized_identity) ... ok +test_distinct_subtest_contexts_with_identical_labels_are_admitted (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_distinct_subtest_contexts_with_identical_labels_are_admitted) ... ok +test_duplicate_subtest_event_is_refused (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_duplicate_subtest_event_is_refused) ... ok +test_grader_source_safeguards_are_assertion_killed (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed) ... ok +test_rejects_empty_duplicate_and_missing_execution (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_empty_duplicate_and_missing_execution) ... ok +test_rejects_expected_and_unexpected_success (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_expected_and_unexpected_success) ... ok +test_rejects_lazy_body (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_lazy_body) ... ok +test_rejects_missing_and_duplicate_success_events (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_missing_and_duplicate_success_events) ... ok +test_rejects_returned_deferred_and_non_none_values (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_returned_deferred_and_non_none_values) ... ok +test_rejects_runtime_and_skip (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_runtime_and_skip) ... ok +test_rejects_setup_teardown_cleanup_and_manual_body (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_setup_teardown_cleanup_and_manual_body) ... ok +test_rejects_subject_helper_nested_and_subtest_origin (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_rejects_subject_helper_nested_and_subtest_origin) ... ok +test_subject_mutant_is_not_admitted (test_lifetime_dd_node_oracle.OracleOriginSelfTests.test_subject_mutant_is_not_admitted) ... ok + +---------------------------------------------------------------------- +Ran 25 tests in 22.984s + +OK diff --git a/reviews/dd_node_oracle_20261029/event-context-repair/preservation.json b/reviews/dd_node_oracle_20261029/event-context-repair/preservation.json new file mode 100644 index 000000000..fc7f250b1 --- /dev/null +++ b/reviews/dd_node_oracle_20261029/event-context-repair/preservation.json @@ -0,0 +1,14 @@ +{ + "parent": "94a78d8bd95f0cafae85bd6b202407e418fafc2b", + "source_sha256": "4ac046ee75d70e30aeb90b1f57046bdb900738df8f910ea6929cd336b6af0ba5", + "prior_methods": 23, + "current_methods": 25, + "only_modified_prior_method": [ + "OracleOriginSelfTests.test_grader_source_safeguards_are_assertion_killed" + ], + "new_methods": [ + "OracleOriginSelfTests.test_distinct_subtest_contexts_with_identical_labels_are_admitted", + "OracleOriginSelfTests.test_duplicate_subtest_event_is_refused" + ], + "production_bytes_unchanged": true +} diff --git a/tests/test_lifetime_dd_node_oracle.py b/tests/test_lifetime_dd_node_oracle.py index c925f4fd8..75d971629 100644 --- a/tests/test_lifetime_dd_node_oracle.py +++ b/tests/test_lifetime_dd_node_oracle.py @@ -45,6 +45,8 @@ def __init__(self, cases): self.origins = [] self.success_ids = [] self.failure_ids = [] + self.event_contexts = [] + self.unique_events = True self.body_codes = {case.id(): getattr(case, case._testMethodName).__func__.__code__ for case in cases} @@ -73,7 +75,15 @@ def addSuccess(self, test): self.success_ids.append(test.id()) super().addSuccess(test) + def record_event(self, test, context): + # Retain references: equal labels and recycled integer IDs are not identity. + if any(test is prior_test and context is prior_context + for prior_test, prior_context in self.event_contexts): + self.unique_events = False + self.event_contexts.append((test, context)) + def addFailure(self, test, err): + self.record_event(test, test) # A regular failure must be the identical exception escaping the actual # selected method invocation, not setup/teardown/cleanup or callbacks. self.failure_ids.append(test.id()) @@ -81,6 +91,7 @@ def addFailure(self, test, err): super().addFailure(test, err) def addSubTest(self, test, subtest, err): + self.record_event(test, subtest) if err is not None: self.failure_ids.append(test.id()) self.origins.append(self.active == test.id() and self.origin(test, err)) @@ -93,7 +104,7 @@ def admitted(self, killed): and tuple(self.entered) == self.expected and self.testsRun == len(self.expected)) clean = not (self.errors or self.skipped or self.expectedFailures or self.unexpectedSuccesses) - terminal = (len(self.success_ids) == len(set(self.success_ids)) + terminal = (self.unique_events and len(self.success_ids) == len(set(self.success_ids)) and not set(self.success_ids).intersection(self.failure_ids) and set(self.success_ids).union(self.failure_ids) == set(self.expected)) if killed: @@ -393,9 +404,37 @@ class Probe(unittest.TestCase): def test_body(self): cloned(self, 'cloned subject code') self.assertFalse(run_oracle_cases(Probe, ('test_body',)).admitted(True)) + def test_distinct_subtest_contexts_with_identical_labels_are_admitted(self): + class Probe(unittest.TestCase): + def test_body(self): + for unused in range(2): + with self.subTest(value=1): + self.assertTrue(False) + result = run_oracle_cases(Probe, ('test_body',)) + self.assertEqual(len(result.failures), 2) + self.assertTrue(result.admitted(True)) + + def test_duplicate_subtest_event_is_refused(self): + class Probe(unittest.TestCase): + def test_body(self): + with self.subTest(value=1): + self.assertTrue(False) + def run(self, result): + original = result.addSubTest + def duplicate(test, subtest, err): + original(test, subtest, err) + original(test, subtest, err) + with mock.patch.object(result, 'addSubTest', duplicate): + return super().run(result) + result = run_oracle_cases(Probe, ('test_body',)) + self.assertEqual(len(result.failures), 2) + self.assertFalse(result.admitted(True)) + def test_grader_source_safeguards_are_assertion_killed(self): source = Path(__file__).read_text() controls = ( + ('event_identity', 'self.unique_events and len(self.success_ids)', + 'True and len(self.success_ids)', 'test_duplicate_subtest_event_is_refused'), ('code_identity', 'any(code is allowed for allowed in _ASSERTION_CODES)', 'code in _ASSERTION_CODES', 'test_cloned_approved_code_is_not_authorized_identity'), ('origin', 'all(any(code is allowed for allowed in _ASSERTION_CODES) for code in codes[positions[0] + 1:])',