Skip to content

test(loader): INT-02 — prove + regression-lock the host-agnostic loader bridge#267

Merged
hyperpolymath merged 1 commit into
mainfrom
int02-loader-bridge
May 19, 2026
Merged

test(loader): INT-02 — prove + regression-lock the host-agnostic loader bridge#267
hyperpolymath merged 1 commit into
mainfrom
int02-loader-bridge

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

INT-02 — host-agnostic loader bridge: proven + regression-locked

Refs #179 (not Closes — owner-gated; the affinescript-dom-loader
satellite shell is downstream). The #244 pattern: the substrate was
already built + merged; this supplies the guarantee.

State found

packages/affine-js/loader.js already implements all four INT-02 pieces
(host-agnostic readBytes, multi-namespace buildImportObject,
parseOwnershipSection, detectHost Deno/Node/browser); mod.js
consumes it — SAT-02 is gone. But:

  • loader_test.js (14 tests) had no run task — green only with the
    right --allow-read/--allow-write; a naive run looked "1 failed" (a
    permission error, not a loader bug).
  • Nothing proved the loader on real compiler-emitted wasm — the unit
    tests use synthetic bytes; the INT-01 xmod-link harness still
    hand-rolls Deno.readFile + a manual import object (the SAT-02
    anti-pattern the loader exists to replace).

This PR locks it in

Layer Where Result
14 unit tests, pinned packages/affine-js/deno.jsondeno task test 14/14 reproducible
Real-wasm e2e via the actual loader API tests/modules/loader-bridge/ (bridge.mjs+run.sh+README) PASS

bridge.mjs compiles the INT-01 fixtures and uses readBytes +
buildImportObject to link CrossCallee.consume(42) = 42, then
parseOwnershipSection reads a real Linear-param entry from
compiler-emitted wasm — closes INT-01 ↔ INT-02.

Finding (in the harness README)

buildImportObject spreads module members (merge-not-clobber), so a
catch-all Proxy WASI stub must be attached as a whole namespace, not via
the spread — mirroring real usage (host owns wasi; the loader owns the
affine runtime + cross-module namespaces).

Scope

Ledger truthed: ECOSYSTEM/TECH-DEBT INT-02 → PROVEN+locked, SAT-02 →
FIXED
. No compiler change (loader is JS); the hermetic dune gate is
unaffected by construction (docs + deno.json + harness only; dune build clean). Reproducible harness kept out of the hermetic gate by
design (needs a wasm engine + deno), like tests/modules/xmod-link.

🤖 Generated with Claude Code

