docs(lessons): publish proof-engineering lessons from standards#134 session (Refs standards#134) - #105
Merged
hyperpolymath merged 2 commits intoMay 20, 2026
Conversation
…ession (Refs standards#134) A single day's work under standards#124 (estate proof-debt epic) surfaced four recurring failure modes in proof-bearing code. This commit publishes them in both human-readable and machine-readable form so future humans and AI agents will know to look for the patterns rather than re-learn them the hard way. The four lessons: 1. **build-is-the-only-oracle** — in-file proof-status comments are NOT authoritative. ephapax/formal/Semantics.v carried "FULLY CLOSED" with Qed.; coqc rejected it. ephapax#87 propagated the lie into ROADMAP+PROOF-NEEDS without running the build. PR#92 + #103 reverted it. 2. **vacuous-wrapper-theorems** — a theorem can be vacuous. Check the BODY, not the header docstring. ephapax/src/formal/Ephapax/ Formal/RegionLinear.idr's `regionSafetyExtract` and `noGCExtract` have bodies `= ne` / `= (ne, lc)` (return inputs unchanged). ROADMAP cited them as 'regionSafetyTheorem' / 'noGCTheorem' complete — overstated. PR#95 flagged honestly in the seam. 3. **coq-show-existentials-recipe** — Show. + Show Existentials. before Admitted. is the precise diagnostic. Don't assume 'one more tactic'. ephapax/formal/Semantics.v::preservation had 910 open goals when the in-file comment claimed 'only ONE remains'. 4. **induction-doesnt-substitute-outer-slots** — for preservation- style proofs, `induction Hstep` leaves the outer expression slot abstract; `inversion Htype` then generates n×m cross-cases instead of n diagonals. Fix is the standard `remember (mu, R, e) as cfg eqn:Hcfg` + `inversion Hcfg; subst` pattern. ephapax#102 used this and reduced 910 → 29 open goals (97%). The anti-pattern `remember e_typed as e_orig eqn:He_orig` from the typing's expression was a misdiagnosis — wrong variable. Files: - `docs/sessions/SESSION-2026-05-20-proof-engineering-lessons.adoc` Human-readable session-report-format doc. Each lesson has: the pattern (with code), where it bit us (with file:line citations), the recipe (do this / don't do that), and cross-references to the PRs that fixed it. Follows the existing SESSION-*.adoc convention in docs/sessions/. - `.machine_readable/agent_instructions/lessons.a2ml` Machine-readable companion. Read at session start by any AI agent touching formal-verification code. Each lesson is a `[[lesson]]` block with id (kebab-case slug), title, severity, applies-to language list, pattern, bit-us-where, do, dont, fixed-by-pr, and cross-references to relevant memory files + related-memory list for chained lookups. Cross-references: - `formal/PRESERVATION-HANDOFF.md` (PR#102) — per-case checklist using the lesson-4 fix. - `RUST-SPARK-STANCE.adoc` § Honest gaps (PR#95) — lesson-2 examples flagged at seam level. - `.machine_readable/agent_instructions/methodology.a2ml` — existing agent-methodology file; lessons.a2ml is its failure-catalogue sibling. Refs standards#134 (NOT Closes — joint-close on agreement). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
hyperpolymath
deleted the
proof-debt/standards-134-proof-engineering-lessons
branch
May 20, 2026 20:38
🔍 Hypatia Security ScanFindings: 30 issues detected
View findings[
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Admitted leaves proof hole (1 occurrences, CWE-704)",
"type": "admitted",
"file": "/home/runner/work/ephapax/ephapax/formal/Semantics.v",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "Coq admit tactic leaves goal unproven (2 occurrences, CWE-704)",
"type": "coq_admit_tactic",
"file": "/home/runner/work/ephapax/ephapax/formal/Semantics.v",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "User-defined Coq axiom -- not verified by kernel (1 occurrences, CWE-704)",
"type": "coq_axiom",
"file": "/home/runner/work/ephapax/ephapax/formal/Semantics.v",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/ephapax/ephapax/src/formal/Ephapax/Formal/RegionLinear.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "assert_total bypasses totality checker (1 occurrences, CWE-704)",
"type": "assert_total",
"file": "/home/runner/work/ephapax/ephapax/src/formal/Ephapax/Formal/RegionLinear.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/ephapax/ephapax/src/ephapax-repl/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "from_raw constructs types from raw pointers without safety checks (1 occurrences, CWE-676)",
"type": "from_raw",
"file": "/home/runner/work/ephapax/ephapax/src/ephapax-vram-cache/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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
A single day's work under standards#124 (estate proof-debt epic) surfaced four recurring failure modes in proof-bearing code. This PR publishes them in both human-readable (asciidoc session report) and machine-readable (.a2ml) form so future humans and AI agents won't have to re-learn them.
The four lessons
build-is-the-only-oracleformal/Semantics.vL3328 'FULLY CLOSED' lie → PR#87 propagated into ROADMAP+PROOF-NEEDS;.machine_readable/6a2/STATE.a2mlclaimed '67 Qed, 0 Admitted' — also falsevacuous-wrapper-theoremssrc/formal/Ephapax/Formal/RegionLinear.idr::regionSafetyExtractbody is= ne;noGCExtractbody is= (ne, lc). ROADMAP cited them as "complete" — overstatedcoq-show-existentials-recipeShow. Show Existentials.is the precise diagnosticformal/Semantics.v::preservationhad 910 open goals when in-file comment claimed "only ONE remains"induction-doesnt-substitute-outer-slotsremember (cfg) as cfg eqn:Hcfgfix for preservation proofsremember e_typedfailedWhat's added
docs/sessions/SESSION-2026-05-20-proof-engineering-lessons.adoc(human-readable, 318 lines). Follows the existingSESSION-*.adocconvention indocs/sessions/. Each lesson has: the pattern (with code), where it bit us (with file:line citations), the recipe (do / don't), and cross-references to the PRs that fixed it..machine_readable/agent_instructions/lessons.a2ml(machine-readable, 196 lines). Read at session start by any AI agent touching formal-verification code. Each lesson is a[[lesson]]block with:id(kebab-case slug),title,severity,applies-tolanguage list,pattern,bit-us-where,do,dont,fixed-by-pr, and cross-references to relevant memory files viarelated-memory.Cross-references
formal/PRESERVATION-HANDOFF.md(PR#102) — per-case checklist using the lesson-4 fix.RUST-SPARK-STANCE.adoc§ Honest gaps (PR#95) — lesson-2 examples flagged at seam level..machine_readable/agent_instructions/methodology.a2ml— the existing agent-methodology file;lessons.a2mlis its failure-catalogue sibling.Refs
Refs standards#134 (NOT Closes — joint-close on agreement).
Test plan
SESSION-*.adocfiles.a2mlsyntax matches existingagent_instructions/*.a2mlfiles🤖 Generated with Claude Code