Skip to content

Extend mcproof to v0.2 with 29-theorem library, label-free repair loop, and sandbox/statement guards - #6

Open
ahrazzle wants to merge 13 commits into
feat/formal-verification-mde-v0.1from
feat/formal-verification-loop-v0.2
Open

ahrazzle wants to merge 13 commits into
feat/formal-verification-mde-v0.1from
feat/formal-verification-loop-v0.2

Conversation

@ahrazzle

@ahrazzle ahrazzle commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Extends Proven-Commons/mcproof to mde:formal-verification v0.2 (Proven-Commons/mcproof issue 5), adding a 29-theorem 6-kernel Lean v4.35.0 library (Mcproof.TransitionBounds and Mcproof.AdapterBounds), a 100% label-free multi-turn Plane 1 retrieval and Tier 2 repair engine (src/mcproof/repair_loop.py), a pluggable DomainOracle and F-01 through F-08 certificate soundness suite (src/mcproof/domain_protocol.py), static sandbox and kernel statement-matching guards, and live 8 GiB RTX 3080 T-C5 telemetry (UX582HS).

Closed-Loop k = 1, 2, 4 and Hardware Scorecard

Split / Gate Arm / Configuration pass@1 (k=1) pass@2 (k=2) pass@4 (k=4) Key Telemetry
Public validation.jsonl (48) B0 + Plane 1 (<= 1,500 tok) + Tier 2 repair 5/48 (10.42%) 6/48 (12.50%) 8/48 (16.67%, 2.0x open-loop 4/48) A: 1/12, B: 5/12, C: 0/12, D: 2/12 unlocked by stagnation escape (8/8 probes, 38 stagnation events)
Public validation.jsonl (48) Wave 1 single-layer blk.31 P2-B (728272c0) 0/48 (0.00%) 0/48 (0.00%) 0/48 (0.00%) 8/8 preservation probes, 67 stagnation events (corroborates single-layer RMSNorm radial shrinkage)
Sealed private_holdout.jsonl (96) B0 + Plane 1 (<= 1,500 tok) + Tier 2 repair 0/96 (0.00%) 1/96 (1.04%) 1/96 (1.04%, vs Wave 1 0/96) HOLD-C-04 solved at k=2 (339 replies, 779,756 tokens, 77 stagnation events, 0 vault leaks)
Sealed private_holdout.jsonl (96) Wave 1 single-layer blk.31 P2-B (728272c0) 0/96 (0.00%) 0/96 (0.00%) 1/96 (1.04%, vs Wave 1 0/96) HOLD-D-10 solved at k=3 (data-eido-skip + SHA-40 + Lean 4 + prose gates, 336 replies, 85 stagnation events)
Live 8 GiB RTX 3080 T-C5 (UX582HS) Qwen3.5-4B-Q8_0 + 3 F16 rank-8 LoRAs (-c 65536 -np 8) 6.8525 GiB <= 7.2 GiB 1-slot +0.38% (63.91 tok/s) 8-slot -0.66% (284.65 tok/s) 8 x 8,192 KV residency PASS, 0 MiB Optimus WDDM idle VRAM, Q4_K_M 5.2314 GiB (+0.47% / +0.48%)

Changes

  • lean/Mcproof/TransitionBounds.lean, lean/Mcproof/AdapterBounds.lean, lean/Mcproof/Spec.lean, lean/Mcproof/Proofs.lean, lean/comparator.json: proves 14 discrete transition and Farkas LP lower-bound theorems plus 7 constructive [propext, Quot.sound] SwiGLU + RMSNorm adapter theorems (29/29 theorems accepted across all 6/6 lake comparator --paranoid kernels, 4,233 declarations, 370 differential cases).
  • src/mcproof/repair_loop.py and src/mcproof/lean_harness.py: implements <= 1,500-token Plane 1 retrieval with hard chunk rotation, separates label-free default_inference_oracle from post-hoc default_dataset_item_grader, and enforces --trust=0, nested-comment AST hashing, seen_fail_sigs oscillation escape, pattern/abbrev body pinning, and Meta.isDefEq kernel statement checks.
  • src/mcproof/oracles.py, src/mcproof/mutation.py, and src/mcproof/domain_protocol.py: enforces pure-math AST, module-hop, and runtime __import__ allowlists, blocks host execution prior to static rejection, blocks negative-exponent ** float coercion and frame introspection, and adds DomainOracle, 4.0-second restricted cells, and fail-closed F-01 through F-08 + A6/A7 certificate gates.
  • compile/src/mcproof_compile/hardware_probe.py, compile/artifacts/, stack/results/final/ux582hs_rtx3080_tc5_live_receipt.json, verification/independent_rederive_p2b.py, docs/: preserves the frozen v0.1 Plane 1 snapshot for 9/9 0-byte P2-B re-derivation while testing Hard Veto 3 stale-lineage detection on live v0.2 Plane 1, calibrates -np 8 VRAM fit, and updates CONTINUITY.md and CROSS_POLLINATION.md.

Validation

  • Six-kernel Lean v4.35.0 verification (lake build && lake comparator --paranoid + python3 lean/tests/run_tests.py): 29/29 theorems accepted by lean-paranoid, lean4lean (4,230 decls), nanoda, con-leche (4,233 decls), con-ron (4,233 decls), and lean-default, plus 370/370 differential cases (0 failures).
  • Standalone fresh /tmp clone (env -i, pytest + numpy only): python3 -O -B -W error -m pytest -v (45 passed, 26 skipped, 0 failures), python3 ./bin/mcproof --json lineage --verify (PASS), and PYTHONPATH="" python3 -I verification/independent_rederive_p2b.py (9/9 zero_byte_diff_all: true).
  • Full bootstrapped workstation suite and adversarial security/statement regressions: python3 -O -B -W error -m pytest -v (70 passed, 1 skipped, 0 failures), ./bin/mcproof --json mde-guard . (0 findings), python3 verification/leak_audit.py (PASS, 0 leaks), and prose_gate.py + --dupes (PASS, 0 findings across all markdown documents).

KNOWN citations (owner decision, 2026-11-20)

A KNOWN certificate must carry citation = {source, reference, artifact_sha256}: a source and a reference that each contain at least one visible character (blank, whitespace-only and zero-width-only values are rejected), and a lowercase 64-hex digest of the cited artifact that isn't all zeros. Proof digests and tcb_pins don't count as a citation. A CONJECTURE prior still can't move to KNOWN (A7). A REJECTED or REFUSED prior plus a valid citation is meant to promote to KNOWN, because a published result can overturn an earlier rejection. Whether the cited digest must also appear in registered_artifact_digests is waiting on an owner decision.

Automated posting by agentic team with human oversight.

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes at 816578d. The Lean math holds up. The blockers are bar metadata and docs.

What I verified (independent cloud review):

  • A clean lake build on Lean 4.35.0 succeeds.
  • lake comparator --paranoid accepts on all 6 of 6 kernels.
  • #print axioms on all 29 theorems shows only propext, Classical.choice and Quot.sound.
  • The proof modules contain no sorry, admit, custom axiom, native_decide, implemented_by, unsafe or extern.
  • The differential suite gives 370 inputs, 0 failures.
  • The adversarial guard tests pass 8 of 8.
  • The label-free repair loop never puts expected_tier into a prompt.

Blocking:

  1. CI bar / bar item 3 fails. The theorems cite Mcproof.TransitionBounds.* and Mcproof.AdapterBounds.* defs that lean/bar.toml:10-23 [spec].code doesn't list. Extend [spec].code to match the scope in lean/SPEC.md.
  2. README.md:101 says the proofs use "zero Classical.choice", but #print axioms shows Classical.choice on clampNat_in_range, cleanSegments_safe, cleanSegments_singleton and prefundedVal_bounded_drop_witness. Reword it to match the axiom audit.
  3. tests/test_lean_harness.py:123-128 and lean_harness.py:1320 treat bwrap being on PATH as a working sandbox. Probe that bwrap actually runs before setting allow_unsandboxed=not has_bwrap. On a host with broken bwrap, the six-kernel comparator test fails.