…er bridge (Refs #179)

The INT-02 loader (`packages/affine-js/loader.js`) was already
implemented + merged (host-agnostic readBytes, multi-namespace
buildImportObject, parseOwnershipSection, Deno/Node/browser detectHost;
mod.js consumes it — SAT-02 gone). What was missing was the *guarantee*,
exactly the INT-01 #244 pattern:

1. loader_test.js (14 unit tests) had NO run task — green only with the
   right --allow-read/--allow-write flags; a fresh run looked "1 failed"
   (a permission error, not a loader bug). Pinned: deno.json
   `tasks.test` -> `deno task test` = 14/14, reproducible.

2. Nothing proved the loader on REAL compiler-emitted wasm (unit tests
   use synthetic bytes; the INT-01 xmod-link harness still hand-rolls
   Deno.readFile + a manual import object — the SAT-02 anti-pattern the
   loader replaces). Added tests/modules/loader-bridge/ (bridge.mjs +
   run.sh + README): compiles the INT-01 fixtures and drives them through
   the *actual* loader API — readBytes loads both; buildImportObject
   wires the genuine `CrossCallee` cross-module namespace; linked
   caller.main() === 42; parseOwnershipSection reads a real Linear-param
   ownership entry from compiler output. Closes INT-01 <-> INT-02.

Finding (documented in the harness README): buildImportObject *spreads*
module members (merge-not-clobber), so a catch-all Proxy wasi stub must
be attached as a whole namespace, not via the spread — mirroring real
usage (host owns wasi; loader owns the affine runtime + cross-module
namespaces).

Ledger truthed: ECOSYSTEM/TECH-DEBT INT-02 -> PROVEN+locked; SAT-02 ->
FIXED. No compiler change (loader is JS); hermetic dune gate unaffected
by construction (docs + deno.json + harness only; dune build clean).
Refs #179 (not Closes — owner-gated; satellite shell downstream).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 47 issues detected

Severity Count
🔴 Critical 12
🟠 High 21
🟡 Medium 14

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Stray AI.a2ml in root -- use 0-AI-MANIFEST.a2ml only",
    "type": "banned",
    "file": "AI.a2ml",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "reason": "Superseded by 0-AI-MANIFEST.a2ml",
    "type": "banned",
    "file": "AI.djot",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "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 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/checkout@v4 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": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/example/smoke_driver.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/cli.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit 4a36a7d into main May 19, 2026
13 of 14 checks passed
@hyperpolymath hyperpolymath deleted the int02-loader-bridge branch May 19, 2026 18:03
hyperpolymath added a commit that referenced this pull request May 31, 2026
… (Refs #179, #489)

INT-02 substrate (host-agnostic loader bridge) shipped in #250 + proven
in #267 back on 2026-05-19, but the issue (#179) stayed open under the
PR-body convention "Refs not Closes — owner-gated; the
`affinescript-dom-loader` satellite shell is downstream".

Re-verified on `main` @ efa0339 2026-05-31 (14/14 unit + e2e harness on
real compiler-emitted wasm both green); closed #179; the satellite-shell
scope question (separate repo vs. fold into `packages/affine-js`) is now
runtime (#183) unblocks (#255).

Truthed:
- ECOSYSTEM.adoc satellite-registry row → `scope-deferred` with the
  #489 / #183 / #255 back-pointer.
- ECOSYSTEM.adoc INT-02 ledger row → "#179 CLOSED 2026-05-31"; clarified
  "unblocked INT-05/08/11"; satellite-shell pointer → #489.
- ECOSYSTEM.adoc INT-05 row → INT-02 dep cleared; flagged as next-up
  candidate for issue-spinout (no other blockers).
- ECOSYSTEM.adoc INT-11 row → INT-02 dep cleared; still blocked by
  INT-08 runtime via #255; satellite-repo question pointer → #489.
- TECH-DEBT.adoc INT-02 row → matched closure language; satellite-repo
  pointer → #489.

No code change. Pure ledger truthing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request May 31, 2026
… (Refs #179, #489) (#492)

INT-02 substrate (host-agnostic loader bridge) shipped in #250 + proven
in #267 back on 2026-05-19, but the issue (#179) stayed open under the
PR-body convention *\"Refs not Closes — owner-gated; the
`affinescript-dom-loader` satellite shell is downstream\"*.

Re-verified on `main` @ `efa0339` 2026-05-31 — 14/14 unit tests via
`deno task test` + e2e harness `tests/modules/loader-bridge/run.sh` on
real compiler-emitted xmod wasm both green. Closed #179.

The *satellite-shell scope question* (separate
`hyperpolymath/affinescript-dom-loader` repo vs. fold into
`packages/affine-js` vs. defer until INT-08 runtime unblocks) is now
**#489** with A/B/C options + recommendation pending owner call.

## Ledger updates

| Doc | Row | Change |
|---|---|---|
| `ECOSYSTEM.adoc` | satellite-registry `affinescript-dom-loader` |
`scaffold` → `scope-deferred`; back-pointer to #489 / #183 / #255 |
| `ECOSYSTEM.adoc` | INT-02 | added \"#179 CLOSED 2026-05-31\";
satellite-shell pointer → #489 |
| `ECOSYSTEM.adoc` | INT-05 | \"blocked by INT-02\" → INT-02 dep
cleared; flagged next-up for issue-spinout |
| `ECOSYSTEM.adoc` | INT-11 | INT-02 dep cleared; still blocked by
INT-08 runtime via #255; satellite-repo pointer → #489 |
| `TECH-DEBT.adoc` | INT-02 | matched closure language; satellite-repo
pointer → #489 |

`SAT-02` row in TECH-DEBT was already marked FIXED + Proven + locked —
left as-is.

No code change. Pure ledger truthing.

Refs #179, #489.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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