Skip to content

Capability-driven just-in-time cognition

Status: canonical implemented architecture layer.

Principle and terminology

AncientOS treats context as a runtime dependency, not a giant static system prompt. The stable runtime prompt retains constitutional identity, governance, memory, and transport invariants. Specialized operational knowledge is supplied as an ephemeral request layer only after the active capability or workflow is known.

This implementation adopts four terms:

  • Cognition Package: repository-owned, versioned metadata plus inert model-facing Markdown.
  • Cognition Contract: the cognition_requirements references on a Rubick capability. Rubick owns these references, not package prose.
  • Cognition Resolver: deterministic capability and package dependency traversal.
  • Cognition Assembler: deterministic rendering of the selected package set as a request-scoped model context layer.

The three conceptual graphs remain distinct. Rubick describes the capability graph. Runtime and provider records describe operational dependencies. Cognition contracts and package requires edges describe what the model must know. They share IDs and resolution points but are not competing authority graphs.

Runtime flow and boundaries

Once workflow decomposition provides capability IDs, the resolver reads only their cognition references from Rubick, traverses package dependencies, rejects missing or cyclic graphs, deduplicates shared dependencies, and emits a stable dependency-first package order. Capability scope and whole-workflow scope are both supported. Phase-specific callers can resolve each step independently to avoid loading later mutation cognition during an earlier observation phase.

The assembler emits a separate [TASK-SPECIFIC COGNITION] system layer between the constitutional runtime context and request/conversation messages. It records package versions, provenance, content hashes, selection reasons, dependency edges, an assembly hash, characters, and a deterministic token estimate. No global active-package state exists. Immutable package parsing may be cached in future, but semantic task state must remain request-scoped.

Context layers are:

  1. constitutional and system invariants;
  2. active task and bounded conversation state;
  3. resolved runtime evidence;
  4. task-specific cognition packages;
  5. capability and provider interface contracts;
  6. the model request.

The current conversational inference integration represents layers 1, 4, and 6 explicitly; existing session and governed retrieval paths provide layers 2 and 3. Capability/tool interfaces remain owned by their existing adapters.

Package contract and trust

Packages live under cognition/<id>/ as cognition.yaml plus context.md. Metadata requires stable ID, version, description, owner, source, status, schema version, and optional dependencies, priority, and tags. Content hashes cover a canonical metadata serialization plus Markdown. Packages are trusted local Git assets: user input cannot create them, the registry performs no network fetch, and packages contain no executable code.

Code, governed registries, Runtime Composition, and canonical architecture documentation remain authoritative. Cognition summarizes those sources for a model and is never an alternative governance, evidence, configuration, or memory authority.

Governance invariants

Cognition is advisory only. Package metadata rejects authority, approval, executor, permission, and Zeus-evidence fields. The assembled layer explicitly states authority: advisory_only. Resolution cannot mutate Rubick posture, create a proposal or approval, call an executor, widen an allowlist, or record a Zeus receipt. Lich remains exact-action approval authority; governed executors remain the only mutation boundary; Zeus remains evidence authority; LifeVault remains memory authority.

Determinism, conflicts, and failure semantics

Roots and dependency edges are sorted, shared dependencies collapse, and a depth-first dependency-first traversal produces stable output. Missing capabilities, packages, content, and dependencies fail closed. Cycles report the explicit cycle path. Duplicate package IDs and malformed metadata fail loading.

The layer does not claim semantic contradiction detection. Package ID, version, source, boundaries, ordering, and hashes remain visible so a future validator can compare claims without adopting a loose last-prompt-wins rule. Dependency order establishes prerequisites, not authority or textual precedence.

Initial packages and limitations

The initial reusable set covers governed-action preconditions, governed mutation, filesystem semantics, configuration editing, Spectre terminal observation, Home Assistant light state, Keeper task semantics, and Oracle proposal semantics, plus host resource interpretation. Only selected existing Rubick capabilities declare these contracts; migration of the wider portfolio is intentionally incremental.

The runtime interface requires resolved capability IDs. Existing routes that do not yet expose a capability set continue without task cognition. Governed host resource questions now resolve capabilities at the common conversational runtime boundary for Web, Discord, and Terminal before evidence collection and cognition resolution; transport adapters contain no resource-selection logic. This does not yet make extraction universal for every capability portfolio entry. Resolution metadata is available to Oracle as read-only inspection and on governed runtime-inspection results, but cognition identity is not yet persisted in universal Kernel Records or Zeus replay records.