Repository navigation
Reject a certificate that names no recognized status - #11
Conversation
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
left a comment
There was a problem hiding this comment.
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’s parent is the base tip. One commit. Draft. [source claim] Fixes #9.
- 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
- 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
- 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.
- 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]
- Gaps. [verified]
passed=Trueandaudit-certexit 0 remain forREJECTED,CONJECTURE,LINT_PASS, pinnedLOWER_BOUND(status staysLOWER_BOUND),LOWER_BOUND_UNWITNESSED, andUNVERIFIED_CALLER_BOUNDS. The new tests require that forREJECTEDandCONJECTURE. [verified] A caller that only checks the exit code still treats those as a pass.- A passing
PROVENcertificate is still emitted asVERIFIED. Same on the base. [verified] KNOWN,REFUSED, andIN_PROGRESSare nowCERT_STATUS_UNKNOWN. On the base each came backVERIFIED. [verified]KNOWNandIN_PROGRESSare inschemas/oracle-receipt.v0.1.schema.json.REFUSEDis a spec claim tier. They are absent fromRECOGNIZED_CERT_STATUSES.- CLI now emits
LINT_PASS,LOWER_BOUND,LOWER_BOUND_UNWITNESSED, andUNVERIFIED_CALLER_BOUNDS. Those four strings are outside the receipt schema enum (PROVEN,VERIFIED,KNOWN,CONJECTURE,IN_PROGRESS,REJECTED).run_checker_oraclealready emitsLINT_PASS. [read inoracles.py] audit_portfolio_bounds([])returnspassed=True epistemic_status='VERIFIED' items=[]. A blank row{}returns overallVERIFIEDwhile the item status isUNVERIFIED_CALLER_BOUNDS. Same on the base. This function is in the same file and was not changed. [verified]- JSON
nulland[]hitcert.getand raiseAttributeError. Process exit 1, empty stdout, no receipt.maindoes not catchAttributeError. Same class of crash on the base. [verified] str.uppermaps U+0131 toI. Status"verıfıed"plus both digests returnspassed=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.
|
Ready to mark ready. grk-proof approved this PR at This branch and the other fix on |
ec54365
into
feat/formal-verification-loop-v0.2
|
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. |
…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>
Fixes #9
audit_transition_certificateno longer reports VERIFIED when the certificate names no recognized status.An empty object and an unknown status are findings, and
audit-certexits 1. REJECTED and CONJECTURE keep their own status. A VERIFIED record with both digests still passes. CONJECTURE still needs no pins.Validation
16 passed. 4 skipped for a missing mde build and pinned deps. Those skips are on the base branch as well.