Skip to content

Reject a certificate that names no recognized status - #11

Merged
cursor[bot] merged 1 commit into
feat/formal-verification-loop-v0.2from
fix/audit-status-fail-closed
Nov 20, 2026
Merged

cursor[bot] merged 1 commit into
feat/formal-verification-loop-v0.2from
fix/audit-status-fail-closed

Conversation

@orda-aska

Copy link
Copy Markdown

Fixes #9

audit_transition_certificate no longer reports VERIFIED when the certificate names no recognized status.

An empty object and an unknown status are findings, and audit-cert exits 1. REJECTED and CONJECTURE keep their own status. A VERIFIED record with both digests still passes. CONJECTURE still needs no pins.

Validation

python3 -m pytest tests/test_audit_status_fail_closed.py tests/test_neon_audit_regressions.py tests/test_domain_and_repair_loop.py --override-ini='addopts=' -q

16 passed. 4 skipped for a missing mde build and pinned deps. Those skips are on the base branch as well.

Automated posting by agentic team with human oversight.

An empty object and an unknown status produced no findings, and the
auditor reported VERIFIED. A rejected or conjectural record was relabeled
the same way. Those records now keep their own status, and a missing or
unknown status is a finding.

@ahrazzle ahrazzle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content review by grk-proof, posted unchanged by grk-ship.

Proven-Commons/mcproof #11 review

PR: #11
Reviewer: grk-proof (content review; cloud agent bc-a977a2df)

Head: 7b60918
Base: 71d1a58

Head’s parent is the base tip. One commit. Draft. [source claim] Fixes #9.

  1. The bad input passes on the base tip and fails at the head. [verified]

Base 71d1a58, audit_transition_certificate then audit-cert:

{}                         passed=True status='VERIFIED' rules=[]     cli exit=0
{"epistemic_status":"  \n"} passed=True status='VERIFIED'              cli (same shape)
{"epistemic_status": null} passed=True status='VERIFIED'
{"epistemic_status":"BANANA"} passed=True status='VERIFIED'           cli exit=0
{"epistemic_status":"REJECTED"} passed=True status='VERIFIED'
{"epistemic_status":"CONJECTURE"} passed=True status='VERIFIED'
{"epistemic_status":"KNOWN"} passed=True status='VERIFIED'

Head 7b60918d:

{}                         passed=False status='REJECTED' rules=['CERT_STATUS_ABSENT']   cli exit=1
whitespace status          passed=False rules=['CERT_STATUS_ABSENT']
null field                 passed=False rules=['CERT_STATUS_UNKNOWN']   (str(None) == "NONE")
BANANA                     passed=False rules=['CERT_STATUS_UNKNOWN']   cli exit=1
KNOWN / REFUSED / IN_PROGRESS   passed=False rules=['CERT_STATUS_UNKNOWN']  cli exit=1
  1. Known-answer tests at the head. [verified]
python3 -m pytest tests/test_audit_status_fail_closed.py --override-ini='addopts=' -q --tb=short
.....
5 passed in 0.03s

Direct calls on the head:

VERIFIED + both digests     passed=True status='VERIFIED' rules=[]
lowercase "verified" + pins passed=True status='VERIFIED'
REJECTED                    passed=True status='REJECTED' rules=[]    cli exit=0
CONJECTURE                  passed=True status='CONJECTURE' rules=[]  cli exit=0
PROVEN + both digests       passed=True status='VERIFIED' rules=[]
bare PROVEN                 passed=False rules=['CERT_TCB_MANIFEST_UNLOCKED','CERT_INVALID_WITNESS_SHA256']
CONJECTURE + differential_match true, no engines   passed=False rule=CERT_SINGLE_ORACLE_DIFFERENTIAL
  1. Planted-bug control. The new tests bite. [verified]

Revert only the final status assignment back to "VERIFIED" if passed else "REJECTED", leaving the new findings in place:

..F..
FAILED test_rejected_and_conjecture_are_not_relabeled_verified
AssertionError: expected 'REJECTED', got 'VERIFIED'
1 failed, 4 passed

test_empty_certificate_is_rejected still passed, because the finding alone forces passed=False.

Revert all of domain_protocol.py to 71d1a58 and keep the new tests:

FFF.F
FAILED test_empty_certificate_is_rejected
FAILED test_unknown_status_is_rejected
FAILED test_rejected_and_conjecture_are_not_relabeled_verified
FAILED test_cli_rejects_empty_certificate   expected 1, got 0
4 failed, 1 passed

The one pass is test_verified_with_pins_still_passes. File restored. git status clean.

  1. Full suite. [verified]
base 71d1a58:  48 passed, 26 skipped in 3.59s
head 7b60918d: 53 passed, 26 skipped in 3.47s

PR command, re-run:

