Skip to content

majordomus watch

What has drifted since the last update — policy, projections, state, retention.

What has drifted since the last update — policy, projections, state, retention.

  • read-only
  • system
  • active task optional
  • --json

Exits 11 for drift, never 10. Drift is information, and no hook blocks on it.

Syntax

majordomus watch [--json]

Lifecycle

  1. Set up
  2. Begin
  3. Work
  4. Verify
  5. Conclude
  6. Inspect

Other commands at this stage:doctor, history, search, doctrine, version, knowledge, rules, bench.

Reads

  • .ai/repo/policy.yaml
  • .ai/local/state/current.yaml
  • .ai/local/state/

Writes

Nothing. This command is read-only.

Exit codes

Only the codes this command can produce. The full contract is on the commands index.

  • 0 ok
  • 2 usage
  • 10 contract unmet
  • 11 drift found

What has moved since the last update

watch answers a different question from doctor: not what is wrong, but what has changed. It exits 11 for drift and never 10, so no hook blocks on it.

Nothing has drifted

policy edited since update
no

Given this repository

# A repository with Majordomus installed and projections generated, and one commit of work.
"$MJ" init >/dev/null
"$MJ" update >/dev/null
mkdir -p lib docs
echo a > lib/a
echo d > docs/d
git add . && git commit -qm base

Run

$ majordomus watch

Output contains

  • watch: 0 drift

exit 0

Exit 0. The policy hash matches the one recorded at the last update and every projection matches its fingerprint.

The policy was edited and not regenerated

policy edited since update
yes

Given this repository

# Installed and generated, then the policy was edited without regenerating the projections.
. "$FIXTURE_SETUP/installed.sh"
printf '\nledger:\n  retention_max_lines: 4000\n' >> .ai/repo/policy.yaml

Run

$ majordomus watch

Output contains

  • DRIFT

exit 11

Exit 11 is DRIFT, which is information rather than a verdict. The generated instruction files no longer follow from the policy they were generated from, and `majordomus update` is the fix.

Reference

What has drifted? Read-only. Never used to block; exit 11 when findings exist so that scripts can tell "drift" from "healthy" without confusing it with a contract failure.

DriftDetected how
policythe policy hash a projection's stamp names is not the policy on disk
projectiona projection's content differs from the hash its own stamp names
statecurrent.yaml outcome contradicts ledger, or label is diverged
scopetouched files outside claim (same check as check)
handovertask is handed_over but no handover names it, or that handover lacks a required section
verificationcurrent.yaml has a terminal outcome with no task.finished ledger record for it
checkpointcurrent.yaml older than the profile's checkpoint interval
retentionledger.jsonl or handovers/ over cap
$ majordomus watch
DRIFT policy      .ai/repo/policy.yaml modified after last update  [reproduce: majordomus update --dry-run]
DRIFT projection  AGENTS.md — content differs from its stamp (hand-edited?)  [reproduce: majordomus update --diff AGENTS.md]
DRIFT checkpoint  t-20260903-193012-a4f1 — last checkpoint 48m ago, interval 15m
watch: 3 findings

Evidence

Every case below runs in CI on Linux and macOS. The site refuses to build if a public command has no behavioural case, no negative case, or no demonstration.

Guarantees this command carries