Repository navigation
P0 hardening: axiom audit, Ed25519 certificates, stamp gating, real verify - #10
Merged
Merged
Conversation
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.
Summary
Closes the four P0 ship-blockers from the adversarial strengthen assessment (
workspace/certification-authority/strengthen-assessment.md). No certificate may be sold until these are closed — this PR closes them.Note: this branch is based on remote
main. The diff also picks up the previously-unpushed Sept 26 validation work (explicit Lake targets, vacuous-build guard, honesty regression tests) for the touched files, since that was never pushed.P0-1: Axiom audit (
core/prover.py)#print axiomsruns for each proven theorem (via a temp copy — no module imports needed, works for generated files outside the lakefile's static roots).propext,Quot.sound,funext,Classical.choice).sorryAxis deliberately excluded.axiom sneaky : False→1 = 2exploit now reportsverified=False, naming the smuggled axiom. Axiom failures are not LLM-repairable — the loop ends honestly.lake env lean <file>instead oflake build <module>: Lake cannot address generated modules outside static roots (pre-existing:lake build Algorithms.<name>failed with "unknown target", sorun_proofcould never verify in the real repo layout). Elaborating the file directly cannot be vacuous.P0-2: Ed25519 replaces HMAC (
core/security.py,core/licensing.py)ProofCertificateandLicenseCertificatenow use Ed25519. The public verification key is embedded in the certificate and covered by the signature — third parties and agents can verify without a shared secret.Ed25519KeyPair,KeyStore.create_signing_key/load_signing_key;cryptographyadded torequirements.txt(stdlib-only constraint yields deliberately — hand-rolling Ed25519 would be worse). Module docstrings corrected (no more false "stdlib only" claim).P0-3: Stamp gating (
cli.pyextract_python)__proof_verified__ = Trueand "formally verified" language are emitted only whenverification_status == "verified". Failed/unverified proofs ship an honest NOT-verified label.P0-4: Real verify (
cli.py)cmd_verify/cmd_publishnow runverify_certificate_artifact(): Ed25519 signature check → issuer-key binding against the trusted keystore key → fresh Lean elaboration of the stored proof → axiom audit. Fails closed on every uncertainty.SIGNATURE INVALID);publishrefuses when verification fails. Thelean --c /dev/nulltheater is gone.Behavior-test evidence (real toolchain, not mocks)
run_proof:1 = 2via smuggled axiom →verified=False, log namessneaky.2 + 3 = 5byrfl) → stillverified=True.verifyCLI on genuine cert+proof →VERIFICATION PASSED(signature, issuer binding, fresh elaboration, axiom audit all green).verifyCLI on tampered cert →SIGNATURE INVALID, exit 1.publishCLI on tampered cert →Publish REFUSED, exit 1, nothing published.verifyCLI on failed-status cert → honestNOT machine-verified, exit 1.Test report
pytest tests/: 167 passed (includes new axiom-smuggling regression test, Ed25519 roundtrip/tamper/wrong-key tests, keystore signing-key roundtrip).ruff check+ruff format --check: clean.mypy(CI flags): clean.Out of scope (remain open)
P1/P2 items from the assessment: certificate schema v2 (serial/validity/revocation), migration re-signing,
_parse_spectruncation fix, public registry, audit-log signing, AEAD ciphers, batch-artifact labeling, marketing claim audit.