From 987a04bac99261a7dd9ae5e2f60fa833b2408c27 Mon Sep 17 00:00:00 2001 From: Shay Date: Wed, 15 Jul 2026 17:09:59 -0700 Subject: [PATCH] fix(tests): evolve P12 anti-self-Accept guard for the ratified state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The guard pinned 'ADRs stay Proposed — not self-Accepted', which was correct until its own precondition was fulfilled: Joshua Shay ruled 'Ratify' on the D10 packet (2026-07-15, ruling record packet §8) and #43 flipped both ADRs to Accepted — turning this pin red on main (first flagged by the W3 lane as a 'brand-new governance-doc red'). The guard's spirit survives, strengthened: the test now asserts Accepted WITH inline ratification provenance on both ADR status lines AND the §8 ruling record in the packet — so a silent status flip in EITHER direction (an Accept without provenance, or a quiet demotion) still fails. [Verification]: tests/test_adr_0241_governance_p12.py 6 passed; smoke gate queued behind the running slow-lane sweep, push held until green. --- tests/test_adr_0241_governance_p12.py | 31 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/tests/test_adr_0241_governance_p12.py b/tests/test_adr_0241_governance_p12.py index a295282b..5d9cbb38 100644 --- a/tests/test_adr_0241_governance_p12.py +++ b/tests/test_adr_0241_governance_p12.py @@ -4,7 +4,8 @@ Does not re-execute the full physics suite. Asserts the load-bearing governance surfaces for ADR-0241/0242 cohesion remain present and honest: * runtime_contracts documents off-serve quarantine + epistemic standing * acceptance checklist maps C0–C8 to tests - * ADRs stay Proposed (ready for Joshua) — not self-Accepted + * ADR statuses carry recorded ruling provenance (ratified 2026-07-15; + a silent status flip in either direction fails) * cohesion suite still names I-01…I-05 pins """ @@ -82,21 +83,37 @@ def test_cohesion_suite_names_entity_invariants(): assert name in text, f"missing entity pin {name}" -def test_adrs_ready_for_acceptance_not_self_accepted(): - """P12: implementation complete → Proposed + ready; Joshua alone Accepts.""" +def test_adrs_accepted_with_recorded_ruling_provenance(): + """P12 (post-ratification): status flips are valid ONLY with provenance. + + Joshua Shay ruled "Ratify" on 2026-07-15 (D10 acceptance packet §8), so + the anti-self-Accept guard evolves rather than dies: each ADR must say + Accepted WITH the ratification provenance inline, and the packet must + carry the ruling record. A silent status flip in either direction — an + Accept without provenance, or a quiet demotion — fails here. + """ + packet = ( + _ROOT / "docs/audit/adr-0241-0242-acceptance-packet-2026-07-15.md" + ).read_text(encoding="utf-8") + assert "## 8. RULING RECORD" in packet, "ruling record section missing" + assert "RATIFIED — Joshua Shay, 2026-07-15" in packet, "ruling attribution missing" + for rel in ( "docs/adr/ADR-0241-wave-field-driven-hyperbolic-atlas-and-resonant-cognition.md", "docs/adr/ADR-0242-atlas-packing-and-fibonacci.md", ): text = (_ROOT / rel).read_text(encoding="utf-8") - # First status line must remain Proposed until human Accept. status_line = next( (ln for ln in text.splitlines() if ln.startswith("**Status**")), "", ) - assert "Proposed" in status_line, f"{rel} lost Proposed status" - assert "Accepted" not in status_line, f"{rel} must not self-Accept" - assert "Joshua" in status_line or "ready" in status_line.lower() + assert "Accepted" in status_line, f"{rel} lost Accepted status" + assert "ratified by Joshua Shay" in status_line, ( + f"{rel} status lacks ratification provenance" + ) + assert "acceptance-packet" in status_line, ( + f"{rel} status must cite the ruling packet" + ) def test_serve_quarantine_list_matches_cohesion_ast_pin():