From 980bf234300717de477aadffcc4f1e59aa4177eb Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 27 Sep 2026 18:58:58 +0000 Subject: [PATCH] claims_check: read H3-RUNG-FLOOR's interval declaration; reconcile prose count Merging #134 (closed arithmetic vocabulary) and #111 (H3-RUNG-FLOOR added to the graph) onto the hardening branch left claims_check at problems=3: the evidence declaration 'interval (mpmath iv, 100 dps)' classified as AMBIGUOUS because the fixed string contains the float hint 'mpmath', and claims/README.md still said 26 claims. - Add the certificate's verbatim declaration to EXACT_ARITHMETIC_DECLARATIONS (mpmath's iv context is directed-rounding interval arithmetic, not the mp float context). Closed vocabulary preserved: one explicit string. - claims/README.md: 27 claims. - tests/test_claims_firewalls.py: three controls pinned pre-#111 facts (unreadable=1; no CERTIFIED_RUNG claim; literal '26 claims'). They now pin the current graph: unreadable=2, H3-RUNG-FLOOR is the sole CERTIFIED_RUNG with empty depends_on, count derived from the graph. claims_check: claims=27 premises=13 firewalls=10 enforced=10 problems=0. No grade, gate or independence credit moves. Co-authored-by: Dylan Roy --- claims/README.md | 2 +- tests/test_claims_firewalls.py | 22 +++++++++++++++------- tools/claims_check.py | 5 +++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/claims/README.md b/claims/README.md index 2e4a263f8..0f9c70c7a 100644 --- a/claims/README.md +++ b/claims/README.md @@ -1,6 +1,6 @@ # Claim / premise dependency graph -`graph.json` is the program's claim structure as data: 26 claims, 13 named +`graph.json` is the program's claim structure as data: 27 claims, 13 named premises, 10 firewalls. `tools/claims_check.py` turns the firewalls into assertions; `tests/test_claims.py` and `tests/test_claims_firewalls.py` prove the checker actually rejects each violation it is supposed to reject. diff --git a/tests/test_claims_firewalls.py b/tests/test_claims_firewalls.py index 04ffc9b46..875ab5c72 100644 --- a/tests/test_claims_firewalls.py +++ b/tests/test_claims_firewalls.py @@ -108,8 +108,10 @@ def test_the_summary_reports_enforced_and_unreadable_counts(): assert code == 0, out assert "enforced=10" in out, out # One record's arithmetic is the BINDING sentence, which is ambiguous by - # construction. Reporting it is the point: it is unreadable, not inert. - assert "evidence_arithmetic_unreadable=1" in out, out + # construction; a second (H3-RUNG-FLOOR's carrier record, added by #111) is + # the BINDING prose "not applicable (Markdown artifact)". Reporting them is + # the point: they are unreadable, not inert. + assert "evidence_arithmetic_unreadable=2" in out, out assert "certifying_without_evidence=1" in out, out @@ -409,11 +411,16 @@ def test_rejects_a_certified_rung_over_a_register_note_that_is_not_a_discharge() assert "FW-RUNG-OPEN-PREMISE" in out and "status_register_note" in out, out -def test_no_claim_is_graded_certified_rung_in_the_committed_graph(): - """So FW-RUNG-OPEN-PREMISE refuses nothing today. An inert firewall is not a - broken one, but it is one whose only evidence of working is its control.""" +def test_the_only_certified_rung_in_the_committed_graph_has_no_premise(): + """Until #111 no claim was graded CERTIFIED_RUNG and FW-RUNG-OPEN-PREMISE + refused nothing. H3-RUNG-FLOOR (single-rung enclosure at r = 0.05) now + carries the grade with an empty `depends_on`, so the firewall is live and + has no open premise to refuse; this pins that state rather than the old + inert one.""" g = graph() - assert not [n for n, c in g["claims"].items() if c.get("grade") == "CERTIFIED_RUNG"] + rungs = {n: c for n, c in g["claims"].items() if c.get("grade") == "CERTIFIED_RUNG"} + assert sorted(rungs) == ["H3-RUNG-FLOOR"], sorted(rungs) + assert rungs["H3-RUNG-FLOOR"]["depends_on"] == [] def test_the_two_status_vocabularies_do_not_overlap(): @@ -481,7 +488,8 @@ def test_rejects_prose_that_does_not_name_an_enforced_firewall(): def test_rejects_a_drifted_claim_count_in_the_prose(): - code, out = run(readme=prose().replace("26 claims", "24 claims")) + n = len(graph()["claims"]) + code, out = run(readme=prose().replace(f"{n} claims", f"{n - 2} claims")) assert code == 1, out assert "claim count has drifted" in out, out diff --git a/tools/claims_check.py b/tools/claims_check.py index b68c03624..b93fcda8a 100644 --- a/tools/claims_check.py +++ b/tools/claims_check.py @@ -152,6 +152,11 @@ # suffix is UNRECOGNISED until it is added here, which refuses rather than # admits. "interval 384bit", "interval arb 384bit", + # H3-RUNG-FLOOR transcribes its certificate's own declaration verbatim. + # mpmath's `iv` context is directed-rounding interval arithmetic, a + # different thing from the `mp` float context that FLOAT lists as "mpmath"; + # the word "mpmath" inside this fixed string is therefore not a float hint. + "interval (mpmath iv, 100 dps)", }) # The third case, and it must be spelled rather than left blank: a review record # or a register row performs no arithmetic at all. Nine evidence records say so.