feat(verify): mirror L13 module-isolation from the OCaml verifier (Refs #35)#37
Merged
Conversation
#35) Part 1 of #35: keep `crates/typed-wasm-verify` in lock-step with the OCaml spec-of-record after affinescript PR #280 added L13 module-isolation (negative form) to `lib/tw_verify.ml`. - `OwnershipError::ModuleNotIsolated { reason }` (thiserror "Level 13 violation: {reason}") — mirrors OCaml `Tw_verify.ModuleNotIsolated`. - `verify_from_module`: first pass now also records an imported memory/table (`TypeRef::Memory`/`Table`) and whether the module declares its own `MemorySection`. After the ownership-section gate (so the "no section ⇒ Ok" contract is preserved exactly as OCaml), a module that owns linear memory yet imports a memory/table yields `ModuleNotIsolated`. Carrier-free — standard import/memory sections only; NO `affinescript.ownership` wire-format change (multi-producer ABI with ephapax untouched; the L2-6/L15 carrier proposal is #34). Tests (verify.rs): isolated own-memory module ⇒ Ok; own + imported memory ⇒ ModuleNotIsolated; imported memory with no ownership section ⇒ Ok (contract). `cargo test`: 43 unit + 10 cross_compat green, zero regression — the cross-compat suite remains the OCaml↔Rust parity oracle. Part 2 of #35 (INT-12 C5.1: real affinescript-emitted fixtures) stays toolchain-gated; not in this PR. Refs #35. Mirrors affinescript PR #280.
🔍 Hypatia Security ScanFindings: 25 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 actions/setup-node@v4 needs attention",
"type": "unpinned_action",
"file": "e2e.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action actions/setup-node@v4 needs attention",
"type": "unpinned_action",
"file": "e2e.yml",
"action": "pin_sha",
"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": "Action actions/upload-artifact@v4 needs attention",
"type": "unpinned_action",
"file": "release.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action actions/download-artifact@v4 needs attention",
"type": "unpinned_action",
"file": "release.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/SessionProtocol.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/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/SessionProtocol.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/Echo.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
}
]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.
Mirror L13 module-isolation (OCaml→Rust parity) — #35 part 1
After affinescript PR #280 added L13 module-isolation (negative form) to the OCaml spec-of-record (
lib/tw_verify.ml), this keepscrates/typed-wasm-verifyin lock-step.OwnershipError::ModuleNotIsolated { reason }— mirrors OCamlTw_verify.ModuleNotIsolated.verify_from_modulefirst pass also records an imported memory/table (TypeRef::Memory/Table) + ownMemorySection. After the ownership-section gate (preserves "no section ⇒ Ok", exactly as OCaml), a module owning linear memory yet importing a memory/table ⇒ModuleNotIsolated.affinescript.ownershipwire-format change (multi-producer ABI with ephapax untouched; the L2-6/L15 carrier proposal is Multi-producer ABI proposal: region/type-schema + capability carrier section (unblocks L2-6 / L15 on emitted wasm) #34).cargo test: 43 unit + 10 cross_compat green, zero regression. New tests: isolated own-memory ⇒ Ok; own+imported memory ⇒ModuleNotIsolated; imported memory + no ownership section ⇒ Ok (contract). The cross-compat suite remains the OCaml↔Rust parity oracle.Part 2 of #35 (INT-12 C5.1 real affinescript-emitted fixtures) stays toolchain-gated — not in this PR.
Refs #35. Mirrors affinescript PR #280.
🤖 Generated with Claude Code