Agent contract lockfile
Lock the observed agent-contract surface.
Fetch the observed agent-contract lockfile (coderifts.lock v1), or check MCP drift of a locked manifest against a live one.
If you’ve used package-lock.json, the idea is familiar: coderifts.lock pins the agent-contract surface your agents actually touched, so you can tell when it drifts.
What coderifts lock creates
The CLI fetches the observed agent-contract lockfile from GET /api/v1/lock. Lock v1 records agents/ops, not MCP tool bodies.
README boundary: write mode requires a cloud API key.
Drift detection with --check
--check compares a locked MCP manifest against a live one and scores the difference against a catalogue of known risk signals. It is monitor only — it does not block. ⚠ Note what --check is not: the lockfile itself records agents and ops, not MCP tool bodies. --check is the separate drift comparison, and it reads the manifests you hand it.
Unreachable live → status unreachable (not drift).
--check exit codes: 0 unchanged; 3 drift; 2 unreachable / missing locked or live (not clean); 1 usage/error.
How to use it
The CLI README gives these commands for creating the lockfile and checking a locked manifest against a live manifest:
coderifts lock owner/repo
coderifts lock --check --locked-manifest mcp.json --live-manifest live.json
Run on 2026-09-15 against the shipped coderifts@8.6.3. The --check form needs no key; coderifts lock owner/repo does (Error: no API key).
$ coderifts lock --check --locked-manifest locked.json --live-manifest live.json
CodeRifts lock --check (MCP drift monitor)
Monitor only — does not block. Drift is a scored finding, not an accusation.
status: drift
drift: true
max_risk: 0
summary: MCP manifest DIFFERS from the locked baseline (content hashes disagree), but no
catalogued risk signal explains the difference. Treated as drift: an unrecognised
change is still a change. Compare the manifests directly — the signal catalog
is not exhaustive.
Read the last sentence of the tool’s own output: the signal catalog is not exhaustive. A max_risk: 0 drift is still a drift.