0012 — The Smith review runs itself every morning, and a merge refuses under a person

What changes

Until today the smith-review skill — the day's pass over everything Smith said and did, ending in fixes — ran only when a human typed /smith-review. Its own preamble calls it "the inventory that a future autonomous self-repair engine will run." Three things become true at once:

  1. The review is a scheduled pipeline. MorningQueueWorkflow's last step, smith-review, runs agent_smith.self_review run, which reads the checkpoint store for the window (since the last checkpoint; a day if there is none), refuses to run twice in a day, posts the brief as a #agent-smith thread and starts a durable SmithTaskWorkflow carrying it. The brain runs the skill inside that container, on MODEL_HIGH, and closes it with smith-task verdict — Rung 6's receipt, not a merge.
  2. The review may merge its own PRs. That is the instruction. Rung 0 (never under an agent still pushing) and Rungs 1–6 (merged-verified, deployed, tooling re-run, live test, proved in prod in the channel, checkpoint) still bind; what is gone is the human deciding the moment.
  3. A merge that would restart the worker refuses while a person is mid-turn with Smith. New: live_runs (every claude -p turn registers itself by pid while it runs) and merge_guard (refuses a merge into a restart repo while a human-facing turn is live). It is consulted at BOTH merge sites — the brain's own gh pr merge through the command-gate hook, and the human-✅ approval path's merge_pr_activity — and it fails CLOSED when it cannot see the registry.

Why a task container and not a turn, and why not a new scheduler

A brain turn has a two-hour wall and no memory of why it started once it ends. The review opens PRs, waits on CI, merges, restarts the very worker it runs on, and must then come back and prove each fix in prod. SmithTaskWorkflow is the structure agent-smith already has for "a task that outlives a turn": it restates goal and acceptance on every wake, re-wakes the brain when the thread's PR evidence changes phase, and closes DONE only on a receipt. Its workflow id is derived from the goal, and the goal names the date — so a second dispatch the same morning collides into "already driving" instead of a second review. No scheduler was invented: the step is a NightJobSpec run through the same run_night_job_activity every nightly job uses.

How it relates to the ladder

What the guard means for the graceful drain (agent-smith #422)

#422 (merged 2026-09-07) makes the worker drain in-flight activities on SIGTERM instead of killing them — deploys relaunch within ~4s of a merge via SIGTERM+wait, not kickstart -k. That makes a restart survivable; this makes the review not the thing that asked for one while a person is waiting. They are two lines, not one: the drain protects a turn from a restart that happens; the guard stops a Smith-initiated merge from scheduling that restart under a person in the first place. Gera's phrasing — "the drain makes it safe, not polite" — is the reason both exist.

What the first morning can and cannot do

Consequences

The catalog gains smith-daily-review, proposed, with the two signals above; it flips to active after the first morning whose thread carries a checkpoint. The review's #agent-smith receipt becomes a daily thread, and the phase doc's hero number is expected to go DOWN on mornings the sweep finds more than it fixes — which the skill's §0 says is the count getting more honest, not the work regressing.

Amendment 2026-10-19 — on a tracker board, merged counts as done

What changed. Gera, 2026-10-19: "for status it should just say like shipped, merged and in flight, because when it says not proven etc it overrides the item", and "as long as we've shipped it we can call it done, and that should be the case also for the template." So a merged row is done. The Can count Rung 5 clause above said a merged-but-untested fix renders merged · untested and "does not count"; on every tracker board it now counts. ADR-0025's supersession table had already retired that clause as a GATE ("under decision 6 those 114 are done"); the hero kept counting shipped only until this change, so the board read lower than the doctrine. This amendment closes that gap; ADR-0025's row needs no edit.

What shipped (propflow-docs, all 2026-10-19):

What did not change.

Consequence for this ADR's own prediction. Consequences expected the hero to go DOWN on mornings the sweep finds more than it fixes. That still holds, but a merge now moves the hero on the day it lands, not on the day prod evidence arrives, so the number rises sooner and the merged-versus-shipped gap is read from the tiles and board-count, not from the hero.