Skip to content

Commit 661f0ae

Browse files
committed
test: add sessions-canary fixture for host integration of act:sessions
Hand-rolled minimal component exporting both \`act:tools/tool-provider\` and \`act:sessions/session-provider\`. Each session holds a \`u64\` counter; tools \`read\` and \`increment\` operate on the counter identified by \`std:session-id\` in call metadata. This is a stand-in until act-sdk-rs grows session macros — at which point we'd write a proper SDK-driven component. The canary lets us implement and test session-provider host bindings against a real .wasm artifact without depending on SDK work. Layout: - act-cli/tests/fixtures-src/sessions-canary/ — source crate (own workspace, not part of act-cli's) - act-cli/tests/fixtures/sessions-canary.wasm — packed binary tracked in git for tests Verified the existing host (basic ActWorld with tool-provider only) loads the canary fine — extra exports (session-provider) are not a mismatch error in wasmtime. \`act info --tools\` lists the tools, and calling tools without std:session-id returns \`std:invalid-args\` as expected; calling with an unknown session-id returns \`std:session-not-found\`.
1 parent 65d47f9 commit 661f0ae

11 files changed

Lines changed: 1014 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Test fixture sources
2+
3+
Hand-rolled component sources whose built wasms live in `tests/fixtures/`.
4+
5+
These are NOT production components — they are minimal artifacts written
6+
to exercise host integration code paths (especially capability interfaces
7+
that don't yet have SDK ergonomic support).
8+
9+
## sessions-canary
10+
11+
Stateful counter component. Exports both `act:tools/tool-provider` and
12+
`act:sessions/session-provider`. Each session holds a `u64` counter;
13+
tools `read` and `increment` operate on the counter identified by
14+
`std:session-id` in call metadata.
15+
16+
### Rebuild
17+
18+
```bash
19+
cd tests/fixtures-src/sessions-canary
20+
cargo build --target wasm32-wasip2 --release
21+
# Pack metadata into the wasm:
22+
cargo run --manifest-path ../../../../act-build/Cargo.toml --release -- \
23+
pack target/wasm32-wasip2/release/sessions_canary.wasm
24+
# Copy into the fixtures dir:
25+
cp target/wasm32-wasip2/release/sessions_canary.wasm \
26+
../../fixtures/sessions-canary.wasm
27+
```

0 commit comments

Comments
 (0)