A complete integration

This example keeps one user’s AgentState in a store, exposes one narrow tool, emits progress, and commits only a successful result.

Why each choice exists

  • One server-owned model. Provider credentials and tool authority never enter browser state.
  • Explicit tools. Omitting tools would enable the default workspace tools; this product needs only service lookup.
  • Product vocabulary. decision is useful here, so it is configured instead of allowing arbitrary semantic types.
  • Completion evidence off. The built-in evidence policy targets coding work. Operational answers use product-specific policy and tool evidence.
  • Compare-and-set persistence. Two replicas cannot silently overwrite one session version.
  • Diagnostic failure path. Failed work is inspectable but does not become canonical session state.

Coding-agent variant

For workspace work, opt into scoped defaults and completion evidence:
Put sandboxPath inside a real process and filesystem sandbox when inputs are untrusted. StateWeave’s path checks are defense in depth, not tenant isolation.

Test the causal contract

A focused integration test should assert more than the answer:
Use MockModel for deterministic unit tests and one real provider smoke test for action formatting, usage metadata, and semantic-node behavior.