Fix one-click deploy: valid WASM, icp-cli manifest, wasm auto-discovery#64
Merged
Conversation
…oot pinning, wasm auto-discovery - generateWasm emitted structurally invalid modules (missing custom-section name length, wrong func-type encoding, exports pointing at undeclared functions, malformed code/memory/data sections) — rewritten to emit spec-valid WASM, guarded by WebAssembly.validate; validateWasmFile now runs full engine validation instead of magic-byte checks - deploy via icp-cli now generates an icp.yaml manifest for the packaged WASM, pins --project-root-override so unrelated parent manifests are never picked up, and auto-starts the local network in the background - deploy's wasm argument is optional: auto-discovers dist/<name>.wasm via agent.json, matching the init onboarding instructions - agentvault package writes the icp.yaml manifest (marker-guarded, never overwrites user-managed manifests) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fixes the
init → package → deploy --network localonboarding flow, which failed at every step past packaging.Root causes found
generateWasmemitted structurally invalid WASM — the replica rejected it with IC0505 ("Failed to decode wasm module ... offset 0xb"). The hand-rolled encoder had a missing custom-section name-length prefix, wrong func-type encodings (no result count), 4 exports pointing at only 2 declared functions, malformed memory/code/data sections, and unsigned LEB where signed is required.deployrouted to icp-cli with no project manifest and no project root — icp-cli walked up the directory tree and choked on unrelatedicp.yamlfiles (e.g. AgentVault's own internal-format one), and could never deploy a bare WASM anyway.init's next-steps saiddeploy --network localbut thewasmargument was required.Changes
compiler.ts; every generated module is now checked withWebAssembly.validatebefore being returned, andvalidateWasmFileruns full engine validation instead of magic-byte checks.agentvault packagenow writes an icp-cli-compatibleicp.yaml(script build step copying the packaged WASM — avoids the remote recipe registry, whose templates aren't compatible with all icp-cli binary versions). Marker-guarded: user-managed manifests are never overwritten.deployWithIcpClipins--project-root-overrideto the agent project, generates the manifest if missing, and auto-starts the local network in the background when it isn't running.deploy'swasmargument is now optional — auto-discoversdist/<name>.wasmviaagent.json.Verification
npx agentvault init clem-agent --template minimal→package ./→deploy --network local --yesdeploys a canister to the auto-started local network (Canister ID4ld2s-rd777-77775-aaaaq-cai).🤖 Generated with Claude Code