012-steady-state — routine prompt
The block below is the live driver of the CS-Hourly routine: the trigger's
own prompt says to read .station/modules/work-agent/routines/job.md
and then the active workstream's ROUTINE.md, so edits here take effect on
the next firing without touching the trigger. It inherits every rule the
closed tracks earned — the batch loop, atomic claim refs, the read, verify
and output budgets, the worktree rule — each recorded in
002's shape notes with the
failure that produced it. What changes is the claim namespace
(claim/012-*), the item source (ROADMAP → NEXT rather than a phase table),
and one rule this workstream adds: a change that can reach a page is
checked on a page.
Advance the roadmap (012 steady state) by a BATCH of items, then stop.
LOOP, per item: INSPECT → IMPLEMENT → VALIDATE → DOCUMENT → UPDATE ROADMAP
→ ARCHIVE (.station/modules/work-agent/routines/job.md). One item per PR, each merged before
the next is claimed. Continue until the FIRST of: 4 items landed; the next
item is larger than one PR (do its first shippable slice, then stop); the
next item is blocked (one line in SESSION.md, stop); NEXT is empty; or
remaining context is too small to merge cleanly.
INSPECT (paid once per run): `git fetch origin`; list open PRs; `git
ls-remote origin 'refs/heads/claim/*'`; read ROADMAP.md's NEXT list and
.station/jobs/012-steady-state/SESSION.md through "Next". Open a
charter, an ADR or the readiness assessment only when the claimed item
names it. Trust SESSION.md's state; re-run a gate only after a diff moves it.
- An open PR from a previous run exists → land it (or fix it) as this
batch's first item.
- Else take the top NEXT row whose `claim/012-<slug>` ref is absent or
stale (no open PR, no commit newer than 3 hours). Claim BEFORE any code:
git push origin origin/main:refs/heads/claim/012-<slug>
A rejected push means it is taken — go back to the list. A slug
SESSION.md's Completed records is done, not in flight.
- NEXT empty → change nothing; report completion; recommend disabling
the routine. Do not invent scope. Do not answer a DEFERRED row.
IMPLEMENT: solo by default; a sub-agent only for real enumeration, and any
agent that writes runs in its own `git worktree` (relink node_modules
first if workspace packages resolve into the run's tree). Migrations at
the next free number with .down.sql, applied by hand, never renumbered;
handler → repository → database; APIResponse envelope; breaking wire
changes under /api/v2/; Studio primitives and tokens only, no raw colours;
vocabulary from docs/GLOSSARY.md; strings behind t() with the key in the
en bundle; Redis optional; a debt marker names an ADR, a track or a PR;
no adjacent cleanup — a one-line fix in a file already open is fixed, a
larger one is a NEXT row.
VALIDATE: targeted tests while iterating; `npm run verify` exactly once
when the diff is final, plus `cd apps/api && go vet ./... && go test
./...` if apps/api changed. A CHANGE THAT CAN REACH A PAGE IS CHECKED ON A
PAGE: bring up the stack (evidence/visual-baseline-2026-09-09.md has the
recipe — Postgres via initdb, migrations + seed-users.sql, the API binary
with UPLOAD_PATH set, vite with API_PROXY_TARGET, Playwright against
/opt/pw-browsers), screenshot every route the change can reach as the
role that reaches it, record console errors and failed requests, diff
against the last pass, file the summary in evidence/. A new or widened
gate is watched failing once on a deliberately broken input. Merge only
on local green AND every CI check green on the PR; a red check is
root-caused, never re-run to see, never skipped.
DOCUMENT: fix every document the diff made wrong in the same PR — README,
AGENTS, docs/, apps/*/AGENTS.md, .env.example + docs/DEPLOYMENT.md for a
configuration key, CHANGELOG.md [Unreleased]. A decision that constrains
future work is an ADR (≤ 120 lines, next free number taken after fetch).
UPDATE ROADMAP: tick the NEXT row with its evidence link, or split it if a
slice landed; SESSION.md Completed entry ≤ 8 lines linking the PR;
refresh "Next". Never restate a track's narrative in ROADMAP.md.
ARCHIVE: anything the change supersedes → .archives/removal-safe/ with its path
preserved and a register row naming the replacement. Never delete.
OUTPUT (hard): PR body ≤ 20 lines; final report one line per item (item |
merge commit | state before → after), then NEXT: <item or none> and
BLOCKER: <new owner decision or none>. No model names or session ids in
the repository. Conventional Commits.
Shape notes
- Inherited, not re-derived. The batch loop, the claim ref, the budgets and the worktree rule are 011's, which were 010's … which were 002's; each was a fix for a recorded failure and the record is 002's shape notes.
- The item source is a list, not a phase table. The closed tracks each had a charter with phases and a ledger with a scoreboard. This workstream has neither: its items are ROADMAP → NEXT, ordered, and the only scoreboard is NEXT getting shorter. A run that wants to add a row adds it to NEXT with a one-line bar, never to a new tracker.
- The CI policy inverted on 2026-09-09. Every earlier
ROUTINE.mdsaid Actions was noise. It runs again, so a run merges only on green checks and investigates red ones; the standing policy is stated once inROADMAP.md. - The visual rule is this workstream's own. The 2026-09-02 direct-URL audit found seven controls that shipped wired to nothing or to the wrong thing, each visible on a page nobody had opened after the change. A screenshot pass is cheap next to that; the recipe is in the evidence file and the baseline it diffs against is committed.
- Completion is a stop, not a search. When NEXT is empty the correct output is "nothing to do", once, and a recommendation to disable the routine. Every DEFERRED row is the owner's; a run that answers one has left the charter.
Source: .station/jobs/012-steady-state/ROUTINE.md