Skip to content

Instance layout ​

regulator init creates the layout below in a repository, and the loop writes into it as units run. The repository itself is the domain. .regulator/ holds the instance's state and is ignored by git. regulator/identity/ is the one harness-owned directory that is committed.

In the repository ​

PathOwnerWhat
regulator/identity/IDENTITY.md, INVARIANTS.md, GLOSSARY.md, BOUNDARIES.mdS5the instance's identity, seeded from the definition and committed on the base branch. It is protected by the write gate, by the bash snapshot-and-restore and by the identity-untouched check, and only identity accept writes it
.gitignoreinitgains the .regulator/ line
.env (if committed)the projectany credential-looking value in it is recorded as a canary and watched for in every tool result

Under .regulator/ ​

PathStoreWhat
instance.jsonmanifestthe manifest
units/executionone record per unit, holding the contract version, the attempts, the budgets consumed, the decisions and the report. Only the loop writes it
leases/executionone lease per running unit, with its TTL and liveness
worktrees/<unit>/executionthe unit's git worktree on its own branch, removed on reintegration
trace.ndjsonregulatoryevery schema-validated trace event, append-only
signals.ndjsonregulatorythe regulatory log, append-only. It holds every typed message a session or the loop recorded, the obligation events the router and the consumers appended (opened, acknowledged, resolved, escalated, delivered, noted), and the interaction requests and answers. Obligations are the fold of it
events.dbregulatorythe SQLite event store the generic vsm_* reporting tools write. A unit's session does not load those tools, so an instance driven by the loop keeps it empty
audit.ndjsonregulatoryevidence records, technical verdicts and human acceptances, append-only
effects.ndjsonregulatorythe effect journal: every side-effecting tool call, its outcome, and its reconciliation on restart
memory.ndjsonregulatoryoperational memory: facts with provenance and expiry, and their retractions, scoped by unit type
outboxdeliveryone line per delivery of an obligation owed to a person. watch forwards new lines to a channel command, and REGULATOR_OUTBOX moves the file
outbox.cursordeliveryhow far watch has forwarded, so that a restart forwards nothing twice
canariesmanifestthe credential-looking values init found in a committed .env, one per line. They are watched for in every tool result and redacted from spans

Execution state and regulatory state live in different stores on purpose. The loop decides what a unit may do next by reading the regulatory log, and the regulators never read the loop's progress off the repository. So the record under units/ says what the loop did with a unit, while the regulatory files say what was observed, what was recorded and what is still owed.

The manifest ​

.regulator/instance.json is written once, by init, and read by the profile grant, the closeout and doctor. It is the only file under .regulator/ that carries a person's declaration, and even so it is not edited by hand. init refuses to run twice, so changing the declared layout means creating a new instance. A definition newer than the one recorded shows as definition-drift in doctor until a person upgrades.

FieldMeaning
version1
definition.root, definition.namethe definition this instance runs under
definition.registryhow many regulators the definition declared at init
definition.harnessRevisionthe definition's git revision at init. A later revision shows as definition-drift in doctor
definition.pithe Pi version the definition pins
writablePaths[]optional. Where the implement profile may write in this repository, in place of its own default
protectedPaths[]optional. Prefixes the closeout refuses a change under, in addition to regulator/identity/ and the discovered conventions
initializedAt, initializedBywhen the instance was initialized and by whom: the --by given, or else the user and host. This is recorded as provenance and is not checked against the interaction policy

Environment ​

VariableMeaning
REGULATOR_OUTBOXwhere notify_owner and delivery write. The default is <repo>/.regulator/outbox
REGULATOR_INTERACTION_POLICYa different interaction policy, for a session run by hand
REGULATOR_HOSTthe host package unit dispatch and unit drive load. The default is @metacoding.io/regulator-pi, and --host overrides it for one run
PI_*, provider keysPi's own environment. The harness reads none of them

Nothing else in the instance is configuration. The Pi settings a unit's session runs under come from the definition's settings.json, which the dispatcher holds in memory. The repository's own .pi/settings.json is never read.

Released under the Apache-2.0 License.