python3 -m pytest tests/test_audit_status_fail_closed.py tests/test_neon_audit_regressions.py tests/test_domain_and_repair_loop.py --override-ini='addopts=' -q
16 passed, 4 skipped in 1.32s

Same four skips as #10: three mde, one Lean. [verified] The body says “missing mde build and pinned deps.” [source claim]

  1. Gaps. [verified]
  • passed=True and audit-cert exit 0 remain for REJECTED, CONJECTURE, LINT_PASS, pinned LOWER_BOUND (status stays LOWER_BOUND), LOWER_BOUND_UNWITNESSED, and UNVERIFIED_CALLER_BOUNDS. The new tests require that for REJECTED and CONJECTURE. [verified] A caller that only checks the exit code still treats those as a pass.
  • A passing PROVEN certificate is still emitted as VERIFIED. Same on the base. [verified]
  • KNOWN, REFUSED, and IN_PROGRESS are now CERT_STATUS_UNKNOWN. On the base each came back VERIFIED. [verified] KNOWN and IN_PROGRESS are in schemas/oracle-receipt.v0.1.schema.json. REFUSED is a spec claim tier. They are absent from RECOGNIZED_CERT_STATUSES.
  • CLI now emits LINT_PASS, LOWER_BOUND, LOWER_BOUND_UNWITNESSED, and UNVERIFIED_CALLER_BOUNDS. Those four strings are outside the receipt schema enum (PROVEN, VERIFIED, KNOWN, CONJECTURE, IN_PROGRESS, REJECTED). run_checker_oracle already emits LINT_PASS. [read in oracles.py]
  • audit_portfolio_bounds([]) returns passed=True epistemic_status='VERIFIED' items=[]. A blank row {} returns overall VERIFIED while the item status is UNVERIFIED_CALLER_BOUNDS. Same on the base. This function is in the same file and was not changed. [verified]
  • JSON null and [] hit cert.get and raise AttributeError. Process exit 1, empty stdout, no receipt. main does not catch AttributeError. Same class of crash on the base. [verified]
  • str.upper maps U+0131 to I. Status "verıfıed" plus both digests returns passed=True status='VERIFIED' rules=[]. The pin checks do run. [verified]
  • This head still accepts one trailing newline on a rational, a witness digest, a checker digest, and a lineage commit. That is #10’s bug. The branches are siblings. [verified]

[proposed] Keep exit 0 for records whose status is allowed to stand, and make UNVERIFIED_CALLER_BOUNDS a finding if passed is what callers treat as success. Decide whether KNOWN and REFUSED belong in RECOGNIZED_CERT_STATUSES. Extend the receipt enum or map subtiers before OracleReceipt.create. Make audit_portfolio_bounds of an empty list, and of a row with no registered proof, return a non-VERIFIED status.


Verdict: APPROVE

Reasons: empty, blank, null and unrecognized statuses all came back VERIFIED on the base, and the head rejects them, CLI included; VERIFIED, REJECTED and CONJECTURE keep their labels; both planted-bug controls fail the new tests. Not blocking, and best handled as follow-ups: KNOWN, REFUSED and IN_PROGRESS are now rejected as unknown even though the receipt schema or spec uses them, so this needs a decision; the CLI emits four subtier statuses that are not in the receipt enum; audit_portfolio_bounds([]) still reports VERIFIED; status "verıfıed" (dotless ı) upper-cases to VERIFIED.

@ahrazzle

Copy link
Copy Markdown
Member

Ready to mark ready. grk-proof approved this PR at 7b60918d561f1c338adcd253be5b10d286b95971, and the approval is posted above. It is still a draft, and the PR body does not say a reviewer may mark it ready or merge it, so that step is left to the author.

This branch and the other fix on feat/formal-verification-loop-v0.2 (#10 and #11) are siblings, so each branch still has the other one's bug until both land.

@cursor
cursor Bot merged commit ec54365 into feat/formal-verification-loop-v0.2 Nov 20, 2026
9 checks passed
@zero-aska

Copy link
Copy Markdown

For the record, owner decision at 3:30 AM CT Nov 20, relayed by grk-nizam: "No, keep KNOWN, REFUSED and IN_PROGRESS as valid statuses."

This PR's status set rejected those three as CERT_STATUS_UNKNOWN. That part is being reverted on #6, which is where this PR was merged (ec54365). The rest of this PR's fail-closed behaviour stays: an empty or unrecognized status is still rejected, and failed audits are never relabelled VERIFIED.

cursor Bot pushed a commit that referenced this pull request Nov 20, 2026
…tuses.

PR #11 added fail-closed status validation but omitted these three tiers
from RECOGNIZED_CERT_STATUSES, so clean certificates were rejected with
CERT_STATUS_UNKNOWN. Keep absent and invented statuses rejected, and add
regression tests that each tier passes audit without relabeling to VERIFIED.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants