Skip to content
Press / to search

Tutorials

Hands-on, step-by-step walkthroughs of the canonical execution contract — author a Context Pack, bind a destructive tool, wire a Decision Catalog entry, and close the improvement loop.

Living DocumentLast reviewed:
At a glance
ContextOS ContractPolicy & GatesCompiler & MemoryAdapter MeshExact profiles · current authority · active boundariesFenced effects · shared budgets · scoped evidenceContextActions

Four worked walkthroughs build the context, tool, decision and improvement contracts for one workflow. The repository exercises deterministic compilation and validators; a live payment gateway, approval service and production stores are supplied by the implementation. Reading or running reference examples does not execute a real refund or establish runtime conformance.

Pick your starting point

TutorialWhat you buildTime
1. Ship your first Context PackA versioned, immutable-after-publication Context Pack that compiles into a CompiledContext for one intent.12 min
2. Bind a destructive tool through the Tool GatewayAn adp_payments.issue_refund capability with native risk, a v1 destructive projection, GATE_FINANCE_APPROVAL, and a frozen evidence snapshot.15 min
3. Wire a typed Decision Catalog entryA DecisionSpec with required_evidence that produces a typed DecisionRecord from the Critic.12 min
4. Close the improvement loopAn operator correction in the Feedback Store → a StrategyRule from the Strategy Compiler → release-gated promotion.18 min

What you need

  • The TS reference compiler under src/lib/contextos/ — already in this repo.
  • npx tsx for the runnable harness.
  • The Quickstart as the worked artifact map; it does not deploy the runtime services.

For current production obligations, read Execution Contract, Control Profiles and Conformance. They preserve base envelopes while specifying exact admission, full stored approval, current authority/boundary/data checks, durable effect recovery and shared limits. The teaching examples defer to those requirements; local illustrative helpers are not shipped enforcement services. Estimated reading times are illustrative.

What these tutorials are not

  • They are not a replacement for the foundations — read those for the spec narrative.
  • They are not a production deployment guide — see the Deployment Blueprint for that.
  • Local illustrative helper or deployment-protocol fields are not additional required base-schema fields; verify the actual published types and implementing runtime behavior.