feat(formal): F-1 preservation + grow K-1 (let/vars) + state P-2/P-3/F-3/F-4#621
Merged
Conversation
… state P-2/P-3/F-3/F-4 Continues the formal/ Wave-0 programme (docs/PROOF-NEEDS.adoc), in the order F-1 → grow-K-1 → state-siblings. All Coq/Rocq 8.18, all axiom-free (`Print Assumptions`: "Closed under the global context"); no Admitted. F-1 — F1_TransformerPreservation.v (mechanized, composes on K-1): Models a face surface `fexp` + sugar, the transform `elaborate : fexp -> sexp` (ADR-010's T_F), and the face's own semantics `feval`. Proves the transform preserves meaning (feval f = seval (elaborate f)), then chains K-1's k1_preservation_holds to get end-to-end codegen preservation, plus the cross-face same-cube corollary (faces landing on the same canonical AST emit identical code). The observational split is F-2 (SameCube.agda). K-1 grown — K1Let_CodegenPreservation.v (mechanized): Re-proves codegen preservation for a richer fragment adding de Bruijn variables, `let`, and an environment; the target machine gains a locals register with IBind/IUnbind balancing. (`if`/structured control is the next increment — needs a target control construct + termination measure.) Siblings stated — Siblings_Stated.v (statements only, nothing proven): P-2 (progress + preservation), P-3 (borrow soundness + the explicit "reject #554" obligation), F-3 (pragma locality + alias-table functionality), F-4 (error-vocabulary faithfulness as a class/referent simulation). Each is a `Definition ..._statement : Prop` over section Variables, discharged at End into closed universally-quantified props — the Coq analogue of solo-core's statement-only Idris2 skeleton. Track wiring: justfile `check` now compiles all four in dependency order (F-1 Requires K-1) and asserts no axioms; _CoqProject + README updated. .hypatia-ignore extends the Coq-not-V-lang carve-out to the three new .v files. PROOF-NEEDS.adoc: F-1 absent→partial, F-3/F-4 absent→stated, formal/ file list + Wave-0 row refreshed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPG9mEQXFyA3k7NWAzMNMr
🔍 Hypatia Security ScanFindings: 41 issues detected
View findings[
{
"reason": "Action denoland/setup-deno@v2 needs attention",
"type": "unpinned_action",
"file": "publish-jsr.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in instant-sync.yml",
"type": "secret_action_without_presence_gate",
"file": "instant-sync.yml",
"action": "peter-evans/repository-dispatch",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
"type": "js_exec_sync",
"file": "/home/runner/work/affinescript/affinescript/packages/affinescript-cli/mod.js",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "Shell execution -- validate input before passing to shell (2 occurrences, CWE-78)",
"type": "js_exec_sync",
"file": "/home/runner/work/affinescript/affinescript/packages/affine-vscode/mod.js",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
"type": "js_exec_sync",
"file": "/home/runner/work/affinescript/affinescript/affinescript-vite/src/affine-plugin-improved.js",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "expect() in hot path (32 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/affinescript/affinescript/affinescriptiser/src/codegen/wasm_gen.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (29 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/affinescript/affinescript/affinescriptiser/src/codegen/affine_gen.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unsafe block -- requires SAFETY comment (2 occurrences, CWE-676)",
"type": "unsafe_block",
"file": "/home/runner/work/affinescript/affinescript/runtime/src/panic.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unsafe block -- requires SAFETY comment (1 occurrences, CWE-676)",
"type": "unsafe_block",
"file": "/home/runner/work/affinescript/affinescript/runtime/src/alloc.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unsafe block -- requires SAFETY comment (3 occurrences, CWE-676)",
"type": "unsafe_block",
"file": "/home/runner/work/affinescript/affinescript/runtime/src/ffi.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]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.
What
Continues the
formal/Wave-0 programme in the order you gave — 3 → 1 → 2 (F-1, then grow K-1, then state the siblings). All Coq/Rocq 8.18, all axiom-free (Print Assumptions→ "Closed under the global context"); noAdmitted.3 — F-1 (
F1_TransformerPreservation.v, mechanized)The real same-cube theorem, composing on K-1: models a face surface
fexp+ parser sugar, the transformelaborate : fexp → sexp(ADR-010'sT_F), and the face's own semanticsfeval. Proves the transform preserves meaning —Theorem f1_transform_preserves_eval : forall f, feval f = seval (elaborate f).— then chains K-1's
k1_preservation_holdsfor end-to-end codegen preservation (f1_codegen_preservation), plus a cross-face same-cube corollary (faces landing on the same canonical AST emit identical code). The observational trailing-statement/tail split stays ininvariant-path/proofs/SameCube.agda(F-2).1 — grow K-1 (
K1Let_CodegenPreservation.v, mechanized)Re-proves codegen preservation for a richer fragment: de Bruijn variables,
let, and an environment. The target machine gains a locals register, and compilation balancesIBind/IUnbindso locals scope correctly. (if/structured control is the next increment — it needs a target control construct + a termination measure.)2 — state the siblings (
Siblings_Stated.v, statements only)P-2 (progress + preservation), P-3 (borrow soundness + the explicit "reject #554" obligation), F-3 (pragma locality + alias-table functionality), F-4 (error-vocabulary faithfulness as a class/referent simulation). Each is a
Definition ..._statement : PropoverSectionVariables, discharged atEndinto closed, universally-quantified props — the Coq analogue of solo-core's statement-only skeleton. Nothing is claimed proven, and there are no axioms/Parameters.Wiring & docs
justfilecheckcompiles all four in dependency order (F-1Requires K-1) and asserts no axioms;_CoqProject+README.adocupdated..hypatia-ignoreextends the Coq-.v-is-not-V-lang carve-out to the three new files.PROOF-NEEDS.adoc: F-1absent → partial, F-3/F-4absent → stated,formal/file list + Wave-0 row refreshed.Check
Verified locally: 4 closure reports, zero axioms.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KPG9mEQXFyA3k7NWAzMNMr
Generated by Claude Code