Skip to content

proofs(coq): close admit triumvirate (#56 / #57 / #58) — Coq layer at zero Admitted - #128

Merged
hyperpolymath merged 2 commits into
mainfrom
proofs/close-coq-admit-triumvirate-56-57-58
Jun 2, 2026
Merged

proofs(coq): close admit triumvirate (#56 / #57 / #58) — Coq layer at zero Admitted#128
hyperpolymath merged 2 commits into
mainfrom
proofs/close-coq-admit-triumvirate-56-57-58

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Closes the 3 Coq Admitted markers introduced in PR #55 (build-oracle cascade), bringing the Coq layer to zero Admitted markers — only the justified Axiom is_empty_dir_dec remains.

Also reconciles PROOF-NEEDS.md:

  • Idris2 hole tally corrected 22 → 16 (equivSymProof and appendOnlyAuditLogProof were closed silently in the morning sweep but the inventory text was not updated).
  • Assumption Registry table updated.
  • "What Needs Proving" rewritten as a 7-tier prioritised attack-list (P1 closeable now; P2 blocked on primitive-eq groundwork; P3 research; P4–P7 Tier-A/B/C/D from frontier).

Test plan

  • coqc -R . ValenceShell clean on all 11 .v files
  • Print Assumptions mkdir_two_dirs_reversiblefunctional_extensionality_dep only
  • Print Assumptions overwrite_pass_equalizes_storage → "Closed under the global context" (zero axioms)
  • Print Assumptions obliterate_not_injectivefunctional_extensionality_dep only
  • idris2 --build valence-shell.ipkg exit 0 (no Idris2-side regression)
  • grep -c '^Admitted' across proofs/coq/*.v = 0
  • CI idris-verification.yml green
  • CI Coq build oracle green (if wired)

Closes#56.
Closes#57.
Closes#58.

🤖 Generated with Claude Code

Three closures land the Coq layer at zero `Admitted` markers:
* `mkdir_two_dirs_reversible` (filesystem_composition.v) — restated to
LIFO order so it discharges via `two_op_sequence_reversible`
+ `rmdir_precondition_after_mkdir` + `mkdir_preserves_well_formed`.
Closes#56. Only standard funext.
* `overwrite_pass_equalizes_storage` (rmo_operations.v) — closure
path (A) per issue #57: `Hgeom` strengthened with
`block_overwritten blk1 = block_overwritten blk2`. Proof case-splits
on `In bid (sfs_mapping sfs1 p)`; mapped branch uses
`In_existsb_Nat_eqb` + `f_equal` on the `mkBlock` constructor; un-
mapped branch uses `overwrite_path_blocks_non_mapped_preserved` and
the `Hother` hypothesis. `one_pass_storage_agrees` re-signed to
match. Closes#57. Zero axioms.
* `obliterate_not_injective` (rmo_operations.v) — threads the
strengthened hypothesis through `one_pass_storage_agrees` and
`multi_pass_same_start_same_result`, then reassembles the
`mkStorageFS` via `cbn [sfs_tree sfs_storage sfs_mapping]` +
`f_equal` + `functional_extensionality`. The strengthened
hypothesis is trivially satisfied for the canonical first-time
obliteration use case (block_overwritten = 0 on both sides), so
the MAA/GDPR marketing claim is unchanged. Closes#58. Only
standard funext.
PROOF-NEEDS.md reconciled:
* Idris2 hole tally corrected 22 -> 16 (equivSymProof and
appendOnlyAuditLogProof were closed silently during the morning
sweep but the inventory text was not updated).
* Assumption Registry table updated: 3 Coq admits removed, axiom
inventory now lists only is_empty_dir_dec + funext.
* "What Needs Proving" rewritten as a 7-tier prioritised attack-list
(P1 closeable now; P2 blocked on primitive-eq groundwork; P3-P7
research / frontier / marginal / tooling).
Verified locally:
* `coqc -R . ValenceShell` clean on all 11 .v files
* `Print Assumptions` for each closed theorem: only funext (or zero
for #57)
* `idris2 --build valence-shell.ipkg` exit 0
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 136 issues detected

SeverityCount
🔴 Critical8
🟠 High36
🟡 Medium92

⚠️Action Required: Critical security issues found!

View findings
[
{
"reason": "Issue in codeql.yml",
"type": "missing_workflow",
"file": "codeql.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Workflow executes remote script directly (curl/wget piped to shell). Download, verify checksum/signature, then execute.",
"type": "download_then_run",
"file": "lean-verification.yml",
"action": "verify_download_integrity",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Workflow executes remote script directly (curl/wget piped to shell). Download, verify checksum/signature, then execute.",
"type": "download_then_run",
"file": "rust-cli.yml",
"action": "verify_download_integrity",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in boj-build.yml",
"type": "missing_timeout_minutes",
"file": "boj-build.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in bridge-forbidden-phrases.yml",
"type": "missing_timeout_minutes",
"file": "bridge-forbidden-phrases.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in cflite_batch.yml",
"type": "missing_timeout_minutes",
"file": "cflite_batch.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in cflite_pr.yml",
"type": "missing_timeout_minutes",
"file": "cflite_pr.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in compilation_tests.yml",
"type": "missing_timeout_minutes",
"file": "compilation_tests.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Closer reading of every remaining Idris2 hole on the P1/P2 attack-list
reveals the original triage (and the P1 paragraph from earlier this
commit-series) was over-optimistic.
The 3 RMO holes I'd labelled Cat-D axiomatic placeholders are actually
provably false as stated:
* overwriteIrreversibleProof (RMO.idr:130) — conclusion
`recovery randomData = Nothing` is refuted by `recovery = Just`.
* hardwareEraseIrreversibleProof (RMO.idr:215) — type signature is
refuted by any non-empty `Unit -> Filesystem`.
* auditTrailCompletenessProof (RMO.idr:270) — conclusion is refuted
by `entries = []`.
These need theorem-shape redesign (per the #60 / #61 precedent), not
believe_me markers. Recorded as follow-up — recommend filing as #119
sub-issues with the explicit refutations.
Additionally:
* DecEq Path does NOT unblock the primitive-eq batch because it
transitively depends on DecEq String. Earlier claim that decEq gives
a free path-eq reflexivity lemma was wrong.
* Three closure paths for the primitive-eq blocker documented (axioms
via believe_me / Nat-interned paths / decEq-style reformulation),
each requiring owner sign-off.
* Frozen-hole list made explicit.
No source changes; documentation honesty only.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 136 issues detected

SeverityCount
🔴 Critical8
🟠 High36
🟡 Medium92

⚠️Action Required: Critical security issues found!

View findings
[
{
"reason": "Issue in codeql.yml",
"type": "missing_workflow",
"file": "codeql.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Workflow executes remote script directly (curl/wget piped to shell). Download, verify checksum/signature, then execute.",
"type": "download_then_run",
"file": "lean-verification.yml",
"action": "verify_download_integrity",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Workflow executes remote script directly (curl/wget piped to shell). Download, verify checksum/signature, then execute.",
"type": "download_then_run",
"file": "rust-cli.yml",
"action": "verify_download_integrity",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in boj-build.yml",
"type": "missing_timeout_minutes",
"file": "boj-build.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in bridge-forbidden-phrases.yml",
"type": "missing_timeout_minutes",
"file": "bridge-forbidden-phrases.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in casket-pages.yml",
"type": "missing_timeout_minutes",
"file": "casket-pages.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in cflite_batch.yml",
"type": "missing_timeout_minutes",
"file": "cflite_batch.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in cflite_pr.yml",
"type": "missing_timeout_minutes",
"file": "cflite_pr.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in compilation_tests.yml",
"type": "missing_timeout_minutes",
"file": "compilation_tests.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath merged commit a10005d into mainJun 2, 2026
26 of 27 checks passed
@hyperpolymath
hyperpolymath deleted the proofs/close-coq-admit-triumvirate-56-57-58 branch June 2, 2026 22:34
@hyperpolymath
hyperpolymath restored the proofs/close-coq-admit-triumvirate-56-57-58 branch June 5, 2026 02:07
hyperpolymath added a commit that referenced this pull request Jun 5, 2026
…er A-12) (#132)
## Summary
Closes frontier item **A-12** from \`docs/PROOF-OPEN-FRONTIER.adoc\`:
prove that \`ShellState::resolve_path\` always returns a \`PathBuf\`
within the sandbox root, regardless of \`..\` / \`.\` / normal
components in the input.
Regression-guard for the **2026-02-12 CVE-class audit fix**
(\`resolve_path(\"../../etc/passwd\")\` previously escaped the sandbox).
## Changes
**Lean 4** — \`proofs/lean4/PathTraversal.lean\`
* Models the Rust resolve_path loop as \`Component → applyComponent\`.
* Proves \`applyComponent_preserves_root_prefix\` per component (with
sub-lemmas \`isPrefix_append_right\` and \`isPrefix_dropLast\`).
* Lifts to \`normalizeRaw_within_root\` via the foldl invariant.
* Headline: \`path_traversal_containment\` — \`root <+: normalizePath
root raw\` for all \`root\`, \`raw\`.
* Corollary: \`normalizePath_eq_normalizeRaw\` (the final clamp never
fires — the foldl invariant alone suffices).
* Wired into \`lakefile.lean\` as \`lean_lib PathTraversal\`.
* Verified locally: \`lean PathTraversal.lean\` exit 0.
**Rust** — \`impl/rust-cli/tests/security_tests.rs\`
* \`property_resolve_path_stays_within_sandbox\` — proptest with mixed
\`..\` / \`.\` / normal components, optional leading slash (256 random
cases per the proptest default).
* \`property_resolve_path_parent_dir_heavy_stays_within_sandbox\` — 10:1
weighted toward \`..\` to specifically target the audit failure mode.
* Both new tests + all 15 existing security tests pass (17 total).
## Test plan
- [x] \`lean PathTraversal.lean\` — exit 0
- [x] \`cargo test --test security_tests\` — 17 passed, 0 failed
- [ ] CI \`lean-verification.yml\` green
- [ ] CI \`rust-cli.yml\` security_tests job green
## References
* Independent of PR #128 (the Coq admit triumvirate) — these can land in
either order.
* Frontier doc: \`docs/PROOF-OPEN-FRONTIER.adoc\` §A-12
* Origin bug: 2026-02-12 Opus audit session (path_traversal in \`What
Was Fixed\` § \`CLAUDE.md\`)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request Jun 5, 2026
## Summary
Pilot for **Q1 closure-path-C** (\`believe_me\` axioms with CI
allow-list). Lands the smallest possible footprint to demonstrate the
unlock and gates further use behind a registry + CI check.
**Closes 1 of 16 Idris2 holes** (\`equivReflProof\`) and provides the
infrastructure to close more in follow-ups, subject to owner sign-off on
Q4 policy.
## What's in this PR
### New module — \`proofs/idris2/src/Filesystem/Axioms.idr\`
| Identifier | Type | Justification |
|---|---|---|
| \`axStringEqRefl\` | \`(s : String) -> (s == s) = True\` | Every
Idris2 backend evaluates \`prim__strEq s s\` to True for any \`s\`;
type-checker cannot see through the primitive on opaque values. Same
epistemic status as Agda \`postulate funext\` or Coq \`Axiom
is_empty_dir_dec\` (both already accepted). |
| \`axBits8EqRefl\` | \`(b : Bits8) -> (b == b) = True\` | Same shape
for the byte-level primitive. |
| \`fileContentEqRefl\` | \`(xs : List Bits8) -> (xs == xs) = True\` |
Derived (not an axiom) — structural induction over the list using
\`axBits8EqRefl\` at the leaf. |
### \`Model.idr\` — \`equivRefl\` closed
* \`pathEqRefl\` (structural induction over \`Path\`)
* \`fsEntryEqRefl\` (case-split on \`Dir\` / \`File c\`)
* \`entryEqRefl\` (tuple combinator)
* \`equivRefl\` derives via \`allElemSelf\` (every entry is \`elem\` of
its own list).
Subtle bit: Idris2 0.8.0's \`elem\` is \`Foldable.any (==)\` which
desugars to a foldl form, not the textbook \`(x==y) || elem x ys\`
recursion. The proof threads through \`foldlOrTrueIdempotent\` — once
the accumulator hits True, the foldl stays True regardless of the tail.
Hole inventory: **16 → 15**.
### CI guard — \`.github/scripts/check-idris2-believe-me.sh\`
* Rejects any \`believe_me\` in \`proofs/idris2/**/*.idr\` that is NOT
in \`Filesystem.Axioms\`.
* Sanity-check: registered-axiom count matches \`believe_me\` count in
the allowed file.
* Wired into \`idris-verification.yml\` as a pre-build gate.
### Registry — \`.machine_readable/IDRIS2_AXIOMS.a2ml\`
Single source of truth for the \`believe_me\` allow-list. Each entry
carries: type signature, operational justification, morally-equivalent
existing axioms, downstream consumers.
## Test plan
- [x] \`idris2 --build valence-shell.ipkg\` — exit 0
- [x] Guard pass: 2 occurrences in \`Axioms.idr\` / 2 axioms in registry
- [x] Guard rejection test: added test \`believe_me\` in \`Model.idr\` —
correctly flagged + exit 1
- [ ] CI \`idris-verification.yml\` green
- [ ] Reviewer confirms Q4 policy (accept soft \`believe_me\` with named
+ gated axioms)
## Q4 policy implication
This commit takes **Q4 option B** (soft policy with named + gated
axioms). If you subsequently prefer **Q4 option A** (hard \"never
believe_me\"), revert this PR and accept the **Q1-B** (Nat-interned
\`Path\`) migration as the only path forward — substantially bigger work
but no \`believe_me\` at all.
## Unblocks (follow-up work, not in this PR)
With the axioms available, the following holes become tractable in
subsequent per-PR closures:
* \`equivTransProof\` (Model.idr:353) — needs \`elem\` transitivity on
top of reflexivity
* \`cnoWriteSameContentProof\` (Operations.idr:254) — uses the same
\`equiv\`-membership chain
* 4 \`?XXXPrfAfter\` sub-holes in Operations.idr (postcondition
equalities)
The 7 reversibility theorems in Operations.idr + 4 Composition.idr
theorems need both this axiom infrastructure AND the Cat-A theorem-shape
redesigns from #129/#130/#131.
## References
* Builds on the discussion in #128 and #132
* Issue #119 (Idris2 hole inventory + closure plan audit)
* Companion PRs (independent): #128 (Coq admit triumvirate), #132 (A-12
path-traversal containment)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@hyperpolymath