← back to Docs source: system/seo/CONTINUITY.md

CONTINUITY — Backup, Restore Drills, Rollback Tiers

Status: DRAFT v2.0 — command-center review pending

Descends from: SYSTEM.md §5 (the ledger, everything-as-arithmetic-over-it), bounded by VALUES.md V4. The prototype's only durability story was implicit — content lives in a git repo — and its first real deployment's recovery plan for the agent layer was literally "reinstall if recreated." Nothing covered config, cron schedules, skills, memories, or channel maps; no restore had ever been rehearsed. v2 ships durability as protocol plus workers: massive-failure recovery is a rehearsed procedure with a measured time-to-restore, not an improvisation.


1. Everything-as-code

All system state that can live in the repo does. Directives, doctrine, gate scripts, worker configurations, playbooks, pattern libraries, the ledger, channel and schedule maps as data files — versioned, diffable, restorable. If a piece of state matters and is not in the repo, that is a defect: either move it in, snapshot it in (§2), or inventory it in the secrets ledger (§3).

Everything-as-code is what makes the other three mechanisms cheap:

The repo is the system's body; the host is a place the body happens to run. Any fresh host plus the repo plus the secrets ledger's restore procedures must equal the system.

2. Nightly sanitized agent-layer snapshots

The agent layer — the machinery that runs the workers, distinct from the content they produce — is snapshotted nightly by a backup worker (a script: cheap, mechanical, silent when unchanged):

3. The secrets ledger

Secrets are the one class of state that must never be machine-restorable — credentials are granted, never derived (V4), and restoring them is a human provisioning act by design.

What ships instead is a secrets ledger: the inventory in git, the values never. One entry per key:

FieldContent
NameWhat the credential is called
PurposeWhat the system uses it for; which workers' functions depend on it
LocationWhere the live value resides (env var, key file, platform vault)
RotationHow to rotate it, and any known expiry/rotation cadence
RestoreThe exact human procedure to re-grant it on a fresh host

The ledger makes a total-loss restore a checklist ML can execute rather than an archaeology project. The prerequisite check from launch (seo/ONRAMP.md §2) doubles as the restore-time verifier: it reads the secrets ledger, tests every listed credential, and reports exactly which grants are missing.

4. Three rollback tiers

Rollback exists at three named tiers; naming them is what makes the middle and top tiers exist at all (the prototype had only the first, implicitly).

  1. Change-level. The finest grain: a committed change (directive update, playbook merge, pattern addition, worker change) is rolled back through the same gate and review machinery that admitted it — reviewer-triggered rollback on regression, and retire-with-record for workers: retirement carries the full record of what the worker was, why it retired, and what replaced it, so removal is reversible and auditable. Removing capacity demands stronger evidence than adding it.
  2. Commit-level. Any gated change or publish is a repo commit; git revert restores the prior state of any artifact, page, or configuration without touching anything else. The everything-as-code rule (§1) is what guarantees this tier's coverage.
  3. System-level. Total loss of the host: restore the agent layer from the latest dated snapshot (§2) plus the repo onto a fresh container/host, then re-grant secrets per the ledger (§3). The system-level tier is the one that must be rehearsed, because it is the one that is never exercised naturally (§5).

Each tier's trigger, actor, and procedure live in the ops runbooks (ops/DEPLOYMENT.md); this document fixes the doctrine that all three exist and are tested.

5. Restore drills — an untested backup is a hypothesis

A backup that has never been restored is not a backup; it is a hypothesis about a backup. The drill machinery makes it a verified claim:

Drill cadence starts at build settings (frequent, while the snapshot machinery itself is young) and graduates like any gate — on evidence that consecutive drills pass and the snapshot format is stable, never on the calendar.

6. Scope notes

7. What changed from the prototype

Prototype (v1)v2
Durability implicit: "content lives in git"Everything-as-code as an audited rule covering the whole system's declarable state
Agent layer (config, cron, skills, memories) unbackedNightly sanitized snapshots, committed with dated tags, gap-detectable
Secrets: undocumented locations, no restore pathSecrets ledger: name/purpose/location/rotation/restore in git; values never
Rollback only at change levelThree named tiers: change-level (gate/reviewer + retire-with-record), commit-level (git revert), system-level (fresh-host restore)
No restore ever rehearsedPeriodic restore drills into scratch environments; measured time-to-restore; canary-verified drill worker

8. Open items