Explain architecture and ownership
06 - Reference · Explore documentation
When customer status changes during a lending workflow, the application needs a single authority for whether existing results remain current. Co2 provides that authority inside the host process. The host still runs agents, decides routes and owns external effects. Read core concepts first for the business model; this document defines the implementation and trust contracts.
For source locations, component ownership and extension points, see the Repository Structure and Ownership guide.
begin / scoped reads / complete_outputs / planPrivate DependencyEngine InterfacePublic contracts expose no Salsa types or revisions. begin and complete retain default invocation-level behavior and use the stable default output slot. begin_with_strategy selects a strategy; complete_outputs publishes one or more uniquely identified output slots for that computation.
A slot is (computation, output) and has an independent current artifact, generation, effective dependency set and plan step. Replacing one slot leaves sibling outputs in place. Attempt IDs and artifact IDs remain unique within one authority.
A successful batch advances the computation generation, so another concurrently started attempt for the same computation is rejected even if it targets a different output.
Strategies and Assurance
The host must provide the entire accessible context, including resources, prior artifacts, prompts/configuration and any other information capable of influencing work, represented as versioned resources or artifacts. Co2 cannot discover omissions or prove that source values match their reported versions. Output declarations refer only to identities in that captured snapshot; empty identifiers, duplicate references, unknown and inaccessible references are rejected. The captured snapshot supplies the version, not an LLM-provided version.
| Strategy | Effective Dependencies & Recorded Assurance | Completeness Boundary |
|---|---|---|
InvocationLevel (default) | Every captured input; InvocationLevel. | Conservative only if the host included all accessible context. |
ExplicitStructured, developer declaration | The output's declared subset; DeveloperDeclared. | A declaration is an assertion by trusted host/developer code that the set is complete for that output. Co2 checks references and recorded accesses, but cannot prove this assertion. The host must never label model-provided declarations as developer declarations. |
ExplicitStructured, model declaration | The full captured set; LlmFallback. The declaration is retained as provenance. | A model declaration and schema validity do not prove completeness; it cannot narrow observed or accessible dependencies. |
ExplicitStructured, absent declaration | Full captured set; MissingDeclarationFallback. | No completeness assertion. |
| Developer declaration omits a controlled observed read | Full captured set; ObservedOmissionFallback. The original declaration and observed reads are retained. | Scoped observations are accumulated across the entire invocation, so a read made for one output can conservatively force fallback on another. |
Ordinary RuntimeEnforced | Full captured set; RuntimeObservedFallback, with controlled reads recorded separately. | ScopedContext restricts its own resource/artifact access to the captured allow-list, but arbitrary host code can bypass it, retain data, call other APIs, or access ambient state. This ordinary path does not establish complete mediation or host context isolation; it issues no narrowed runtime assurance. |
| Evidence-required approved local guest | Verified broker-consumed inputs plus mandatory workload/profile/provider controls; ScopedRuntimeEnforced. | Complete input mediation only within the enrolled trusted broker-only guest profile; excludes arbitrary host access, source truth and remote providers. |
ScopedContext::resource returns the captured resource observation, not resource data; the host supplies and binds actual bytes to that version. ScopedContext::artifact returns an accessible currently valid artifact. Both reject out-of-scope or already stale access and record successful reads for the invocation. They are not a sandbox, and host behavior outside them is not observed. The reviewed-provider path below uses a separately validated boundary covering its accessible inputs and a binding between execution and registration before narrowing runtime-derived dependencies. An assertion flag or intercepted tool calls alone would not establish that property.
Atomic Registration and Validity
One Mutex serializes all resource registration, scoped access, snapshot capture, validation and publication. begin captures resource observations with locally monotonic generations and current valid input artifacts. At completion, the entire invocation snapshot is revalidated even if a developer declaration later selects a smaller set for an output.
This conservatively rejects a result if any accessible input changed during work. Co2 then validates every output, declaration, attempt/artifact identity, generation and the combined prospective graph before publishing any output. A batch is also rejected if replacing one output would invalidate an artifact captured by that same invocation.
A private structural adjacency/rank certificate validates rank-safe graph replacements locally and otherwise checks the complete prospective overlay iteratively; recovery and collection reconstruct it from current provenance. It stores no independent validity decisions. Failed preflight installs no structural update.
Rejected ordinary batches publish nothing and leave the attempt reserved. Evidence-required admission failures close the attempt without publication, as described below.
Per-output engine nodes are private implementation keys passed through the private engine interface. Immutable ComputationRecords independently retain the full invocation snapshot, declaration and source, invocation-wide observed reads, assurance, effective dependencies, optional scoped execution evidence and output value. Each accepted replacement advances that output slot's generation even if bytes are equal; consumers of the previous artifact become stale. Locally monotonic resource generations reject A-to-B-to-A late results. The source owner must supply ordered versions and must not reuse a current version for different content.
plan returns one step per latest output in deterministic dependency order. Each step independently reports context validity, execution classification, disposition, dependency assurance, ordered reasons and stale causes. A shared native action planner independently derives validity from retained provenance and cross-checks every output against Salsa.
plan_actions returns the same ordered dispositions, identities, assurance and reasons without causal path vectors; plan expands all stale paths in their original order, and explain_artifact expands one current output. See planning and identity contracts. Detailed calls preflight the complete causal model against an explicit budget (16 MiB by default) before allocating path vectors.
Oversized calls fail with a typed explanation-budget error; successful calls remain complete and deterministically ordered. Lightweight actions do not consume that budget. Computation and artifact paths distinguish different outputs from one computation.
record returns an immutable historical record; artifact_status separately reports whether that artifact is current and valid, current and stale, or superseded. All status and plan results are point-in-time snapshots.
Execution Classification and Planning
The host supplies an ExecutionKind at invocation start. begin and begin_with_strategy default to execution kind Unknown, so their output plans block. Use begin_with_execution or begin_with_strategy_and_execution for a known classification. Once a computation ID has a successfully registered output, its classification cannot change; use a distinct ID for different semantics. Classification is a trusted host assertion. It does not establish that an operation is safe, idempotent, authorized or actually executed.
| Execution Kind | Current - context valid | Context Stale |
|---|---|---|
| Unknown | Block | Block |
| Deterministic | Reuse | Recompute |
| Read-only observation | Reuse | Refresh |
| Probabilistic reasoning | Reuse | Block by default; Recompute only when PlanPolicy.allow_probabilistic_recomputation is set |
| Side-effecting operation | Reuse the historical artifact | Block |
| Irreversible operation | Reuse the historical artifact | Escalate |
| Human decision | Reuse the historical artifact | Revalidate |
Reuse refers to context freshness of the recorded artifact; it does not prove an external effect occurred, remains in effect, or authorizes future actions. A stale step blocked by its own semantics retains a reason explaining why. A dependent output whose direct prerequisite disposition is Block, Escalate or Revalidate becomes Block, with an ordered PrerequisiteNotReady reason identifying the current prerequisite artifact and disposition.
This propagates transitively. A stale irreversible step remains Escalate even when it has blocked prerequisites; its reasons include both the escalation and prerequisite conditions. Stale deterministic, read-only and permitted probabilistic prerequisites are ordered before dependent work but have not yet run.
The plan describes eligibility and dependencies only; it does not execute, authorize or guarantee that a later operation is safe.
Separate probabilistic attempts can produce different outputs from identical captured inputs; both completed execution records remain immutable. Every replacement advances its output generation regardless of output bytes and invalidates consumers of the earlier artifact. No textual or semantic output-equivalence policy is inferred.
Boundaries and Limitations
- Host execution and source observation occur outside Co2's lock. Unreported changes, out-of-order version reports, omitted accessible inputs, incorrect developer declarations, mismatched source values, and external effects can defeat assumptions. Co2 cannot create a transaction across resource owners or authorize an effect.
- Probabilistic results are represented as host-supplied records; no LLM invocation, model integration, automatic execution, general policy engine or framework adapter is part of the core. Optional framework adapters consume the public SDK.
Recomputeis never permission to replay side effects. Co2 cannot stop the host from executing an operation outside the planner. - Default authorities are in-memory; optional local durable authorities provide owned recovery/reconciliation under the boundary below. Abandonment and collection do not cancel external work. No distributed synchronization is provided.
- The same mutex prevents concurrent access to the private Salsa database; no general claim is made about Salsa worker cancellation. Lock poisoning fails closed. Project licensing is recorded in LICENSE and NOTICE.
Python SDK Boundary
The co2 package calls the existing Rust authority through a private PyO3 extension; Python dataclasses and enums are immutable translated snapshots. It does not duplicate the engine, provenance, registration or planning logic and exposes no Salsa handles. Each authority is a separate Arc-owned Rust instance; scoped contexts retain the same instance. On standard CPython the bridge detaches from the GIL during core operations; the core mutex still serializes shared-instance access. Explicit close invalidates all shared references; optional durable operation uses the same Rust authority. Process sharing and free-threaded Python are unsupported. See SDK guide.
Optional LangGraph Boundary
The optional adapter in co2.integrations.langgraph uses the public Co2 SDK from ordinary LangGraph node functions. LangGraph retains node execution, parallelism, retries and explicit routing. Each adapter is bound to one graph thread and one live UUID namespace; the host supplies source versions and the complete accessible input set.
The adapter creates unique attempts/artifacts, refuses automatic human/effect/unknown execution and returns Co2 plans and records. A graph checkpoint is not a Co2 snapshot; cross-process restore, checkpoint rollback and inconsistent or mismatched graph artifact bindings are rejected rather than reconstructed. Quiescent snapshot validation is host-invoked and is not atomic with LangGraph or external sources.
See integration guide.
Optional Model Execution Experiment
The synthetic lending application adds an optional OpenAI provider behind an application-owned protocol, not to the core or SDK. LangGraph callbacks supply structured synthetic inputs and publish validated probabilistic outputs through the existing adapter. Prompts, schemas, model configuration and accessible inputs are versioned host resources; the recommendation depends on both assessment artifacts.
Co2 maintains the authoritative provenance and atomically rejects reported changes during inference. The host explicitly enables probabilistic recomputation and routes work; simulated human and irreversible records are never replayed. The untrusted and runtime-observed fallbacks remain unchanged.
The experiment guide records its host assertions, comparison method, measured results and limits; No semantic equivalence or provider isolation is inferred.
Optional OpenAI Agents SDK Boundary
The optional OpenAI Agents SDK adapter maps a host-named agent, each asynchronous SDK run and each successful result to a session-namespaced computation, attempt and immutable Co2 artifact. The host reports complete invocation inputs and versions, handles routing and consumes Co2 plans. The first supported boundary is static, tool-free, handoff-free and single-turn; it does not sandbox agent/model code or automatically execute effects. SDK tracing does not establish dependency completeness, and RuntimeObservedFallback remains unchanged. Co2's engine, provenance and atomic registration are unchanged. See integration guide.
Optional Google ADK Boundary
The optional Google ADK adapter creates a fresh in-memory ADK session per Co2 attempt and records a host-supplied, explicitly versioned session-state snapshot alongside all other accessible inputs. It maps each successful bounded ADK invocation to an immutable Co2 artifact, exposes plans and relies on existing atomic registration. ADK session state and event history are not the Co2 authority; session restoration, implicit history, state mutations, persistence and cross-process recovery are unsupported. The host controls routing and source versions. RuntimeObservedFallback remains unchanged. See integration guide.
Optional Claude Agent SDK Boundary
The Claude adapter maps each explicitly requested bounded SDK/CLI execution to a Co2 computation, attempt and immutable artifact. A private per-attempt worker supplies a clean process environment and fresh working/home/config directories, while the public Claude SDK controls its bundled CLI. Explicit tools, setting sources, session, turn, time and budget options bound the supported cooperative path; init and terminal messages are validated before atomic Co2 publication.
SDK configuration and subprocesses do not prove runtime isolation. Retained built-in registries and managed settings remain explicit host assumptions, and RuntimeObservedFallback is unchanged. No dependency engine or existing public domain contract changed.
See guide.
Atomic Local Evidence Admission
The optional runtime-provider integrations enroll approved, versioned local profiles through an explicit authority-owner facade. Wasmtime/runtime-specific execution code lives in the optional provider crate; the native catalog and Python integration install/invoke it; the private dependency engine interface is unchanged. The base SDK does not install Wasmtime.
The Provider Host invokes reviewed native implementations. The Wasmtime provider executes a compiled-in trusted embedding. A Rust broker copies/delivers immutable captured inputs and records execution-phase accesses, including initialization reads. Native sealing is available only on successful approved execution; Python cannot upload manifests or call a finish/assurance setter. The core's feature-gated, doc-hidden glue remains privileged host implementation detail; the provider SPI is defined separately. Malicious host code or compromised providers remain outside this local trust model.
Admission holds the existing mutex across enrollment/profile/identity validation, full captured-snapshot and graph/generation preflight, artifact/evidence/edge publication and replay-fence consumption. Effective edges narrow only after that full-snapshot check. Workload, profile and provider controls are always dependencies and use the protected \0co2-control: resource namespace. Re-enrollment/configuration/profile changes or revocation invalidate historical scoped outputs. Registration keeps immutable evidence provenance with the artifact, not an after-commit side table.
Evidence-required attempts cannot use ordinary completion or ScopedContext. A correctly bound failed admission closes the attempt; retries require fresh IDs. Ordinary invocation/structured/runtime-observed paths retain their behavior. Atomicity covers recoverable preflight errors and cooperating in-process calls, not process failure or rollback from engine panics. Source byte/version truth and complete change reporting remain host responsibilities.
Provider SPI 1.0 and Runtime Ownership
Runtime execution/configuration lives in independently owned provider crates. co2-provider-spi defines native source-level contracts; co2-provider-host owns reviewed installation, explicit invocation, broker verification and admission handoff. The Python bridge transports opaque generic handles. Provider-specific factories/profile whitelists live in a separate trusted installer catalog, with all runtime providers disabled in the base build.
Wasmtime and a separate bounded expression interpreter implement the same SPI. The latter uses decimal text, different output lengths and evaluate read labels; generic Core contracts do not encode Wasmtime's eight-byte/lifecycle assumptions. The dependency engine and Salsa interface remain unchanged. No provider-specific selection, runtime configuration or execution is added to Core. Opaque identity bytes include the selected enrollment, workload, mapping and reviewed profile; Core assigns private monotonic versions through full-byte equality.
Only privileged native installations of independently validated boundaries can enter scoped admission. Ordinary Python callbacks, manifests, signatures or completeness flags cannot construct verified execution handles. Providers return output, not dependency lists/assurance levels. A shared broker gate records reads before delivery, latches failures and closes before sealing. Atomic admission still checks the whole captured snapshot and publishes consumed-plus-mandatory dependencies, evidence and fence under one mutex. The current fixed scoped assurance remains local; unverified boundaries retain ordinary runtime fallback.
See provider development guide. SPI 1.0 is a native source contract with explicit trusted code/build review, not a language-independent wire/attestation protocol. Compiled installer wiring is the remaining extension-build coupling; no generic admission or Core changes are needed for a new implementation. The second provider and no-Wasmtime builds validate this boundary.
Coordinate Provider Execution
The Provider Host is the trusted execution intermediary between the Coherence Core and runtime enforcement providers. Implemented in crates/provider-host, it coordinates explicitly requested bounded execution, establishes consumed inputs through a trusted broker and hands successful outputs and native evidence to Core for validation and admission. It is an embedded Rust library component. The application retains orchestration; model-provider integration and infrastructure operation remain outside this component.
The Provider executes. The Provider Host coordinates and establishes execution evidence. The Coherence Core determines validity and authoritatively admits the result.
Also, not every Co2 application needs the Provider Host. Applications using invocation-level or explicit structured dependency tracking can use the Core directly. The Provider Host becomes relevant when enterprises require trusted, runtime-enforced dependency tracking.
[Illustration: Provider Host placement: enterprise applications use the Co2 SDK; Core owns validity and admission, while the Provider Host integrates implemented Wasmtime and expression runtimes through Provider SPI 1.0. Other isolated runtimes remain future possibilities.. View source image]
Conceptual component relationships. The SDK reaches both Core and the Provider Host; the host calls Core during preparation, broker reads, sealing and admission. The image does not prescribe a one-way call sequence.
Assign Responsibilities
| Component | Responsibility | Implementation |
|---|---|---|
| Coherence Core | Owns source generations, full invocation snapshots, dependency provenance, validity, planning, replay fences and final atomic admission; optionally persists authoritative state. | src/store.rs, src/provider_admission.rs, src/persistence/. |
| Provider Host | Owns reviewed installations, the live provider registry, explicit execution coordination, broker lifecycle and native verification handoff. | crates/provider-host/src/lib.rs. |
| Provider SPI 1.0 | Defines provider identity, exact execution profiles, immutable execution intent, broker access and successful output contracts. | crates/provider-spi/src/lib.rs. |
| Runtime provider | Validates and executes the actual workload within an independently reviewed mediation boundary. | providers/wasmtime/, providers/bounded-expression/. |
| Input broker | Delivers captured resource/artifact bytes only through granted handles, records successful consumption in Core and prevents sealing after a recorded broker failure. | AuthorityBroker in the Provider Host; read_local in Core. |
ProviderAuthorityV1 holds an Arc<Coherence> and a separate live registry of enrolled implementations. Clones share that registry; a new facade starts with an empty one. Core enrollment metadata and revocation floors do not substitute for this live installation registry. Durable restart restores metadata and historical evidence but never recreates implementations, native verification credentials or live execution handles. The owner must explicitly re-enroll reviewed providers or revoke them before recovery readiness completes.
Ordinary invocation-level and structured-declaration applications can use Coherence directly. A Provider Host becomes relevant when the application explicitly requests execution through a reviewed runtime enforcement provider. Existing agent framework adapters do not automatically enter this path or acquire stronger assurance from framework callbacks.
Bind Executions and Capture Consumption
Installation is an authority-owner trust decision. ReviewedInstallationV1::install checks SPI compatibility and exact reviewed profiles against the implementation's advertised profiles. ProviderAuthorityV1::enroll binds those profiles and provider configuration to Core enrollment controls, then stores the live implementation in its registry. Review strings and constructors describe an independently validated trust decision; they do not themselves prove mediation or protect against dishonest privileged native code.
[Illustration: Provider Host execution stages: prepare context, resolve the runtime, execute through the broker, establish evidence, submit for admission and atomically publish output.. View source image]
Conceptual execution stages. The current API resolves or enrolls the provider before calling prepare; the table below gives the exact method order.
The host then coordinates the following sequence. Provider resolution precedes preparation in the public API because prepare is a method on an enrolled provider.
| Step | Public native entry point | Binding or validation |
|---|---|---|
| 1. Resolve provider | ProviderAuthorityV1::provider | Resolves a live reviewed installation and verifies that its enrollment still matches Core. The caller may also use the enrolled handle returned directly by enroll. |
| 2. Prepare execution | EnrolledProviderV1::prepare | Validates the workload, profile and size limits. Core captures all supplied resource versions, upstream artifact identities and mandatory controls, copies immutable input bytes, and binds computation, attempt, execution and intended output identity. |
| 3. Execute computation | EnrolledProviderV1::execute | Rechecks the enrollment/profile and asks Core to start the prepared run. Invokes the provider through SPI 1.0 with an execution-scoped broker, outside Core's authority mutex. Each broker access re-enters Core validation. |
| 4. Establish evidence | Host broker closure and Core seal_local | Closes the broker after provider completion, surfaces recorded read failures, rejects unsuccessful execution and oversized output, and seals only a successful result. Returns an opaque VerifiedExecutionV1 bound to the prepared execution. |
| 5. Submit for admission | ProviderAuthorityV1::admit | Checks that prepared run and evidence identities match, then delegates to Core. No guest-generated manifest, arbitrary signature or caller completeness flag is accepted as verification. |
| 6. Publish output | Core admit_local and shared publish_outputs | Revalidates enrollment/profile, execution state, the entire captured snapshot, identities, generations and graph. Atomically publishes the immutable artifact, evidence/provenance, effective edges and replay fence; durable mode commits through its existing mutation driver. |
The workload binding includes framed provider/SPI identity, enrollment name, exact profile specification and limits, workload bytes and ordered resource/artifact grant identities. Core tracks this binding through mandatory workload controls; provider and profile controls are also always dependencies. The execution intent identifies the computation, attempt, execution and artifact. Input values are delivered through the broker rather than exposed as an independent intent-value accessor. Actual resource bytes matching their reported source versions remain a host responsibility.
The broker records reads before returning bytes, including initialization-time reads when performed by the approved provider. It rejects access after closure and retains a read failure even if the provider catches the returned error. An unsuccessful execution, caught provider unwind, broker failure or rejected output cannot produce an admitted artifact. The host asks Core to fence failed runs and surfaces failure-fencing errors; retries need fresh identities. Native process aborts and compromised providers remain outside this cooperative local guarantee.
Core publishes ScopedRuntimeEnforced only for this approved admission path. After publication, effective dependencies contain consumed inputs plus mandatory provider, profile and workload controls. Ordinary runtime observation retains RuntimeObservedFallback and the full accessible context. No provider chooses its own assurance classification.
Trace Lending Inputs
Consider an illustrative bank application executing deterministic eligibility logic packaged as a WebAssembly module. It grants five independently versioned context inputs, but the approved computation consumes only three:
[Illustration: Illustrative banking context: income of $140,000, debt of $25,000 and credit score of 780 are consumed; the Melbourne address and 12-year employment history are available but unread.. View source image]
Five inputs are granted and three are consumed. Admission still validates all five captured inputs.
| Available input | Illustrative customer value | Broker consumption |
|---|---|---|
| Annual income | $140,000 | Consumed |
| Outstanding debt | $25,000 | Consumed |
| Credit score | 780 | Consumed |
| Residential address | Melbourne | Not consumed |
| Employment history | 12 years | Not consumed |
The example illustrates dependency selection, not a deployed lending policy or a measured banking workload. The current Wasmtime reference profile grants broker-only eight-byte signed i64 inputs and returns an i64; it does not accept arbitrary business objects or unrestricted WebAssembly applications. An executable version must use matching source snapshots and reviewed numeric encodings, including a versioned identifier for an address, or introduce and independently validate a different profile. The host remains responsible for those source/encoding bindings. See the reference profile contract.
All five captured inputs must still be current at admission. If any changes during execution-even an unread address or employment-history grant-the full-snapshot check rejects the late result. After successful publication, the following decisions apply when each source change is reported separately and every other effective dependency and mandatory control remains unchanged:
| Reported change after publication | Context validity | Deterministic plan disposition |
|---|---|---|
| Residential address changes | Valid: input was not consumed. | Reuse |
| Employment history changes | Valid: input was not consumed. | Reuse |
| Annual income changes | Stale: consumed input changed. | Recompute |
| Credit score changes | Stale: consumed input changed. | Recompute |
| Outstanding debt changes | Stale: consumed input changed. | Recompute |
A provider/profile/workload control change also invalidates the result, even if consumed customer inputs are unchanged. Without admitted scoped evidence, ordinary invocation/runtime-observed tracking retains all five captured inputs and conservatively invalidates on any of their changes. Trusted developer declarations provide a separate assertion-based narrowing strategy; they do not acquire runtime-enforced assurance.
A Recompute disposition describes eligibility for new work. The application decides whether to invoke it. Human decisions, side effects and irreversible operations retain their existing revalidation, block and escalation semantics; this deterministic reference-provider path does not authorize those operations.
Evaluate Enterprise Providers
| Provider shape | Potential enterprise use | Current Co2 status and boundary |
|---|---|---|
| WebAssembly runtime | Isolated business rules, validation functions, eligibility calculations and deterministic transformations. | Implemented restricted Wasmtime reference provider with broker-only i64 access, approved imports/exports and bounded execution. Broader workloads require separately reviewed profiles. |
| Enterprise expression engine | Pricing calculations, financial rules, risk assessments and controlled decision logic. | Implemented bounded expression reference interpreter: checked i64 constants, reads, addition, multiplication and conditional branching. It demonstrates independent mediation and SPI substitutability; it is not a general enterprise rules or pricing engine. |
| Sandboxed Python runtime | Controlled enterprise data processing, feature engineering and analytical workloads. | Potential future provider; not implemented. Requires independently validated input mediation and execution-bound evidence. |
| MicroVM-based execution | Isolated workloads with controlled enterprise-context access, potentially using externally owned infrastructure such as Firecracker. | Potential future provider; not implemented. Requires additional integration, independently validated mediation and operational ownership outside Co2. |
Isolation alone does not establish dependency completeness. A future provider must show how all accessible semantic inputs are mediated and bound to the execution/output, and identify residual host/provider assumptions. These examples do not extend SPI 1.0 into a remote protocol or imply support for generic attestation, arbitrary Python callbacks, remote model state or distributed recovery.
Embed Runtime Components
An illustrative enterprise deployment can place the application, embedded Co2 SDK/Core, Provider Host and optional Wasmtime runtime in one application pod within a Kubernetes cluster. The Provider Host runs within the application process; it does not require another network service. The current Wasmtime implementation also requires its pinned Python runtime dependency, while the independent expression implementation does not. Enable only the required native provider features and runtime packages.
The Kubernetes/Linux arrangement is a conceptual deployment example, not a validated platform claim for these providers. Reference integrations have been exercised on macOS ARM64 and native Linux ARM64/x86_64. Durable authorities support the narrowly qualified macOS ARM64/local APFS and Linux ARM64 or x86_64/glibc/qualified ext4 configurations; other deployment targets require independent validation.
Any enterprise rollout must independently validate its runtime/profile/environment and retain host responsibility for resource versions, review, execution routing and external outcomes. See provider setup and platform limits and durable requirements.
Keep Runtime Selection Outside Core
| Direct runtime coupling | Provider Host separation |
|---|---|
| Core depends on Wasmtime. | Core remains runtime-neutral; optional provider crates own runtime dependencies. |
| Adding a runtime requires modifying Core execution code. | New implementations use SPI contracts plus reviewed native installation/build wiring outside generic Core admission. |
| Execution and validity responsibilities overlap. | Providers execute, the host coordinates broker-bound evidence, and Core validates and publishes. |
| Runtime-specific configuration accumulates in the authority. | Implementations and exact reviewed profiles own their runtime configuration. |
| Implementations evolve together with domain logic. | Independent providers can implement the same versioned source contract, subject to matching builds and owner review. |
Providers execute. The Provider Host coordinates and establishes broker-bound evidence. Core determines validity and authoritatively admits results. Co2 owns neither sandbox infrastructure nor application scheduling. For concrete extension and installer contracts, see provider development; for source navigation, see repository ownership.
Lifecycle Boundary
The authority exposes configurable retention, explicit abandon/collect, issued identities, capacity errors and lifecycle/engine statistics. Collection runs under the existing mutex and preserves current artifacts plus active/full transitive historical snapshots. Private terminal provider runs and unreachable records can be reclaimed without forgetting replay protection or generation/revocation floors.
Managed identities use compact counters/outstanding reservations; new_identities preflights and reserves an ordered typed bundle atomically, while existing individual APIs remain. Legacy accepted IDs use a capped ledger. The fully specified bounded preset rejects further work at capacity, including when required history pins records.
Default behavior remains unlimited with reclamation disabled.
Salsa is rebuilt from authority-owned captured generations during collection; its private ingredient/memo measurements and process RSS are reported separately from logical payload accounting. No provider-specific engine logic, SPI 1.0 change, execution scheduler is introduced by lifecycle management. Framework failures/cancellations abandon snapshots; ADK additionally supports explicit obsolete-session cleanup and optional session/ledger/byte caps. Caller-held handles, external histories and arbitrary trusted runtime resources remain outside Core's retention bound. See inventory and correctness contract.
Durable Storage and Recovery
Default authorities use memory. The optional persistence-sqlite feature enables owned local SQLite create/open/close, atomic recovery, boot-local source/provider reconciliation, labelled history and explicit compaction. The Python bridge forwards its explicit native persistence build feature; default wheels remain SQLite-free. Supported native storage is macOS ARM64/local APFS or Linux ARM64 or x86_64/glibc/qualified ext4 with controlled paths; the durable Python runtime is standard GIL-enabled CPython 3.14. See the durable authority contract.
Every authority mutation still uses one driver and the original domain rules under the same mutex. SQLite writes complete changed domain sections and the metadata/global image digest; it still reads, checksums, decodes and validates the entire old image inside the transaction. Unchanged sections are retained only after that validation and exact cached-image binding.
Schema 1, record codec 2 and identity codec 2 are unchanged. Durable candidates own their mutable state; immutable records can share read-only ownership without changing public record snapshots or persisted bytes. Graph-affecting candidates reconstruct a private engine.
A typed lifecycle-only path exposes only lifecycle state and authority identity to its internal closure, uses an owned empty engine during preparation, then transfers the original engine only after known commitment; one transaction binds the exact old image, lineage/revision, records/provenance, generations and replay changes before installation/acknowledgement. Source/generation truth remains host-supplied. Native execution, installers and registries stay outside Core; no scheduler, storage plugin SPI or second planner is added.
Exclusive cooperative ownership is acquired before creation/recovery. Canonical paths, file/sidecar identities, process-scoped POSIX locks and a same-process registry reject competing owners and unsafe links/layouts. Process checks precede authority mutexes; inherited SQLite/Salsa state is not used or destroyed in fork children. Close invalidates every retained context/provider/adapter reference and releases ownership without waiting for those references to disappear. Uncertain commits or installation failures fault the authority; close and a newly recovered instance are required.
Recovery restores the stable namespace, advances boot/revision, burns reservations, abandons pending attempts and marks unfinished native journals interrupted in one transaction. It rebuilds Salsa with captured resource and artifact generations. It never restores native credentials, grant/output buffers, runtime installations or Salsa internals. Stored evidence remains immutable history. Active provider metadata needs reviewed re-enrollment or explicit owner revocation; mandatory controls advance and old-boot handles reject.
Before readiness only labelled history/diagnostics and required administration are allowed. Every registered external source must be explicitly reconciled; even equal labels advance generation. Confirmations are boot-local and do not survive another restart. Owned controls are not external sources. Missing sources/provider decisions keep the gate closed. There is no continuity shortcut, automatic execution or framework checkpoint/session restoration.
Logical collection retains full reference closure and all replay/generation/revocation floors. Physical compaction is explicit and serialized; observed file sizes/headroom are diagnostics, not complete disk quotas. Record codec 2 upgrades valid prior durable codec-1 images during recovery, preserving schema 1 and identity codec 2; unsupported/corrupt storage is never reset. Backup rollback, cloned lineages, raw same-file SQLite access, hostile administrators, untested platforms and power-loss/VFS guarantees are outside the supported boundary.
Continuous Integration
The CI entry workflow runs on pushes to main and on pull requests. A standard-library path detector selects the affected suites and their shared/transitive consumers, then calls seven existing reusable workflows. Manual runs and release qualification run every suite. A full routine run has 14 validation jobs plus detection and the final CI gate; a documentation-only change runs packaging checks plus those two lightweight jobs. No workflow-level path filter can leave the required gate pending.
| Workflow | Purpose and checks | Python matrix |
|---|---|---|
| Rust core | Checks Rust formatting, rejects Clippy warnings, runs default-feature Core tests and executes the selective-planning example. | Not required |
| Python SDK | Checks Rust/bridge formatting and bridge Clippy; runs default and provider-admission Core tests, provider-host tests and expression-provider tests; builds and installs a base wheel; checks dependency consistency, SDK behavior, Rust/Python parity, the lending example and Python types. Verifies the base installation has no LangGraph, Wasmtime or compiled runtime providers. | 3.11, 3.12, 3.13, 3.14 |
| LangGraph integration | Installs the optional LangGraph extra, runs integration tests, the synthetic lending graph and mock LLM tests, and checks SDK/integration Python types. | 3.11, 3.14 |
| OpenAI Agents SDK | Installs only the OpenAI Agents optional extra and runs its framework-specific suite. | 3.11, 3.14 |
| Google ADK | Installs only the Google ADK optional extra and runs its framework-specific suite. | 3.11, 3.14 |
| Claude Agent SDK | Installs only the Claude Agents optional extra and runs its framework-specific suite. Live provider and actual CLI tests retain explicit opt-in guards. | 3.11, 3.14 |
| Release artifacts | Stages the reviewed source allowlist, runs adversarial archive tests, builds and audits source/base-wheel artifacts with native path remapping, and executes the clean installed quickstart. No upload. | 3.14 |
Framework suites live under agent_frameworks_tests/, with independent discovery paths and optional dependencies. See test commands.
Routine CI runs for pull requests and pushes to main. Feature-branch pushes use their pull-request run, avoiding duplicate push/PR validation. The merged main commit still receives its own exact-commit validation, which publishing requires. Branches without a pull request can use manual CI.
Use CI as the required status check, rather than conditional matrix jobs. It always runs for these events, accepts deliberately unselected suites, and rejects failed, cancelled or skipped selected suites and mismatched source commits. Unknown paths, unavailable comparison history, initial pushes and manual runs conservatively select all suites. Git diffs cover the complete push range or pull-request merge base, including deleted/renamed paths, without GitHub's path-filter file-count truncation.
| Changed boundary | Routine validation selected |
|---|---|
| Public documentation, assets, notices or release inventory | Artifact/source packaging checks |
| Rust Core or root Cargo configuration/lock | All suites |
| Descriptive package metadata only | Artifact/source packaging checks |
| Python bridge, native provider contracts, shared SDK, package identity, dependencies or build configuration | SDK, every framework and artifacts |
| One framework adapter, its tests or example | That framework and artifacts; LangGraph adapter changes also select SDK type checks |
| SDK tests or shared lending/quickstart examples | SDK, LangGraph type checks and artifacts |
| LLM example/tests or shared Python test requirements | LangGraph mock tests and artifacts |
| Release tools or one workflow | Their consuming suite(s) and artifacts |
| CI routing or an unclassified input | All suites |
Descriptive metadata means only project.readme, description, classifiers, urls, authors, maintainers and keywords. The detector parses both committed pyproject.toml snapshots and compares everything else, including types. Package name/version, Python requirements, dependencies, optional extras, build backend, Maturin features and unknown fields retain all Python consumers. Missing or malformed snapshots cannot claim this exception. Other changed files still contribute their own consumers.
The detector's representative tests run before selection on every CI event. Maintain its consumer map when adding imports, build inputs or workflows. Superseded push/PR runs are cancelled within their own workflow/ref group. Manual candidate and publishing concurrency groups remain non-cancelling; a candidate's nested full CI has a distinct caller group and cannot be cancelled by routine pushes.
Routine workflows cover default in-memory builds and the listed optional integration checks. The manually dispatched candidate workflow additionally configures native feature variants, compiler checks, dependency audits and durable/provider regressions on hosted macOS/APFS. The public base candidate uses only GitHub-hosted runners; Linux durable storage qualification remains separate from publishing the SQLite-free base SDK.
Qualification and publication require administrator-owned manual dispatch verified through GitHub, including current permissions of original and rerun actors. Environments restrict deployment to the exact main branch; workflow editors remain within the trusted publishing boundary. The live cargo-deny 0.22.2 advisory/licence/source checks run in that manual candidate workflow, not on an ordinary push. Every candidate calls full CI at its own source commit before assembly, regardless of routine path selection. Its 32 required jobs include the original 16 candidate jobs and all 16 unfiltered CI jobs. Publication additionally requires the latest successful push CI for that same commit; filtered routine success never substitutes for full candidate coverage. Workflow configuration alone does not establish a passing platform result.
The durable build and operational contract is documented separately.
Check Contracts and Configurations
Bound Native Validation
The private Salsa adapter verifies current query prerequisites in iterative postorder before asking Salsa for the final validity result. Revision-scoped scheduling markers contain no validity values. This bounds query execution and lazy memo-verification stack depth without replacing Salsa, bypassing provenance checks or imposing an arbitrary graph-depth limit. Collection and recovery reconstruct the same adapter with an empty schedule. Graph traversal, authority state and complete explanations still require heap memory; see tested workloads and limits.
Review Release Contracts
- Installation and native variants
- Known limitations
- Security policy
- Contribution guide
- Proposed release notes
- Changelog
Native x86_64 storage qualification uses a dedicated EC2 EBS-backed ext4 volume. It validates the existing single-owner/process-crash recovery contract and does not establish local physical-media or power-loss guarantees. Co2 does not create mounts, provision EC2 resources or own the validation environment. Manual SSH qualification does not imply that GitHub candidate CI or protected-environment configuration has run.
Promote Reviewed Artifacts
The manual publisher workflow consumes one sealed base candidate from candidate qualification. The candidate retains the existing source/memory/native/audit gates and adds final source-bound assembly; native feature wheels remain private. Publication checks exact distribution metadata, source inventories, run/attempt identity, complete jobs, hashes and expiry without rebuilding.
TestPyPI upload and its complete 12-job clean-installation matrix precede production. Production requires administrator-owned dispatch with publish_to_pypi=true and main-only environment restrictions; actor permissions and source/artifact bindings are rechecked before upload. Only the two publishing jobs receive OIDC write permission; no persistent PyPI API token is used. Pinned PyPA publishing generates publish attestations, distinct from independent compiler/build attestation. No automatic push/tag publisher or release creation is introduced. See distribution contracts and release security.

