Skip to content

proofs(coq): assert single_op_reversible model gap (Qed → Admitted) - #48

Merged
hyperpolymath merged 1 commit into
mainfrom
proof/admit-becomes-admitted
Jun 1, 2026
Merged

proofs(coq): assert single_op_reversible model gap (Qed → Admitted)#48
hyperpolymath merged 1 commit into
mainfrom
proof/admit-becomes-admitted

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Convert the silently-broken proofs/coq/filesystem_composition.v::single_op_reversible (Qed. after mid-proof admit.) into an explicit Admitted. so the assumption is registered for Print Assumptions.

The original form ended with Qed. after a mid-proof admit. in the OpRmdir branch — modern Coq treats this as an incomplete proof and refuses to discharge it. Confirmed locally with coqc 8.18.0. The verify-proofs job in .github/workflows/validation.yml is disabled per _CoqProject, so this never surfaced in CI.

Also found and made-explicit: the OpDeleteFile branch invoked apply create_delete_file_reversible. assumption., which proves the forward direction delete_file (create_file fs) = fs. The branch needs the reversecreate_file (delete_file fs) = fs — same model gap as OpRmdir (both rely on default_perms matching the original).

Why this matters

Per the 2026-06-01 directive ("make sure we start asserting the assumptions"):

  • Silent admit.+Qed. looks like a proven theorem to downstream readers, but is rejected by Coq.
  • Explicit Admitted. registers the theorem as an axiom-equivalent; Print Assumptions on any downstream theorem now correctly surfaces single_op_reversible as a dependency.

