opschain state doctor
Included from Basic tier
Classifies every database property owner in the local store against the
repository's current config.yaml, as a table (OWNER VERSION STATUS):
declared— the owner node exists in config.yaml.ORPHANED (not in config.yaml)— the owner exists in the store but not in the current config.yaml (a renamed or removed node).other project (per-user store)— the owner belongs to another project sharing this per-user store.
Every run then names the store file and the keyset in force — store: <opschain home>/local/opschain.db, then keyset: <opschain home>/local/keys.env (present, mode 0600), or (present, mode <mode> — tighten to 0600) when the file is readable more widely than the generated
posture, or (missing — generated on the next local write; values encrypted with a previous keyset are unreadable) — and ends with the
scoping note the store operates under: owners are keyed by project path in the per-user store: two repositories declaring the same project code share these layers. -o json|yaml emits the full result document
(project path, owners, removals, store with path, keyset with
path/present/mode, note).
With --gc the orphaned owners' layers and history are deleted, reported as
removed <n> orphaned owner(s): <paths>.
This verb is repo-scoped: against a server target it fails with inspecting state is repo-scoped and runs locally — it has no remote form; run it in the repository (or pass --local).
Flags
| Flag | Meaning |
|---|---|
--gc | Delete the orphaned owners' layers and history. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Report printed (and orphans removed, with --gc). |
| 1 | The store read, config.yaml read or GC failed. |
| 2 | Usage error. |
Examples
opschain state doctor
opschain state doctor --gc
See also
opschain docs cli/state-reset— the project-granularity clobber, and how a reset treats the keyset.opschain docs storage— "Local mode": the store's location beside its keyset, and the keyset's rules.opschain learn 1.3— properties and settings, including DB property layers.