The 8
Primitives

Everything in CFS is built from 8 building blocks. Simple enough to understand, powerful enough to build anything. This page explains each primitive in depth.

01

Record

The atom of context

Definition

A Record is a stable identifier for any entity in the context plane. Records are the nodes in your context graph - the things that exist and persist.

Why it matters

Without stable identifiers, you can't have reliable references. Records give everything in your context plane an address that doesn't break when names change or systems migrate.

Properties

  • record_id — Globally unique, stable identifier
  • labels — Type classification (person, service, doc)
  • props — Key-value attributes (name, status, metadata)
  • created_at — System time of creation
  • tenant_id — Isolation boundary

Examples

person:ryan-hunter-7f3a

A human identity with preferences, history, context

service:api-gateway-prod

A running service with deps, owners, runbooks

doc:arch-decision-0042

A document with content, citations, approvals

Invariants

  • Record IDs are immutable once created
  • Records can be versioned but never deleted (append-only)
  • All records belong to exactly one tenant
03

View

Permissioned projections

Definition

A View is a policy-filtered projection of context. Different consumers see different slices of the same underlying data, based on their identity and the policies that govern access.

Why it matters

Not everyone should see everything. Views let you share context safely: engineering sees code, sales sees customers, agents see only what they need. Same source of truth, appropriate visibility.

Properties

  • view_id — Identifier for this projection
  • base_query — What records/links are included
  • field_mask — Which properties are visible
  • policy_refs — Policies that govern access
  • refresh_mode — Live, cached, or snapshot

Examples

view:eng-services

All services with code, deps, owners - for engineering

view:exec-summary

High-level metrics and decisions - no implementation details

view:agent-support

Customer context for support agent - minimal disclosure

Invariants

  • Views never expose more than the base data allows
  • Every view access is logged with the consumer's identity
  • Views compose: a view can be derived from another view
04

Tool

Safe, scoped actions

Definition

A Tool is a scoped action that agents can invoke. Tools have explicit permissions, defined inputs/outputs, and audit trails. They're not "do anything" - they're "do this specific thing with these constraints."

Why it matters

AI agents need to act, not just read. Tools make that safe: explicit capabilities, minimal privilege, full audit. An agent with a tool grant can do exactly what's permitted - nothing more.

Properties

  • tool_id — Unique identifier for the tool
  • input_schema — What parameters it accepts
  • output_schema — What it returns
  • required_permissions — What grants are needed
  • side_effects — What state it modifies
  • audit_level — How actions are logged

Examples

tool:create-ticket

Create a ticket in the issue tracker with given fields

tool:query-metrics

Read metrics for a service within a time window

tool:propose-change

Suggest a context update for human review

Invariants

  • Tool invocations require valid capability grants
  • Every invocation produces a receipt
  • Tools cannot exceed their declared side effects
05

Receipt

Immutable audit trail

Definition

A Receipt is an immutable record of an action or access. Every read, every write, every tool invocation produces a receipt. The audit trail is append-only and tamper-evident.

Why it matters

Without receipts, you can't answer "who saw what?" or "what happened?" Receipts replace tribal memory with verifiable history. Compliance, debugging, accountability - all become possible.

Properties

  • receipt_id — Unique, immutable identifier
  • actor — Who performed the action (human, agent, system)
  • action — What was done (read, write, invoke, approve)
  • target — What was affected (records, views, tools)
  • timestamp — System time of the action
  • context — Why it happened (request ID, session, intent)
  • integrity — Hash for tamper detection

Examples

receipt:alice-viewed-customer-7f3

Alice accessed customer record at 14:32 UTC via support view

receipt:agent-created-ticket-892

Support agent created ticket with these parameters

receipt:system-backfilled-metrics

Background job ingested historical metrics for Q3

Invariants

  • Receipts are append-only - never modified or deleted
  • Receipts form a merkle chain for tamper evidence
  • Every mutation to the context plane produces a receipt
06

Policy

Machine-checkable rules

Definition

A Policy is a declarative rule that governs access and behavior. Policies define what views expose, what tools permit, and what conditions must hold. They're machine-checkable and auditable.

Why it matters

Rules in docs get ignored. Policies in code get enforced. By making constraints explicit and machine-checkable, you get consistent enforcement without relying on human vigilance.

Properties

  • policy_id — Unique identifier for the policy
  • effect — Allow or deny
  • principal — Who the policy applies to
  • resource — What records/views/tools it governs
  • condition — When it applies (time, context, state)
  • priority — Resolution order for conflicts

Examples

policy:eng-reads-code

Engineering role can read service code and dependencies

policy:agents-minimal-disclosure

AI agents receive only fields needed for their task

policy:sensitive-requires-approval

Writes to sensitive records require human approval

Invariants

  • Policy evaluation is deterministic given the same inputs
  • Policy changes are versioned and receipted
  • Deny takes precedence over allow by default
07

Sync

Incremental replication

Definition

Sync is the mechanism for incremental updates between context planes. It enables federation without centralization - planes can exchange context while maintaining their sovereignty.

Why it matters

Portability means nothing without a way to move context. Sync makes export, import, and replication first-class operations. Your context isn't trapped - it travels with you.

Properties

  • sync_id — Identifier for the sync session
  • source — Origin context plane
  • target — Destination context plane
  • filter — What records/links to include
  • cursor — Position for incremental updates
  • mode — Push, pull, or bidirectional

Examples

sync:pcf→ocf-engineering

Personal goals synced to org engineering view

sync:ocf→backup

Org context replicated to cold storage

sync:export-portable

Full context exported to portable format

Invariants

  • Sync respects policies - only permitted context transfers
  • Sync preserves provenance - sources remain attributed
  • Sync is resumable - cursors enable incremental updates
08

Gate

Constraints that unlock

Definition

A Gate is a declarative constraint that controls capability over time. Gates encode rules like "no production access until security review complete." Progress through proof.

Why it matters

Policies control access. Gates control progression. They're the missing piece for workflows that require evidence before proceeding: security reviews, approvals, training completion, audit passes.

Properties

  • gate_id — Identifier for the gate
  • requirements — Conditions that must be met
  • unlocks — What capability is gated
  • evidence — Proof that requirements are satisfied
  • status — Locked, unlocked, or pending
  • expires — When the unlock lapses (optional)

Examples

gate:prod-deploy-requires-review

Production deploy unlocked after security review passes

gate:pii-access-requires-training

PII access unlocked after privacy training completed

gate:implementation-requires-marketing

Implementation work unlocked after marketing layer complete

Invariants

  • Gate evaluation is deterministic and reproducible
  • Gate unlocks are receipted with evidence
  • Gates can be enforced by humans, agents, or tooling

How they compose

The 8 primitives aren't isolated - they work together. Here's how a typical flow uses multiple primitives:

1

Agent requests context

An agent needs to answer "who owns the payments service?"

2

Policy filters the View

The agent's capability grants determine which View they can access. Policies filter to only permitted Records and Links.

3

Links reveal the answer

The "owns" Link between a person Record and service Record provides the answer with full provenance.

4

Receipt logs the access

A Receipt records that this agent accessed this context at this time for this purpose.

5

Agent proposes action via Tool

If the agent wants to create a ticket, they invoke a Tool. The Tool checks if a Gate is satisfied (e.g., "support tickets require customer context").

6

Sync propagates changes

Changes made in the org context plane Sync to relevant personal context planes and public views.

Continue reading