Proposed adr-001 · 2026-10-15

The First Implementation of the wuwei Contract Is a Service a Project Deploys, Not a Module Linked Into ontoref-daemon

Context

The working plan (T6) had ontoref-daemon implement the contract, as an isolated module behind an optional cargo feature so that a checkout without wuwei-observer would still build. Measured on 2026-10-15 with cargo 1.99.0 on a two-crate workspace, that mitigation does not hold: a path dependency whose directory is missing breaks every cargo command — with the feature off, with a Cargo.lock written while the peer existed, and with --locked. Cargo resolves optional path dependencies eagerly. ontoref already lives with this for stratumiops (its bl-156).

So a daemon depending on wuwei-contract by path makes every ontoref checkout require wuwei-observer beside it. ontoref publishes to forgejo, rad and a GitHub mirror; wuwei-observer's mirror is suspended. Publishing the contract to crates.io would remove the edge, and the principal declined it for now.

What the daemon would have reused is small (measured the same day): its ActorRegistry deletes dead sessions in its sweep, which the contract forbids, so wuwei needed a store of its own beside it; its notifications are file-change acknowledgements, unrelated to requests and answers; its trace would have had to live in redb (adr-099 allows no other substrate).

Decision

The first implementation of the wuwei contract is the service `wuwei-observer`, a library and a binary in code/crates/wuwei-observer, depending on the contract by path inside wuwei-observer's own workspace and on nothing of ontoref.

A project adopts wuwei by DEPLOYING the service (its Deployment: NATS, the trace and records streams, a Unix socket or TCP), never by linking it. ontoref takes part through its bond (.domains-ontoref/wuwei, axis Governance, state Node) and the domain's modes, not through a cargo edge in either direction.

The library stays embeddable: if the contract is ever published to a registry, ontoref-daemon can link it behind a feature by VERSION, and the service is unchanged. A link between a wuwei session and an ontoref actor is a declaration in the session's origin, `{ namespace = "ontoref", kind = "actor", ref = <token> }`, which the contract already admits.

Constraints

Alternatives considered