This is the smallest principled change toward honesty in the proof layer. Three closure paths are documented in the new docstring + in docs/PROOF-NARRATIVE.adoc § Assumption Registry (PR #47):

(A) strengthen reversible to require default_perms on the original
(B) add OpMkdirWithPerms / OpCreateFileWithPerms variants whose reverse_op carries the perm snapshot
(C) Filesystem × UndoLog model

Scope

This PR does not attempt the closure. The composition.v file has additional cascading proof-script errors at:

LineIssue
filesystem_composition.v:271operation_sequence_reversible — stale rewrite direction; rewrite <- (IH ...) expands fs on RHS instead of folding the apply_sequence on LHS
filesystem_composition.v:327reversible_creates_CNOrewrite app_nil_r targets a subterm simpl already eliminated
filesystem_composition.v:407path_prefix_app_invert — argument-shape mismatch
filesystem_composition.v:365missing Require Import Lia. for the lia tactic
file_content_operations.v:133rewrite Hntype fails to find a matching subterm

These need a coordinated proof-debt sweep with the build oracle running locally. Catalogued in docs/PROOF-OPEN-FRONTIER.adoc § Tier S F-2 (PR #47).

Test plan

  • coqc filesystem_model.v succeeds
  • coqc file_operations.v succeeds
  • Local build of filesystem_composition.vup to the cascading-error line (271) — this PR doesn't make compilation worse; it makes the single specific bug explicit.
  • CI: governance / link-check / SPDX should pass (no doc files modified; pure proof script).

Refs #42 (proof inventory).

@hyperpolymath
hyperpolymath enabled auto-merge (squash) June 1, 2026 13:15
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 132 issues detected

SeverityCount
🔴 Critical9
🟠 High21
🟡 Medium102

⚠️Action Required: Critical security issues found!

View findings
[
{
"reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action dtolnay/rust-toolchain@nightly needs attention",
"type": "unpinned_action",
"file": "validation.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"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 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 codeql.yml",
"type": "missing_timeout_minutes",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

`proofs/coq/filesystem_composition.v::single_op_reversible` ended with
`Qed.` despite containing a mid-proof `admit.` in the OpRmdir branch.
Modern Coq (8.10+) treats this as an incomplete proof and refuses to
discharge it — meaning the file did not compile under `coqc` (the
`verify-proofs` job in `.github/workflows/validation.yml` is currently
disabled per `_CoqProject`).
Switching to `Admitted.` registers the missing branches as
Axiom-equivalents, so `Print Assumptions` on any downstream theorem now
correctly surfaces `single_op_reversible` as a dependency rather than
silently treating it as a closed fact.
While writing the docstring, also found that the OpDeleteFile branch
invoked `apply create_delete_file_reversible. assumption.`, which proves
the *forward* direction `delete_file (create_file fs) = fs`. The branch
needs the *reverse* `create_file (delete_file fs) = fs`, which is the
same model gap as OpRmdir (both rely on `default_perms` matching the
original). Now also explicitly `admit`.
Three closure paths documented in the docstring + in
`docs/PROOF-NARRATIVE.adoc § Assumption Registry`:
(A) strengthen `reversible` to require default_perms on the original
(B) add `OpMkdirWithPerms` / `OpCreateFileWithPerms` variants whose
`reverse_op` carries the perm snapshot
(C) `Filesystem × UndoLog` model
This PR does *not* attempt the closure — that requires the local Coq
build oracle to be working end-to-end. The composition.v file has
additional cascading proof-script errors at:
* line 271 — `operation_sequence_reversible`: stale rewrite direction
* line 327 — `reversible_creates_CNO`: `rewrite app_nil_r` targets a
subterm that simpl already
eliminated
* line 407 — `path_prefix_app_invert`: argument-shape mismatch
* line 365 — missing `Require Import Lia.` for the `lia` tactic
* file_content_operations.v:133 — `rewrite Hntype` fails to find
a matching subterm
These will need a coordinated proof-debt sweep with the build oracle
running locally. Filed at docs/PROOF-OPEN-FRONTIER.adoc § Tier S F-2.
Refs #42 (proof inventory).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath
hyperpolymathforce-pushed the proof/admit-becomes-admitted branch from 9b3e25d to f43636cCompareJune 1, 2026 17:31
@hyperpolymath
hyperpolymath merged commit af3f4b8 into mainJun 1, 2026
15 of 22 checks passed
@hyperpolymath
hyperpolymath deleted the proof/admit-becomes-admitted branch June 1, 2026 17:32
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 132 issues detected

SeverityCount
🔴 Critical9
🟠 High21
🟡 Medium102

⚠️Action Required: Critical security issues found!

View findings
[
{
"reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action dtolnay/rust-toolchain@nightly needs attention",
"type": "unpinned_action",
"file": "validation.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"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 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 codeql.yml",
"type": "missing_timeout_minutes",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

hyperpolymath added a commit that referenced this pull request Jun 1, 2026
Closes#33.
`panic-attack assail` Critical/High findings remaining after PR #32
(Track A, UnsafeCode/UnsafeFFI). All 8 issue-#33 findings + 2 newer
findings (Coq Admitted, security_tests.rs libc::geteuid) are audited
and either fixed-at-source or classified as legitimate:
9× new classifications in audits/assail-classifications.a2ml:
5× UnboundedAllocation — bounded-by-fs-size / -process-output / FP
(audit_log, redirection, main, secure_erase, executable)
1× CommandInjection — false-positive (verify-proofs.sh eval is
only ever called with script-internal literal strings)
1× UnsafeDeserialization — false-positive (Server.res JSON.parseExn
is wrapped in try/catch that returns JSON-RPC -32700)
2× ProofDrift — declared-model-gap (single_op_reversible
Admitted introduced in PR #48, documented in PROOF-NARRATIVE)
1× UnsafeCode — legitimate-ffi (libc::geteuid in
security_tests.rs root-detection guard)
1× fix-at-source:
flake.lock — pin nixpkgs (nixos-unstable, rev e9a7635a) +
flake-utils (rev 11707dc2), matching the estate
cadence from boj-server. Resolves SupplyChain (PA023).
audits/audit-triage-2026-06-01.md — auditor record, per-finding
rationale, anti-gameability note, verification command.
Post-fix `panic-attack assail . --headless` reports 0 unsuppressed
Critical/High findings (verified locally; pre/post JSON saved under
/tmp/panic-attack-run/audit-trail/).
Refs hyperpolymath/panic-attack#32.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request Jun 1, 2026
…oses#49) (#55)
* proofs(coq): partial closure of build-oracle cascade (refs #49)
Fixes the first wave of errors uncovered while attempting to re-enable
the verify-proofs CI oracle. Issue #49 catalogued 5 errors; this PR
closes those + several deeper cascading failures in the same modules.
Closed:
- file_content_operations.v:133 redundant rewrite of Hntype after eqn:
destruct already substituted
- file_content_operations.v:137,140 exact (Hcontra eq_refl) replaced
with destruct (False has no constructors)
- file_content_operations.v:178 destruct (node_type node) missing eqn:
(no substitution into RHS match)
- file_content_operations.v:272 injection on un-reduced match — restructured
with assert + destruct
- filesystem_model.v added has_read_permission (referenced by
copy_move_operations:38, never defined)
- copy_move_operations.v reordered is_prefix definition before its use
at line 62
Verified locally: filesystem_model.v, file_operations.v,
file_content_operations.v compile against coqc 8.18.0. Remaining
errors past line ~110 of copy_move_operations.v and downstream
in filesystem_composition.v are tracked as continuation of #49.
The verify-proofs CI job will be re-enabled in a follow-up PR once the
full module set compiles end-to-end.
Refs #49, #47.
* proofs(coq): close build-oracle cascade + re-enable verify-proofs (closes#49)
Completes the verify-proofs CI guard from issue #49. After PR #50's first
wave (file_content_operations + filesystem_model + copy_move is_prefix
reorder), the cascade ran deeper than the 5 enumerated errors:
Fixed (extends #49):
* copy_move_operations.v: 6 contradiction-direction + reflexivity-via-Hfile
fixes (copy_file_preserves_source, move_creates_destination,
move_preserves_content, move_reversible, copy_preserves_other_paths,
copy_then_move).
* filesystem_composition.v: 4 issues from #49 closed (Lia import,
operation_sequence_reversible rewrite direction + apply_sequence_app
helper, reversible_creates_CNO stale app_nil_r, path_prefix_app_invert
arg shape via Hpre_path save). Plus 4 not-in-#49: well_formed_ancestor_exists
(absurd typo + IHn vs Hind scope + symmetry), mkdir_preserves_well_formed
rewrite direction, rmdir_precondition_after_mkdir repeat-split overshoot.
* posix_errors.v: classic returns Prop but goal is sumbool — switch to
excluded_middle_informative; safe_rmdir <-> rmdir_precondition needs
explicit split (not repeat-split, since is_empty_dir nests).
* rmo_operations.v: omega → lia (Coq 8.14+); multi_pass helpers reordered
before obliterate_removes_path so the proof can use them; rewrite
multi_pass_preserves_tree/mapping in obliterate_preserves_other_*.
* extraction.v: missing Require Import String (Coq doesn't auto-import
on Extract Inductive); proofs/coq/.gitignore adds extracted/.
Three admits added (each model-gap, not laziness):
* filesystem_composition.v:611 Example mkdir_two_dirs_reversible —
non-LIFO sequence-reversal order; not derivable from
two_op_sequence_reversible as stated.
* rmo_operations.v:420 overwrite_pass_equalizes_storage — geometry
hypothesis missing block_overwritten constraint; conclusion provably
false for inputs with mismatched overwrite counters.
* rmo_operations.v:531 obliterate_not_injective — depends on the
admitted overwrite_pass_equalizes_storage.
(Pre-existing: filesystem_composition.v:238 single_op_reversible from
PR #48, OpRmdir/OpDeleteFile model gap.)
CI re-enablement:
* .github/workflows/validation.yml verify-proofs job: drop `if: false`,
install coq via apt-get (37s vs ~5min for coqorg image per
ephapax CI build oracle memory), build with coq_makefile + make -j1,
then Print Assumptions for single_op_reversible,
operation_sequence_reversible, reversible_creates_CNO,
copy_file_reversible to surface the registered model gaps in
the build log.
* proofs/coq/_CoqProject: remove "currently disabled" note,
bump last-verified to Coq 8.18.0 2026-06-01.
Build verified locally: 11/11 .vo files green from clean state.
* ci(verify-proofs): mkdir extracted/ before make (gitignored output dir)
extraction.v's [Extraction "extracted/filesystem.ml" ...] writes into the
gitignored directory, which doesn't exist on a fresh CI clone. Add a one-
line mkdir before the make step.
Local fresh clone reproduces the issue without this fix.
Sign up for freeto 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.

1 participant

@hyperpolymath