Skip to content

feat(verify): mirror L13 module-isolation from the OCaml verifier (Refs #35)#37

Merged
hyperpolymath merged 1 commit into
mainfrom
s35-l13-rust-mirror
May 19, 2026
Merged

feat(verify): mirror L13 module-isolation from the OCaml verifier (Refs #35)#37
hyperpolymath merged 1 commit into
mainfrom
s35-l13-rust-mirror

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

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 keeps crates/typed-wasm-verify in lock-step.

  • OwnershipError::ModuleNotIsolated { reason } — mirrors OCaml Tw_verify.ModuleNotIsolated.
  • verify_from_module first pass also records an imported memory/table (TypeRef::Memory/Table) + own MemorySection. After the ownership-section gate (preserves "no section ⇒ Ok", exactly as OCaml), a module owning linear memory yet importing a memory/table ⇒ 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 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

#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.
@hyperpolymath hyperpolymath merged commit c43d8fc into main May 19, 2026
14 of 21 checks passed
@hyperpolymath hyperpolymath deleted the s35-l13-rust-mirror branch May 19, 2026 20:16
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 25 issues detected

Severity Count
🔴 Critical 6
🟠 High 8
🟡 Medium 11

⚠️ Action Required: Critical security issues found!

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

Sign up for free to 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