feat(valid-detection-benchmark): 11.4 spend-ordering crash and failure-visibility matrix

This commit is contained in:
Marius Ciepluch
2026-11-23 03:51:56 +01:00
parent da5323002e
commit 66ec3e1a31
4 changed files with 986 additions and 19 deletions
@@ -384,7 +384,7 @@
- _Requirements: 1.1, 1.2, 1.3, 1.4, 2.6, 3.2, 3.3, 3.4, 5.3, 5.7, 5.8, 5.9, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 8.1, 8.2, 8.3, 9.1, 9.2, 9.3, 9.4, 9.6, 9.7, 10.1_
- _Boundary: Replacement Benchmark End-to-End Integration_
- _Depends: 8.6, 9.3_
- [ ] 11.4 Run the spend-ordering, crash, retry, and failure-visibility matrix
- [x] 11.4 Run the spend-ordering, crash, retry, and failure-visibility matrix
- Inject insufficient scope, missing arm, zero read, skipped stage, early exit, timeout, budget/resource exhaustion, failed CAS, after-spend interruption, scoring failure, publication failure, expired lease, and stale resume owner.
- Assert no pre-spend failure calls the label loader, all post-spend failures preserve spent state, and exact resume never reruns a completed arm.
- Require every failure to produce a closed insufficient/impaired reason rather than a clean metric or invented infrastructure diagnosis.
@@ -454,3 +454,4 @@
- Task 10.4/10.5 reviews (2026-11-22), advisories forwarded to the next owners: (a) `cohort_selection.py` `_ledger_facts` accepts a non-tuple `pending_entries` iterable from forged in-process ledgers without STATE_MISMATCH (durable paths enforce tuple-of-digests upstream; failure direction is starvation, never acceptance) — one-line isinstance guard; (b) `positive_set_closure.py` `_validate_closure` lacks the `type() is int` strict check on `total_accepted_positives` (forged float 40.0/bool decodes; no gate can flip; integers are equally forgeable, store authority is the integrity boundary) — one-line strict-int guard; (c) `_pending_by_ecosystem` docstring equivalence claim is false in the CONFLICTING_ACCEPTED_REVIEW corner (committed third-round marks the entry answered, fourth-round conservatively keeps it pending; fail-safe direction, committed behavior untouched) — docstring fix only. Real cohorts for rounds 3 and 4 remain PENDING external review records; the 10.5 combined-set closure (48 positives, both ecosystems, 5 families) is fixture-verified only.
- Task 11.1 review (2026-11-22), advisory forwarded to the reservation-identity owner (pre-dates 11.1; load-bearing before the 11.6 real run): `reservation_identity.py:70` strips the `.git` suffix case-sensitively (`removesuffix(".git")`), and `reservation_guard.py:178` repeats the case-sensitive strip after an IGNORECASE regex, so a mixed-case `https://GITHUB.com/ACME/Core.GIT` URL normalizes to a distinct identity and escapes the reservation scan (admission still fails closed via the reviewed-registry check in population_freeze). Fix: case-insensitive suffix normalization at both sites + adversarial test. Also: the `license_class` conjunct of the public-material gate (`population_materials.py:92`) has no independent mismatch fixture (non-permissive class + allowlisted expression); one-line addition to the confidentiality suite when next owned.
- Task 11.3 review (2026-11-23), items for the 11.6 owner: (a) run.py's `bind_case_adapter_replay_stage`/`AdmissionCaseAdapterRequestV1` re-exports match the `BenchmarkRunStagesV1.replay` seam but have no in-repo consumer yet — 11.6 must adopt the preparation-rooted spend (`derive_case_adapter_preparation`; the CAS receipt must be minted from `preparation.label_release_request`, an 8.3-style `label_open_request` receipt can never satisfy core `_exact_successor_receipt`, proven) or the seam stays declaration-only; (b) the e2e synthetic population uses 20 ordinary pushes TOTAL for 40 positives with relaxed Wilson precision — the literal 3.2 ratio (>=20 per positive) and production precision bind real admission populations (10.6 proved the ratio at draw time); (c) `admission_spend.join_released_cases` now joins positives by `underlying_push_digest` (structurally necessary: core pins `projection.case_input_digest == ref.case_input_digest` at evaluation_observation.py:121 while sealed labels key raw identities) — 11.6 population builders must key both sides consistently; (d) hostile-decode parse hooks in `replacement_artifact_contract._decode_canonical` are defense-in-depth (downstream canonical re-encoding independently rejects non-finite values) — keep, but do not treat hook removal alone as a regression signal.
- Task 11.4 review (2026-11-23), item for the 11.6 owner (11.7 backstop): a run stage returning `None` instead of a product escapes `benchmark_run_command` as a raw `AttributeError` at run.py:445 (`_persist_terminal_outcome` on `None.outcome`; reviewer probe reproduced). Fails loud, never clean, and is a miswired caller contract rather than an operational failure — but 11.6 wires the production stages and owns run.py next: either type-check stage returns (closed INVALID_REQUEST/refusal) or document the seam contract. Optional hardening for the next fixtures owner: `CountingCrashLoader` (tests/valid_benchmark_failure_injection.py) counts reads without asserting custody SPENT itself (committed `_LabelSource` does); ordering violations are still caught via spent-state assertions and the committed pre-CAS refusal.