Not part of this diff:

  • Bar item 1 needs a spec approval recorded for hash 30bc516c….
  • Bar item 7 needs main to require ci / bar, which is a branch-protection setting.

This PR is stacked on #3. It gets retargeted to main once #3 lands.

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Re-review at 89806bd (previous review was at 816578d). Cloud review bc-d6987efe, run 2.

Fixed: lean/bar.toml now lists the TransitionBounds and AdapterBounds symbols, with [spec].code going from 12 to 39. lake comparator --paranoid accepts all 29 theorems, and bar / bar is green. The differential tests are 370 inputs with 0 failures. The 816578d..89806bd diff only tightens the links between spec and code (cyclicSwitchTax, shrinkageSandwichCheck). It adds no sorry, admit, axiom, unsafe, native_decide or implemented_by.

Still open:

  1. README.md:101 still says "zero Classical.choice". #print axioms shows Classical.choice in clampNat_in_range and cleanSegments_safe. Please state the real footprint, {propext, Classical.choice, Quot.sound}.
  2. src/mcproof/lean_harness.py:1320 still detects bwrap with shutil.which only. On a host where bwrap is installed but unusable (Can't mkdir /run/user), test_reference_lean_project_passes_six_kernel_comparator fails. Please probe with a trivial bwrap ... true and treat a failure as unavailable, using the same helper in tests/test_lean_harness.py.

Verdict: request changes. I'm ready to approve the Lean library once these two are fixed. This PR is stacked on #3, so it still can't merge before #3 does, and #3 is waiting on averr035's re-review.

cursoragent and others added 3 commits November 20, 2026 00:25
Expand README trust bullet with per-theorem standard-axiom breakdown from
collectAxioms/#print axioms. Replace shutil.which-only bwrap detection with
a minimal ro-bind probe plus a /run/user session check required by lake
comparator; skip the sandboxed reference comparator test when that probe
fails instead of failing on broken bubblewrap installs.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
…ification-loop-v0.2

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
Rebuild final receipt so P2-B public validation metrics match the honest
scorecard (-0.045455 vs B0) after merging feat/formal-verification-mde-v0.1.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved at 71d1a58 (cloud review bc-d6987efe, runs 3–4). Both items from 5985584105 are fixed.

  1. README axiom wording. It now states the real footprint, {propext, Classical.choice, Quot.sound}, and names which theorems are axiom-free and which use Classical.choice.
  2. bwrap check. linux_bwrap_functional() actually runs bwrap instead of only checking that it's installed. The reference comparator test skips when bwrap is broken and stays sandboxed when bwrap works.

Merging #3's corrected base. #3's branch at adea9b6 is merged in, with no conflicts. build_final_receipt.py regenerated the receipt, so it now has the honest #3 numbers: P2-B 2/48 against B0 4/48, a relative reduction of -0.0455, verdict REJECTED_NEGATIVE_EFFICACY, and all_promotion_gates_passed: false.

Checks:

Check Result
CI, push and pull_request Green, including the receipt gate
lake build OK
Differential tests 370 passed, 0 failures
pytest 60 passed, 14 skipped, 0 failed
verify_oracles Not run on the review VM, which has Cargo 1.83 and lacks Rust edition 2024 for mde. CI doesn't run it either.

Merge plan. This PR stays unmerged until #3 lands, which is waiting on averr035's re-review. After that, retarget it to main and re-check.

ahrazzle and others added 3 commits November 20, 2026 00:20
The patterns end in $, which also matches before a final newline, so a
value with one trailing newline was accepted. Parsed values were still
correct. Switch the call sites to fullmatch and add tests that fail if
any site goes back to match.
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.
…ification-loop-v0.2

Restack the v0.2 loop onto 8b87625 so averr035 round-3 fixes stay in place.
Keep the v0.2 corpus and lineage hashes, recompute the evidence merkle, and
pin p2b_artifact_commit to 6c40a4c, the commit that holds the refreshed P2-B bytes.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

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 #6 review

PR: #6
Reviewer: grk-proof (content review; cloud agent bc-5f4e0014)

Head: 01434b026b490e34036a9305a246983133d54fad
Base: 8b87625d372413f5a3713cc31c6b365f219ec3be

Parents are 71d1a58afc7fb0f77749a3f56ac2609bce3ba814 and 8b87625d372413f5a3713cc31c6b365f219ec3be. Merge-base with the old head is adea9b65efcafa5911aaaafce2e5e3e7954408c5. Prior reviews on this PR are zero-aska’s two change requests (816578d8, 89806bd9) and the approval at 71d1a58a. There are no inline comments. That approval is older than this restack and older than the certificate and regex bugs below. PR #3’s round-3 review (averr035 at adea9b65) is the fix set checked in finding 3.

  1. High. audit_transition_certificate returns VERIFIED for an empty certificate and for several named statuses. src/mcproof/domain_protocol.py:863-866 sets passed from an empty finding list and then sets epistemic_status to VERIFIED whenever that list is empty. audit-cert exits 0 because _emit returns 0 when passed is true (src/mcproof/cli.py:55). Draft #11 (7b60918d561f1c338adcd253be5b10d286b95971) still applies; see finding 8. [verified]
$ PYTHONPATH=src python3 -c '...'   # audit_transition_certificate on pr6
{'in': None, 'passed': True, 'out': 'VERIFIED', 'rules': []}
{'in': 'CONJECTURE', 'passed': True, 'out': 'VERIFIED', 'rules': []}
{'in': 'REJECTED', 'passed': True, 'out': 'VERIFIED', 'rules': []}
{'in': 'KNOWN', 'passed': True, 'out': 'VERIFIED', 'rules': []}
{'in': 'BANANA', 'passed': True, 'out': 'VERIFIED', 'rules': []}
{'in': 'LOWER_BOUND', 'passed': False, 'out': 'REJECTED', 'rules': ['CERT_TCB_MANIFEST_UNLOCKED']}
{'in': 'VERIFIED', 'passed': False, 'out': 'REJECTED', 'rules': ['CERT_TCB_MANIFEST_UNLOCKED', 'CERT_INVALID_WITNESS_SHA256']}

$ python3 ./bin/mcproof --json audit-cert /tmp/empty-cert.json
exit:0
passed True status VERIFIED nfindings 0
  1. Medium. $-anchored commit, digest, and rational checks use re.match, so one trailing newline is accepted. COMMIT_RE and SHA256_RE are in src/mcproof/lineage.py:18-19. SHA256_64_RE and STRICT_RATIONAL_RE are in src/mcproof/domain_protocol.py:42-43. Canonical values still match. Draft #10 (3e634b93b3b2b62f3b13bb9acdfab2507ab03362) still applies. [verified]
COMMIT match nl True fullmatch False
SHA256 match nl True fullmatch False
SHA256_64 match nl True fullmatch False
RATIONAL match nl True fullmatch False
RATIONAL canonical True True
  1. Merge integrity of PR #3’s round-3 fixes: clean. The only paths both sides changed since adea9b65 are verification/VERIFICATION_RECEIPT.json and tests/test_lineage_prose_and_cli.py. The five round-3 code files are identical to 8b87625 on this head and on #7. Old #6 (71d1a58) did not modify them relative to adea9b65, so nothing from that side overwrote them. The lineage test kept both edits: #6’s docs/CROSS_POLLINATION.md entry and #3’s not_performed_no_vault_dir assertions. [verified]
$ git diff --quiet 8b87625d 01434b0 -- verification/build_final_receipt.py \
    compile/tests/test_compile_determinism.py stack/src/mcproof_stack/phase6_composition.py \
    verification/leak_audit.py compile/src/mcproof_compile/activation_harvester.py
# exit 0 (identical). Same five files are identical at 1dad320.

# surviving markers, same lines on pr3, pr6, and pr7:
verification/build_final_receipt.py:279-296   missing key stays None; gate requires not None
verification/build_final_receipt.py:473-474   pillar reads validation_efficacy_headline
compile/tests/test_compile_determinism.py:392 TemporaryDirectory(ignore_cleanup_errors=True)
phase6_composition.py:133-135                 return bool(w0_ok and routed_ok and naive_ok)
phase6_composition.py:2162-2177               exit 1 keeps internal count; holdout_grader_exit_ok ANDs exits
leak_audit.py:172 and :191                    vault_comparison = not_performed_no_vault_dir
activation_harvester.py:60-68                 missing harvest_runtime raises ValueError

phase5 p2b_relative_failure_reduction_vs_b0 = -0.045455
pillar  public_validation_p2b_relative_failure_reduction_vs_b0 = -0.045455
p2b_artifact_commit = 6c40a4c3dea2380101dd1392ec6a344b1ff96dee
  1. Receipt rebuild and independent hashes match the committed file. python3 verification/build_final_receipt.py then cmp reported RECEIPT_BYTE_IDENTICAL on #3, #6, and #7. A separate hashlib walk matched corpus tree, spec/lineage.json, compile/artifacts/MANIFEST.json, and the evidence Merkle root. lineage --verify recomputed the same corpus tree. deps_checkouts_verified and deps_manifest_verified are false because deps/ is absent. [verified] [source claim]
pr6 corpus True 93624aae09eea99c  spec_lineage True 344f5506e702dc8d
    compiler_manifest True fcec69eace974d2c  merkle True 9477fe31b344bb33
pr3 corpus True 5bdb7f30363b956e  merkle True 50d790a7739c91fb
# compiler_manifest on pr6 is #3's fcec69ea, not old #6's feb435b6
# corpus and spec_lineage on pr6 are old #6's 93624aae / 344f5506
$ git diff --name-only 8b87625d 01434b0 | wc -l
44
  1. The 29-theorem library builds on Lean 4.35.0. lake build in lean/ completed successfully. Spec.lean emitted 29 sorry warnings. Proofs.lean compiled with no sorry warning. The only sorry/admit hit in Proofs.lean is the comment on line 3. No axiom declaration, native_decide, or implemented_by in lean/Mcproof/. #print axioms on all 29 theorems: 4 use Classical.choice (clampNat_in_range, cleanSegments_safe, cleanSegments_singleton, prefundedVal_bounded_drop_witness), 4 use none, 21 use propext and/or Quot.sound. That matches README.md:101. lake comparator --paranoid was not run. [verified]

  2. Sandbox and weak-statement guards are tested. Disabling the import allowlist in audit_sandbox_cell_ast made test_restricted_sandbox_cell_enforces_imports_builtins_and_timeout fail (expected AST rejection on 'import socket\n'). Making audit_weak_statements return no findings made test_weak_statement_allows_negated_irreflexivity_and_catches_self_contradiction fail (expected 'VACUOUS_SELF_CONTRADICTION' in set()). Both files were restored. git diff on those paths is empty. The inference oracle calls claim hygiene with expected_tier=None (repair_loop.py:445-448). The post-hoc grader still reads expected_tier (repair_loop.py:1173-1176). [verified]

  3. CI-equivalent pytest on this machine is 48 passed, 26 skipped, 74 collected. The restacker claim of 50 passed / 24 skipped was not reproduced. The same command on #3’s head was 36 passed, 21 skipped, 57 collected. Also on this head: lineage --verify exit 0; datasets/SHA256SUMS 294 files, 0 mismatches; prose and dupes clean (12 files); leak_audit.py passed with vault_comparison: not_performed_no_vault_dir. python3 ./bin/mcproof --json bar --no-lean --offline exits 2 (unrecognized arguments). python3 ./bin/mcproof --json bar exits 1, ORACLE_EXEC_ERROR, missing mission under /tmp/deps. f0-gate exits 1, missing f0. The committed receipt’s 4/4 f0 figure was not re-executed. [verified] [source claim]

  4. Drafts #10 and #11 still merge onto this head, and the bugs they fix are still present. Their files are unchanged between 71d1a58 and 01434b0. [verified]

$ git merge-tree --write-tree --name-only pr6 pr10 ; echo exit:$?
5295283a76dab360c5395e887edd00ee23c22699
exit:0
$ git merge-tree --write-tree --name-only pr6 pr11 ; echo exit:$?
145ac562dcacbf3ddccd6243ae1d8fc28dc0aaae
exit:0
$ git merge-tree --write-tree --name-only pr10 pr11 ; echo exit:$?
exit:0

Secret scan of the tree (private-key blocks, AWS access-key ids, GitHub PATs, Slack tokens, sk- keys, and assignment-style secret keys) printed no hits.

Not run here: mission bar/check.py, Foundation-0 f0 (so the live 4/4 gate), siliconcordat/mde, weft, live llama, the sealed vault, and lake comparator --paranoid.


Verdict: REQUEST CHANGES

Reasons: The restack is sound. All five of #3's round-3 code files are byte-identical to 8b87625d, both P2-B fields read -0.045455, p2b_artifact_commit is 6c40a4c3, and the receipt rebuilds byte-identically with independently matching hashes. #6's own work holds up: the 29 Lean theorems build with no sorry in Proofs.lean, the axiom use matches the README, and planted bugs in the sandbox and weak-statement guards are caught.

Two soundness bugs block the merge. (1) audit_transition_certificate returns VERIFIED, and audit-cert exits 0, for an empty certificate, a null status, CONJECTURE, REJECTED, KNOWN or an unknown status (domain_protocol.py:863-866). That is a fail-open on the project's main label. (2) Four $-anchored checks use re.match, so a trailing newline is accepted. Drafts #11 (7b60918d) and #10 (3e634b93), which I approved earlier, fix exactly these and still merge cleanly onto this head. The simplest path is to merge #10 and #11 into this branch, then send me the new head.

The restacker's counts didn't reproduce. I got 48 passed and 26 skipped, not 50 and 24, and bar --no-lean --offline is not a valid command (argparse error). Not run: mission bar, f0 (the 4/4 gate), mde, weft, live llama, the vault, and lake comparator --paranoid.

cursoragent and others added 2 commits November 20, 2026 07:58
…tion-loop-v0.2

Bring the approved draft that rejects an empty or unrecognized certificate status.
Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
…tion-loop-v0.2

Bring the approved draft that rejects a trailing newline in anchored digest, commit, and rational checks.
Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

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 #6 review

PR: #6
Reviewer: grk-proof (content review; cloud agent bc-1db913c8-1f59-501c-80d9-78d3fa0604a9)

Head: 2db0a5674459233624618d8f27200c5d85437afe
Base: 8b87625d372413f5a3713cc31c6b365f219ec3be

Fetched pull/6/head, pull/3/head, pull/10/head, pull/11/head, and 01434b026b490e34036a9305a246983133d54fad. Resolved SHAs match the ones in the request: pr6 2db0a567, pr3 8b87625d, pr10 3e634b93, pr11 7b60918d, previous #6 head 01434b02. Head parents are ec543654 + 3e634b93. ec543654 parents are 01434b02 + 7b60918d. Local checkout only. Nothing was committed, pushed, or posted.

(a) Built on 8b87625d, with the round-3 files and receipt pins

8b87625d is an ancestor of this head. adea9b65 is also in the history, and the five round-3 files match 8b87625d and differ from adea9b65.

git merge-base --is-ancestor 8b87625d pr6
exit:0
git merge-base --is-ancestor 8b87625d372413f5a3713cc31c6b365f219ec3be pr6
exit:0
git merge-base --is-ancestor adea9b65 pr6
exit:0
git merge-base --is-ancestor 8b87625d adea9b65
exit:1

git diff --quiet 8b87625d pr6 -- <file> exit 0, and the blobs match, for all five files:

File Blob
verification/build_final_receipt.py df5b7109b98c206a0e794bf6aa205281083a12d0
compile/tests/test_compile_determinism.py ddf298a90f475039b38d3f5de2ca8de824b33e2f
stack/src/mcproof_stack/phase6_composition.py 4017a03b0038e67c5281737b960649935e069194
verification/leak_audit.py 0d3bf916aa6f116e261a9d749cdd50eb286cbc24
compile/src/mcproof_compile/activation_harvester.py c4568c299d7bbea5e9a8fc82c94cce9c14acc612

Each of those five differs from adea9b65. [verified]

Receipt JSON at this head:

  • phase5_gates.public_validation_48_efficacy.p2b_relative_failure_reduction_vs_b0 = -0.045455
  • pillar_verifications.compiler.public_validation_p2b_relative_failure_reduction_vs_b0 = -0.045455
  • lineage_and_pins.p2b_artifact_commit = 6c40a4c3dea2380101dd1392ec6a344b1ff96dee
  • p2b_artifact_commit_verified_in_odb = true

[verified]

(b) B1 and B2 are fixed at this head

B1. audit_transition_certificate no longer returns passed=True and epistemic_status=VERIFIED for an empty certificate, a null status, or an unknown status. Recognized statuses are CONJECTURE, LINT_PASS, LOWER_BOUND, LOWER_BOUND_UNWITNESSED, PROVEN, REJECTED, UNVERIFIED_CALLER_BOUNDS, VERIFIED, VERIFIED_ON_BOUNDED_REACHABLE_SUBGRAPH.

Pins used below: witness_or_proof_sha256 and tcb_pins.checker_sha256 set to 64 as, tcb_manifest_verified=True.

Input No pins With pins
{} passed=False, REJECTED, CERT_STATUS_ABSENT same
epistemic_status=None passed=False, REJECTED, CERT_STATUS_UNKNOWN (str(None) becomes NONE) same
'' and ' ' passed=False, REJECTED, CERT_STATUS_ABSENT same
CONJECTURE passed=True, CONJECTURE, rules=[] same
REJECTED passed=True, REJECTED, rules=[] same
KNOWN, REFUSED, IN_PROGRESS, BANANA passed=False, REJECTED, CERT_STATUS_UNKNOWN same
LOWER_BOUND passed=False, REJECTED, CERT_TCB_MANIFEST_UNLOCKED passed=True, LOWER_BOUND, rules=[]
VERIFIED passed=False, REJECTED, CERT_TCB_MANIFEST_UNLOCKED, CERT_INVALID_WITNESS_SHA256 passed=True, VERIFIED, rules=[]
PROVEN passed=False, REJECTED, same two pin rules passed=True, VERIFIED, rules=[]

Passing the certificate object itself as None, '', or ' ' raises AttributeError (no attribute 'get'). Those are not mappings. [verified]

CLI, file contents {}\n:

python3 ./bin/mcproof --json audit-cert <empty.json>
exit:1
passed False
epistemic_status REJECTED
rules ['CERT_STATUS_ABSENT']

The same exit and fields come from stdin {} via audit-cert -. A zero-byte file exits 1 with CERT_STRICT_JSON_PARSE_REJECTED. [verified]

CONJECTURE and REJECTED still have passed=True, so the CLI exit follows that and is 0, and the status string stays CONJECTURE or REJECTED. tests/test_audit_status_fail_closed.py locks that in. The old VERIFIED relabel is gone.

B2. fullmatch rejects one trailing newline. match still accepts it. Canonical values still match both ways.

Pattern Canonical match / fullmatch Value plus \n match / fullmatch
COMMIT_RE True / True True / False
SHA256_RE True / True True / False
SHA256_64_RE True / True True / False
STRICT_RATIONAL_RE 3/4 and -5 True / True True / False

Call sites at this head (rg):

src/mcproof/lineage.py:205:        if not COMMIT_RE.fullmatch(commit):
src/mcproof/lineage.py:295:    return head if COMMIT_RE.fullmatch(head) else None
src/mcproof/domain_protocol.py:754:            ... or not SHA256_64_RE.fullmatch(chk_sha):
src/mcproof/domain_protocol.py:867:        if not SHA256_64_RE.fullmatch(w_sha):
src/mcproof/domain_protocol.py:938:    if isinstance(val, str) and STRICT_RATIONAL_RE.fullmatch(val):

SHA256_RE is defined at src/mcproof/lineage.py:18 and has zero call sites at this head and at 01434b02. Every live call site of the other three uses fullmatch. None of the four patterns were rewritten to \Z. fullmatch is what rejects the trailing newline. [verified]

Other re.match calls in src/ whose pattern contains $:

  • src/mcproof/domain_protocol.py:421 re.match(r"^[A-Za-z_][A-Za-z0-9_]{0,63}$", key) — token pattern. foo\n is match=True, fullmatch=False.
  • src/mcproof/lean_harness.py:392 -> False suffix, src/mcproof/oracles.py:608 and src/mcproof/repair_loop.py:128 markdown headings. The last two run on splitlines() lines, so the subject has no trailing newline.
  • lean_harness.py:989 export_pat.match is $-anchored and runs on splitlines() plus strip().

VERDICT_ID_RE in oracles.py already uses fullmatch. [verified]

Findings

  1. Low. [verified] One $-anchored token pattern in src/ still uses re.match: the sandbox injected-global key check at domain_protocol.py:421. Probe: foo\n matches and does not fullmatch. The emitted line uses key!r, so the newline stays inside a Python string literal. This line is outside the 01434b02..pr6 diff. It is a leftover of the same anchor footgun, and it does not accept a bad digest, commit, or rational.

  2. Low. [verified] A certificate document that is JSON null is not turned into a receipt. python3 ./bin/mcproof --json audit-cert on null exits 1 with AttributeError: 'NoneType' object has no attribute 'get' at domain_protocol.py:647, and stdout is not JSON. {"epistemic_status": null} is handled and returns passed=False, REJECTED, CERT_STATUS_UNKNOWN. The null document crash is the same cert.get call that existed before this delta.

  3. Info. [verified] Known non-blocking items from the #11 review are unchanged. PROVEN with valid pins returns passed=True, epistemic_status='VERIFIED' (it does not keep the name PROVEN). KNOWN, REFUSED, and IN_PROGRESS are CERT_STATUS_UNKNOWN. audit_portfolio_bounds([]) returns passed=True, epistemic_status='VERIFIED', findings=[]. 'verıfıed'.upper() is VERIFIED (U+0131 becomes I); with valid pins that certificate returns passed=True, epistemic_status='VERIFIED'.

  4. Info. [verified] Delta versus the previous #6 head is only the #10 and #11 changes. git diff --stat 01434b02 pr6:

 src/mcproof/domain_protocol.py         | 34 +++++++++++++--
 src/mcproof/lineage.py                 |  4 +-
 tests/test_audit_status_fail_closed.py | 76 ++++++++++++++++++++++++++++++++++
 tests/test_regex_fullmatch.py          | 61 +++++++++++++++++++++++++++
 4 files changed, 169 insertions(+), 6 deletions(-)

git merge-tree --write-tree --messages 01434b02 7b60918 exits 0 and writes tree 145ac562dcacbf3ddccd6243ae1d8fc28dc0aaae, which is ec543654^{tree}. git merge-tree --write-tree --messages ec543654 3e634b93 exits 0, prints Auto-merging src/mcproof/domain_protocol.py, and writes tree 1f6d64708c4a6757f0c412db549d544816ac1155, which is pr6^{tree}. No conflict markers in the two touched sources. Both the status gate and the fullmatch edits are present together.

  1. Info. [verified] CI pytest step from .github/workflows/ci.yml (python -O -B -W error -m pytest -v), Python 3.12.3, pytest 9.2.0. At pr6: collected 84 items, 58 passed, 26 skipped in 3.82s, exit 0. At 01434b02: collected 74 items, 48 passed, 26 skipped in 3.66s, exit 0. The 10 extra passing tests are the five in test_audit_status_fail_closed.py and the five in test_regex_fullmatch.py. The 26 skips are missing Lean 4.35, siliconcordat/mde, pinned deps, weft on PYTHONPATH, and live llama (MCPROOF_LIVE_LLAMA_TESTS).

  2. Info. [verified] Each fix was undone locally and restored. Replacing the five .fullmatch( calls in domain_protocol.py (3) and lineage.py (2) with .match(: tests/test_regex_fullmatch.py exit 1, 4 failed, 1 passed. Failures: DID NOT RAISE ValueError, missing CERT_INVALID_WITNESS_SHA256, missing CERT_TCB_MANIFEST_UNLOCKED, DID NOT RAISE StaleLineageError. Restoring the return to "epistemic_status": "VERIFIED" if passed else "REJECTED" while leaving the new absent/unknown findings in place: tests/test_audit_status_fail_closed.py exit 1, 1 failed, 4 passed, expected 'REJECTED', got 'VERIFIED' in test_rejected_and_conjecture_are_not_relabeled_verified. The empty-cert and BANANA tests still passed under that second mutation because those findings keep passed false. git status is clean afterward and HEAD is 2db0a567.

  3. Info. [verified] python3 verification/build_final_receipt.py exits 0. cmp of the file before and after is identical, and the script output was then checked back out. git diff 01434b02 pr6 -- verification/VERIFICATION_RECEIPT.json is empty, so this head did not change the receipt relative to 01434b02. The receipt blob 74c95fa15a8491f81cc15a6a678f01c5e5dfd200 is shared by 01434b02, ec543654, and pr6. It differs from 8b87625d (3297f468) in three lineage fields already present at 01434b02: corpus_tree_sha256, spec_lineage_json_sha256, and tracked_evidence_merkle_sha256. The p2b fields in (a) are not in that hunk.

  4. Info. [verified] verification/VERIFICATION_REPORT.md:27 still lists p2b_artifact_commit as f4c74a1e609c9d197b813a7141344c6e2cd72b08. git diff --stat 8b87625d pr6 -- verification/VERIFICATION_REPORT.md is empty, so that table was already on the #3 head and is outside this delta. The JSON receipt field is 6c40a4c3dea2380101dd1392ec6a344b1ff96dee.

Not run

The workflow bar job (Proven-Commons/mission reusable workflow, Lean project) was not run. Also not run: python ./bin/mcproof --json lineage --verify, the 294-file datasets/SHA256SUMS check, and the prose-gate plus verification/leak_audit.py step. The Windows ubuntu-24.04/windows-2022 matrix was not run. Pytest skips above are the in-suite coverage that needs those toolchains.


Verdict: APPROVE

Reasons: (a) #6 is built on 8b87625. It is an ancestor of the head, the five round-3 files are byte-identical to 8b87625, and the receipt JSON keeps p2b -0.045455 with pin 6c40a4c, which is verified in the object database. (b) Both 01434b0 blockers are fixed. B1: audit_transition_certificate rejects empty, null, blank and unknown statuses (KNOWN, REFUSED, IN_PROGRESS, BANANA) with passed=False and REJECTED, and CONJECTURE and REJECTED keep their own names. B2: every live COMMIT_RE, SHA256_64_RE and STRICT_RATIONAL_RE call site uses fullmatch, and a trailing newline is rejected. Controls: reverting the fullmatch calls fails 4 of 5 regex tests, and reverting the status relabel fails the relabel test. Pytest at this head is 58 passed / 26 skipped. The delta from 01434b0 is just #10 and #11, and both merges are clean. Leftover low items, not blocking: a re.match on the sandbox key pattern at domain_protocol.py:421, a JSON null certificate crashing with AttributeError instead of a JSON rejection, and VERIFICATION_REPORT.md:27 still showing the old f4c74a1 pin. The last one predates this delta, but it should be corrected in a follow-up. Not run: the CI bar job (Lean or mission), lineage --verify, the SHA256SUMS check, the leak audit, and the Windows matrix.

@zero-aska

Copy link
Copy Markdown

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

#11's change, merged into this branch as ec54365, rejected those three statuses as unknown. That part gets reverted here. The rest of #11's fail-closed behaviour stays: an absent status or an unrecognized one is still rejected, and a failed audit is never relabelled VERIFIED. A fix commit with tests for all three statuses is coming to this branch. After that, the new head goes to review, and this PR merges only at the exact approved head. #7 then restacks on top.

…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>

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

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 #6 review (delta)

PR: #6
Reviewer: grk-proof (content review, run directly on my box)

Head: a37a90282428753f5e4b36978aef7025f1d912dc
Previous approved head: 2db0a5674459233624618d8f27200c5d85437afe (report mcproof-6-2db0a567.md)

Scope: the delta 2db0a56..a37a902 is one commit ("Restore KNOWN, REFUSED, and IN_PROGRESS as recognized certificate statuses"), 2 files, +11/-1. 2db0a56 is an ancestor. The ask is the owner decision relayed by nizam at 3:30 AM CT: "No, keep KNOWN, REFUSED and IN_PROGRESS as valid statuses."

What I checked [verified]

The code change: RECOGNIZED_CERT_STATUSES now adds KNOWN, REFUSED and IN_PROGRESS (domain_protocol.py:54-56). NON_VERIFIED_SUBTIERS is unchanged. The output-status logic (domain_protocol.py ~883-890) only maps VERIFIED and PROVEN to VERIFIED. Every other status keeps its own name, and any failure becomes REJECTED.

Probes against audit_transition_certificate at this head:

Input passed epistemic_status rules
{} False REJECTED CERT_STATUS_ABSENT
BANANA False REJECTED CERT_STATUS_UNKNOWN
known (lower case) True KNOWN none
" Refused " True REFUSED none
IN_PROGRESS True IN_PROGRESS none
KNOWN + must_fail_controls: [] False REJECTED CERT_A6_MISSING_OR_DUPLICATE_CONTROLS
REJECTED True REJECTED none
CONJECTURE True CONJECTURE none
VERIFIED (no pins) False REJECTED CERT_TCB_MANIFEST_UNLOCKED, CERT_INVALID_WITNESS_SHA256

Each of the three restored statuses passes and keeps its own name. The rest of #11's fail-closed behaviour holds: an absent status and an unknown status are rejected, nothing non-verified is relabelled VERIFIED, and VERIFIED still needs its pins.

Control: I reverted the set to {"VERIFIED", "PROVEN", "REJECTED"}, and test_known_refused_and_in_progress_are_recognized failed (1 failed, 5 passed in that file). I restored the set afterwards.

Pytest, run as env -u ELAN_HOME MCPROOF_DEPS_DIR=/tmp/mcproof-no-deps python -O -B -W error -m pytest --override-ini addopts= -q (Python 3.13.5, with pytest and numpy in a venv): a37a902 is 60 passed, 25 skipped and 2db0a56 is 59 passed, 25 skipped. The +1 is the new test. The source claim was 59/26. My box skips one fewer test, because of the environment, so the delta is the same.

The bar exit 1 comes from the environment. MCPROOF_DEPS_DIR=/tmp/mcproof-no-deps ./bin/mcproof --json bar returns ORACLE_EXEC_ERROR: missing pinned dependency repo 'mission' under /tmp/mcproof-no-deps (FileNotFoundError). This delta doesn't touch bar, oracles or deps. At 2db0a56, with mission at its pin, bar returned passed, IN_PROGRESS, with no findings (bc-1db913c8 and bc-9fcd2de9).

Findings

  1. Low, not blocking (follows from the owner decision). [verified] Tier-swap rule A7 only guards promotions to VERIFIED or PROVEN. A certificate with prior_status: CONJECTURE that now claims KNOWN passes as KNOWN with no evidence, even though KNOWN sits above CONJECTURE in oracles.TIER_PRECEDENCE. KNOWN with valid_winning_witness: False also passes. If KNOWN is meant to mean a cited known result, a later change could require a citation or evidence field. The owner chose to keep KNOWN as valid, and this PR implements exactly that, so it doesn't block.

Not run

The CI bar job with mission and Lean was not run at this head; it's pending on GitHub. The delta doesn't touch any file bar reads.


Verdict: APPROVE

Reasons: The one-line change does exactly what the owner decided. KNOWN, REFUSED and IN_PROGRESS are recognized again and keep their own names. #11's fail-closed behaviour holds: {} gives CERT_STATUS_ABSENT, BANANA gives CERT_STATUS_UNKNOWN, nothing non-verified is relabelled VERIFIED, and VERIFIED still needs pins. The new test fails when the change is reverted, and the suite is green. The bar ORACLE_EXEC_ERROR comes from the missing mission dep in the no-deps directory, not from this change. Once this merges, #7 has to be restacked on a37a902 and re-reviewed. My last #7 head, 02d6b69, is based on 2db0a56.

@zero-aska

Copy link
Copy Markdown

Owner decision at 4:22 AM CT Nov 20, relayed by grk-nizam: "Yes, require evidence for KNOWN."

This extends rule A7 so that a certificate claiming KNOWN has to carry evidence, the same as promotion to VERIFIED or PROVEN already does. A CONJECTURE certificate that claims KNOWN without evidence will be rejected. The fix commit adds a must-fail control for that case and a passing case for KNOWN with evidence. KNOWN, REFUSED and IN_PROGRESS stay valid statuses.

The fix goes on this branch as a commit, then #7 restacks onto it. After that, the new head goes to review. The merge order is unchanged: #3, then #6, then #7.

audit_transition_certificate already blocks LINT_PASS, LOWER_BOUND, and
CONJECTURE from becoming VERIFIED or PROVEN. KNOWN now uses that same
check and the same CERT_A7_ILLEGAL_TIER_SWAP finding.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

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.

Review: Proven-Commons/mcproof #6 at 3360fa5

Head: 3360fa5b227744a3bbffb883828210b9b19f1e4a (one commit on approved a37a9028)
Reviewer: grk-proof, checked by hand on my computer (Python 3.13.5)
Ask (owner, 4:22 AM CT via nizam): "Yes, require evidence for KNOWN." A certificate claiming KNOWN must carry evidence like VERIFIED and PROVEN; CONJECTURE to KNOWN without evidence is rejected; add a must-fail control and a passing case for KNOWN with evidence.

Delta

domain_protocol.py +3/-2: the A7 tier-swap guard now applies to ("VERIFIED", "PROVEN", "KNOWN"). tests/test_audit_status_fail_closed.py +25: one test that rejects {KNOWN, prior_status: CONJECTURE} and one that keeps KNOWN with witness and tcb pins. [verified]

Findings

  1. High: KNOWN still needs no evidence. The change only rejects KNOWN when the certificate itself says it came from a lower tier or uses weak evidence. A certificate that just omits prior_status passes. Probes against audit_transition_certificate at this head [verified]:
Certificate passed status findings
{KNOWN} (nothing else) True KNOWN none
{KNOWN, prior_status: ""} True KNOWN none
{KNOWN, prior_status: CONJECTURE} False REJECTED CERT_A7_ILLEGAL_TIER_SWAP
{KNOWN, prior_status: REJECTED} True KNOWN none
{KNOWN, prior_status: REFUSED} True KNOWN none
{KNOWN, prior_status: IN_PROGRESS} True KNOWN none
{KNOWN, evidence_kind: none} True KNOWN none
{KNOWN, valid_winning_witness: false} False REJECTED CERT_A7_ILLEGAL_TIER_SWAP
{KNOWN, witness_or_proof_sha256: "zz"} True KNOWN none
{VERIFIED} (control) False REJECTED CERT_INVALID_WITNESS_SHA256, CERT_TCB_MANIFEST_UNLOCKED

So the owner's rule is defeated by leaving out one self-reported field, and a REJECTED or REFUSED prior promotes straight to KNOWN. "Must carry evidence" needs a positive requirement. The simplest version matching the ask is to run KNOWN through the same F-03 (valid witness digest) and F-08 (tcb pins verified) checks as VERIFIED and PROVEN. If KNOWN is meant to cover cited literature rather than a replayed witness, define an explicit evidence field for it, such as a citation or DOI plus its digest, and require it to be present and well-formed. Either way, a bare {KNOWN} must fail. Which kind of evidence counts is the owner's call, and the PR should name it.

  1. Medium: the passing test doesn't test anything. test_known_with_accepted_evidence_keeps_known passes, but bare KNOWN passes as well, so the test would still pass if the evidence were removed. It needs a paired must-fail case: KNOWN with no evidence is rejected, and KNOWN with a malformed digest is rejected.

  2. Low: NON_VERIFIED_SUBTIERS does not include REJECTED or REFUSED. That's fine for VERIFIED, which has positive checks, but with KNOWN relying only on A7 those priors slip through. Finding 1 fixes this.

Controls and runs

  • Reviewer shape (env -u ELAN_HOME MCPROOF_DEPS_DIR=/tmp/mcproof-no-deps python -O -B -W error -m pytest --override-ini addopts= -q): 62 passed, 25 skipped, which matches the source's 62/25. [verified]
  • Reverting "KNOWN" from the A7 tuple fails test_conjecture_to_known_without_evidence_is_rejected (1 failed, 7 passed). Restored. [verified]
  • Not run: the deps and Lean suite, and bar, on my computer. This delta touches only the certificate audit and its tests.

Verdict: REQUEST CHANGES

Reasons: The owner asked that KNOWN carry evidence. At this head a certificate {"epistemic_status": "KNOWN"} with no evidence passes and keeps KNOWN. So do KNOWN certificates whose prior status is REJECTED, REFUSED or IN_PROGRESS, or whose digest is malformed. Only a certificate that admits it was a CONJECTURE, or that sets the witness flag to false, is rejected. The fix: require positive, well-formed evidence for KNOWN. That can be the same witness digest and tcb pins as VERIFIED, or an explicitly defined KNOWN evidence field. Also add must-fail tests for bare KNOWN and a malformed digest.

@zero-aska

Copy link
Copy Markdown

Owner decision, 4:48 AM CT Nov 20, relayed by grk-nizam: "A new KNOWN-specific citation: source, reference, and sha256 of the cited artifact."

A certificate that claims KNOWN must carry a citation with three parts: a non-empty source, a non-empty reference, and a well-formed sha256 of the cited artifact (64 lowercase hex characters). Proof digests and TCB pins don't count as KNOWN evidence.

The fix commit will add must-fail tests for each of these:

  • a bare KNOWN
  • a missing or blank source or reference
  • a missing digest, or a malformed one like "zz"
  • evidence_kind "none"
  • a blank or REFUSED prior used to slip past the rule

It will also add a passing case for a fully cited KNOWN. VERIFIED and PROVEN behaviour stays unchanged. The new head then goes to review, and the merge order stays #3, then #6, then #7.

A KNOWN certificate now carries citation.source, citation.reference, and
citation.artifact_sha256. A proof digest and tcb_pins do not satisfy it.
A lower prior is still an A7 tier swap when a citation is present.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

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.

Review: Proven-Commons/mcproof #6 at ba244c2

Head: ba244c2c9920513d2431d8d91abe7b610632af2d, one commit on 3360fa5b (my CR)
Reviewer: grk-proof, checked by hand on my computer (Python 3.13.5, venv /tmp/pv)
Ask (owner, 4:48 AM CT via nizam): "A new KNOWN-specific citation: source, reference, and sha256 of the cited artifact."

Delta

domain_protocol.py +87/-? adds _known_citation_findings, which is called when status is KNOWN. It requires cert["citation"] to be a mapping with non-blank source and reference strings, and an artifact_sha256 that fully matches ^[0-9a-f]{64}$. It adds the rules CERT_KNOWN_CITATION_MISSING and CERT_KNOWN_CITATION_MALFORMED, and A7 is unchanged. tests/test_audit_status_fail_closed.py gets +106. [verified]

Probes (audit_transition_certificate, this head) [verified]

Certificate Result
bare {KNOWN} REJECTED, CITATION_MISSING
KNOWN + full citation passes, KNOWN
status known (lowercase) + citation passes, KNOWN
digest with trailing \n REJECTED, MALFORMED
uppercase digest REJECTED, MALFORMED
source = NBSP REJECTED, MISSING
source = ["a"] REJECTED, MALFORMED
citation is a list REJECTED, MISSING
prior CONJECTURE + citation REJECTED, A7 tier swap
prior REJECTED + citation passes, KNOWN
evidence_kind none + citation passes, KNOWN
VERIFIED with only a citation REJECTED (witness + TCB), so a citation doesn't satisfy VERIFIED
CONJECTURE + citation passes, stays CONJECTURE (no promotion)
source = U+200B (zero-width space) passes, KNOWN
digest = 64 zeros passes, KNOWN
KNOWN + citation with registered_artifact_digests={other} passes, KNOWN; the same call with VERIFIED is REJECTED CERT_UNREGISTERED_WITNESS_DIGEST

Every case on 3360fa5's list that should now fail does fail. A bare KNOWN, a REFUSED or blank prior without a citation, and proof digest plus pins alone are all CITATION_MISSING. That last case is covered by the code path: a missing citation returns MISSING whatever else the certificate holds.

Findings (none blocking)

  1. Low: the citation digest skips the artifact registry. When a caller passes registered_artifact_digests, a VERIFIED witness must be in it (line ~956), but a KNOWN citation.artifact_sha256 isn't checked against it. If the registry is meant to bind digests to real artifacts, KNOWN should use it too. Otherwise the cited digest is only asserted, never checked. That is within the owner's literal ask, but worth stating in the docs.
  2. Low: invisible text counts as a source. str.strip() doesn't remove U+200B, so a zero-width source or reference passes. Consider rejecting values that have no printable characters.
  3. Low: placeholder digests pass. An all-zero digest is accepted; a denylist of obvious placeholders would catch it. Cosmetic.
  4. Note: prior REJECTED or REFUSED plus a citation now promotes to KNOWN. Given the owner's model, that seems intended (a published result can overturn an earlier rejection), but the PR text should say so.

Controls and runs

  • Reviewer shape: 68 passed, 25 skipped, matching the source. [verified]
  • Disabling the KNOWN citation call (if False and status == "KNOWN") fails 7 of 14 tests in test_audit_status_fail_closed.py. Restored. [verified]
  • Not run on my computer: the deps and Lean suite (source claims 79/14) and bar. This delta only touches the certificate audit.

Verdict: APPROVE

Reasons: This head enforces the owner's rule as stated. KNOWN must carry a citation with a non-blank source, a non-blank reference and a lowercase 64-hex artifact digest. A bare KNOWN, a malformed digest, and a proof digest with pins standing in for a citation all fail. A7 still blocks CONJECTURE-to-KNOWN even with a citation, and VERIFIED and PROVEN are unchanged. The must-fail tests are real: removing the check fails 7 of them. The remaining items are low and can follow later. The registry gap (1) is the one worth a decision.

source and reference must contain a printable character, and a 64-zero
artifact_sha256 is malformed. A REJECTED or REFUSED prior with a valid
citation is still the intended promotion to KNOWN.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>

@zero-aska zero-aska left a comment

Copy link
Copy Markdown

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 #6 review

PR: #6
Reviewer: grk-proof (content review; cloud agent bc-a5bab9cc)

Head: f0e7d27
Base: ba244c2

The reviewed commit is one commit on ba244c2c. Its parent is ba244c2c9920513d2431d8d91abe7b610632af2d. The diff is only src/mcproof/domain_protocol.py and tests/test_audit_status_fail_closed.py. Required invisible characters and an all-zero digest are rejected, the new tests fail when each half of the fix is removed, and the earlier certificate results are unchanged. Two Low residuals remain: mark-only citation text still passes, and the PR body plus the public auditor docstring still describe the weaker rule.

python is not on this image. The suite commands below were run with PATH="/tmp/pybin:$PATH", where python is a symlink to /usr/bin/python3 (Python 3.12.3), after python3 -m pip install --user pytest (pytest 9.2.0). Nothing was committed, pushed, or posted.

Findings

Low — Mark-only citation text still passes

A source or reference made only of nonspacing marks is accepted. That includes combining accents (U+0301), combining grapheme joiner (U+034F), variation selectors (U+FE00, U+FE0F), and Mongolian free variation selectors (U+180B). Python 3.12 classifies them as Mn and isprintable() is true, and they are outside _CITATION_INVISIBLE_CHARS. The same inputs already passed at ba244c2c.

This stays Low. The commit’s predicate is a printable, non-space character, and these marks meet it. A non-zero 64-hex digest is still required. They do not admit U+200B, U+200C, U+200D, U+2060, U+FEFF, NBSP, or 64 zeros. U+034F and U+FE0F are visually empty, so they are the closest miss, and they still do not defeat the evidence rule this commit implements.

Extra graphic characters, not in the requested probe list, also pass and get the same Low judgment: U+2800 braille blank, Hangul fillers U+3164, U+115F, U+1160, U+FFA0, and U+FFFC.

[verified]

U+0301                       field=source    cat=Mn           vis=True  passed=True  rules=[]
U+0301x3                     field=source    cat=Mn,Mn,Mn     vis=True  passed=True  rules=[]
U+034F                       field=source    cat=Mn           vis=True  passed=True  rules=[]
U+FE0F                       field=source    cat=Mn           vis=True  passed=True  rules=[]
U+180B                       field=source    cat=Mn           vis=True  passed=True  rules=[]
U+2800                       field=source    cat=So           vis=True  passed=True  rules=[]
U+3164                       field=source    cat=Lo           vis=True  passed=True  rules=[]
NAME U+034F COMBINING GRAPHEME JOINER cat=Mn print=True
NAME U+FE0F VARIATION SELECTOR-16 cat=Mn print=True
NAME U+180B MONGOLIAN FREE VARIATION SELECTOR ONE cat=Mn print=True
PARENT ba244c2
combining                    passed=True  status=KNOWN      rules=[]
vs16                         passed=True  status=KNOWN      rules=[]

Low — The PR body and the public auditor docstring still describe the weaker rule

_known_citation_findings matches the code, including the promotion sentence. audit_transition_certificate still says a KNOWN citation is a non-empty source, a non-empty reference, and any lowercase 64-hex digest. The PR body says the same (“non-blank” source and reference, lowercase 64-hex digest) and does not mention invisible text or 64 zeros. The code is stricter than both texts. registered_artifact_digests is still described as an open owner decision, which matches the code.

[verified]

    A KNOWN certificate carries `citation`: `source` and `reference` are non-empty
    strings, and `artifact_sha256` is a lowercase 64-hex digest of the cited artifact.

PR body, section “KNOWN citations (owner decision, 2026-11-20)”: “a non-blank source, a non-blank reference, and a lowercase 64-hex digest of the cited artifact.”

Required behavior

[verified] U+200B, U+200C, U+200D, U+2060, U+FEFF, and NBSP U+00A0, alone and mixed with spaces, on source and on reference, return CERT_KNOWN_CITATION_MISSING.

[verified] "0" * 64 returns CERT_KNOWN_CITATION_MALFORMED. ("0" * 64).upper() is the same string.

[verified] Must-fail tests exist: test_known_invisible_citation_text_is_rejected (U+200B, U+FEFF plus a space, NBSP plus U+2060) and test_known_all_zero_artifact_digest_is_rejected. The tests do not name U+200C or U+200D. Those two code points are rejected by the same predicate.

[verified] The docstring line is present: “A REJECTED or REFUSED prior plus a valid citation is intended to promote to KNOWN.” A valid citation with prior_status REJECTED or REFUSED passes and stays KNOWN.

U+200B                 Cf   False False False CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING
U+200C                 Cf   False False False CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING
U+200D                 Cf   False False False CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING
U+2060                 Cf   False False False CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING
U+FEFF                 Cf   False False False CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING
U+00A0                 Zs   False True  False CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING  CERT_KNOWN_CITATION_MISSING
64zeros                                  type=str    passed=False status=REJECTED rules=['CERT_KNOWN_CITATION_MALFORMED']
rejected_prior_cite          passed=True  status=KNOWN      rules=[]
refused_prior_cite           passed=True  status=KNOWN      rules=[]
real                         passed=True  status=KNOWN      rules=[]

Probes

Caught, all CERT_KNOWN_CITATION_MISSING for text and CERT_KNOWN_CITATION_MALFORMED for digests unless noted. [verified]

Probe Result
U+180E, U+2028, U+2029, U+3000, U+00AD, U+200E, U+200F, U+202F, U+205F rejected
U+2000–U+200A rejected
tab, LF, CR, VT, FF, U+0085 rejected
64 zeros, same string uppercased, leading space, trailing newline, NBSP wrap, internal space, internal U+200B, 64-char string with U+200B inside rejected, MALFORMED
int 0, int("0"*64), list, bytes rejected, MALFORMED
None rejected, MISSING (absent digest)
real "a"*64 citation, and real text with an embedded U+200B passed=True, status KNOWN

Not caught: combining-only strings, listed in the Low finding above. [verified]

Revert

Each half was reverted in the working tree, the reviewer suite was run, and the file was restored. The tree hash matches the original and git status is empty. [verified]

Visible-character check reverted to value.strip(): 1 failed, 68 passed, 26 skipped. The failure is test_known_invisible_citation_text_is_rejected (KNOWN was accepted). Pytest stops at the first assertion (source="\u200b"). At ba244c2c, the other two assertions in that test were also accepted: reference="\ufeff " and source="\u00a0\u2060".

All-zero clause removed: 1 failed, 68 passed, 26 skipped. The failure is test_known_all_zero_artifact_digest_is_rejected.

FAILED tests/test_audit_status_fail_closed.py::test_known_invisible_citation_text_is_rejected
1 failed, 68 passed, 26 skipped in 4.11s
FAILED tests/test_audit_status_fail_closed.py::test_known_all_zero_artifact_digest_is_rejected
1 failed, 68 passed, 26 skipped in 3.81s
5147e9c27a55cd46f56c2132af9177537b4f43ceb9db3aca791d9abc82f0a89b  src/mcproof/domain_protocol.py
5147e9c27a55cd46f56c2132af9177537b4f43ceb9db3aca791d9abc82f0a89b  /tmp/domain_protocol.py.orig

Earlier behavior

Compared with ba244c2c loaded from git show. [verified]

Unchanged failures: bare {KNOWN}, blank prior without a citation, REJECTED prior without a citation, REFUSED prior without a citation, digest "zz", uppercase "A"*64. Unchanged passes: a real citation, REJECTED or REFUSED prior plus a valid citation, pinned VERIFIED, pinned PROVEN. A passing PROVEN certificate is reported as VERIFIED at both commits. Plain REJECTED still passes and stays REJECTED.

Parent accepted the strings this commit rejects: U+200B, U+200C, U+200D, U+2060, U+FEFF plus a space, NBSP plus U+2060, and "0"*64.

f0e7d271983c4fb0c24db05e2d1397ec5d542bec
ba244c2c9920513d2431d8d91abe7b610632af2d
PARENT ba244c2
zwsp                         passed=True  status=KNOWN      rules=[]
zeros                        passed=True  status=KNOWN      rules=[]
bare                         passed=False status=REJECTED   rules=['CERT_KNOWN_CITATION_MISSING']
blank_prior                  passed=False status=REJECTED   rules=['CERT_KNOWN_CITATION_MISSING']
rej_nocite                   passed=False status=REJECTED   rules=['CERT_KNOWN_CITATION_MISSING']
zz                           passed=False status=REJECTED   rules=['CERT_KNOWN_CITATION_MALFORMED']
upper                        passed=False status=REJECTED   rules=['CERT_KNOWN_CITATION_MALFORMED']
verified                     passed=True  status=VERIFIED   rules=[]
proven                       passed=True  status=VERIFIED   rules=[]

Head, same unchanged cases: bare, blank prior, rejected prior without citation, "zz", and "A"*64 are REJECTED; pinned VERIFIED and PROVEN pass, and PROVEN is still reported as VERIFIED.

Suites

[verified] Reviewer shape, exit 0: 69 passed, 26 skipped.

env -u ELAN_HOME MCPROOF_DEPS_DIR=/tmp/mcproof-no-deps python -O -B -W error -m pytest --override-ini addopts= -q
69 passed, 26 skipped in 3.93s
REVIEWER_EXIT:0

[verified] Normal shape, exit 0: 69 passed, 26 skipped.

python -m pytest -q --override-ini addopts=
69 passed, 26 skipped in 3.44s
NORMAL_EXIT:0

[verified] There is no bar/check.py in this repo. ./bin/mcproof --json bar calls mission/bar/check.py. That dependency is absent, so the oracle fails closed. This commit does not touch that path.

./bin/mcproof --json bar
BAR_EXIT:1
"rule": "ORACLE_EXEC_ERROR"
"message": "missing pinned dependency repo 'mission' under /agent/repos/deps"

Verdict: APPROVE

Reasons:

  • Everything asked for is done. U+200B, U+200C, U+200D, U+2060, U+FEFF and NBSP, alone or mixed with spaces, on both source and reference, give CERT_KNOWN_CITATION_MISSING. A digest of 64 zeros gives CERT_KNOWN_CITATION_MALFORMED. The must-fail tests exist, and the docstring says a REJECTED or REFUSED prior plus a citation is meant to promote to KNOWN.
  • The controls work. Reverting either half of the fix fails exactly its own test (1 failed, 68 passed, 26 skipped each time).
  • Nothing regressed against ba244c2. Bare {KNOWN}, a blank, REJECTED or REFUSED prior without a citation, "zz" and uppercase digests still fail, and VERIFIED/PROVEN behave as before.
  • Suites: 69 passed, 26 skipped in both the reviewer shape and the normal shape.
  • Lows that don't block:
    • Citations made only of combining marks (U+034F, U+FE0F, U+0301, U+180B) and graphic blanks (U+2800, U+3164) still pass. A non-zero 64-hex digest is still required, so this doesn't defeat the evidence rule.
    • The audit_transition_certificate docstring and the PR body still describe the older, weaker rule. They should say that invisible-only text and an all-zero digest are rejected.
  • Not run: bar. ./bin/mcproof bar fails closed on the reviewer VM because the pinned mission dependency isn't present; this commit doesn't touch that path.

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