Repository navigation
Conversation
A type edit that still compiles, or an edit to the article's statement text, used to keep an article fully proved. Articles may now record statement_hash: sha256:<hex> beside statement: formalized. The skeleton command prints each article's hash (text and JSON), and `autoform skeleton --check-statements` fails when a recorded hash no longer matches. The hash covers the published statement text and the name, kind, and elaborated meaning of the article's declarations and their trusted items; proofs, axioms, assumptions, boundary modules, the Lean version, and the passage stay out. The verify workflow runs the check after the audit, and the skeleton report schema moves to v5 to carry the hashed statement text.
Contributor
Author
|
This is not ready to restack or merge yet. The exact-head audit found five contract blockers:
Also settle whether v1 binds the published H1 and imported-definition semantics, add a fixed golden digest, avoid shifting Please replay the unique commit onto the valid integration stack after #139/#140; do not retain the closed #115 ancestry. |
This was referenced Oct 7, 2026
Draft
6 tasks
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.
Historical note: this was drafted as one commit on #115. That base closed unmerged; preserve the design record here and rebuild the unique work as described above.
This fixes H5 from the #115 contract audit, a gap that already exists on
main.What was wrong
statement: formalizedwas not tied to anything it certified. Skeleton'sreview_hashwas printed but stored in no frontmatter and compared by nothing. A type edit that still compiled, or an edit to the article's statement text that left the frontmatter alone, therefore kept the article fully proved.Changes
statement_hash: sha256:<64 lowercase hex>besidestatement: formalized. The loader checks the format and rejects the key withstatement: retracted, withoutstatement: formalized, or withmathlib: true.autoform skeletonprints each article's hash:== ID · statement_hash sha256:...in text, andstatement_hashin JSON. The hash is SHA-256 over canonical JSON of three things:autoform-statement/v1;lean:declaration and every project declaration its statement rests on.autoform skeleton --check-statementscompares every recorded hash with the current one. It exits 1 with one line per drifted article:error: ID: statement_hash OLD is recorded but the statement now hashes to NEW; re-review the statement and record the new hash.lean:, or whose names do not all resolve. When no article records a hash, it printsno article records statement_hash; nothing to checkand exits 0 without running Lean.autoform-verify.ymlruns the check after the kernel-trust audit.autoform-skeleton/v5to carry the hashed statement text.statement: formalized.statement: formalized. That includes the fallback for anAUTOFORM_REFthat predatesstatement: retracted.Tests
New in
tests/test_graph.py:test_records_a_statement_hashtest_rejects_a_statement_hash_without_a_statement_to_bindNew in
tests/test_skeleton.py:test_statement_hash_binds_the_statement_text_and_meaning_onlytest_article_statement_is_the_published_statement_with_normalized_line_endstest_report_records_the_statement_text_its_hash_bindstest_cli_check_statements_skips_lean_when_no_article_records_a_hashtest_cli_check_statements_fails_on_a_changed_statementtest_cli_check_statements_fails_when_a_recorded_hash_cannot_be_computedtest_cli_check_statements_sets_the_probe_timeouttest_statement_hash_survives_a_proof_and_catches_a_type_edit, which runs against real LeanLocal runs at
f3725f9:ruff check autoform_cli servers tests: clean.AUTOFORM_REQUIRE_REAL_LEAN_TESTS=1), the CI skeleton step's selection,tests/test_skeleton.pyplustests/test_project_inspect.py::test_stale_inherited_mathlib_is_ignored_by_real_lake: 170 passed.AUTOFORM_REQUIRE_REAL_LEAN_TESTS=1),tests/test_lake_artifact_audit.py tests/test_impact.py tests/test_contract.py: 136 passed, 1 skipped. The skip istest_helper_runs_on_python_310, because python3.10 is not installed on this machine.tests/test_scaffold.pypin tests. They fail only because my local clone has nooriginremote, soplugin_pin()finds no pin. In a clone withoriginthey pass (63 of 63), and they pass in CI.Caveats
statement_hashare not checked, so an existing project gets no protection until it records hashes.--outputno longer loads; regenerate it.--check-statementsdoes not combine with--node,--json,--output,--packets, or--passages, so it always checks the whole blueprint.AUTOFORM_REFpredates the key stops atautoform checkwithunsupported frontmatter key 'statement_hash'. Move the pin and take the new workflow before recording hashes.