Recovery Playbooks
Recovery Playbooks
Section titled “Recovery Playbooks”ContextBrew’s trust story is not “everything is fine” — it is that every check reports what it actually saw, including nothing. This page is the public counterpart: the recovery steps for each failure the tooling can report, before you need them.
Every playbook below names the command or screen that detects the problem and the honest next step. None of them require trusting a claim — each one re-derives the answer from stored artifacts.
Playbook: the Trust page says “compromised”
Section titled “Playbook: the Trust page says “compromised””Detected by: the Trust page in Studio
(/projects/<project-id>/trust).
The Trust page runs two live verifications every time it loads:
- Ledger tamper-evidence. Every recent ledger entry carries an
append-time dedupe key (
kind:scope_id:payload-hash). The page recomputes that key from the stored entry with the same hashing the writer used and compares. A mismatch means the stored entry no longer matches what was recorded — it is shown as TAMPERED, with the entry ids listed. - Sealed-vintage signatures. Every sealed Vintage is re-verified with the same Ed25519 check the CLI runs on signed exports. A signature that no longer verifies is shown INVALID with the reason (content changed after sealing, signature does not match the claimed signer, and so on).
Recovery steps:
- Entries marked unverifiable (recorded before the ledger carried tamper-evidence keys) are gaps, not failures. They are never counted as verified; no action is required beyond knowing they exist.
- For TAMPERED ledger entries: do not build on them. The ledger is append-only — ContextBrew will not rewrite history to hide the mismatch. Treat the affected entries as untrusted evidence and re-derive the current state from the specs (brew again from Studio; the new entries carry fresh keys).
- For an INVALID vintage: the sealed bundle disagrees with its signature. Re-seal from the current project state; if the vintage was already shared, tell the consumers which content hash is invalid — the Trust page shows it.
Playbook: a signed export fails ctxbrew verify
Section titled “Playbook: a signed export fails ctxbrew verify”Detected by: ctxbrew verify <export>.signed.json exiting 1 with a
reason.
ctxbrew verify re-computes the canonical content hash of the export
and checks the Ed25519 signature against it. The reason line tells you
which check failed:
content-hash-mismatch— the file’s content changed after signing. Someone (or something) edited the export. Re-export from the source project and compare.signature-invalid— the signature does not verify against the claimed signer’s key. The file may be from a different signer than it claims.missing-signature/malformed-signature/unsupported-algorithm— the envelope itself is broken; the file was truncated, hand-edited, or produced by a non-ContextBrew tool.
Recovery step: in every case, the file is not trustworthy as signed. Re-export from the project of record and re-verify. The exit code is the contract: 0 only when both the hash and the signature check out.
Playbook: is my project stale?
Section titled “Playbook: is my project stale?”Detected by: ctxbrew stale (advisory report) or the
Drift model itself.
ctxbrew stale is a pull projection, not an alarm: it exits 0 and
reports which artifacts are behind their sources, each with the verb
that fixes it (regenerate or brew). In CI, use --gate to flip the
semantics — it exits 1 when staleness passes the configured threshold
(--max-age-days, default 30), and also exits 1 when it cannot reach
the ledger at all. A gate that cannot run must not silently pass.
Recovery step: follow the verb each entry carries — regenerate the named model or brew the project again. There is no separate “fix staleness” step; staleness is defined as “a newer source exists than the artifact records”, so the fix is always producing the artifact from the current source.
Playbook: something in my environment is off
Section titled “Playbook: something in my environment is off”Detected by: ctxbrew doctor.
ctxbrew doctor fans out over sub-checks — runtime versions, git
hooks, GitNexus index freshness, the recipe lock digest, MCP health,
agent wiring, and schema drift — and prints one verdict line per check.
A check whose precondition is missing reports skip rather than
passing silently; warnings are warnings, not passes.
Recovery step: each failing line names its own fix (re-run the
indexer for a stale GitNexus check, re-run ctxbrew hooks doctor for
hook failures, set the MCP URL or skip the MCP check). Re-run
ctxbrew doctor until the table is green or explicitly skipped.
Playbook: the replay screen doesn’t match what happened
Section titled “Playbook: the replay screen doesn’t match what happened”Detected by: the replay screen in Studio
(/projects/<project-id>/replay), which renders the recorded ledger
grouped by day.
The replay screen is a read model over the same ledger the Trust page verifies. If an event is missing, the ledger recorded no such event — check the Trust page to confirm the entries that do exist are intact. If an event is wrong, the ledger is append-only: the wrong entry stays, and the correction is a new entry.
Recovery step: verify first (Trust page), then re-brew to append corrected state. Never assume a silent correction — the whole point of the ledger is that what happened is what it says.
See also
Section titled “See also”- CLI Reference — flags and exit codes for every command above.
- Gates & Evidence — how checks become verifiable artifacts you can attach to a PR.
- Drift — the model behind the staleness report.
