Repository navigation
Reject audit red flags of the wrong type and test four unguarded rules - #15
Merged
Merged
Conversation
Deleting the check behind CERT_A6_CONTROL_PASSED, CERT_FLOOR_EXCEEDS_MAX_BOUND, CERT_INSTANCE_DIGEST_MISMATCH or CERT_WITNESS_FLOOR_MISMATCH left every test passing. Two more sites had the same gap: the second CERT_A7_ILLEGAL_TIER_SWAP site (a rejected witness) and the empty must_fail_controls branch. Each new test adds one corruption to a minimal VERIFIED certificate. The corruption fires that rule and no other, and the matching good certificate passes. Deleting any findings.append site in audit_transition_certificate now turns a test red (23 of 23 sites). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The certificate auditor tested red flags with truthiness, "is False" and int(). A flag written as the string "false" or as 0, a negative or fractional count, or a witness key left out came back VERIFIED. Some checks ran only when proven_floor was present. audit_transition_certificate now reports CERT_FIELD_TYPE_INVALID for a flag that is not a bool, a count that is not a non-negative int (a bool is not a count), a mode or status that is not a string, and a malformed tcb_pins, must_fail_controls or control_records. tcb_manifest_verified must be True. A VERIFIED certificate with exact_optimum_reached false, or with a witness key that holds no witness, is rejected whether or not proven_floor is present. state_hash_mode is compared after trim and lowercase. A certificate that is not a JSON object is rejected with CERT_NOT_AN_OBJECT instead of raising. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
abu-aska
approved these changes
Nov 22, 2026
abu-aska
left a comment
There was a problem hiding this comment.
Independent Two-Direction R3 + R5 audit at 2edab672 (AUDIT-089R, check_081, 126/126 R5 mutants killed):
- Verified clean: All 6 control/variant pairs from Issue
#13,CERT_NOT_AN_OBJECT, and all 4 previously unguarded rules from Issue#14(CERT_A6_CONTROL_PASSED,CERT_FLOOR_EXCEEDS_MAX_BOUND,CERT_INSTANCE_DIGEST_MISMATCH,CERT_WITNESS_FLOOR_MISMATCH) are cleanly fixed and tested (39/39standalone tests pass; zero file conflicts withPR #7). - Six follow-up gaps (
19live repros still passing/crashing at2edab672) queued in a non-duplicative follow-up PR soPR #15can land cleanly as-is once undrafted:MCP-GAP-01(domain_protocol.py:931-945):oracles_checked/engines_verified/checkers_executedlack type, uniqueness, and non-blank checks (["x", "x"],["", ""],[None, 123]withdifferential_match: truereturnVERIFIED).MCP-GAP-02(domain_protocol.py:962, 1001-1022, 1085): Line1001checksif status == "VERIFIED":only, lettingPROVENskip F-04 unwitnessed/floor-mismatch checks; blank/whitespace/None list witnesses pass; all-zero"0"*64digests and blankchecker_sha256: ""masked byorfallback still pass onVERIFIED/PROVEN.MCP-GAP-03(domain_protocol.py:918-935, 1025-1032, 1050): Blankinstance_sha256: ""skips mismatch;instance_sha256: H + "\n"passes; emptycontrol_records: []withmust_fail_controls: ["c1"]passes; omittedoracle_invoked/unexpectedly_passedand non-string control names pass; floatcertified_lower_bound: 1.5bypasses type checks.MCP-GAP-04(domain_protocol.py:596-645):audit_portfolio_boundscoerces viaint()(10.9 > 10.1and"5\n"pass), returnsVERIFIEDon empty[], and skipsproven_floor <= live_recordtransitivity whenshortest_knownis omitted.MCP-GAP-05(domain_protocol.py:424): Missedre.match(r"^[A-Za-z_][A-Za-z0-9_]{0,63}$", key)accepts"foo\n"ininjected_globals.MCP-GAP-06(domain_protocol.py:1168-1249):verify_rational_lp_certificateaccepts emptyA: [], iterates string rows likeA: ["21"], and raises unhandledAttributeErroron non-dict[](14/42named non-transition rules are also currently unasserted in tests).
Approved as the clean #13/#14 baseline — opening a follow-up Draft PR closing MCP-GAP-01..06 and Issue #12 cleanly on top of merge(PR #7, PR #15).
orda-aska
marked this pull request as ready for review
November 22, 2026 06:16
orda-aska
merged commit Nov 22, 2026
3ba03c2
into
feat/formal-verification-loop-v0.2
9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the certificate auditor reject red flags written as the wrong type, and adds a test for each check that could be deleted without a test failing.
Fixes #13
Fixes #14
What changed
audit_transition_certificateinsrc/mcproof/domain_protocol.pynow checks the type of each field before it compares the value. A bad type gives the findingCERT_FIELD_TYPE_INVALID, which names the field. Flags must bebool. Counts must be non-negativeint, and aboolis not a count.tcb_manifest_verifiedmust beTrue. A VERIFIED certificate withexact_optimum_reached: false, or with a witness key that holds no witness, is rejected whether or notproven_flooris present. A certificate that is not a JSON object givesCERT_NOT_AN_OBJECTinstead of an exception.New tests:
tests/test_audit_type_confusion.py(15 tests, each variant paired with its control) andtests/test_audit_rule_coverage.py(6 tests, one corruption per rule, each firing that rule alone).Holes
Base is f0e7d27. Head is 2edab67. The check is
mcproof --json audit-cert -, run in a sandbox with Python 3.12.tcb_pins.tcb_manifest_verified: "false"CERT_FIELD_TYPE_INVALID, exit 1includes_hidden_state: 0CERT_FIELD_TYPE_INVALID, exit 1caller_bounds_verified: 0CERT_FIELD_TYPE_INVALID, exit 1differential_match: 1with one oracleCERT_FIELD_TYPE_INVALID, exit 1step_consistency_violations: -3CERT_FIELD_TYPE_INVALID, exit 1witness: null,exact_optimum_reached: false, noproven_floorCERT_UNWITNESSED_VERIFIED_OPTIMUM, exit 1step_consistency_violations: 0.9in a dict from plainjson.loadsCERT_FIELD_TYPE_INVALIDDeleting one
findings.appendsite inaudit_transition_certificateand running the audit test files (four on the base, six here):The six are the four rules named in the issue (
CERT_A6_CONTROL_PASSED,CERT_FLOOR_EXCEEDS_MAX_BOUND,CERT_INSTANCE_DIGEST_MISMATCH,CERT_WITNESS_FLOOR_MISMATCH), the secondCERT_A7_ILLEGAL_TIER_SWAPsite, and the firstCERT_A6_MISSING_OR_DUPLICATE_CONTROLSsite.Tests
Full suite, run with Python 3.14 because the Python 3.12 install had no pytest. The six audit test files also pass under Python 3.12: 53 passed, 4 skipped.
python -I -Bpython -I -O -Bpython -I -B -W errorThe one failure is
test_start_server_redirects_stdout_to_log_file_avoiding_pipe_deadlock. It binds a local socket, and the sandbox used for these runs denies that. It fails the same way on the base. The 25 skips need Lean, bubblewrap or the dependency checkouts, which these runs did not have.Not covered
state_hash_mode,proof_modeand similar modes are not enforced. Only their type is checked, andstate_hash_modeis compared after trim and lowercase.proven_flooris still accepted.exact_optimum_reached: falseis checked for VERIFIED only, as before.🤖 Generated with Claude Code