Architecture

One pipeline, one gate.

Every frame flows through the same refuse-to-guess pipeline: sample → route/cache fast tiers → judge → gate → deliver. The model is called only when the cheaper tiers cannot resolve the goal, and one gate decides what you hear about. Below: the whole system as a schematic, three animated plates of its core loops, and the fourteen modules that share the frozen vocabulary.

01 · The whole system

The end-to-end schematic.

Follow the ink line left to right — the frame's journey and the only path that spends money, at the judge. Dashed lines are the returns the hot path never waits on: episodic priors folded back into sampling, and the trace tapped down to the offline rail. The judge fans up to Sensing & Signals for cheap cues and down to Backends for the model call; the gate fans right to the three outcomes.

DECLAREHOT PATHPERSISTFOUNDATIONOFFLINETHE HOT PATH · the only route that spends the modelOFFLINE · derives from traces, never in the hot pathgoalsmiss → escalateDecisioncheap cuesresultretainpriorstraceAUTHORgoals in plain languageWATCHPLAN & GOALSwatch() · desugar · compiletwo-phase atomic applySOURCEcamera · videoRTSP · audio+VADRUNTIMEworker loopdrives the coreSAMPLESamplingControllerSensePolicyFAST PATHRouteEngine · regexFrameHashLayer · cacheJUDGEauthorize → bindSHA-256 · dispatchfail-closedCONSEQUENCE GATErising-edgethree-stateFIREdeliver incidentASKdefer to humanSILENTlog onlyDELIVERYRuntime sinkswebhook · idempotentdead-letter · SSRF-safeSENSING & SIGNALSentity graph · re-idextraction · rhythmBACKENDSresolve_vision → Vision/LLMcircuit breaker · fallbackEPISODES & EVIDENCEepisodic memory · evidence handles (opaque)incidents · consent · persistenceCONTRACTSthe frozen vocabulary every box speaksCONTRACT_VERSIONPROFILES & CONFIGURATIONlayered Settings · versioned profilesprovenanceOBSERVABILITYone funnel · trace · replayvisualizer · doctorEVALUATIONoffline, pre-registeredship-gateHARNESSedge sim · syntheticcorpora · bench

Five bands — declare, hot path, persist, foundation, offline. Every label is a real module or seam; scroll the diagram sideways on a narrow screen.

02 · The core loops, in motion

Three plates.

The watch loop selects one frame from a continuous stream; the cost cascade spends the model only as a last resort; the consequence gate turns a verdict into exactly one of fire, ask, or silent. Motion pauses when off-screen and holds a resting frame when you prefer reduced motion — the readouts are illustrative instrument telemetry, not benchmarks.

Plate 01 · Signal from noise

The watch loop

Frames arrive without pause and mostly pass through as faint outlines. SamplingController asks its SensePolicy whether this instant is worth sensing; the tier-0 gate latches a single frame on the rising edge and seals it into an EventCapsule.

01stream advances one frame per beat
02sense window closes, frame darkens
03admitted frame lifts to the latch
04EventCapsule outline seals it
05ingest buffer sweeps
FRAME STREAM · 30 FPSLATCH · TIER-0 GATEEventCapsuleINGEST BUFFERseen → admitted · most frames never sensed
Seen1,210,855
Admitted4,733
Sense rate0.4%
Illustrative instrument readout — not a benchmark.
Plate 02 · Route, cache, then — only if it must — judge

The cost cascade

An admitted frame falls through three tiers of rising cost. RouteEngine tries a local regex route; on a defer it drops to FrameHashLayer, a near-frame cache; only a miss escalates to the Judge, which authorizes, binds to a SHA-256-verified static context, and dispatches a model. Fail-closed at every step.

01token probes the route layer → defer
02probes the cache → miss
03context binds, hash verifies
04judge dispatches, verdict exits
05most traffic never reaches the model
COST →ROUTING · RouteEngineregex fast-path · local, no modelCACHE · FrameHashLayernear-frame hash · Hamming ≤ τJUDGE · authorize → bind → dispatchdeployment catalog · fail-closedDEFER →MISS →SHA-256most traffic resolves before the model · routed ≫ cached ≫ judgedDECISION
Routed926,004
Cached61,208
Judged8,241
Illustrative instrument readout — not a benchmark.
Plate 03 · Fire, ask, or stay silent

The consequence gate

One dot leaves the Gate along exactly one of three routes; only the route it takes illuminates — the two it declines stay dark. FIRE delivers an incident, ASK defers to a human, SILENT logs and suppresses. The gate fires only on the rising edge — so most cycles stay silent.

01confidence fills
02dot follows the chosen curve
03destination lamp illuminates
04counter increments, dot fades
05weighted cycle repeats
CONSEQUENCE GATEGATECONFIDENCEFIREDELIVER INCIDENTASKDEFER TO HUMANSILENTLOG ONLY
Dispatched3,182
Weightingmostly silent
Illustrative instrument readout — not a benchmark.
03 · The system map

The fourteen modules, mapped.

From the frozen contracts at the bottom to the edge harness at the top, every subsystem feeds the same pipeline. Each chip is distilled on the modules page.

Foundation
Contracts

DTOs, Protocols, the safety envelope, CONTRACT_VERSION

Profiles & Config

layered Settings + versioned profiles, resolved with provenance

Planning
WatchPlan & Goals

the watch() seam, goal desugaring, two-phase atomic apply

Cognition core
Core & Agent

the Percept orchestrator + the three-state gate

Routing

local fast-path route engine

Cache

frame-hash cascade

Judges

authorize → SHA-256 bind → dispatch

Backends

vendor adapters behind Protocols

Sensing & Signals

entity graph, re-id, OCR, rhythm

Episodes & Evidence

memory + opaque evidence handles

Runtime
Runtime

the front door: source → core → safe sinks

Quality & tooling
Observability

one funnel, trace, replay, visualizer, doctor

Evaluation

offline, pre-registered ship-gate

Harness

edge sim + test/bench (percept.edge)

04 · The public surface

Where the seams live.

Contracts sit at the bottom of the layering — imported by the cognition core, never the reverse. Fourteen modules share that frozen vocabulary; each one is distilled on the modules page.

Public surfaceimport percept
percept                        # pip install percept-vision · import percept
percept.watch(...)             # frozen entrypoint — WATCH_VERSION "1.1.0"
percept.run(...) / .start(...) # batteries-included runtime front door
percept.Percept                # the cognition core — create / configure / from_bundle
percept.contracts.watchplan    # WatchPlan, ArtifactBinding — typed, portable plans
percept.edge.tier0             # tier-0 gate reference — bit-identical with the JS/WASM edge
percept.edge.detectors         # cheap high-fps detectors — motion, onset, pose
CONTRACT_VERSION = "1.10.0"    # frozen data contract — MAJOR bump, never a silent edit