Skip to content
Press / to search

Docs Overview

The five planes, the canonical execution contract, and reading paths into the spec.

Living DocumentLast reviewed: Edit on GitHub
At a glance

ContextOS is the decision runtime for AI-native enterprises. It compiles per-request Context Packs that bound model behavior, runs governed decision loops, and produces typed decisions with evidence and approvals — not free-form text.

Explore the five planes

Hover or click each plane to see its primitives and the typed contracts it owns.

Bounded execution loop

Decision plane

Primitives
  • Cognitive loop layers
  • Planner / Executor / Critic
  • Subagent lanes
  • Background Sessions
  • Decision Catalog
Typed contracts
  • Plan
  • DecisionRecord
  • CriticReport
  • Session
Read the Decision plane spec

The five planes

┌───────────────────────────────────────────────────────────────┐
│  TRUST PLANE                                                  │
│  policy · approval-mode tiers · identity · evaluators · OTEL  │
├───────────────────────────────────────────────────────────────┤
│  ACTION PLANE                                                 │
│  Tool Gateway · MCP · A2A · OpenAPI · idempotency             │
├───────────────────────────────────────────────────────────────┤
│  DECISION PLANE                                               │
│  cognitive loop · Planner / Executor / Critic · subagent lanes│
├───────────────────────────────────────────────────────────────┤
│  CONTEXT PLANE                                                │
│  Context Pack Compiler · token budgets · runtime controls     │
├───────────────────────────────────────────────────────────────┤
│  INTELLIGENCE PLANE                                           │
│  ontology · knowledge graph · memory · embeddings · identity  │
└───────────────────────────────────────────────────────────────┘
PlaneWhat it coversFoundation docs
IntelligenceSubstrate of meaningontology, knowledge-graph, memory, identity-layer
ContextPer-request compilationcognitive-core, agentic-context-engineering
DecisionBounded execution loopcognitive-core, orchestration
ActionGoverned external effectsadapter-mesh
TrustControl over the other fourgovernance, evaluation-observability, improvement-loop, security

Improvement surfaces by plane

ContextOS treats the harness as a versioned artifact that can improve from traces, scorecards, corrections, and replay. The Improvement Loop may propose changes across all five planes, but each plane owns both a tunable surface and an invariant that the optimizer cannot relax.

PlaneImprovement surfaceInvariant
Intelligencesource contracts, ontology refinements, graph retrieval policy, memory promotion candidatesno silent ontology breaking change, no uncited durable memory, no unpinned knowledge snapshot
Contextretrieval top_k, source priority, bucket budgets, compression strategy, prompt fragmentsrequired evidence, policy manifests, redaction, and tool eligibility cannot be dropped for cost or latency
Decisionplanner templates, tool ordering, re-plan budgets, subagent lane policy, Critic rubricsplans cannot bypass evidence checks, approval gates, loop guards, or DecisionSpec binding
Actionadapter timeout/retry policy, cached read-only aliases, circuit breakers, adapter version routingschemas, approval-mode maxima, credential exchange, and idempotency cannot be weakened
Trustevaluator thresholds, sampling, replay sets, rollout gates, proposal rankingsafety and policy are floor constraints; proposals never auto-promote themselves

This is the practical reading of “autotune” in ContextOS: search may discover better harness configurations, but every candidate remains a typed proposal that passes replay, review, and staged rollout before release.

Cross-cutting primitives

Every contract carries:

  • RunContextrun_id, trace_id, session_id, tenant_id, user (delegation), agent (workload identity), safety_mode, run_budget.
  • ApprovalMode (5-tier) — read_only / local_write / network / delegated / destructive.
  • ContextPack — versioned, signed, immutable.
  • CompiledContextcompiled_prompt, manifests, runtime_controls, budget_report.
  • DecisionRecord — typed outcome with evidence_refs, approvals, controls_active, trace_id.
  • ToolEnvelopeToolCallEnvelope / ToolResultEnvelope with policy_decision_id, approval mode, idempotency, evidence refs, and W3C trace context.

The canonical execution contract

invokeAgent(request_envelope, run_context)
  → compile(packs, request, run_context) → CompiledContext
  → loop {
       planner(CompiledContext)         → Plan
       critic.verify(Plan)              → ok | replan | reject
       executor(Plan, ToolGateway)      → step_results, evidence
       critic.score(step_results)       → accept | retry | replan | escalate
       consolidate(effects, evidence)   → memory_proposals
     }
  → DecisionRecord(evidence_refs, approvals, controls_active, trace_id)

Every doc references back to this contract. Schemas are authoritative; prose snippets are blueprints unless explicitly marked production.

What is authoritative vs. blueprint

LayerAuthoritative source
Context Pack schema/docs/implementation/context-pack + JSON Schema
Runtime invocation contract/docs/implementation/api-contracts
Decision Spec/docs/implementation/decision-catalog
Decision Record/docs/implementation/decision-record
Approval-mode tier taxonomy/docs/foundations/governance#approval-mode-tiers
TS reference compilersrc/lib/contextos/{types,compiler,test-harness}.ts (reference only — not the production runtime)

New patterns are validated against working systems before they land in the spec — this repo lags implementation, not the other way around.

Reading paths

Platform engineers building the runtime → How It WorksReference Architecture → all foundationsAPI ContractsContext Pack.

Product engineers building agents on top of the runtime → How It WorksQuickstartIntent-Task CatalogDecision CatalogDecision RecordWorkflow Examples.

Applied AI / ML integrating models and retrieval → Cognitive CoreAgentic Context EngineeringKnowledge GraphIdentity LayerEvaluation and Observability.

Security / governance assessing the runtime → GovernanceSecurity and ComplianceHigh-Risk WorkflowEvaluation and Observability.

Executives evaluating the investment case → Invest Early in ContextOSReference Architecture executive summary → Use Cases.

Document status

Every doc declares a status in its frontmatter:

StatusMeaning
Living Documentactively maintained; expect updates
Foundational Specstable contract; changes go through review
Implementation Guideconcrete patterns for adopting the spec
Reference Designcomprehensive deep-dive