Skip to content

Watch

reports drift between policy, projections, state, scope, and git, each finding with the command that reproduces it

reports drift between policy, projections, state, scope, and git, each finding with the command that reproduces it

Where it lives

The command that acts on it

majordomus watch

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

  • read-only
  • active task optional
  • --json
majordomus watch [--json]

See it refuse, and accept

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.

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.

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.

What is guaranteed

Rules this command runs

Doctrines whose enforced_by names watch. Enforcing a rule and being governed by one are different relations, so they are listed separately.

The moments this answers