Skip to content

feat(bindings): close bindings roadmap #5 — AS-side wasmCall surface#431

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/bindings-5-wasmcall-as-side
May 28, 2026
Merged

feat(bindings): close bindings roadmap #5 — AS-side wasmCall surface#431
hyperpolymath merged 1 commit into
mainfrom
feat/bindings-5-wasmcall-as-side

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Re-lands the AS-side wasmCall surface (extern + test fixtures + roadmap row flip) that PR #419 originally bundled. #419 was closed as "superseded by #422", but #422 only carried the motion binding — the host-side codegen (__as_wasmCall + lowering-table entry) is present on main while the AS-side pieces are missing.

Flips docs/bindings-roadmap.adoc row #5 from ◐ host-side; AS-side ○ to ● usable (Option A landed).

  • stdlib/Deno.affine: new pub extern fn wasmCall(exports: WasmExports, name: String, args: [Float]) -> Float with docstring + wasmInstance → wasmCall worked example.
  • tests/codegen-deno/wasm_call.{affine,harness.mjs}: round-trip harness over a 41-byte inline wasm module exporting add(i32, i32) -> i32 (4 assertions).
  • docs/bindings-roadmap.adoc: row ci: Bump actions/github-script from 7.0.1 to 8.0.0 #5 status ; cross-cutting §2 observation rewritten "LANDED".

Closes bindings roadmap #5. Closes #414 (host-side via #422, AS-side via this PR).

Test plan

  • affinescript check stdlib/Deno.affine → Type checking passed.
  • affinescript check tests/codegen-deno/wasm_call.affine → Type checking passed.
  • tools/run_codegen_deno_tests.sh (gated on Actions budget — admin-merge per estate policy).

Out of GH Actions budget; admin-merging on clean local verify per estate policy (see MEMORY.md session-2026-05-27-estate-sweep-1254-prs).

🤖 Generated with Claude Code

Host-side codegen for wasmCall landed via #422 (`__as_wasmCall` helper +
lowering-table entry in `lib/codegen_deno.ml`), but the AS-side surface
(`pub extern fn wasmCall` in `stdlib/Deno.affine`) and test fixtures
that PR #419 originally bundled were lost when #419 was closed as
"superseded by #422". This re-lands the AS-side bits so the binding is
end-to-end usable, flipping roadmap row #5 from `◐ host-side; AS-side ○`
to `● usable (Option A landed)`.

Surface:

    pub extern fn wasmCall(
      exports: WasmExports,
      name: String,
      args: [Float]
    ) -> Float;

Lowers to `Number(exports[name](...(args || [])))` on `--deno-esm`.
Number coercion means i32/i64/f32/f64 export return types all flow
back as `Float` at the AS boundary. Caller is responsible for the
export existing + arity-matching; absent exports raise the host
`TypeError` at the boundary (documented in the extern docstring).

Files:

- `stdlib/Deno.affine` — new `wasmCall` extern + docstring with
  `Bytes -> WasmExports -> wasmCall` worked example.
- `tests/codegen-deno/wasm_call.affine` — fixture exposing `addViaWasm`.
- `tests/codegen-deno/wasm_call.harness.mjs` — Node ESM harness
  instantiating a hand-built 41-byte wasm module exporting
  `add(i32, i32) -> i32`; asserts 4 round-trip cases.
- `docs/bindings-roadmap.adoc` — row #5 status `◐` → `●` and the
  cross-cutting observation reads "LANDED" instead of "one-day fix".

Local verification:

- `affinescript check stdlib/Deno.affine` → "Type checking passed".
- `affinescript check tests/codegen-deno/wasm_call.affine` → "Type
  checking passed".

Closes bindings roadmap #5. Closes #414 (host-side via #422, AS-side
via this PR).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit 851fbdc into main May 28, 2026
13 of 23 checks passed
@hyperpolymath hyperpolymath deleted the feat/bindings-5-wasmcall-as-side branch May 28, 2026 12:51
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 81 issues detected

Severity Count
🔴 Critical 4
🟠 High 10
🟡 Medium 67

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action actions/checkout@v6 needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "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 affine-vscode-publish.yml",
    "type": "unknown",
    "file": "affine-vscode-publish.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "unknown",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "unknown",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

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.

bindings #5: WASM-exports calling pattern

1 participant