Documentation / Core concepts

03 - Understand

Explore documentation · Previous: 02 - Get started · Next: 04 - Build

Connect information to results

A lending application reads a customer status and credit history, produces assessments, then combines them into a recommendation. Co2 represents that relationship with a small set of contracts:

Business exampleCo2 conceptMeaning
Customer status in a source systemResourceA stable source identity registered by the host.
Status revision active-v1Resource versionAn opaque host-supplied label bound to the actual source data.
Captured status revisionObservationResource identity, version and authority-owned generation.
Eligibility assessmentComputationStable logical work, with one or more named output slots.
A particular assessment runExecution attemptA unique captured invocation that may succeed, fail or be abandoned.
Completed eligibility valueArtifactImmutable bytes with computation, output and attempt identity.
Inputs available to that runCaptured contextThe full resource/artifact snapshot supplied by the host.
Inputs retained for future validityEffective dependenciesThe edges selected by the dependency strategy and assurance.
How those edges were selectedProvenanceImmutable declarations, observed reads, effective dependencies and admitted evidence where present.

Co2 keeps generations as well as version labels. A reported A→B→A change cannot make an old in-flight result appear current. Re-registering the same current version is unchanged; changing the actual data without changing/reporting its version violates the host contract.

Artifacts represent executions, not mutable cache values. Even equal output bytes from a replacement produce a new artifact and output generation. Downstream work captured against the prior artifact becomes stale. Historical provenance is unchanged; retained history does not imply current validity.

Follow direct and transitive changes

flowchart LR
    S[Customer status] --> E[Eligibility]
    H[Credit history] --> C[Credit]
    E --> R[Recommendation]
    C --> R
    R --> A[Human approval]
    A --> F[Irreversible funding record]

Status directly affects eligibility and transitively affects recommendation, approval and funding. Credit can remain valid when its accurate dependency contract excludes status. A new eligibility artifact also invalidates consumers of its predecessor, regardless of whether its bytes happen to be equal.

Co2 returns outputs in deterministic dependency order. A multi-output computation can retain one valid slot while another is invalidated. Replacement declarations/observations replace the affected slot's dependencies; stale historical edges do not silently remain current.

Choose dependency confidence

StrategyLending useAssurance and cost
INVOCATION_LEVELAn assessment may use everything the host supplied.Default: retain the complete captured set. Conservative, with no dependency-narrowing assertion.
EXPLICIT_STRUCTUREDTrusted deterministic code produces separate status and credit outputs.A complete developer declaration may narrow each output. Incorrect trusted assertions can make reuse unsound.
RUNTIME_ENFORCEDA reviewed bounded computation reads inputs through a trusted broker.Ordinary host reads keep RUNTIME_OBSERVED_FALLBACK; only reviewed native provider admission can establish SCOPED_RUNTIME_ENFORCED.

Developer-declared and LLM-declared dependencies have different trust. Missing declarations, untrusted LLM declarations and declarations omitting observed inputs retain the full snapshot with a corresponding fallback assurance. Unknown/inaccessible or malformed references reject. Co2 cannot detect an unobserved omission in an otherwise trusted developer assertion.

ScopedContext records resource/artifact reads but does not isolate Python code from files, environment, network or closures. Framework state and callbacks do not establish completeness. All framework adapters retain this conservative boundary.

Reviewed providers supply a narrower execution boundary. A trusted broker captures consumed inputs; native verification binds the execution and output. Subsequent validity uses consumed inputs plus mandatory provider, profile and workload controls. The host, reviewed implementation, source byte/version binding and operating environment remain trusted. Provider assurance does not cover arbitrary host code, remote model state or model quality. See SPI and provider trust.

Separate publication from later reuse

Publication always revalidates the entire captured invocation snapshot, including granted-but-unread inputs and inputs excluded by a trusted declaration. Output identities, generations, declarations and the prospective dependency graph must all pass before any output in a batch is published.

Only after successful publication does the effective dependency set determine later invalidation. Thus an unread resource changing during execution rejects a result; that same change after publication may permit reuse under a valid narrowed contract. This distinction preserves conservative late-result rejection.

Separate freshness from execution eligibility

A human approval can become stale; that does not turn a human decision into replayable code. The host classifies work when it begins. Co2 combines validity, classification, explicit policy and prerequisite dispositions:

ExecutionKindValid contextStale context
UNKNOWNBLOCKBLOCK
DETERMINISTICREUSERECOMPUTE
READ_ONLY_OBSERVATIONREUSEREFRESH
PROBABILISTIC_REASONINGREUSEBLOCK by default; RECOMPUTE only with explicit policy.
SIDE_EFFECTING_OPERATIONREUSE recorded artifactBLOCK
IRREVERSIBLE_OPERATIONREUSE recorded artifactESCALATE
HUMAN_DECISIONREUSE recorded artifactREVALIDATE

A dependent output cannot automatically proceed past prerequisites needing blocking, revalidation or escalation. Stale irreversible work retains escalation even with blocked prerequisites. REUSE of a historical effect record does not prove that an external operation occurred or authorize another operation.

PlanPolicy(allow_probabilistic_recomputation=True) explicitly permits stale reasoning to be classified for recomputation. It does not make reasoning deterministic, authorize effects or prove equivalence. Identical model inputs can yield different immutable results.

Inspect decisions at the right detail

Use plan_actions() for routing dispositions and ordered reasons without expanded causal paths. Use explain_artifact(id) for a current output's complete causes or plan() for all detailed causes. Detailed calls have a default 16 MiB explanation budget and reject oversized results without partial detail. That budget is not a process-memory limit.

Plans are point-in-time snapshots. They do not reserve source revisions, schedule work, implement permissions or guarantee external consistency. The host must check again when publishing and handle any later change before actual use. See planning contracts and API signatures.

Assign application responsibilities

The host supplies complete accessible inputs, values matching honest ordered source versions, accurate execution kinds and any trusted dependency declarations. It owns execution, retries, cancellation, authorization, external outcomes and framework session consistency. Co2 owns atomic artifact publication, immutable provenance, validity and deterministic planning within its supported authority boundary.

Default authorities are in-memory. Optional durable recovery retains domain state but requires source/provider reconciliation and creates no framework checkpoint recovery or restored provider trust. Continue with operational choices when results must outlive a process.

Terms

a host is the application embedding Co2; an authority is one Co2 instance that owns coherence decisions; a snapshot is the captured set of input identities/versions; invalidation means reported changes make current context stale; recomputation is a new host-run execution; assurance describes the basis for dependency selection, not task correctness. Formal fields and enumerations appear in the API reference.