The domain
Three capabilities, one contract
The contract lives in code/schemas as Nickel. wuwei-contract is its Rust mirror: it decodes only what the schemas accept, holds the lifecycle as pure transitions and declares the traits SessionRegistry, Trace, Messenger, Liveness and Edge.
session-registry
A session receives an identity when it registers, and declares what it is, such as its VCS identity or its custody status, as declarations validated by form. One live session per host and workspace, unless the deployment says otherwise.
session-trace
What a session does is recorded without intervening: an append-only trace per session on NATS JetStream, queryable as evidence. Every event names the contract version it was written under.
session-messages
Typed events and .md files carried between a session, its principal and other sessions, over a Unix socket or TCP. Bodies travel inline only as small markdown; reports, receipts and signatures travel as references by digest.
Status: contract 4 is complete in code/ and held by its tests, and the service passes the kit on real NATS. It is not frozen: the owner has not accepted those changes, and ADR-001, ADR-002 and ADR-003 are Proposed. No deployment declares where the service and the view run, and no harness has the adapter installed for real work.
The lifecycle
A session moves by its own steps, never by the observer's
wuwei never closes a session by itself. A session reaches a terminal state by its own step, its principal's, or its harness ending, and the trace names who. The states and the steps, as code/schemas/session.ncl declares them:
- Awaiting holds while a request is open. Any answer, unread, returns the session to the state it came from.
- Stale is an observation, not a step. A process that stops answering the liveness probe leaves its session Stale; when it answers again, the interrupted state is restored.
- Abandoned carries the party that abandoned it, and Failed the reason given. Neither is inferred.
- shared_workspace says what happens when a second session registers on a host and workspace another live session holds:
Refuseby default, writing nothing;Report, which records WorkspaceShared in its trace; orAsk, which makes it wait on a request its principal answers.
Two places in the flow are still open: a session answered under Ask returns to Registered and cannot be abandoned until it starts, and there is a delivery gap at SessionEnd.
A session under wuwei
From deployment to delivery
Deploy
A project adopts wuwei by deploying the service, never by linking it (ADR-001).
wuwei-observer --deployment <file>reads a declared Deployment: NATS with JetStream, the trace and records streams, a Unix socket or TCP. It refuses to start on streams that differ from the deployment, and creates them only with--create-streams.Register
The harness's adapter registers each session. For Claude Code,
wuwei-claude-codedoes it onSessionStart. A session refused for a held workspace is told so before it touches a file.Trace
The adapter keeps the session alive on
UserPromptSubmit,StopandNotification. The service appends every event to the trace stream, which is the source of truth: on start it replays the trace into its projection, so it keeps no store of its own.Carry
Messages, requests and answers go on the records stream. The service delivers them and never reads what an answer means.
Close
On
SessionEndthe adapter brings the session to a terminal state, and each step is taken by a named party and recorded with who took it. What is delivered at that moment is the open gap the lifecycle names.
The conformance kit
Twelve checks any implementation passes
wuwei-conformance depends on the contract only, never on an implementation. It judges two: wuwei-memory, an in-memory fixture, and the service on a NATS server with JetStream. The fixture's tests break it on purpose, once per check, and each check must catch its defect.
DistinctIdentity
Sessions of the same project and actor get distinct ids and never overlap.
FullLifecycle
The whole lifecycle, with a continuous trace.
AnswerUnread
An open request keeps the session Awaiting; any answer, unread, returns it to Working.
LivenessObserved
A dead process makes the session Stale; a revived one restores it; nothing closes.
AppendOnly
The trace is append-only.
EvidenceByDigest
Evidence travels by digest; inline evidence is refused.
DeclarationsByForm
Declarations are validated by form and kept, whatever their namespace.
EdgeRefutes
A malformed frame is refused at the edge and leaves nothing behind.
WorkspaceHeld
A session registering in a workspace another live session holds meets the policy the implementation declares.
QueriesRead
The queries on the wire answer from what is recorded and never write.
WarrantCarried
A principal's warrant is carried as given and never read.
VersionNegotiated
The contract version is negotiated, never imposed.
The contract depends on no ontoref crate. An agnosticism test refuses any ontoref package in the lockfile and any vocabulary of the attaching domains in the sources, so the kit is the only judge of an implementation.
A published contract
Frozen by version, negotiated like TLS
The trace outlives the implementation that wrote it, so a type change reaches every writer and every reader (ADR-002). What a change owes is ontoref's rule, invoked and never restated here.
A frozen version does not change
A version freezes when the owner accepts the changes that complete it. After that, every change of a type is a new version, which says how it reads the traces written before it.
Every event names its version
Event.contract travels on every event. A reader refuses an event of another version by name, never by guessing from its shape. The number lives once, in primitives.ncl, and Rust is held to it by test.
No authority is necessary
A registration says the versions it speaks. The implementation takes its own when offered, or answers Unsupported with both ranges.
The agreement is named by its digest
What a version covers is data of the contract. The service announces it on <prefix>_agreement; any carrier may spread it and none is trusted for it: a reader recomputes the digest. Endorsements are optional opinions a reader's policy weighs.
The session view
Perspective for the principal, and their acts carried
The view shows what runs, what waits for the principal's act, what stopped sending heartbeats, and whether the floor holds. It reads and acts through the service's wire only: it never writes to NATS and keeps no projection of its own.
Acts by a named principal
Answer, deliver, fail, abandon: each offered only where the lifecycle allows it, and recorded with who took it. The same acts reach the pages, the HTTP endpoint and the command line through one dispatch.
An assertion, not a proof
The wire authenticates nobody. A principal always says what it rests on: an authority's Decision or Attestation, or Asserted by a named writer. No deployment issues warrants yet, so the view listens on loopback only, and acting needs a session opened with a passkey or a registered device.
States are named, never judged
Every colour is a role of the brand: live, waiting, without heartbeat, delivered, failed. No template draws a tick or a cross, and a check refuses one that does (ADR-003).
Boundaries
What wuwei is not
Not surveillance
To observe is not to watch over. The trace shows what passed and changes nothing.
Not an intervention
It assigns, plans and decides nothing for a session. Every act it carries is a step a named party takes: the session, its principal or its harness.
No verdicts
A state is said by its name. wuwei does not approve or reject a session it only observed.
Not orchestration
Orchestration is vapora's. An orchestrator can be a further implementation of the contract, held to the same kit.
Not a harness
It observes the harness. An adapter per harness reports to the service; wuwei does not run the agent.
Not custody, not a signature
It never acts with credentials. Custody is another domain, and signing belongs to Signatio and gov; a principal's warrant is carried, never read.
ontoref Gov
One domain in three layers: how a project governed by ontoref governs itself.
What it is
Gov is ontoref's own domain. It holds the arrangement — what a project's boundary declares, its members, which artefacts a consumer inherits — and the exercise — what work is committed and how an act is delivered. Its name is the root of governance, governability and government, and elects none of them.
Why
A decision, a boundary or a delivery that lives only in someone's memory binds no one. In Gov each one is a declaration a project can be held to, and what holds it is a mechanism, not a good intention.
What for
A project reaches Gov by bond, never by imposition, and takes only the parts it needs. In signature governance each project carries one: the contract, the operations of work, the signature, the dossier, the agreement and the signing on an agent's behalf. Beside them, the capabilities any state of governance uses: the host boundary, deployment, the observed session and the opening by name.
How governance is layered
Protocol · base
ontoref's base: bonds and planes, content bound by digest, the unsigned work order, the check form, and mandatum's types. Every project is written in it; a project can bond without adopting any governance.
Management and governability · gov
The gov domain, in ontoref: how the constellation is organised, its management modes, and decisions held by validators.
Signature governance · foedus
The foedus domain, provided by the foedus project and operated by warden: the agreement, each party's annex and the tests that prove it. A project is here because it is a party to the agreement.
Isolation, provisioning, wuwei and openbyname are capabilities any state of governance uses — the agent's boundary, deployment, sessions, and running tasks locally — not governance: governance needs them, they do not need governance.
Each project chooses its governance mode
Governability (coherence) · ontoref alone
Coherence only: ontoref checks that the declarations hold together. No signature.
Auditable governance · signature
The person signs. It detects a departure; it does not prevent it.
Applied governance · signature + isolation
Signature and isolation together. It prevents.
Part of the same system
signature governance
Custody
A safeguarded project is held to a contract, one axis at a time. Custody states it; implementations hold it.
custody.ontoref.dev →
foedus
Many parties, one agreement: each holds its own part, and every condition is proved by a test that fails when it should.
foedus.ontoref.dev →
iter
An owner and an agent work in one store. gov decides what each class of change requires; iter carries it out.
iter.ontoref.dev →
Signatio
A signature grants a declared reach. Signatio produces that grant and checks it.
signatio.dev →
SpecDossier
SpecDossier keeps the terms of a Statement of Work, not its execution, and brings them to landing.
specdossier.dev →
warden
No agent holds a key: warden signs for it, only inside a core the owner signed.
warden.ontoref.dev →
capabilities
Isolation
Owner and agent share the same trees. What the agent may not do, the host refuses.
isolation.ontoref.dev →
openbyname
openbyname lets a link on a web page open a file on your own machine, by name and safely: the link carries only names, and your machine's declarations decide what it may do.
openbyname.dev →
Observed, not forced.
A session opens, reports, waits, closes and delivers by its own steps and its principal's. wuwei registers it, traces it and carries what is said, on a floor that earns the lightness.