Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion claims/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
22 changes: 15 additions & 7 deletions tests/test_claims_firewalls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions tools/claims_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading