How Traverse works
\nThe key ideas behind contracts, registries, runtime execution, placement, traces, and workflows.
\nCapability Contracts
\nEvery capability in Traverse is governed by a machine-readable contract. The contract is the source of truth. It declares what the capability does, what inputs it requires, what outputs it guarantees, and where it can run.
\nNothing executes without a verified contract. The runtime reads the contract before placement, validates inputs before execution, and checks postconditions after. The contract is not documentation. It is enforcement.
\n{\n // Identity\n \"id\": \"namespace.name\", // e.g. \"pricing.eligibility-check\"\n \"version\": \"MAJOR.MINOR.PATCH\",\n\n // Lifecycle: draft | active | deprecated | retired | archived\n \"lifecycle\": \"active\",\n\n // Execution\n \"execution\": {\n \"binary_format\": \"wasm32-wasi\",\n \"entrypoint\": \"function_name\",\n \"preferred_targets\": [\"edge\", \"cloud\"],\n \"constraints\": {\n \"host_api_access\": \"none\", // none | exception_required\n \"network_access\": \"forbidden\", // forbidden | required\n \"filesystem_access\": \"none\" // none | sandbox_only\n }\n },\n\n // Input/output schemas (JSON Schema)\n \"inputs\": { /* JSON Schema */ },\n \"outputs\": { /* JSON Schema */ },\n\n // Events\n \"events\": {\n \"emits\": [\"event-id-1\"],\n \"consumes\": [\"event-id-2\"]\n }\n}\n Event contracts follow the same pattern: identity, payload schema, publishers, subscribers, and compatibility policy.
\nRegistry
\nThe registry is the single source of truth for what the system can do. It holds capability contracts, event contracts, and workflow definitions. All of them are indexed and queryable at runtime.
\nCapabilities are loaded into the registry via registry bundles — manifests that group related capabilities, events, and workflows into a deployable unit. The CLI validates bundles before they are registered.
\nAI agents and orchestrators query the registry to discover capabilities by contract. Composition follows declared contracts — not inferred APIs or guesswork.
\nRuntime & Execution Model
\nThe Traverse runtime is a state machine. Each execution follows a deterministic path from idle to completed (or error). Every state transition is recorded in the trace.
The runtime resolves the correct capability from the registry, validates inputs against the contract, executes the WASM binary, validates outputs, emits declared events, and writes the trace. Same inputs always produce the same path.
\nCore crates
\ntraverse-runtimeCore execution enginetraverse-contractsContract parsing & validationtraverse-registryCapability & event registriestraverse-cliregister · list · validate · runtraverse-mcpMCP stdio serverPlacement Targets
\nPlacement is a client decision, not a fixed deployment target. A capability is device-independent — the same WASM binary runs on any client without modification, and executes locally by default. The contract declares which environments a capability is allowed to run in; the client evaluates that against its own context (resource constraints, latency, connectivity) and decides, heuristically, whether to run locally or delegate a subset of the capability to the server.
\nCurrently, only the local executor is fully implemented. Other targets are specified in contracts and will be resolved as executor adapters ship.
Trace Artifacts
\nEvery execution produces a structured trace artifact. The trace records every decision the runtime made: which capability was discovered, why it was selected, what inputs were validated, what events were emitted, and what the final output was.
\nTraces are queryable and auditable. For AI pipelines they are the compliance record. Proof that every action was governed by a contract.
\n{\n \"trace_id\": \"trv_8f2a1c...\",\n \"capability\": \"expedition.planning.plan-expedition\",\n \"version\": \"1.0.0\",\n \"status\": \"completed\",\n \"placement\": \"local\",\n \"discovery\": {\n \"candidates\": 1,\n \"selected\": \"plan-expedition\",\n \"reason\": \"contract match · preferred target\"\n },\n \"execution\": {\n \"steps\": 5,\n \"events_emitted\": 5,\n \"duration_ms\": 142\n },\n \"contract_validated\": true,\n \"preconditions_met\": true,\n \"postconditions_met\": true\n}\n Workflow Composition
\nWorkflows compose multiple capabilities into a deterministic execution graph. Each node is a governed capability. Each edge is a typed event. The runtime traverses the graph in order. Same inputs, same path, every time.
\nWorkflow definitions declare: the participating capabilities, the events each emits, the input and output shapes, and the terminal conditions. The runtime validates the composition before any execution begins.
\n{\n \"id\": \"expedition.planning.plan-expedition\",\n \"version\": \"1.0.0\",\n \"graph\": {\n \"capabilities\": [\n \"interpret-expedition-intent\",\n \"capture-expedition-objective\",\n \"assess-conditions-summary\",\n \"validate-team-readiness\",\n \"assemble-expedition-plan\"\n ]\n },\n \"terminal_conditions\": {\n \"success\": \"expedition-plan-assembled\",\n \"failure\": \"any-capability-error\"\n }\n}\n Spec-Driven Development
\nTraverse is built spec-first. Every component has an approved, versioned specification before implementation begins. The spec is the source of truth. The code is the proof.
\n73 governing specs are approved as of v0.8.1, covering everything from the foundation, capability and event contracts, and the registries through runtime execution, placement routing, the embedder SDKs, the durable event journal, and the example domains. The first nine — foundation, capability contracts, event contracts, the spec alignment gate, the capability registry, runtime request execution, workflow registry traversal, and the expedition domain and artifacts — remain the core of the system.
\nCI gates — every PR must pass
\n#![forbid(unsafe_code)])