Description
src/ui/gossamer/loader.js (readString) currently assumes the Ephapax wasm string ABI is:
ptr -> [ i32 length (little-endian) | bytes... ]
This matches the AffineScript convention and the project receipts that describe Ephapax strings as {ptr, len} pairs, but the wasm-level packing has never been verified against a real Ephapax-emitted binary — there isn't one yet (gated on hyperpolymath/ephapax#36).
The loader's readString now bounds-checks length and ptr, so a mismatch surfaces as a RangeError rather than a silent garble — but the actual fix would be a one-line update to readString if Ephapax emits something else (e.g. multi-value return, separate _get_len/_get_bytes calls, length-as-second-export).
Definition of done
- Once ephapax#36 lands and the
Build Gossamer GUIworkflow produces ahypatia_gui.wasmartifact, instantiate it locally (or in CI via a tiny node script) and callhypatia_viewagainst anhypatia_initmodel. Confirm the returned bytes decode to the expected view string. - If the ABI differs from the assumed convention, update
readStringaccordingly and adjust thegossamer.bytes_to_string/ JSON-helper stubs that share the same assumption. - Update the ABI documentation block at the top of
loader.jswith the verified convention.
Scope
Out of scope for #196 — that DoD allows the ABI assumption to be documented with bounds-checking until a real wasm exists.
Activity
hyperpolymath commentedon May 11, 2026
Status update from #219:
The new Node smoke harness (
test/gossamer/loader_smoke.test.mjs) instantiates a hand-built minimal.wasmagainstloader.js's gossamer host imports and verifies the{ptr, i32-len}string ABI round-trips through real wasm memory. That confirms the loader side of the convention is internally consistent and decodes correctly when wasm produces strings in the assumed shape.What it does not confirm — and what this issue still tracks — is whether Ephapax-emitted wasm actually packs strings that way, or whether it uses multi-value returns / separate
_get_len/_get_bytescalls / length-as-second-export / etc. That requires a real Ephapax-emitted artifact, which is gated onhyperpolymath/ephapax#36.Plan once
ephapax#36lands and the workflow promotes the compile step:Build Gossamer GUIproduces a realhypatia_gui.wasm.hypatia_view(hypatia_init()), and assert the decoded view string matches the expected initial content.readEphapaxString(single point of change per the loader doc block) and thegossamer.bytes_to_string/ JSON-helper stubs.loader.jswith the verified convention.Holding open until
ephapax#36is mergeable — there's no hypatia-side action I can take to close this issue before then.Generated by Claude Code
ci(gossamer): probe `ephapax compile`; name the real upstream gate
hyperpolymath commentedon May 11, 2026
After inspecting
hyperpolymath/[email protected]to attempt the integration: the upstream gate isn't actually a CLI subcommand wrapper — it's the v2 grammar.What I found:
ephapax(notephapax-cli) and already shipsephapax compile <file> -o <out>(seesrc/ephapax-cli/src/main.rs:65).src/ephapax-parser/src/ephapax.pest) only accepts top-levelfnandtypedeclarations.ephapax compile src/ui/gossamer/bridge.eph -o /tmp/hypatia_gui.wasm→Parse error at line 18: expected EOI or declaration at "module hypatia/ui/bridge".bridge.ephandhypatia_gui.ephuse v2 constructs (module,import,extern "gossamer" { ... },data Msg = Navigate(Department) | PopState,match,let!) — none of which v1.0.0's parser accepts.So
hyperpolymath/ephapax#36(the "compile-eph CLI subcommand" tracker) is really blocked on the v2 grammar landing inephapax-parser. Once the parser accepts v2, the existingephapax compilesubcommand will start producing real wasm and this issue becomes verifiable in one CI cycle.Latest commit on #219 updates the workflow to probe
ephapax compile(the real v1.0.0 subcommand) and surface a clear warning if the parse fails, plus corrects this issue's mental model in the loader/README comments. Doesn't close #215 — the verification still requires upstream parser support — but means the moment that lands we're one CI cycle away from a real artifact rather than two.Generated by Claude Code