carlos / platform Public

operator pages plan: revise for what landed and what was decided since 2026-10-25

Plan 1's real names on main; perf plan 2 cancelled, so Task 13 and the
deferred-part machinery are gone and /fleet and /fleet/boxes keep honest
over: records; claims shelved, so Task 6A is gone; census step expects an
empty card under C2; Rastrillo v0.29.0 (the mockup's stylesheets) with
anchor.js; labels for five new workers; per-task reviews only for Tasks 4,
5 and 7/7A; the dashboard is shown to Paul as soon as it is built; merges
after console-perf-quick-wins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 014f66b90810e9e65c1fc962f03e6190595d2d7d parent acfa4f8
1 file changed, +98 −158
  • docs/superpowers/plans/2026-10-25-operator-pages.md +98 −158

CI passed — run details

diff --git a/docs/superpowers/plans/2026-10-25-operator-pages.md b/docs/superpowers/plans/2026-10-25-operator-pages.md
index 4bad1cbec..604631ef1 100644
--- a/docs/superpowers/plans/2026-10-25-operator-pages.md
+++ b/docs/superpowers/plans/2026-10-25-operator-pages.md
@@ -2,20 +2,25 @@
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-**Goal:** Move every `/fleet*` operator page into a Rastrillo v0.28.0 console shell (bar, rail, `rst-page`), add a dashboard at `/fleet` that says who is using the platform, what they are doing and whether everything is running, add People and accounts and Activity pages, move today's `/fleet` content to Boxes, and record what the dashboard needs and the console does not record yet (last seen, account-level activity, background job status).
+**Revised 2026-10-26** to match what landed and what was decided since: perf plan 1 merged (`ddf3b929`) and its real names are used below; the navigation round merged (`ed03ca7d`); perf plan 2 (`2026-10-25-console-perf-2-fixes.md`) is cancelled (Paul, 2026-10-26), so this plan has no view cache, no deferred parts and no Task 13; claims are shelved, so Task 6A (the claim-gate audit permit) is gone; the census covers only the root binary (C2, `7c9e9d6a`); review is sized by AGENTS.md "Stopping rules"; Rastrillo moves to v0.29.0; tasks run in an order that shows Paul the admin UI early.
-**Architecture:** Rastrillo's stylesheets and two scripts are copied byte for byte into `internal/console/static/rastrillo/`, embedded, and served by the console at content-hashed URLs; a `VERSION` file records the tag, commit and every file's SHA-256, and a test holds the copies to it. A second layout, `op_top`/`op_bottom` in `templates/opshell.html`, is parsed into the same template set as the customer `top`/`bottom` and never shares a name with it; operator templates call it, customer templates are untouched. Operator markup is hand-written in Rastrillo's attribute vocabulary (as the approved mockup is) through small console partials (`op_*`) ported from v0.28.0's `ui/partials`. New SQLite reads live in `opstore.go`; a column (`users.last_seen`) and two audit indexes arrive in the store's existing additive-migration style. Every `Start*` worker reports each run to an in-process job registry. Remote reads on operator pages go through seam functions that Task 13 points at plan 2's view-cache loaders.
+**Goal:** Move every `/fleet*` operator page into a Rastrillo v0.29.0 console shell (bar, rail, `rst-page`), add a dashboard at `/fleet` that says who is using the platform, what they are doing and whether everything is running, add People and accounts and Activity pages, move today's `/fleet` content to Boxes, and record what the dashboard needs and the console does not record yet (last seen, account-level activity, background job status).
-**Tech Stack:** Go 1.26, `html/template` (one set parsed from `templates/*.html`), `embed`, `net/http` mux patterns via `registerRoute`, SQLite (`modernc.org/sqlite`) through `console.Store`, Rastrillo v0.28.0 CSS/JS (copied, MPL-2.0), headless Chromium for screenshots.
+**Architecture:** Rastrillo's stylesheets and three scripts are copied byte for byte into `internal/console/static/rastrillo/`, embedded, and served by the console at content-hashed URLs; a `VERSION` file records the tag, commit and every file's SHA-256, and a test holds the copies to it. A second layout, `op_top`/`op_bottom` in `templates/opshell.html`, is parsed into the same template set as the customer `top`/`bottom` and never shares a name with it; operator templates call it, customer templates are untouched. Operator markup is hand-written in Rastrillo's attribute vocabulary (as the approved mockup is) through small console partials (`op_*`) ported from v0.29.0's `ui/partials`. New SQLite reads live in `opstore.go`; a column (`users.last_seen`) and the operator indexes arrive in the store's existing additive-migration style. Every `Start*` worker reports each run to an in-process job registry. Remote reads: the dashboard and Boxes read exactly what today's `/fleet` reads (`status/fleet.json`, the box reports behind `HostRows`, and for a store operator the storage queue), each once per view, straight from the bucket. There is no cache in this plan (see "Decisions": operator pages are seldom viewed, so `/fleet` and `/fleet/boxes` keep honest `over:` records).
-**Spec:** `docs/superpowers/specs/2026-10-25-console-ux-perf-design.md`, Part 3 (§3.1 to §3.7) and the Constraints section. Read Part 2 too: this plan lives inside its 150 ms rule. The approved mockup is `/home/paulca/.cache/tmp/console-ux-perf/.superpowers/brainstorm/2160157-1792951277/content/fleet-dashboard.html`: it is the target markup. Where this plan and the spec disagree, the spec wins and the plan is the bug.
+**Tech Stack:** Go 1.26, `html/template` (one set parsed from `templates/*.html`), `embed`, `net/http` mux patterns via `registerRoute`, SQLite (`modernc.org/sqlite`) through `console.Store`, Rastrillo v0.29.0 CSS/JS (copied, MPL-2.0), headless Chromium for screenshots.
-**Related plans, consumed by exact name (do not re-plan their work):**
-- Plan 1, `2026-10-25-console-perf-1-measure.md` (must be merged before this branch is cut): `internal/perf`, `consolePerfSkip`, `Server.PerfGroups`, `consoleSpeedRows` and the Console speed section of `metrics.html`, `newConsoleFixtureWith`, `newPerfFixture`, `perfTargets`, `perfInventory`, `loadPerfBudgets`, the `perf-budgets.txt` grammar (`over:`, `calls <n>:`, `deferred:`, `skip:`), `TestConsoleScreensMeetTheBudget`, `writeTemplate`.
-- Plan 2, `2026-10-25-console-perf-2-fixes.md`: Task 7's `viewMode` (`viewCached`, `viewBlocking`), `errViewPending`, `viewGet`, `viewPart{Gate, Fill, Template}`, `renderView`, the `deferred`, `asof`, `partfailed` and `partloader` partials, `getAssembled`, `s.bg.Go` and the test-only `waitBackground` (Tasks 2 and 6); Task 8's invalidation by read set (every cache entry records the keys and prefixes its load read; an acknowledged object-store write invalidates every entry that covers its key and the writing request re-reads them before it answers), which needs no per-door declaration from this plan; Task 15's loaders `fleetJSONView`, `hostRowsView`, `metricsView`, `economicsView(ctx, p, mode, period)`, `storePendingView`, `storeUsageView`, `architectureView`, each `(ctx context.Context, p *page, mode viewMode) (T, error)`. **Only this plan's Task 13 depends on plan 2**, and it runs once plan 2 Task 15 is on `main`. Plan 2 Task 15 says it wires its loaders into "Part 3's handlers if Part 3 has landed": here that means into this plan's seam functions (`opFleetJSON`, `opHostRows`, `opStorePending`, Task 8), not into templates. Plan 2 adds no operator part route and no operator template; this plan's Task 13 adds both. Plan 2 Task 15 is therefore not superseded: it must precede Task 13, and Task 13 consumes its loaders.
-- The nav plan, `2026-10-25-console-ux-nav.md`, keeps `fleet.html`, `store_approvals.html`, `metrics.html`, `economics.html`, `economics_accounts.html`, `architecture.html` and `fleetdetail.html` byte-identical. This plan rewrites the first six and does not touch `fleetdetail.html` or `layout.html`. No conflict.
+**Spec:** `docs/superpowers/specs/2026-10-25-console-ux-perf-design.md`, Part 3 (§3.1 to §3.7) and the Constraints section. Read Part 2 too: this plan lives inside its 150 ms rule, with the one recorded exception above. The approved mockup is `/home/paulca/.cache/tmp/console-ux-perf/.superpowers/brainstorm/2160157-1792951277/content/fleet-dashboard.html`: it is the target markup. Where this plan and the spec disagree, the spec wins and the plan is the bug, except where "Decisions" records a later ruling.
-**Branch:** `operator-pages`, cut from amadan `main` after plan 1 has merged. Tasks 1 to 12 and 14 run alongside plan 2 and Part 1. If plan 2 Task 15 is not on `main` when Tasks 1 to 12 are done, those land as one merge with `over:` records for the operator screens that still read S3, and Task 13 follows on a second branch `operator-pages-cache` cut after plan 2 merges. *(My call.)* Each landing branch has its own census proposal: `NAME=operator-pages` for the first (overlay `testdata/plan14-root-reads-operator-pages.tsv`, card `docs/superpowers/notes/census-proposal-operator-pages.md`, rows `rev3=census-ruling-operator-pages`), and `NAME=operator-pages-cache` for the second (its own overlay, card and `rev3=census-ruling-operator-pages-cache`, appended after whatever plan 2 added, never replacing the first). Each gets its own approval on #280. When everything lands as one branch, only `operator-pages` exists.
+**Related work, consumed by exact name (do not re-plan it):**
+- Perf plan 1, `2026-10-25-console-perf-1-measure.md`, MERGED `ddf3b929`. On `main`: `internal/perf` (the middleware behind `Server-Timing`), `consolePerfSkip` (`internal/console/server.go`, today `r.URL.Path == "/healthz"`), `Server.PerfGroups`, `consoleSpeedRows` (`perfspeed.go`) and the Console speed section of `metrics.html` (`<h2 id="console-speed">`, copy rows `CPF-*` gated by `approved_console_perf_copy_test.go`), `internal/s3fake`, and the CI walk in `internal/console/perfwalk_test.go`: `newPerfFixture(t) (*consoleFixture, *perfLatency)` (over `newConsoleFixtureWith` and `consoleFixtureOptions{WithKey, S3, AppClient, Wrap, WrapReleases}`), `perfSeed`, `perfTargets(fx) map[string][]perfTarget` (`perfTarget{Path, Expect, Anonymous}`; only screens with a path parameter, or that do not answer 200 at their bare path, need an entry), `perfWalkTargets`, `perfStructural`, `perfInventory(entries []claimEntry)` (`perfbudgets_test.go`), `loadPerfBudgets`, `perfQuiesce`, `perfColdReset`, `TestConsoleScreensMeetTheBudget`, `TestPerfSessionS3Requests` (ceiling in `testdata/perf-session-s3.txt`), and `testdata/perf-budgets.txt` with its four record kinds (`over:`, `calls <n>:`, `deferred:`, `skip:`). `perfLatency` has `Enable`, `Calls() (s3, host int64)`, `Fake() *s3fake.Server` and `AppClient`; the fake's `OnRequest` hook records or fails requests. There is no `latencyStore`, no `fx.clock` and no `Server.now`.
+- `console-perf-quick-wins` (plan `2026-10-26-console-perf-quick-wins.md`, which replaces the cancelled perf plan 2), about to merge: the per-app frame cache (`appframe.go`, `Server.frames`), the account-manifest memo (`Server.manifestSeen`), the per-request memo for GET and HEAD (`reqmemo.go`: `memoize`, `s.loadBoxes`, `s.liveEdges`, `s.instancesManifest`, installed by `registerRoute`), settings sections reading only what they show, and in `perfquickwins_test.go` the test helper `recordS3(lat, fail func(s3Req) bool) *s3Recorder`, which records every S3 request the fake answers (method, key or listing prefix) and fails the ones `fail` names with a 403. It also rewrites the `/fleet*` `over:` records in `perf-budgets.txt` and lowers the session ceiling to 320. This plan uses none of its caches (the frame cache and the memo cover app pages; no operator page reads one object twice) but uses `recordS3` from Task 7A on, and edits the same `perf-budgets.txt` lines.
+- Perf plan 2, `2026-10-25-console-perf-2-fixes.md`: CANCELLED (Paul, 2026-10-26), will not be built. Nothing here depends on it: no `viewGet`, `viewLoadEnv`, read-set invalidation, deferred parts, `partloader`, `carlos:part`, `HoldNext`, `waitBackground` or loaders.
+- The navigation round, `2026-10-25-console-ux-nav.md`, MERGED `ed03ca7d`. It changed the customer layout and the customer fleet pages (`layout.html`, `fleets.go`, `fleet_byo.html`) and left the operator templates (`fleet.html`, `store_approvals.html`, `metrics.html`, `economics.html`, `economics_accounts.html`, `architecture.html`, `fleetdetail.html`) as they were. This plan rewrites the first six and does not touch `fleetdetail.html` or `layout.html`. No conflict.
+
+**Branch:** `operator-pages`, cut from amadan `main` (after plan 1 and the navigation round). Rebase it onto `main` once `console-perf-quick-wins` has merged, and before Task 7A (which uses `recordS3`) and Task 8 (which edits the `/fleet` records in `perf-budgets.txt` that quick-wins rewrites). This branch merges after `console-perf-quick-wins`. Everything lands as one merge.
+
+**Task order and review (AGENTS.md "Stopping rules", rules 3, 1 and 6).** Tasks run in number order, which puts the shell and the dashboard first: Tasks 1 to 3 (copy, assets, shell), then the dashboard's data (Tasks 4, 5, 6, 7, 7A), then Boxes (Task 8: the dashboard replaces today's `/fleet`, so that content needs its new home first, and Task 8 defines the reads the dashboard shares), then the dashboard (Task 9; its Step 6 screenshots go to Paul as soon as it is done), then People (Task 10) and Activity (Task 11), then the moved pages (Task 12), screenshots (Task 14), close-out (Task 15). There is no Task 6A and no Task 13. Own Astra review, one per task, at most three rounds, stopping at the first round with no P1: **Task 4** (schema and migration), **Task 5** (a write on the session path and an in-process throttle), **Tasks 7 and 7A together** (the registry touches every background pass; the alert projection is an in-process cache). Every other task is covered by the one whole-branch review in Task 15. Brief every reviewer from `docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md`, carrying the round history.
## Global Constraints
@@ -24,26 +29,18 @@ Every task's requirements include this section.
- **Copy first.** Task 1 builds `docs/superpowers/plans/2026-10-25-operator-pages-copy.md`: every new or changed user-facing string (rail labels, headings, subheads, stat labels and notes, callout items, status words, table headings, empty states, job names, activity kinds, the stored Detail text of the new audit actions). A Luna pass (`codex exec -m gpt-5.6-luna`) reviews it before any template carries it. Later tasks write the approved text verbatim and add their ids to `operatorPagesCopyBuilt`. A string not in the record is not written.
- **House voice.** No em dashes in a new or changed string: a full stop and a new sentence, continuing in lower case. Human text only: log lines, diagnostics, route patterns, rule and job identifiers, JSON keys and data values (box labels, load words from `fleet.json`) are not copy. Strings that move unchanged from today's operator templates are not rows and are carried verbatim (count each one at the base commit with `git grep -n` before touching it).
- **No tenant names** in code, tests, fixtures or copy. Neutral names only: `shop`, `notes`, `example.com`, `fleet-a`, `box-1`. The existing fixtures (`kass`, `ops`/`bab`, `paul@keymail.dev`, the `ada-stargazing` and `grace-kayaking` box labels) may be reused, never newly introduced. The brand in copy is `<brand>` (`page.Brand`), never a literal product name.
-- **The budget.** Every operator GET answers within 150 ms with at most one S3 read on a warm cache. No new polling, no timers. The dashboard's remote reads are `status/fleet.json`, the per-box snapshots behind `HostRows`, and, for a store operator, the storage queue, all through plan 2's view cache from Task 13 on: refreshed only when someone views, single flight, never on the request path of a warm view. The per-box cost is stated in Task 13 (one `List` of `status/boxes/` plus one `Get` per box, at most once per 60 s window, only when an operator views the dashboard or Boxes, which share the entry). S3 requests must not go up. Every new screen is in plan 1's walk (`TestConsoleScreensMeetTheBudget`); a screen that still reads S3 before Task 13 carries an `over:` record naming Task 13, and Task 13 deletes it.
-- **Cached loaders see the object store only.** Every cached load is a plan 2 `viewLoader[A, T] func(env viewLoadEnv, key viewKey, arg A) (T, error)`: a package-level function in `internal/console/viewloaders.go`, passed to `viewGet` by name. No cached loader in this plan is a closure or a method value (`TestViewLoadersAreRestricted` refuses one), and this plan defines none of its own: all seven operator reads use plan 2 Task 15's loaders and views, and their per-request builders. What each caches (raw object-store facts) and what is derived per request:
- - `fleet.json`: `loadFleetJSON` (`{"", "", partFleetJSON}`, the parsed `*status.Fleet`), behind `fleetJSONView`; box status words, the summary-age test and attention items are per request (`s.now()`).
- - box snapshots: `loadBoxSnapshot` (`partBoxes`, the raw `boxSnapshot`), behind `hostRowsView`, which builds `HostRow`s per request; the dashboard's box rows, staleness, `Dark` and the memory meter are per request.
- - storage queue: `loadStorePending` (`partStorePending`, the entitlement objects listed and read under `store/entitlements/`), behind `storePendingView`; the account-existence filter `pendingStoreApplications` applies today (`AccountBySqid`, `apistore_entitlement.go:235`) and the count are per request.
- - store usage: `loadStoreUsage` (`partStoreUsage`, the sweep record `storeBucketCount` reads), behind `storeUsageView`.
- - metrics: plan 2's one `partMetrics` entry, `loadMetricsFacts` returning `metricsFacts` (60 s), behind `metricsView`, which builds what `LoadMetrics` returns per request from `metricsFacts` and `s.now()`. This plan reads only `metricsView` and defines no metrics type.
- - economics: plan 2's per-day `loadEconomicsDay` entries and its scenario, bill and fleet-meter entries, behind `economicsView(ctx, p, mode, period)`, which runs `buildEconomicsView` per request with account names, tiers, registry attribution and the period's dates from SQLite, the registry and `s.now()`. This plan defines no economics loader or builder.
- - architecture: `loadArchitectureFacts` (`partArchitecture`) plus the `fleet.json` and box entries above, behind `architectureView`; the route list and rate-card arithmetic are per request.
- - `loadFleetJSON`, `loadStorePending` and `loadStoreUsage` are the names this plan expects for the three loaders plan 2 Task 15 describes without naming yet; they are plan 2's to define, in `viewloaders.go`, with this signature. If plan 2 lands them under other names, Task 13 uses those and this list is the bug. Task 13 adds `TestOperatorPagesJoinLocalStatePerRequest` for the joins it can see.
-- **What the view cache holds (plan 2's two rules).** Only object-store loads go through it, and only these: `fleet.json`, the box snapshots behind `HostRows`, the storage queue, metrics, economics, store usage and architecture (plan 2 Task 15's loaders). (a) A cached value holds only object-store facts; SQLite rows, registry routes and the clock are joined per request: the dashboard's counts, series, newest people and latest activity, People and accounts, Activity, the job registry and the alert projection are read per request (indexed SQLite or in-process memory), never cached, and the box status words, the "is the summary old" test and the storage count are computed per request from the cached facts. (b) A load whose key set comes from local state caches one entry per key; no operator load here does (each key set comes from a bucket listing). No deferred fragment contains a `<script>`; page behaviour initializes on load and on `carlos:part`. Background work a request starts goes through `s.bg.Go`; this plan starts none of its own.
-- **Gates unchanged.** The claim SQL gate changes in one place only, Task 6A's `audit` classification, and only after its own review. `operatorOnly` (`server.go:3082`) is the first call of every operator page handler; `storePageOperator` (`storepage.go:119`) stays the gate of `/fleet/store`; `handleEconomicsAccounts`' own copy of the gate stays as it is. Every refusal is the byte-identical missing-route 404. The console's security gate order (session, CSRF, owner, `requireFreshAuth`) is unchanged. No new POST door.
-- **Production wiring.** Console tests build the server with `NewServer` through `newConsoleFixture`/`newConsoleFixtureWith` (the constructor `cmd/console` calls, `cmd/console/main.go:520`) and sign in through `signInPaul`. Store tests open the database with `Open` (the flag-off constructor `openConsoleDB` uses) and, for the claim gate, `newClaimCase` (the `OpenGated` path). A pure unit test says "not acceptance" in its doc comment.
+- **The budget.** No new polling, no timers, no new per-box reads, and S3 requests must not go up. Screens that read only SQLite or memory (`/fleet/index`, `/fleet/people` and its views, `/fleet/activity` and its views) answer within 150 ms with zero remote calls and carry no `perf-budgets.txt` record. The dashboard (`GET /fleet`) and Boxes (`GET /fleet/boxes`) read exactly what today's `/fleet` reads: `status/fleet.json` once, the `status/boxes/` listing and each box report once (`HostRows`), and, for a store operator, the storage queue once. Each keeps an honest `over:` record with its measured count (today's `/fleet` record says 8 S3 calls warm and cold, median about 260 ms). Task 9 asserts that no key is read twice in one view. Every new screen is in plan 1's walk (`TestConsoleScreensMeetTheBudget`).
+- **No cache in this plan.** Perf plan 2 is cancelled, and operator pages are seldom viewed, so a short-TTL cache for `fleet.json` and the box reports would buy little and need its own review and invalidation on operator writes. *(My call, from the coordinator's "prefer the simpler option", 2026-10-26.)* The request memo from `console-perf-quick-wins` is installed on every GET by `registerRoute`, so operator pages get it for free, but no operator page needs it: each reads each object once. The two in-process things this plan keeps (the job registry and the alert projection) are state the console's own passes publish, not copies of bucket objects. SQLite counts and lists, box status words, the "is the summary old" test and the storage count are computed per request.
+- **Gates unchanged.** `operatorOnly` (`server.go`, today `:3357`) is the first call of every operator page handler; `storePageOperator` (`storepage.go:119`) stays the gate of `/fleet/store`; `handleEconomicsAccounts`' own copy of the gate stays as it is. Every refusal is the byte-identical missing-route 404. The console's security gate order (session, CSRF, owner, `requireFreshAuth`) is unchanged. No new POST door. The claim SQL gate (`store_gate.go`) is not touched: claims are shelved (Paul, 2026-10-25/26) and no host-claim console is deployed.
+- **Production wiring.** Console tests build the server with `NewServer` through `newConsoleFixture`/`newConsoleFixtureWith` or `newPerfFixture` (the constructor `cmd/console` calls) and sign in through `signInPaul`. Tests that count or fail S3 requests use `newPerfFixture` (the real S3 client over `internal/s3fake`) with `recordS3`. Store tests open the database with `Open` (the flag-off constructor `openConsoleDB` uses). A pure unit test says "not acceptance" in its doc comment.
- **Targeted local tests.** `go test ./internal/console/ -run 'TestName' -count=1`; never `make test`, never a whole-package run. `TestClaimConsoleMutationInvariant` only under `nice -n 19`, once per task that changes routes. `gofmt -l .` empty, `go vet ./internal/console/ ./cmd/console/`, `GOOS=darwin GOARCH=arm64 go build ./...` and `GOOS=windows GOARCH=amd64 go build ./...` before every push. `GOFLAGS=-buildvcs=false` if the sandbox refuses VCS stamping.
- **Go cache:** leave `GOCACHE`, `GOMODCACHE` and `GOTMPDIR` at their defaults (`~/.cache/go-build`). Run go with the sandbox off if the default cache is read-only.
- **Fetches nothing from anywhere.** Every stylesheet and script an operator page loads is served by the console from `/static/`. No CDN, no webfont, no remote URL in a `<link>` or `<script>`.
- **No inline styles.** No operator page carries a `style` attribute or a `<style>` element. The chart bars' heights are attribute values styled by `static/ops.css` (`co-h="0"` to `co-h="20"`). The console's own CSS for operator pages uses the `co-` prefix and lives in `static/ops.css`.
- **Scratch.** Under a directory made with `mktemp -d "$TMPDIR/…"`, removed by its exact path with `rm -r -- "$DIR"`. Never delete by pattern or glob. Nothing started (Chromium, test servers) outlives the task. Test servers bind `127.0.0.1` (`httptest.NewServer` does).
- **Commit per task.** Every commit message ends with `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. One amadan task per plan task on the branch, advanced as each closes. A new top-level `internal/console` test taking a second or more gets a row in `.amadan/test-weights.tsv`.
-- **Merge main first.** Before review and before merging: `git fetch origin && git merge origin/main`, re-run Task 15's census card, push, wait for CI on that tip, merge with `amadan branch merge carlos/platform operator-pages -expect <tip> -message "..."`. Never a bare `amadan branch merge`.
+- **Merge main first.** Before the branch review and before merging: `git fetch origin && git merge origin/main` (with `console-perf-quick-wins` already in it), re-run Task 15's census card, push, wait for CI on that tip, merge with `amadan branch merge carlos/platform operator-pages -expect <tip> -message "..."`. Never a bare `amadan branch merge`.
+- **Review budget.** AGENTS.md "Stopping rules": own reviews only for Tasks 4, 5 and 7 with 7A (see "Task order and review"), one whole-branch review in Task 15, at most three rounds each, P3s to a follow-up list on the branch.
## Review Focus
@@ -61,14 +58,14 @@ Each is marked *(my call)* where it appears in a task.
- **Template set-up:** `op_top`/`op_bottom` in `templates/opshell.html`, parsed by the existing `ParseFS(tmplFS, "templates/*.html")`; every operator name starts `op_` or `ops_`, so nothing collides with `top`, `bottom` or any customer partial. The shell reads `page.Op *opShell`; Rastrillo's per-page blocks (`view`, `up`, `nav`) become fields, because one shared template set cannot redefine a block per page.
- **Assets:** served at `GET /static/{hash}/{file...}` where `{hash}` is the first 12 hex digits of the file's SHA-256, `Cache-Control: public, max-age=31536000, immutable`. The template func `asset "rastrillo/tokens.css"` returns the URL. Public, no session: these files are MPL-2.0 CSS and JS, and the route reveals nothing about who is an operator. A wrong hash serves the current bytes with `no-cache`.
-- **Copied files:** `tokens.css`, `themes/day.css` (as `day.css`), `shell.css`, `shell.js`, `rastrillo.js` (its light dismiss closes the bar's menus on Escape and an outside click; its polling section stays inert because no operator page emits `data-poll`), and Rastrillo's `LICENSE`. The v0.28.0 files carry no per-file licence header, so the MPL-2.0 notice is the copied `LICENSE` plus a line in `VERSION`.
-- **The mockup was rendered with unreleased stylesheets** (the scaffold-shapes checkout). Every attribute it uses exists in v0.28.0's `tokens.css` (checked: `rst-stats`, `rst-stat~="lead"`, `rst-stat-delta`, `rst-lrow`, `rst-box-head`, `rst-card`, `rst-callout`, `rst-status`, `rst-meter`, `rst-btn`, `.rst-nm`, `.rst-cell-mut`, `--rst-cols`), but details may look slightly different. Task 14 compares.
+- **Copied files:** `tokens.css`, `themes/day.css` (as `day.css`), `shell.css`, `shell.js`, `rastrillo.js` (its light dismiss closes the bar's menus on Escape and an outside click; its polling section stays inert because no operator page emits `data-poll`, and its colour-scheme handler because none carries `rst-scheme`), `anchor.js` (new in v0.29.0's console layout: keeps a dropdown's menu on screen in a browser without CSS anchor positioning; the account menu and the filter dropdowns need it), and Rastrillo's `LICENSE`. Not copied: `light.js` (the spec leaves it out) and `busy.js`. The v0.29.0 files carry no per-file licence header, so the MPL-2.0 notice is the copied `LICENSE` plus a line in `VERSION`.
+- **Rastrillo v0.29.0** (released 2026-10-26, commit `3aa8f377`), the newest released tag, not v0.28.0. The mockup was rendered from the scaffold-shapes checkout, whose `ui/tokens.css`, `ui/themes/day.css` and `ui/shell.css` are byte-identical to v0.29.0's (checked 2026-10-26; v0.28.0's `tokens.css` and `day.css` differ by about 2,100 and 490 diff lines: v0.29.0 is "a new look for `day`"). Every `rst-*` attribute and class the mockup uses exists in v0.29.0 (checked). So the pinned tag matches the approved look; Task 14 still compares. *(Changed from v0.28.0 on 2026-10-26.)*
- **The phone index:** a new screen `GET /fleet/index` renders the shell with `view="index"`. Every other operator page's back control is `/fleet/index#nav-<key>`. The dashboard is a content page, so a phone opens `/fleet` on the dashboard, not on the list.
- **One `<h1>`:** the bar's `<h1 rst-shell-title>` is rendered only on the index view; every content page's one `<h1>` is its page header.
- **Customer console link:** `/`, which already sends a signed-in person to the account they last used.
- **The rail hides Storage requests** from an operator who is not on `CARLOS_STORE_OPERATORS`, because `/fleet/store` answers them 404. The dashboard's storage item follows the same rule.
- **Each moved page's `<h1>` becomes its rail label** (Metrics, Storage requests, Economics, Architecture), with a one-line subhead from the copy record. Every other string on a moved page moves verbatim, including today's em dashes, which are left for a later copy pass so that this branch changes what Part 3 says it changes.
-- **Dashboard Boxes table keeps the mockup's columns** (Paul approved the mockup as "perfect"; coordinator, 2026-10-25): Box, Status, Region, Load as a meter, Last report per box. The per-box data comes from `HostRows` (`status/boxes/*.json`) through plan 2's view cache, not on the request path. This overrides the spec's "`HostRows`' per-box reads stay off the dashboard" by putting them behind the cache instead. Rows are joined by label with `fleet.json`'s `FleetBox` (for the load word). The meter is memory in use (`MemTotalBytes - MemAvailBytes` over `MemTotalBytes`), the same fraction the load word is banded from (`status/snapshot.go:1023`); its text is the whole percentage. Last report is `ago` of `HostRow.LastSeen` with `fmtTime` as the `title`. A silent box shows OPS-76 for load, as the mockup does.
+- **Dashboard Boxes table keeps the mockup's columns** (Paul approved the mockup as "perfect"; coordinator, 2026-10-25): Box, Status, Region, Load as a meter, Last report per box. The per-box data comes from `HostRows` (`status/boxes/*.json`), read on the request path once per view, exactly as today's `/fleet` reads it. This overrides the spec's "`HostRows`' per-box reads stay off the dashboard": with perf plan 2 cancelled there is no cache to put them behind, and operator pages are seldom viewed, so the dashboard costs what today's `/fleet` costs and keeps an honest `over:` record (coordinator, 2026-10-26). Rows are joined by label with `fleet.json`'s `FleetBox` (for the load word). The meter is memory in use (`MemTotalBytes - MemAvailBytes` over `MemTotalBytes`), the same fraction the load word is banded from (`status/snapshot.go:1023`); its text is the whole percentage. Last report is `ago` of `HostRow.LastSeen` with `fmtTime` as the `title`. A silent box shows OPS-76 for load, as the mockup does.
- **Box status words:** Stale when `fleet.json` itself is older than `3 × status.SnapshotPeriod` (every row); else Silent when `HostRow.Stale` (or `FleetBox.Stale` for a box `HostRows` did not list); else Busy when the load word is `busy` (warning tone) or `critical` (negative tone); else Healthy.
- **Attention tone:** negative when a service is down; warning for any other item; positive when there are none. Not an attention item: no `fleet.json` yet (that is the Boxes section's empty state).
- **Windows:** all UTC. "This week" is the last 7 × 24 h; "last week" the 7 × 24 h before it; "today" since UTC midnight. "Active" is `last_seen` in the window or a session created in it (sessions are purged at 30 days, so the 30-day number is right from the first day, before `last_seen` has filled). Deploys are audit rows with action `promote` or `rollback`. Apps are rows with `deleted_at = 0`; new accounts count accounts created in the window, deleted since or not.
@@ -77,12 +74,12 @@ Each is marked *(my call)* where it appears in a task.
- **Newest people:** Account is the account of the person's earliest live membership (else `none`); Apps counts live apps they created (`apps.created_by`).
- **People and accounts:** one page with `seg-tabs` People and Accounts (`?show=accounts`), each with its own search (`q`, literal, at most 100 characters) and numbered pages of 50. Accounts lists live accounts only.
- **Activity:** newest first by `audit.id`, 50 per page, keyset paging (`before=<id>`, links Newest and Older) because `OFFSET` over the audit table grows. Kinds: Everything, Deploys (`promote`, `rollback`), Sign-ins (`signin`, `first-signin`), Accounts and invites (`account-created`, `account-deleted`, `invite-sent`, `invite-accepted`), Other changes (everything else). The account filter is `?account=<sqid>`, reached from the Account column's links; an unknown sqid is an empty feed. The What column is the row's stored `Detail`, as the app Activity tab shows it.
-- **Account-level audit rows** have `app = ""`. Sign-ins carry `account_id = 0`; invites and account events carry their account. They are written on every console, host-claim consoles included. Today the claim gate's `audit` triggers refuse any insert without an app permit (`store_gate.go:535-585`), so Task 6A classifies `audit` with the gate's existing `FreeWhenNoApp` rule, the one `cli_tokens` already uses for its app-less user tokens (`store_gate.go:191`): a row whose `app` is `''` names no app incarnation, so no app permit can cover it, and the rule admits exactly those rows. Rows with any app (including the existing `account` and `(service credentials)` subjects) still need their permit, and moving a row into or out of an app still checks both sides. The change goes through an independent gate review recorded on #280 before merge (Task 6A). *(My call: this is the "or equivalent" to an account permit; it reuses a reviewed gate rule instead of adding a permit mode, which would need a new `CHECK` value, new trigger branches and a new grant constructor.)*
+- **Account-level audit rows** have `app = ""`. Sign-ins carry `account_id = 0`; invites and account events carry their account. They are written normally through `RecordActivity`, with no gate change. Claims are shelved (Paul, 2026-10-25/26): no host-claim console runs, so the claim gate's `audit` triggers (`store_gate.go`) are not changed and the earlier Task 6A is dropped. On a store opened with `OpenGated` the insert would be refused; `auditAccount` logs that and the action goes on.
- **Last seen** is written by `session()`, by `cliRoute` for person principals (`PrincipalUser`), by `cliUser`, and by `finishSignin`: at most once an hour per address per process, `UPDATE users SET last_seen = ? WHERE address = ? AND last_seen < ?`. The hour is reserved atomically: one mutex guards the check and the reservation together (`Server.seenMu`, `Server.seen map[string]time.Time`), and the write happens after the lock is released, so concurrent requests after expiry make exactly one write attempt.
-- **Job registry:** keyed by the claim worker names (`claim_workers.go`), seeded at `NewServer` as "Not run yet". A pass reports each run with `s.jobs.Run(ctx, "<worker name>", pass)`. Every pass, whether it returns an error or not, also marks the run failed with `jobFailed(ctx, err)` at each site that logs a failure and carries on (a per-item read, parse or write that is stepped over, as `alertPass` does at `alertwatch.go:121-129` before returning nil): one item failing marks the run Failed, and the pass carries on as today. A test walks the listed pass functions and refuses a swallowed failure log without `jobFailed`. A worker that returns without ever reporting a run is not configured here and drops out of the table. Display order is by label.
+- **Job registry:** keyed by the console worker names `registerClaimWorkers` registers (`claim_workers.go`; 25 on `main` on 2026-10-26), seeded at `NewServer` as "Not run yet". A pass reports each run with `s.jobs.Run(ctx, "<worker name>", pass)`. Every pass, whether it returns an error or not, also marks the run failed with `jobFailed(ctx, err)` at each site that logs a failure and carries on (a per-item read, parse or write that is stepped over, as `alertPass` does at `alertwatch.go:121-129` before returning nil): one item failing marks the run Failed, and the pass carries on as today. A test walks the listed pass functions and refuses a swallowed failure log without `jobFailed`. A worker that returns without ever reporting a run is not configured here and drops out of the table. Display order is by label.
- **Old `/fleet` content:** `/fleet` keeps answering 200 (now the dashboard), so no HTTP redirect is needed. Every in-console link to that content (`store_approvals.html:3`, tests, claim probes) moves to `/fleet/boxes`, and the dashboard links there. No other URL changes.
- **Firing alerts are current state, not notification history.** `alert_seen` records what each recipient was told (and geoip's `geoip@N` reason rows), so it cannot say what is firing now. The alert watcher keeps an in-process projection instead (`Server.alertsNow`), replaced box by box on every pass from the published `alerts/boxes/<box>.json` objects it already reads: one entry per firing `(box, rule)`, with `since` from the rule's `FiredAt`. A box whose object failed to read or parse keeps its previous entries; a box whose object is gone is dropped. Before the first pass after a start the projection is "not known yet" and the dashboard lists no alert item. On a console with no keymail sender `alertPass` returns before reading anything (as today, so no new S3 reads); there the projection stays unknown and the Metrics page remains where alerts show. The claim runtime's receipt-database pages (`claim_runtime.go:315`, host-claim only) are not bucket alerts and stay off the dashboard this round. *(My call: in-process like the job registry, because the watcher reruns at start.)*
-- **Economics scripts survive a deferred body.** A fragment inserted with `outerHTML` runs no `<script>` inside it. So each economics page's script moves out of the body into the page frame as a named, idempotent initializer (`econInit(root)`, `econAccountsInit(root)`), run once at load on the body if it is there, and again on each `carlos:part` event the part loader dispatches after inserting a fragment. Following plan 2's rule that a deferred fragment carries no `<script>` at all, the data block (`<script type="application/json" id="econ-data">`) leaves the body too: its JSON moves to a `data-econ` attribute on the body's wrapper (`<div id="econ-body" data-econ="{{.Economics.DataJSON}}">`, escaped by `html/template`), which the initializer parses.
+- **Economics scripts stay where they are.** With no deferred parts, each economics page's inline script and its `econ-data` block stay in the page verbatim; only the markup around them is re-dressed (Task 12). *(The earlier initializer and `data-econ` move existed only for plan 2's deferred fragments and is dropped.)*
- **Economics:** `/fleet/economics` and `/fleet/economics/accounts` both carry `seg-tabs` Overview and Accounts; the accounts page's search form and position links become one `list-bar` (search plus a filter dropdown); its "Back to the dashboard" link goes (the tabs replace it).
---
@@ -106,7 +103,6 @@ Each is marked *(my call)* where it appears in a task.
| `internal/console/store.go` (modify `:551`) | `migrate` calls `migrateOperatorPages` | 4 |
| `internal/console/lastseen.go`, `lastseen_test.go` (create) | `noteSeen` and its call sites | 5 |
| `internal/console/opaudit.go`, `opaudit_test.go` (create) | the six account-level actions | 6 |
-| `internal/console/store_gate.go` (modify `:190`), `store_gate_test.go` (modify) | `audit` admits app-less rows under the claim gate | 6A |
| `internal/console/jobs.go`, `jobs_test.go` (create) | the registry, `jobFailed`, labels | 7 |
| `internal/console/alertnow.go`, `alertnow_test.go` (create); `alertwatch.go` (modify) | what is firing now, kept by the watcher | 7A |
| every `Start*` file listed in Task 7 (modify) | each run reports | 7 |
@@ -116,10 +112,9 @@ Each is marked *(my call)* where it appears in a task.
| `internal/console/opactivity.go`, `opactivity_test.go`, `templates/ops_activity.html` (create) | Activity | 11 |
| `templates/store_approvals.html`, `metrics.html`, `economics.html`, `economics_accounts.html`, `architecture.html` (modify) | moved into the shell | 3, 12 |
| `internal/console/server.go` (modify) | registrations near `:1461-1477`, `page` fields, `handleFleet` replaced | 3, 8, 9, 10, 11 |
-| `internal/console/opparts_view.go` (create) | `fleetParts`, `handleFleetPart` | 13 |
| `internal/console/opshots_test.go` (create) | opt-in screenshots | 14 |
-| `internal/console/testdata/claim-routes.txt`, `claim_invariant_fixtures_test.go`, `claim_invariant_probes_read_test.go` (modify) | route census and probes for each new route | 2, 3, 8, 9, 10, 11, 13 |
-| `internal/console/testdata/perf-budgets.txt`, `perfwiring_test.go` (modify) | records for new screens; `consolePerfSkip` covers `/static/` | 2, 8, 9, 13 |
+| `internal/console/testdata/claim-routes.txt`, `claim_invariant_fixtures_test.go`, `claim_invariant_probes_read_test.go` (modify) | route census and probes for each new route | 2, 3, 8, 9, 10, 11 |
+| `internal/console/testdata/perf-budgets.txt` (modify), `server.go` (`consolePerfSkip`), `perfwalk_test.go` (`perfTargets`, `perfSeed`) | records for new screens; `consolePerfSkip` covers `/static/`; walk targets and seeds | 2, 8, 9, 10, 11 |
---
@@ -131,7 +126,7 @@ Each is marked *(my call)* where it appears in a task.
- Create: `docs/superpowers/plans/LUNA-COPY-BRIEF-OPERATOR-PAGES.md`, `docs/superpowers/plans/LUNA-COPY-REVIEW-OPERATOR-PAGES.md`
**Interfaces:**
-- Produces: rows `OPS-1` to `OPS-148`, all `approved`; `var operatorPagesCopyBuilt = []string{}` in the gate (later tasks append the ids they write). Placeholders are `<name>` in the record, and the gate checks the fixed text between them, as the moves gate does.
+- Produces: rows `OPS-1` to `OPS-153`, all `approved`; `var operatorPagesCopyBuilt = []string{}` in the gate (later tasks append the ids they write). Placeholders are `<name>` in the record, and the gate checks the fixed text between them, as the moves gate does.
The record uses the moves record's format (one table per heading; columns id, file, text, status), and the gate reuses `parseCopyTable`, `checkMovesNoEmDash`, `checkRunBuilt` and `checkRunApplied` exactly as `approved_asset_cache_copy_test.go` does; name the helpers `operatorPagesBuiltRows`, `checkOperatorPagesBuilt`, `mustParseOperatorPagesCopyRecord`, with id pattern `^OPS-[0-9]+$`. A page's `<h1>` uses its rail row (OPS-8 to OPS-15), so h1s are not separate rows.
@@ -240,11 +235,12 @@ Draft rows (Luna may change any text; ids and files are fixed):
| OPS-146 | `templates/ops_boxes.html` | Memory (the Hosts table's meter column) |
| OPS-147 | same | Last report |
| OPS-148 | `templates/ops_activity.html` | <account> (deleted) (the Activity filter line's name for a deleted account) |
+| OPS-149 to OPS-153 | `jobs.go` | labels for the five workers registered since the list above was drawn (2026-10-26): StartBillingSyncPass "Billing sync", StartLifetimesCutoverWatch "Lifetimes switch-over check", StartLifetimeRecoveryPass "Lifetime recovery", StartIncarnationMigrationPass "Incarnation migration", StartEgressReport "Egress report". If `registerClaimWorkers` names another worker when Task 7 starts, add a row for it the same way and send it through Luna before Task 7 writes it. |
A row's file is where the gate looks for its text; a later page that shows the same words carries them too, unchecked.
- [ ] **Step 1: Write the record** with the rows above as `pending`, one row per id (expand the grouped rows), a placeholder note (`<n>` a whole number of 2 or more where a singular row exists; `<age>` a `humanAge` value; `<brand>` the console's name), and the house rules section copied from `2026-10-24-edge-asset-cache-copy.md`. Header text: where each string shows (an operator-only console; the rail on every page; the dashboard's sections), that strings moved unchanged are not rows, and that OPS-131 to OPS-136 are stored in audit rows at write time.
-- [ ] **Step 2: Write the gate** `approved_operator_pages_copy_test.go` with `TestOperatorPagesCopyInventory` (every row parses, ids unique, no em dash in any text, 148 rows) and `TestOperatorPagesCopyBuiltRowsAreApprovedAndPresent` (every id in `operatorPagesCopyBuilt` is `approved` and its fixed text is in its file).
+- [ ] **Step 2: Write the gate** `approved_operator_pages_copy_test.go` with `TestOperatorPagesCopyInventory` (every row parses, ids unique, no em dash in any text, 153 rows) and `TestOperatorPagesCopyBuiltRowsAreApprovedAndPresent` (every id in `operatorPagesCopyBuilt` is `approved` and its fixed text is in its file).
- [ ] **Step 3: Run** `go test . -run 'TestOperatorPagesCopy' -count=1`. Expected: PASS (nothing built).
- [ ] **Step 4: Write the brief** `LUNA-COPY-BRIEF-OPERATOR-PAGES.md`: Paul delegated plan copy; read the record, spec §3.2 to §3.5 and the mockup; house rules (no em dashes, full stop and a lower-case continuation; plain words; neutral names; keep every `<placeholder>`; rail and tab labels stay short nouns; status words stay one word; facts unchanged); flag anything not human text. Output: a table `id | current | new | why`, a flags list, one count line. Commit the record, gate and brief so Luna reviews a fixed commit.
- [ ] **Step 5: Run Luna** from a script file under a scratch dir, with the sandbox off (codex writes under `~/.codex`):
@@ -252,7 +248,7 @@ A row's file is where the gate looks for its text; a later page that shows the s
```bash
codex exec -m gpt-5.6-luna -c model_reasoning_effort="medium" -s read-only \
-c 'sandbox_permissions=["disk-full-read-access"]' \
- -C /home/paulca/amadan.net/carlos/platform/.claude/worktrees/console-ux-perf \
+ -C /home/paulca/amadan.net/carlos/platform/.claude/worktrees/operator-pages \
-o docs/superpowers/plans/LUNA-COPY-REVIEW-OPERATOR-PAGES.md \
"Read docs/superpowers/plans/LUNA-COPY-BRIEF-OPERATOR-PAGES.md and follow it." </dev/null
```
@@ -261,14 +257,14 @@ Expected: the review file exists with a changes table, and its header does not s
- [ ] **Step 6: Apply Luna's text verbatim**, mark every row `approved` with "approved by delegation to Luna, 2026-10-25". Rows Luna flags as fact or scope questions go to Paul; only the tasks that write those rows wait.
- [ ] **Step 7: Run the gate**, expected PASS; temporarily set one row `pending` and add its id to `operatorPagesCopyBuilt`, confirm FAIL, revert. Commit, message `operator pages: copy record and Luna pass`.
-### Task 2: Rastrillo v0.28.0 copied in, served at hashed URLs
+### Task 2: Rastrillo v0.29.0 copied in, served at hashed URLs
**Files:**
-- Create: `internal/console/static/rastrillo/{tokens.css,day.css,shell.css,shell.js,rastrillo.js,LICENSE,VERSION}`, `internal/console/static/ops.css` (a header comment only in this task)
+- Create: `internal/console/static/rastrillo/{tokens.css,day.css,shell.css,shell.js,rastrillo.js,anchor.js,LICENSE,VERSION}`, `internal/console/static/ops.css` (a header comment only in this task)
- Create: `internal/console/assets.go`, `internal/console/assets_test.go`
-- Modify: `internal/console/server.go` (`"asset": assetURL` in the FuncMap at `:67`; `s.registerRoute("GET /static/{hash}/{file...}", s.handleStatic)` beside `GET /{$}` at `:1447`)
+- Modify: `internal/console/server.go` (`"asset": assetURL` in the template FuncMap; `s.registerRoute("GET /static/{hash}/{file...}", s.handleStatic)` beside `GET /{$}`; `consolePerfSkip` also skips paths under `/static/`)
- Modify: `internal/console/icons.go` (six Lucide icons: `menu`, `circle-check`, `circle-x`, `info`, `search`, `x`, vendored as the file's existing ones are)
-- Modify: `internal/console/perfwiring_test.go` and plan 1's `consolePerfSkip` (skip paths under `/static/`), `internal/console/testdata/perf-budgets.txt` (`GET /static/{hash}/{file...} skip: static asset, not a screen; perf skips it`)
+- Modify: `internal/console/testdata/perf-budgets.txt` (`GET /static/{hash}/{file...} skip: static asset, not a screen; consolePerfSkip leaves it unmeasured`; the screen has path parameters, so without this record `perfStructural` fails the walk)
- Modify: `internal/console/testdata/claim-routes.txt` (`route GET /static/{hash}/{file...}`), `claim_invariant_fixtures_test.go` (`claimRead("public design-system file from the binary; reads nothing")`), `claim_invariant_probes_read_test.go` (`claimPageRead(nil, assetURL("rastrillo/tokens.css"), "--rst-")`)
**Interfaces:**
@@ -284,8 +280,8 @@ Copy the files exactly:
```bash
R=/home/paulca/amadan.net/rastrillo/rastrillo D=internal/console/static/rastrillo
mkdir -p "$D"
-for f in tokens.css themes/day.css shell.css shell.js rastrillo.js; do git -C "$R" show "v0.28.0:ui/$f" > "$D/$(basename "$f")"; done
-git -C "$R" show v0.28.0:LICENSE > "$D/LICENSE"
+for f in tokens.css themes/day.css shell.css shell.js rastrillo.js anchor.js; do git -C "$R" show "v0.29.0:ui/$f" > "$D/$(basename "$f")"; done
+git -C "$R" show v0.29.0:LICENSE > "$D/LICENSE"
```
`VERSION` (comment lines start `#`):
@@ -294,18 +290,19 @@ git -C "$R" show v0.28.0:LICENSE > "$D/LICENSE"
# Rastrillo design-system files, copied unmodified from the tag below.
# Never edit them by hand: re-copy from a tag and update this file.
# Licence: MPL-2.0, see LICENSE. The upstream files carry no per-file header.
-tag v0.28.0
-commit 58718d8968252ee4eeec4caafdfb14e78b34a688
-file tokens.css ui/tokens.css a6e8618148323ab1c38003ff5f20cf7ae3dea4cc17d21ea0402b6adcc8fe894a
-file day.css ui/themes/day.css b76151f3ed219c3153f8da589cec527f5a47e56338e7edccad0fa928466c0b1e
+tag v0.29.0
+commit 3aa8f377718f244f1b9c0a8fb70362e39e8d6d04
+file tokens.css ui/tokens.css 8a99d7e8512d89d8d2469545b57eef670836a376d1fbdbf5e26096aa9241234c
+file day.css ui/themes/day.css 2deaa9f663d9929cfa9238d60ed0e532dc552313d5838b8e0d076f9991b4907f
file shell.css ui/shell.css 566f7dfb5f3907f12b7de92d133e5430ad4537892e9e55578665a849353fb108
file shell.js ui/shell.js 6fa4c282e48d2c63b30d84ce990bf3b8fbec8a717624e3fafb73e6d3d2ac34d7
-file rastrillo.js ui/rastrillo.js 665c4a111d0b11cae7a6f7f5babad81670fd6033d6db96cc6b6bb30a326e23e0
+file rastrillo.js ui/rastrillo.js 13a8ca6fa9ac25833f6485ab50a521dff7bd811372025dc5141b96522b60098b
+file anchor.js ui/anchor.js 9a015c586428d682f5d00eb5ec33df316e48bcf2c4b6418b83400eec70c3ba08
file LICENSE LICENSE 3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779b9d04
```
- [ ] **Step 1: Write the failing tests** in `assets_test.go`:
- - `TestRastrilloCopiesMatchVersion`: parse `static/rastrillo/VERSION`; `Tag == "v0.28.0"`; the set of `Files` names equals the directory's files minus `VERSION`; each file's SHA-256 equals its line. A one-byte edit to any copy fails it (check by hand once).
+ - `TestRastrilloCopiesMatchVersion`: parse `static/rastrillo/VERSION`; `Tag == "v0.29.0"`; the set of `Files` names equals the directory's files minus `VERSION`; each file's SHA-256 equals its line. A one-byte edit to any copy fails it (check by hand once).
- `TestRastrilloCopiesMatchTheTag`: skipped unless `RASTRILLO_REPO` is set; for each line, `git -C $RASTRILLO_REPO show <tag>:<source>` equals the file byte for byte, and `git rev-list -n1 <tag>` equals `Commit`.
- `TestStaticAssetsAreServedWithLongCache` (on `newConsoleFixture`, signed out): GET `assetURL("rastrillo/tokens.css")` answers 200, `text/css; charset=utf-8`, the immutable `Cache-Control`, `nosniff`, and the file's bytes; the same for `shell.js` with `text/javascript; charset=utf-8`; a HEAD answers 200 with no body.
- `TestStaticStaleHashServesCurrentWithoutLongCache`: `/static/000000000000/rastrillo/tokens.css` answers 200, the current bytes, `Cache-Control: no-cache`.
@@ -314,9 +311,9 @@ file LICENSE LICENSE 3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779
- `TestAssetURLPanicsOnUnknownName`.
- `TestStaticIsNotMeasured`: after a GET of an asset, no `fx.srv.PerfGroups()` group names `/static/`, and the response has no `Server-Timing`.
- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestRastrillo|TestStatic|TestAssetURL' -count=1`. Expected: FAIL.
-- [ ] **Step 3: Copy the files, write `VERSION`, implement** `assets.go`, the FuncMap entry, the route, the icons and the perf skip. Add the census line, fixture and probe.
-- [ ] **Step 4: Run** Step 2's command, `go test ./internal/console/ -run 'TestTemplateIconSlugsAllExist|TestClaimConsoleRouteCensus|TestPerfInventory|TestPerfBudgetsFileParses' -count=1`, `nice -n 19 go test ./internal/console/ -run '^TestClaimConsoleMutationInvariant$' -count=1` (runs the new probe), `RASTRILLO_REPO=/home/paulca/amadan.net/rastrillo/rastrillo go test ./internal/console/ -run TestRastrilloCopiesMatchTheTag -count=1`, and both cross-compiles. Expected: PASS.
-- [ ] **Step 5: Commit**, message `console: Rastrillo v0.28.0 stylesheets and shell scripts, copied and served at hashed URLs`.
+- [ ] **Step 3: Copy the files, write `VERSION`, implement** `assets.go`, the FuncMap entry, the route, the icons, the `consolePerfSkip` change and the `skip:` record. Add the census line, fixture and probe.
+- [ ] **Step 4: Run** Step 2's command, `go test ./internal/console/ -run 'TestTemplateIconSlugsAllExist|TestClaimConsoleRouteCensus|TestPerfInventory|TestPerfBudgetsFileParses|TestHealthzIsNotMeasured' -count=1`, `nice -n 19 go test ./internal/console/ -run '^TestClaimConsoleMutationInvariant$' -count=1` (runs the new probe), `RASTRILLO_REPO=/home/paulca/amadan.net/rastrillo/rastrillo go test ./internal/console/ -run TestRastrilloCopiesMatchTheTag -count=1`, and both cross-compiles. Expected: PASS.
+- [ ] **Step 5: Commit**, message `console: Rastrillo v0.29.0 stylesheets and shell scripts, copied and served at hashed URLs`.
### Task 3: The operator shell, its partials, the phone index; Storage requests moved in
@@ -337,10 +334,10 @@ file LICENSE LICENSE 3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779
- `func (s *Server) handleOpIndex(w http.ResponseWriter, r *http.Request)`: `operatorOnly`, then `ops_index` with `View: "index"`.
- partial data in `opparts.go`: `opHeader{Title, Sub string}`, `opPill{Label, Tone string}`, `opStat{Label, Value, Delta, Tone, Note string; Lead bool}`, `opEmpty{Title, Body string}`, `opMeter{Percent int; Text string}`, `opTab{Label, Href string; Current bool}`, `opTabs{Label string; Items []opTab}`, `opDropdown{Label, Aria string; Items []opTab}`, `opListBar{Action, Query, Placeholder, ClearHref string; Hidden [][2]string; Filter *opDropdown}`, `opPageItem{Label, Href string; Current, Disabled, Gap bool}`, `opPager{Label string; Items []opPageItem}`.
- `func opPages(path string, q url.Values, page, pages int) []opPageItem`: first, last, current ± 2, a `Gap` between runs; each `Href` is `path` with `q` plus `page=<n>` (page 1 omits it). `func opNumber(n int) string`: thousands with commas (`1,214`).
- - partials in `opparts.html`, each one v0.28.0's `ui/partials/<name>.html` markup with `{{T …}}` replaced by the approved rows, `{{number}}` by preformatted strings and `{{icon}}` by the console's `icon`: `op_page_header` (`page-header`), `op_status` (`status-pill`), `op_stat` (`stat`), `op_empty` (`empty-state`, no CTA), `op_meter` (`meter`), `op_seg_tabs` (`seg-tabs`), `op_dropdown` (`dropdown`), `op_list_bar` (`list-bar` with `list-bar-search` inlined), `op_pagination` (`pagination`). Task 7 adds `op_jobs`.
+ - partials in `opparts.html`, each one v0.29.0's `ui/partials/<name>.html` markup with `{{T …}}` replaced by the approved rows, `{{number}}` by preformatted strings and `{{icon}}` by the console's `icon`: `op_page_header` (`page-header`), `op_status` (`status-pill`), `op_stat` (`stat`), `op_empty` (`empty-state`, no CTA), `op_meter` (`meter`), `op_seg_tabs` (`seg-tabs`), `op_dropdown` (`dropdown`), `op_list_bar` (`list-bar` with `list-bar-search` inlined), `op_pagination` (`pagination`). Task 7 adds `op_jobs`.
- test-only in `opshell_test.go`: `func signInOperator(t *testing.T, fx *consoleFixture) *http.Client` (`signInPaul`, `SetOperator(true)`, `fx.srv.cfg.StoreOperators = []string{"paul@keymail.dev"}` as `storepage_test.go:197` does); `func operatorScreens(fx *consoleFixture) []string`: every path from plan 1's `perfInventory(fx.srv.claimEntries.snapshot())` under `/fleet` with no path parameter, minus screens with a `skip:` record; `var opShellPending = map[string]bool{"/fleet": true, "/fleet/metrics": true, "/fleet/economics": true, "/fleet/economics/accounts": true, "/fleet/architecture": true}` (later tasks delete entries; Task 12 leaves it empty and Tasks 8 to 11 never add to it); `func opRailKeyFor(path string) string` (the longest `opRail` `Href` that prefixes `path`; `/fleet/index` is `""`); `func assertOpShell(t *testing.T, path, body string)`.
-`op_top` is v0.28.0's `ui/layouts/console.html` ported by hand, in the same DOM order: `<!doctype html><html lang="en" dir="ltr">`, `<title>{{.Title}} · OPS-1</title>`, `<link>`s to `asset "rastrillo/tokens.css"`, `"rastrillo/day.css"`, `"rastrillo/shell.css"`, `"ops.css"`; `<script defer src=rastrillo.js>`, `<script defer blocking="render" src=shell.js>`; `<div rst-shell-console="{{.Op.View}}">`, the skip link (OPS-2), the bar with `<h1 rst-shell-title>` only when `.Op.View` is `index`, the brand link (OPS-1, `href="/fleet"`), the `rst-shell-menu` disclosure (OPS-3 with `icon "menu"`, the profile avatar placeholder and `.Address`), the tail with `rst-shell-who` (`.Address`) and the `rst-shell-account` dropdown whose summary is `.Address` and whose menu holds `<a href="/">OPS-5</a>` and a POST form to `/auth/signout` carrying `.CSRF` with a `<button type="submit">OPS-6</button>`; the back strip `<a href="{{.Op.Up}}" rel="up">OPS-4</a>`; the rail `<nav rst-shell-nav aria-label="OPS-7">` with one `<a id="nav-<key>" href>` per `opRail .Op` item, `aria-current="page"` on the one whose key is `.Op.Rail`; then `<main rst-shell-main id="main"><div rst-page>`. `op_bottom` closes them, puts today's footer line (moved verbatim from `layout.html:598`) in `<footer rst-shell-foot>`, and closes the document. Neither includes anything from `layout.html`. The account menu's form reuses the gate the customer header's sign-out form uses; nothing about sign-out changes. *(My call: the shell's per-page blocks become `opShell` fields because one shared template set cannot redefine a block per page.)*
+`op_top` is v0.29.0's `ui/layouts/console.html` ported by hand, in the same DOM order: `<!doctype html><html lang="en" dir="ltr">`, `<title>{{.Title}} · OPS-1</title>`, `<link>`s to `asset "rastrillo/tokens.css"`, `"rastrillo/day.css"`, `"rastrillo/shell.css"`, `"ops.css"`; `<script defer src=rastrillo.js>`, `<script defer src=anchor.js>`, `<script defer blocking="render" src=shell.js>` (v0.29.0's order, minus `busy.js` and `light.js`); `<div rst-shell-console="{{.Op.View}}">`, the skip link (OPS-2), the bar with `<h1 rst-shell-title>` only when `.Op.View` is `index`, the brand link (OPS-1, `href="/fleet"`), the `rst-shell-menu` disclosure (OPS-3 with `icon "menu"`, the profile avatar placeholder and `.Address`), the tail with `rst-shell-who` (`.Address`) and the `rst-shell-account` dropdown whose summary is `.Address` and whose menu holds `<a href="/">OPS-5</a>` and a POST form to `/auth/signout` carrying `.CSRF` with a `<button type="submit">OPS-6</button>`; the back strip `<a href="{{.Op.Up}}" rel="up">OPS-4</a>`; the rail `<nav rst-shell-nav aria-label="OPS-7">` with one `<a id="nav-<key>" href>` per `opRail .Op` item, `aria-current="page"` on the one whose key is `.Op.Rail`; then `<main rst-shell-main id="main"><div rst-page>`. `op_bottom` closes them, puts today's footer line (moved verbatim from `layout.html:598`) in `<footer rst-shell-foot>`, and closes the document. Neither includes anything from `layout.html`. The account menu's form reuses the gate the customer header's sign-out form uses; nothing about sign-out changes. *(My call: the shell's per-page blocks become `opShell` fields because one shared template set cannot redefine a block per page.)*
`store_approvals.html` becomes `{{define "store_approvals"}}{{template "op_top" .}}{{template "op_page_header" (opHeader OPS-13, OPS-138)}}…{{template "op_bottom" .}}{{end}}`: its counts and paragraphs move verbatim into an `rst-card`; each application is an `rst-card` section with the existing `<h2>`; Approve is `rst-btn="primary"`, Decline `rst-btn="danger"` (check the attribute value in `tokens.css`), the reason input `rst-input`; the "Fleet status" link at `:3` goes (the rail replaces it); the empty state is `op_empty` with the existing sentence. The page's `Title` comes from `opPage`.
@@ -402,6 +399,7 @@ Every method is a read on `s.db` except `TouchLastSeen`, which writes `users`, a
- [ ] **Step 3: Implement** `opstore.go` and the one-line `migrate` change.
- [ ] **Step 4: Run** Step 2's command and the store's own guards: `go test ./internal/console/ -run 'TestClaimSQL|TestStore|TestMigrate|Census' -count=1`. Expected: PASS.
- [ ] **Step 5: Commit**, message `console store: users.last_seen, audit indexes, and the operator pages' reads`.
+- [ ] **Step 6: Task review (schema and migration).** One Astra review of this task's diff from `REVIEW-BRIEF-TEMPLATE.md`, round budget three, stopping at the first round with no P1. What to check: the migration is additive and idempotent on a production-sized `console.db` (no table rewrite, no lock held for long: one `ALTER TABLE ... ADD COLUMN` with a constant default and `CREATE INDEX IF NOT EXISTS`), a console rolled back to the previous release still opens the migrated database, the query-plan witness checks what runs, and the search escaping is literal. Apply P2s without reopening; P3s to the branch's follow-up list.
### Task 5: Last seen, at most once an hour per person
@@ -424,6 +422,7 @@ Call sites: `session()` after `SessionAddress` succeeds; `cliRoute` after `CLIPr
- [ ] **Step 3: Implement.**
- [ ] **Step 4: Run** Step 2's command and `go test ./internal/console/ -run 'TestConsoleE2E|NonMember|CSRF|TestAuthCLIFamily|TestEveryCLIDoorNamesItsRoles|TestEmailSignin' -count=1`. Expected: PASS.
- [ ] **Step 5: Commit**, message `console: remember when each person was last seen, at most once an hour`.
+- [ ] **Step 6: Task review (session path).** One Astra review of this task's diff, same budget as Task 4. What to check: no call site runs before its gate has passed (a refused session, token or sign-in writes nothing), a failing write never fails or slows the request beyond one indexed `UPDATE`, the reservation is atomic, and the `seen` map cannot grow without bound from unauthenticated input (it is keyed only by addresses that passed a gate).
### Task 6: Account-level activity rows
@@ -435,7 +434,7 @@ Call sites: `session()` after `SessionAddress` succeeds; `cliRoute` after `CLIPr
- Consumes: `Store.RecordActivity`, approved OPS-131 to OPS-136.
- Produces:
- `const ( auditFirstSignin = "first-signin"; auditSignin = "signin"; auditInviteSent = "invite-sent"; auditInviteAccepted = "invite-accepted"; auditAccountCreated = "account-created"; auditAccountDeleted = "account-deleted" )` and `var accountAuditActions = []string{…all six}` (Task 11's kinds read it).
- - `func (s *Server) auditAccount(accountID int64, addr string, a Activity)`: `RecordActivity(accountID, "", addr, a, time.Now())` on every console, logging a failure (`console: account audit %s: %v`) and never failing the action. (`withAutoAppSQL` already calls straight through for `app == ""`, `claim_sql_auto.go:15`; on a host-claim console the insert is admitted by Task 6A's gate rule.)
+ - `func (s *Server) auditAccount(accountID int64, addr string, a Activity)`: `RecordActivity(accountID, "", addr, a, time.Now())`, logging a failure (`console: account audit %s: %v`) and never failing the action. No gate change: claims are shelved, and the claim gate's `audit` triggers stay as they are.
Where each is recorded, after the action has succeeded and before the response:
@@ -448,7 +447,7 @@ Where each is recorded, after the action has succeeded and before the response:
| `account-created` | after `CreateAccount` succeeds in `mintAccount` (covers the browser, the CLI and first sign-in) | the new id | TargetType `account`, Target the sqid, Detail OPS-135 |
| `account-deleted` | after `DeleteAccount` succeeds (`ownership.go:168`) | the account | TargetType `account`, Target the sqid, Detail OPS-136 |
-The `app` column is `""`, so these rows never show on any app's Activity tab (`Events` filters by app). Until Task 6A lands (the next commit on this branch), a host-claim console refuses the insert and logs it; nothing else differs.
+The `app` column is `""`, so these rows never show on any app's Activity tab (`Events` filters by app).
- [ ] **Step 1: Write the failing tests:**
- `TestFirstSignInThenSignInAreRecorded`: a new address signs up (`signUp` helper): one `first-signin` row with `app ""` and `account_id 0`; signing out and in again adds one `signin`; and the account minted at landing adds one `account-created` row naming its sqid.
@@ -461,25 +460,9 @@ The `app` column is `""`, so these rows never show on any app's Activity tab (`E
- [ ] **Step 4: Run** Step 2's command, `go test . -run TestOperatorPagesCopy -count=1`, `go test ./internal/console/ -run 'TestInvite|TestTeam|TestDeleteAccount|TestEmailSignin|TestCallback|TestActivityTab' -count=1`. Expected: PASS.
- [ ] **Step 5: Commit**, message `console: account-level activity: sign-ins, invites, accounts created and deleted`.
-### Task 6A: The claim gate admits account-level audit rows, with its gate review
+### Task 6A: removed
-**Files:**
-- Modify: `internal/console/store_gate.go:190` (`"audit": {Account: "account_id", App: "app", FreeWhenNoApp: true}`, with a comment giving the reason: account-level rows name no app incarnation, so no app permit can cover them; the rows are the operator's activity record of sign-ins, invites and accounts)
-- Modify: `internal/console/store_gate_test.go` (the tests below), `internal/console/opaudit_test.go`
-
-**Interfaces:**
-- Consumes: the gate's `FreeWhenNoApp` (`store_gate.go:141-144`, `:535-541`), `newClaimCase`, Task 6's `auditAccount`.
-- Produces: no new type or function. The gate's classification of `audit` changes in one field; every other table, the permit table, the triggers' generation and `withClaimSQL` are untouched. `claimProbeAllSQL` (`claim_probe_all_apps_test.go:57`) already leaves app-less rows of a `FreeWhenNoApp` table out of its digests, so a read probe that signs someone in still sees no app's rows change.
-
-- [ ] **Step 1: Write the failing tests** (in `store_gate_test.go`, beside `TestClaimSQLUnauthorizedWritesDenied`, on the armed store those tests use):
- - `TestClaimSQLAuditAdmitsAppLessRows`: with no permit, `RecordActivity(0, "", addr, Activity{Action: "signin"}, now)` and `RecordActivity(acct, "", …)` succeed.
- - `TestClaimSQLAuditStillGatesAppRows`: with no permit, an insert with app `kass`, with app `account` (`accountAuditSubject`) and with app `(service credentials)` are each refused with `claimDenyMessage`, exactly as before the change.
- - `TestClaimSQLAuditCannotMoveRowsAcrossTheLine`: with no permit, an `UPDATE audit SET app = 'kass'` of an app-less row is refused (NEW is checked); an `UPDATE audit SET app = ''` of a `kass` row is refused (OLD is checked); a `DELETE` of a `kass` row is refused.
- - `TestAccountActivityRecordedUnderClaimGate` (in `opaudit_test.go`, production wiring): on `newClaimCase`, a sign-in succeeds and writes one `first-signin` (or `signin`) row with `app ""`; an invite through the browser door writes `invite-sent`.
-- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestClaimSQLAudit|TestAccountActivityRecordedUnderClaimGate' -count=1`. Expected: FAIL.
-- [ ] **Step 3: Implement** the one-field change and its comment.
-- [ ] **Step 4: Run** Step 2's command, the gate's own suite `go test ./internal/console/ -run 'TestClaimSQL|TestClaimProbe|TestClaimConsoleRouteCensus' -count=1`, and `nice -n 19 go test ./internal/console/ -run '^TestClaimConsoleMutationInvariant$' -count=1`. Expected: PASS.
-- [ ] **Step 5: Gate review.** Run `make census-card` and record any unit it names in Task 15's CLAIMS. Give an independent reviewer of the other model family (Astra) the diff of `store_gate.go` and these tests against the task's base, with this brief: does admitting `app = ''` rows of `audit` without a permit let any request, tenant, app or box agent change, hide or forge a row that an app permit, a purge or a restore relies on; can an app-less row be turned into an app row, or the reverse, without a permit; is any existing refusal weakened. Record the verdict on #280 with the reviewer, the tip and the lines read. An escalation goes to Paul as a decision, and Task 6A's commit waits for it (the rest of the plan does not). Then commit, message `claim gate: audit admits account-level rows (app ''), as cli_tokens does; reviewed on #280`.
+Claims are shelved (Paul, 2026-10-25/26). Account-level audit rows are written normally (Task 6) and the claim gate is not changed, so there is no gate classification change and no gate review.
### Task 7: Background job registry
@@ -487,10 +470,10 @@ The `app` column is `""`, so these rows never show on any app's Activity tab (`E
- Create: `internal/console/jobs.go`, `internal/console/jobs_test.go`
- Modify: `internal/console/templates/opparts.html` (`op_jobs`), `internal/console/static/ops.css` (`.co-jobs`, the mockup's `--rst-cols` for the jobs grid)
- Modify: `internal/console/claim_workers.go` (declare each worker; `RunClaimWorker` reports exit), `internal/console/server.go` (`Server.jobs`, set in `NewServer` before `registerClaimWorkers`)
-- Modify each pass loop: `alertwatch.go:48`, `apidoorkeys.go:350`, `apex.go:251`, `hostclaimops.go:39`, `infrapass.go:49`, `planlimits.go:22`, `plansmarker.go:23`, `economicspass.go:39`, `expirypass.go:27`, `seedsweep.go:65`, `hostreports.go:68-80`, `runsweep.go:39`, `plangracepass.go:24`, `scanpass.go:37`, `relayops.go:275`, `regiondrift.go:23`, `scandrain.go:52`, `mailpush.go:680`, `server.go:1701` (`publishMovesConsoleWorker` in `claim_workers.go`), `server.go:1724`
+- Modify each pass loop: `alertwatch.go:48`, `apidoorkeys.go:350`, `apex.go:251`, `hostclaimops.go:39`, `infrapass.go:49`, `planlimits.go:22`, `plansmarker.go:23`, `economicspass.go:39`, `expirypass.go:27`, `seedsweep.go:65`, `hostreports.go:68-80`, `runsweep.go:39`, `plangracepass.go:24`, `scanpass.go:37`, `relayops.go:275`, `regiondrift.go:23`, `scandrain.go:52`, `mailpush.go:680`, `server.go:1701` (`publishMovesConsoleWorker` in `claim_workers.go`), `server.go:1724`, and the five workers registered since (find each loop by name: `StartBillingSyncPass`, `StartLifetimesCutoverWatch`, `StartLifetimeRecoveryPass`, `StartIncarnationMigrationPass`, `StartEgressReport`). Line numbers are as of 2026-10-25; find each by name.
**Interfaces:**
-- Consumes: approved OPS-32, OPS-67, OPS-77 to OPS-102.
+- Consumes: approved OPS-32, OPS-67, OPS-77 to OPS-102, OPS-149 to OPS-153.
- Produces:
- the partial `op_jobs` (data `[]opJobRow`): `<div rst-box-head id="jobs"><h2>OPS-32</h2></div>`, then `<div rst-card class="co-jobs">` with a head row of OPS-77, OPS-67, OPS-78, OPS-79 and one `rst-lrow` per job (label, `op_status`, `ago` with `fmtTime` as the `title`, note).
- `type jobRegistry struct { … }`, `func newJobRegistry(now func() time.Time) *jobRegistry`
@@ -498,7 +481,7 @@ The `app` column is `""`, so these rows never show on any app's Activity tab (`E
- `func (j *jobRegistry) Run(ctx context.Context, name string, pass func(context.Context) error) error`: records start, runs `pass` with a run handle on `ctx`, records finish and the error (`pass`'s, else the first one `jobFailed` recorded), returns that error. An undeclared name is recorded too (never a panic: a panic in a pass goroutine would take the console down); the census test below keeps names right.
- `func jobFailed(ctx context.Context, err error)`: records `err` on the run carried by `ctx` if it is the run's first; a no-op with no run or a nil error.
- `type JobState int; const (JobNotRun JobState = iota; JobOK; JobFailed)`; `type JobStatus struct { Name string; State JobState; LastRan time.Time; Err string }`; `func (j *jobRegistry) Snapshot() []JobStatus` (configured jobs only; `LastRan` is the last finish)
- - `var jobLabels map[string]string` (OPS-83 to OPS-102, keyed by worker name); `type opJobRow struct { Label string; Status opPill; LastRan time.Time; Note string }`; `func opJobRows(snap []JobStatus) []opJobRow`: sorted by label; OK positive, Failed negative, Not run yet neutral; `Note` is the error's first line, trimmed and capped at 160 runes with `…` (html/template escapes it).
+ - `var jobLabels map[string]string` (OPS-83 to OPS-102 and OPS-149 to OPS-153, keyed by worker name); `type opJobRow struct { Label string; Status opPill; LastRan time.Time; Note string }`; `func opJobRows(snap []JobStatus) []opJobRow`: sorted by label; OK positive, Failed negative, Not run yet neutral; `Note` is the error's first line, trimmed and capped at 160 runes with `…` (html/template escapes it).
Each loop wraps one pass in `s.jobs.Run` with its worker name as a string literal, keeping its existing log line:
@@ -517,7 +500,7 @@ Each loop wraps one pass in `s.jobs.Run` with its worker name as a string litera
- `TestSwallowedAlertFailureShowsAsFailed` (acceptance, production wiring): on `newConsoleFixture` with Paul an operator, write a corrupt `alerts/boxes/box-1.json` (not JSON) to `fx.rel`; run `fx.srv.RunClaimWorker(ctx, "StartAlertWatcher")` until its first run is recorded, then cancel; `Snapshot` has Alerts `JobFailed` with a note naming the unparsable key; once Task 9 has landed, GET `/fleet` shows OPS-31 for Alerts in the callout and Failed in the jobs table (the test's second half lands with Task 9 and is listed in its Step 1).
- `TestWorkerRunsReachTheRegistry` (production wiring): on `newConsoleFixture`, start `fx.srv.RunClaimWorker(ctx, "StartAlertWatcher")` in a goroutine; wait (poll `Snapshot`, 5 s cap) until it has a run; cancel; the worker returns; its row is OK or Failed, never Not run yet. Then `RunClaimWorker(ctx, "StartRelay")` with no relay regions returns at once and `StartRelay` is absent from `Snapshot`.
- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestJobRegistry|TestJobNote|TestEveryWorkerReports|TestPassFailureLogs|TestSwallowedAlertFailure|TestWorkerRunsReach' -count=1`. Expected: FAIL.
-- [ ] **Step 3: Implement**; add OPS-32 and OPS-77 to OPS-102 to `operatorPagesCopyBuilt` (OPS-67's file is the dashboard's; Task 9 adds it).
+- [ ] **Step 3: Implement**; add OPS-32, OPS-77 to OPS-102 and OPS-149 to OPS-153 to `operatorPagesCopyBuilt` (OPS-67's file is the dashboard's; Task 9 adds it).
- [ ] **Step 4: Run** Step 2's command; the passes' own tests, `go test ./internal/console/ -run 'TestAlert|TestEconomicsPass|TestInfraPass|TestExpiryPass|TestPlanLimits|TestPlanGrace|TestRunSweep|TestSeedsPass|TestRelay|TestMailPush|TestDoorKey|TestApex|TestPlacementDiscrepanc|TestScanPass|TestScanDrain|TestHostReports|TestPlansMarker|TestGeoip|TestClaimWorker' -count=1`; and `nice -n 19 go test ./internal/console/ -run '^TestClaimConsoleMutationInvariant$' -count=1`. Expected: PASS.
- [ ] **Step 5: Commit**, message `console: every background pass reports its runs to an in-process job registry`.
@@ -538,17 +521,18 @@ Each loop wraps one pass in `s.jobs.Run` with its worker name as a string litera
`alertPass`, after its listing succeeds: for each key it reads and parses, `setBox(box, st.Rules, now)` before the mail loop for that box; a key whose read or parse fails adds its box to the kept set without calling `setBox`, so its last entries stand (and Task 7 marks the run Failed); after the loop, `keepOnly(every box listed)` then `markKnown()`. A failed listing leaves the projection as it was. Rule names come from the objects (`disk`, `mem`, `cpu`, `lag`, `geoip`), never from `alert_seen`, so `geoip@N` rows never reach it and one geoip firing is one entry. The projection is updated whatever the recipients are, before and independently of who is mailed.
-- [ ] **Step 1: Write the failing tests** (production wiring: `newConsoleFixture`, alert objects written to `fx.rel` with `metrics.AlertKey`, passes run through `fx.srv.alertPass(ctx)`):
+- [ ] **Step 1: Write the failing tests** (production wiring: `newPerfFixture`, so the console reads through the real S3 client over `internal/s3fake`; alert objects written to `fx.rel`, the store under the fake, with `metrics.AlertKey`; passes run through `fx.srv.alertPass(ctx)`; S3 requests recorded with `recordS3` from `console-perf-quick-wins`, which is why the branch is rebased onto `main` after that merges and before this task):
- `TestAlertsNowFiringThenClearedWithARecipientChange`: Paul is the one operator with a grant; `box-1` publishes `disk` firing; a pass: `Firing()` is `[box-1/disk]` with `Since` the object's `FiredAt`. Then the recipients change: Paul's grant is removed (`SetGrantToken(addr, "")` or the store's revoke) and `ann@example.com` becomes an operator with a grant; `box-1` publishes `disk` cleared; a pass: `Firing()` is empty, while `alert_seen` still holds a `firing = 1` row for `box-1/disk` (Paul's or the synthetic recipient's), which is exactly the history the dashboard must not read.
- `TestAlertsNowGeoipIsOneEntry`: `geoip` firing with value 2: `alert_seen` gains `geoip@1` to `geoip@5` rows, and `Firing()` has exactly one entry, `box-1/geoip`.
- `TestAlertsNowKeepsABoxWhoseReadFailedAndDropsAGoneBox`: `box-1` firing; its object replaced with invalid JSON; a pass: still `box-1/disk`; the object deleted; a pass: empty.
- `TestAlertsNowUnknownBeforeTheFirstPass`: on a fresh server `Firing()` reports `known` false; after one pass over an empty prefix it is true and empty.
- - `TestAlertsNowWithoutKeymailStaysUnknownAndReadsNothing`: with the sender unset, a pass reads no key (counted with `opProbeStore`, defined in this task, below) and `known` stays false.
- - Test helper `opProbeStore` (in `alertnow_test.go`; Task 9 reuses it): a `release.Store` wrapper with exactly plan 1's `latencyStore` method list (`Get`, `Put`, `List`, `ListDirs`, `Delete`, `DeleteIfMatch`, `ListMod`, `ListSizes`, delegating to `*deletableStore`), which records every key or prefix it is asked for and fails a `Get` whose key matches a test-set function; `TestOpProbeStoreMethodSetMatches` holds its method set to `*deletableStore`'s, as plan 1's `TestLatencyStoreMethodSetMatches` does.
-- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestAlertsNow|TestOpProbeStore' -count=1 -race`. Expected: FAIL.
+ - `TestAlertsNowWithoutKeymailStaysUnknownAndReadsNothing`: with the sender unset, a pass makes no S3 request (`recordS3(lat, nil)` records none) and `known` stays false.
+ - No store wrapper of this plan's own: request counting and failure injection go through `recordS3` on the fake, which sees what the real client sends (Task 9 uses it the same way).
+- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestAlertsNow' -count=1 -race`. Expected: FAIL.
- [ ] **Step 3: Implement.**
- [ ] **Step 4: Run** Step 2's command and `go test ./internal/console/ -run 'TestAlert|TestSwallowedAlertFailure|TestPassFailureLogs' -count=1`. Expected: PASS.
- [ ] **Step 5: Commit**, message `console: the alert watcher keeps a projection of what is firing now`.
+- [ ] **Step 6: Task review (Tasks 7 and 7A together).** One Astra review of the two tasks' diff, round budget three, stopping at the first round with no P1. What to check: every registered worker reports through `s.jobs.Run` and no pass changes behaviour beyond reporting (same errors returned, same logs, same retries); `jobFailed` sits beside every swallowed failure; a pass panicking or a name typo cannot take the console down; the alert projection's replace-by-box, keep-on-read-failure and drop-on-gone rules, and that it adds no S3 read.
### Task 8: Boxes at `/fleet/boxes`: today's `/fleet` content, plus background jobs
@@ -556,14 +540,14 @@ Each loop wraps one pass in `s.jobs.Run` with its worker name as a string litera
- Create: `internal/console/opboxes.go`, `internal/console/templates/ops_boxes.html`; delete `internal/console/templates/fleet.html`
- Modify: `internal/console/server.go` (register `GET /fleet/boxes` → `handleBoxes` beside `GET /fleet`; `page` gains `Jobs []opJobRow`; `handleFleet`'s body moves to `handleBoxes`, and `handleFleet` answers what it does today until Task 9)
- Modify: `internal/console/server_test.go:1662-1760` (`TestFleetOperatorOnly`, `TestFleetEmptyState`, `TestFleetKeylessReadable` and the Hosts tests target `/fleet/boxes` and the new heading), `storepage_test.go:87`
-- Modify: claim census, fixture (`claimRead("operator boxes view: fleet.json, box snapshots, the storage queue")`) and probe (`claimPageRead(nil, "/fleet/boxes", "<h1>" + OPS-11 + "</h1>")`); `perf-budgets.txt` (`GET /fleet/boxes over: reads fleet.json, every box snapshot and the storage queue until operator-pages Task 13`)
+- Modify: claim census, fixture (`claimRead("operator boxes view: fleet.json, box snapshots, the storage queue")`) and probe (`claimPageRead(nil, "/fleet/boxes", "<h1>" + OPS-11 + "</h1>")`); `perf-budgets.txt` (`GET /fleet/boxes over: <what it reads and its measured count, in the form of today's GET /fleet record: fleet.json, the box reports listed and read once each, and the storage entitlements; operator pages are seldom viewed and carry no cache>`; write the count the walk prints, not a guess)
**Interfaces:**
- Consumes: `opPage`, `opJobRows(s.jobs.Snapshot())`, the `op_*` partials, OPS-11, OPS-137, OPS-146, OPS-147.
-- Produces (the seams Task 13 and plan 2 Task 15 repoint; each a direct read in this task):
+- Produces (the reads the dashboard shares with Boxes, so both read the same way; each a direct read, once per view):
- `func (s *Server) opFleetJSON(ctx context.Context, p *page) (*status.Fleet, error)`: `FleetView(ctx, s.cfg.Releases)`.
- `func (s *Server) opHostRows(ctx context.Context, p *page) ([]HostRow, error)`: `HostRows(ctx, s.cfg.Releases, s.now())`.
- - The server clock: every operator handler and seam reads time through `s.now()`, never `time.Now()`. Plan 2 Task 6 adds `Server.now func() time.Time` (and `newPerfFixture` points it at `fx.clock`); if this task runs before plan 2 has landed, it adds that same field here, defaulting to `time.Now` in `NewServer`, and plan 2 reuses it.
+ - The server clock: every operator handler and seam reads time through `s.now()`, never `time.Now()`. `main` has no console server clock, so this task adds one in the house style of `relayNow`: a field `Server.opNow func() time.Time` (nil means `time.Now`, so `&Server{}` literals stay safe) and `func (s *Server) now() time.Time`. Tests set `fx.srv.opNow`.
- `func (s *Server) opStorePending(ctx context.Context, p *page) (*int, error)`: for a store operator, `len(pendingStoreApplications)` under `storeTimeout`; `nil, nil` for anyone else or with no bucket.
- `func (s *Server) handleBoxes(w http.ResponseWriter, r *http.Request)`.
@@ -585,7 +569,7 @@ Each loop wraps one pass in `s.jobs.Run` with its worker name as a string litera
**Files:**
- Create: `internal/console/opdashboard.go`, `internal/console/opdashboard_test.go`, `internal/console/templates/ops_dashboard.html`
- Modify: `internal/console/server.go` (`handleFleet` replaced by `handleDashboard` on `GET /fleet`; `page` gains `Dash *dashView`), `internal/console/static/ops.css` (`[co-bars]`, `[co-bar]`, `[co-h="0"]` to `[co-h="20"]` as `block-size: 0%` to `100%` in steps of 5, `[co-bars-axis]`, `[co-attention]`, the four grid column templates from the mockup as `.co-people`, `.co-activity`, `.co-boxes`, `.co-jobs`)
-- Modify: `opshell_test.go` (delete `/fleet` from `opShellPending`); the `route GET /fleet` probe and fixture (`claimRead("operator dashboard: SQLite counts, fleet.json, box snapshots, the storage queue")`, marker `<h1>` + OPS-8 + `</h1>`); `perf-budgets.txt` (`GET /fleet over: reads fleet.json, every box snapshot and, for a store operator, the storage queue until operator-pages Task 13`. Until Task 13 has landed this branch is not rolled to flagship: before it, the dashboard's per-box reads are on the request path. *(My call.)*)
+- Modify: `opshell_test.go` (delete `/fleet` from `opShellPending`); the `route GET /fleet` probe and fixture (`claimRead("operator dashboard: SQLite counts, fleet.json, box snapshots, the storage queue")`, marker `<h1>` + OPS-8 + `</h1>`); `perf-budgets.txt` (the existing `GET /fleet over:` record stays, its reason rewritten for the dashboard with the count the walk prints: `status/fleet.json`, the box reports listed and read once each, and for a store operator the storage entitlements, the same reads today's `/fleet` makes; operator pages are seldom viewed and carry no cache. The SQLite reads add no remote call.)
**Interfaces:**
- Consumes: Task 4's reads, `s.jobs.Snapshot()`, `opFleetJSON`, `opHostRows`, `opStorePending`, `Server.alertsNow.Firing()` (Task 7A), `op_meter`, OPS-8, OPS-20 to OPS-76.
@@ -599,7 +583,7 @@ Each loop wraps one pass in `s.jobs.Run` with its worker name as a string litera
`ops_dashboard.html` follows the mockup top to bottom: `op_page_header` (OPS-8, OPS-20 with `.Brand`); the callout (`rst-callout rst-tone="{{.Dash.Tone}}"`, the matching icon `circle-check`, `triangle-alert` or `circle-x`, `aria-hidden`; the title OPS-21, OPS-22 or OPS-23; a `<ul co-attention>` of items, each `{{.Lead}}<code>{{.Code}}</code>{{.Tail}} <a href="{{.Href}}">{{.Link}}</a>`); the `rst-stats rst-card` band of `op_stat`; the chart (`rst-box-head` OPS-46; `<div rst-card>`, `<div co-bars aria-hidden="true">` of `<span co-bar co-h="{{.H}}">`, the axis with the first day as `2 Jan` and OPS-50, then `<table class="rst-sr-only">` with caption OPS-47, headings OPS-48 and OPS-49 and one row per day); Newest people (OPS-51, link OPS-52 to `/fleet/people`, `.co-people` rows: address as `.rst-nm`, account or OPS-56, `ago` joined, apps); Latest activity (OPS-58, link OPS-59, `.co-activity` rows: `ago`, address, `Detail`, app or OPS-56; OPS-64 when empty); Boxes (`{{define "ops_dashboard_boxes"}}`, a partial of the dashboard body: h2 OPS-11, link OPS-65, `.co-boxes` rows of OPS-66 to OPS-70, the label as `.rst-nm` linking `/fleet/boxes#box-<label>`, `op_status`, the region, `op_meter` or OPS-76, `ago` of the last report; OPS-71 when there is no snapshot); `op_jobs`. Empty newest people is OPS-57.
-- [ ] **Step 1: Write the failing tests** in `opdashboard_test.go` (with Task 7A's `opProbeStore`). `seedOperatorWorld(t, fx)` (test-only, shared with Tasks 10, 11 and 14): eight people (`ann@example.com` and others under `example.com`, joined over 30 days with two today and none 10 to 20 days ago), accounts `shop` and `notes` minted through `mintAccount`, apps under them, activity rows (two `promote` today on two apps, a `signin`, an `invite-sent`), `seedHostBoxes` (one fresh box, one dark), `box-1` publishing `disk` firing and one `alertPass` run (so the projection holds it), plus a stale `alert_seen` firing row for a cleared `box-2`/`mem` (history the dashboard must ignore), a failed `StartEconomicsPass` run; Paul is operator and store operator with one pending storage application (as `storepage_test.go` seeds one).
+- [ ] **Step 1: Write the failing tests** in `opdashboard_test.go` (request counting and failure injection with `recordS3` on `newPerfFixture`). `seedOperatorWorld(t, fx)` (test-only, shared with Tasks 10, 11 and 14): eight people (`ann@example.com` and others under `example.com`, joined over 30 days with two today and none 10 to 20 days ago), accounts `shop` and `notes` minted through `mintAccount`, apps under them, activity rows (two `promote` today on two apps, a `signin`, an `invite-sent`), `seedHostBoxes` (one fresh box, one dark), `box-1` publishing `disk` firing and one `alertPass` run (so the projection holds it), plus a stale `alert_seen` firing row for a cleared `box-2`/`mem` (history the dashboard must ignore), a failed `StartEconomicsPass` run; Paul is operator and store operator with one pending storage application (as `storepage_test.go` seeds one).
- `TestAttentionItemsEachCondition` (not acceptance, table-driven over `attentionItems`): nothing wrong gives no items and `positive`; a `Boxes` row with status Silent gives OPS-24 with the label and `warning`, and a `FleetBox.Stale` with no Silent row gives nothing (the callout reads only `Boxes`); `GeneratedAt` older than 15 minutes gives OPS-25; `FleetErr` gives OPS-26; a down service gives OPS-27 and `negative`; an alert gives OPS-28; `StorePending` 1 and 3 give OPS-29 and OPS-30, nil gives none; a failed job gives OPS-31 linking `/fleet/boxes#jobs`.
- `TestDashboardNeedsAttentionFromRealRows`: on the seeded world, the page's callout has `rst-tone="warning"`, OPS-23 with 4 (the dark box, the alert, the storage request, the failed job), and each item's link; an operator who is not a store operator sees 3 and no storage item.
- `TestSwallowedAlertFailureShowsAsFailed`, second half (Task 7's test, extended here): after the failed alert run, GET `/fleet`: the callout lists OPS-31 naming the Alerts label with its link to `/fleet/boxes#jobs`, and the jobs table shows Alerts with OPS-81.
@@ -607,17 +591,18 @@ Each loop wraps one pass in `s.jobs.Run` with its worker name as a string litera
- `TestDashboardAllClear`: with no problems seeded, the callout is `positive` with OPS-21 and no list.
- `TestDashboardCountsFromFixtureRows`: the band shows People with the seeded total and OPS-34 with the active count, New people this week with its delta text, Deploys today `2` with OPS-45 for 2 apps.
- `TestDashboardSeriesHasThirtyDaysWithZerosFilled`: 30 `co-bar` spans; the hidden table has 30 rows; the rows for days 10 to 20 ago say 0; the last row is today's and says 2; the tallest bar is `co-h="20"`; no bar of a non-zero day is `co-h="0"`.
- - `TestAttentionAndBoxesAgreeAcrossTheFifteenMinuteLine` (direct seams, injected clock; no claim about reads, since before Task 13 every GET reads again): set `fx.srv.now` to a fixed `t0`; a box heartbeat at `t0 − 14 min` and a `fleet.json` built at `t0 − 2 min` with that box not stale; GET `/fleet`: the row is Healthy and the callout has no box item. Set `fx.srv.now` to `t0 + 2 min` (the heartbeat is now 16 minutes old; the summary 4 minutes, not itself stale); GET: the row is Silent and the callout lists OPS-24 for that box with `warning`. A second, dark box present only in `HostRows` (absent from `fleet.json`) is listed in both. A seam that read `time.Now()` instead of `s.now()` fails the second GET.
+ - `TestAttentionAndBoxesAgreeAcrossTheFifteenMinuteLine` (direct seams, injected clock; no claim about reads, since every GET reads again): set `fx.srv.opNow` to a fixed `t0`; a box heartbeat at `t0 − 14 min` and a `fleet.json` built at `t0 − 2 min` with that box not stale; GET `/fleet`: the row is Healthy and the callout has no box item. Set `fx.srv.opNow` to `t0 + 2 min` (the heartbeat is now 16 minutes old; the summary 4 minutes, not itself stale); GET: the row is Silent and the callout lists OPS-24 for that box with `warning`. A second, dark box present only in `HostRows` (absent from `fleet.json`) is listed in both. A seam that read `time.Now()` instead of `s.now()` fails the second GET.
- `TestDashboardBoxStatuses` (not acceptance, over `dashBoxes`): comfortable is Healthy, busy is Busy (warning), critical is Busy (negative), a stale `HostRow` is Silent with no meter, a summary older than 15 minutes makes every row Stale, a `FleetBox` with no `HostRow` is Silent; an empty region is OPS-76.
- `TestDashboardLatestActivityAndNewestPeople`: newest 10 activity rows, newest first, with `none` for the sign-in's app; the newest five people with their first account.
- - `TestDashboardReadFailuresDegrade`: on `newConsoleFixtureWith` with `WrapReleases` set to an `opProbeStore` failing `status/fleet.json`, the page is 200 with OPS-26 in the callout.
+ - `TestDashboardReadFailuresDegrade`: on `newPerfFixture` with `recordS3` failing the `status/fleet.json` read, the page is 200 with OPS-26 in the callout; failing the `status/boxes/` listing instead, the page is 200 and the Boxes section shows its degrade line.
- `TestDashboardBoxesKeepTheMockupColumns`: on the seeded world (`seedHostBoxes`), the Boxes section has the five headings OPS-66 to OPS-70 in order; the fresh box's row has `op_status` Healthy, region `eu-west-1`, `<meter rst-meter-bar` with value 50 and `50%`, and an `ago` last report; the dark box's row is Silent with OPS-76 and a last report about an hour ago.
- - `TestDashboardRemoteReadsAreTheDeclaredOnes`: with an `opProbeStore`, GET `/fleet`: every key it was asked for is `status/fleet.json`, the `status/boxes/` listing or a key under it, or the storage queue's. (Task 13 turns these into zero on a warm view.)
- - Walk fixture: `newPerfFixture` (plan 1, `perfwalk_test.go`) gains `seedOperatorScale(t, fx)`, so every operator screen is measured over populated tables: 300 people (joined across 60 days, half with `last_seen`, sessions for a third), 60 accounts each with 2 to 6 members, 1 to 8 apps and a plan row, and 3,000 audit rows spread over the accounts, the six account actions and `promote`/`rollback` (written in one transaction through a test helper so the walk stays well under 10 s). Neutral names (`person-<n>@example.com`, `shop-<n>`).
+ - `TestDashboardRemoteReadsAreTheDeclaredOnes`: on `newPerfFixture` with `recordS3`, GET `/fleet` as a store operator: every request is `status/fleet.json`, the `status/boxes/` listing or a key under it, or the storage queue's; no key and no listing prefix is requested twice in the view; and the total is no more than the same fixture's GET `/fleet/boxes` makes (which reads what today's `/fleet` reads). As an operator who is not a store operator, no storage-queue request.
+ - Walk fixture: `perfSeed` (`perfwalk_test.go`, under `newPerfFixture`) calls a new `seedOperatorScale(t, fx)`, so every operator screen is measured over populated tables: 300 people (joined across 60 days, half with `last_seen`, sessions for a third), 60 accounts each with 2 to 6 members, 1 to 8 apps and a plan row, and 3,000 audit rows spread over the accounts, the six account actions and `promote`/`rollback` (written in one transaction through a test helper so the walk stays well under 10 s). Neutral names (`person-<n>@example.com`, `shop-<n>`).
- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestAttentionItems|TestAttentionAndBoxesAgree|TestDashboard|TestEveryOperatorPage' -count=1`. Expected: FAIL.
- [ ] **Step 3: Implement**; add OPS-20 to OPS-31 and OPS-33 to OPS-76 to `operatorPagesCopyBuilt` (OPS-8 and OPS-32 are already there).
- [ ] **Step 4: Run** Step 2's command, `go test . -run TestOperatorPagesCopy -count=1`, `go test ./internal/console/ -run 'TestOperatorGate|TestBoxes' -count=1`, `nice -n 19 go test ./internal/console/ -run '^TestClaimConsoleMutationInvariant$' -count=1`, and the walk without `CI`.
-- [ ] **Step 5: Visual check.** Run Task 14's command for `dashboard` only, at 1280 and 390, light and dark; compare with the mockup. Pass: the order and shapes of the mockup; the callout lists four items; at 390 the stats band wraps and the back strip shows. Then commit, message `console: the operator dashboard`.
+- [ ] **Step 5: Commit**, message `console: the operator dashboard`.
+- [ ] **Step 6: Show Paul (the first thing he sees).** Write `opshots_test.go` now, as Task 14 describes it, with the pages that exist so far (`index`, `dashboard`, `boxes`, `store`); Task 14 adds the rest. Run it with Task 14's Step 2 command; check the dashboard shots against the mockup (the order and shapes of the mockup; the callout lists four items; at 390 the stats band wraps and the back strip shows) and fix `ops.css` or the template if not. Then give Paul the dashboard and Boxes PNGs at 1280 and 390, light and dark, in the session (paths under the scratch dir, or attached), with one line on what is not built yet (People, Activity, the moved pages). Commit the test (`console: opt-in screenshots of the operator pages built so far`), keep the PNGs until Paul has seen them, then remove the scratch dir by its exact path. Do not wait for his answer to start Task 10; a change he asks for becomes a task on this branch.
### Task 10: People and accounts at `/fleet/people`
@@ -674,71 +659,29 @@ The page: `op_page_header` (OPS-10, OPS-119); a toolbar (`<div rst-lbar>`) with
- Modify: `opshell_test.go` (empty `opShellPending`); the probes' markers for the four routes (`<h1>` + OPS-12/14/14/15 + `</h1>`); every existing test that asserts an old `<h1>` (`Fleet metrics`, `Fleet economics`, `Fleet economics: accounts`, `Architecture` stays)
**Interfaces:**
-- Consumes: `opPage`, the `op_*` partials, plan 1's Console speed section (kept whole, moved into an `rst-card`), OPS-12, OPS-14, OPS-15, OPS-139 to OPS-145.
+- Consumes: `opPage`, the `op_*` partials, plan 1's Console speed section (`<h2 id="console-speed">` and its `consoleSpeedRows` table, kept whole, moved into an `rst-card`), OPS-12, OPS-14, OPS-15, OPS-139 to OPS-145.
-Each page: `op_top`, `op_page_header` (its rail label and its subhead row), then the existing body with its strings and scripts verbatim, re-dressed: flash and warning `banner`s become `rst-callout` (info or negative tone, `role="alert"` kept off); `tiles`/`tile` become `rst-stats`/`op_stat` (keep each tile's `<h2>` text as the `Label`); tables move into `<div rst-card class="co-table-wrap"><table co-table>`; chips become `op_status`; `small` becomes `<p co-note>`; buttons `rst-btn`, inputs `rst-input`. Economics: `seg-tabs` (OPS-141; OPS-142 `/fleet/economics`, OPS-143 `/fleet/economics/accounts`, each keeping the current `period`) under the header on both pages; the utilization bar at `economics.html:149` becomes `op_meter`; the hidden note at `:528` uses the `hidden` attribute and its script toggles `.hidden` instead of `style.display` (check every script line that reads or sets `style`); each page's one inline script (`economics.html:250-413`, `economics_accounts.html:180-243`) becomes a named initializer placed after the body, outside it: `function econInit(root)` and `function econAccountsInit(root)`, which find every element through `root.querySelector…` instead of `document.…` (the bill checkboxes at `:396` included), parse the page data from `root.dataset.econ` (the `data-econ` attribute that replaces the `econ-data` script block; the tests that read `econ-data` read the attribute instead), return at once when `root.dataset.econInit` is set and set it otherwise, and are called once at the end of the script with the body element (`document.getElementById("econ-body")`, a wrapper `<div id="econ-body">` round the body) when it exists. The function bodies are otherwise the existing code, so the existing script-shape tests (`TestEconomicsJSTwinsShape` and its siblings) still find their strings in the page; the accounts page's search form and position links become one `op_list_bar` (search placeholder and submit text moved verbatim from `:66`; `Filter` is a dropdown whose items are All plus each position link, Label the active one, Aria OPS-144) and its "Back to the dashboard" link goes; `js-*` classes and element ids the scripts use stay. Metrics: the alert table and per-box tiles as above; the Console speed section keeps `consoleSpeedRows` and its approved CPF rows. Architecture: content and its refresh form unchanged inside cards.
+Each page: `op_top`, `op_page_header` (its rail label and its subhead row), then the existing body with its strings and scripts verbatim, re-dressed: flash and warning `banner`s become `rst-callout` (info or negative tone, `role="alert"` kept off); `tiles`/`tile` become `rst-stats`/`op_stat` (keep each tile's `<h2>` text as the `Label`); tables move into `<div rst-card class="co-table-wrap"><table co-table>`; chips become `op_status`; `small` becomes `<p co-note>`; buttons `rst-btn`, inputs `rst-input`. Economics: `seg-tabs` (OPS-141; OPS-142 `/fleet/economics`, OPS-143 `/fleet/economics/accounts`, each keeping the current `period`) under the header on both pages; the utilization bar at `economics.html:149` becomes `op_meter`; the hidden note at `:528` uses the `hidden` attribute and its script toggles `.hidden` instead of `style.display` (check every script line that reads or sets `style`); each page's inline script (`economics.html:250-413`, `economics_accounts.html:180-243`) and the `econ-data` block stay in the page verbatim, so the existing script-shape tests (`TestEconomicsJSTwinsShape` and its siblings) still find their strings; the accounts page's search form and position links become one `op_list_bar` (search placeholder and submit text moved verbatim from `:66`; `Filter` is a dropdown whose items are All plus each position link, Label the active one, Aria OPS-144) and its "Back to the dashboard" link goes; `js-*` classes and element ids the scripts use stay. Metrics: the alert table and per-box tiles as above; the Console speed section keeps `consoleSpeedRows` and its approved CPF rows. Architecture: content and its refresh form unchanged inside cards.
- [ ] **Step 1: Write the failing tests:**
- `TestEveryOperatorPageRendersInTheShell` now covers all pages (`opShellPending` empty; `TestOperatorShellPendingShrinks` asserts it is empty).
- `TestEconomicsTabs`: both pages carry `rst-seg-tabs` with `aria-current="page"` on the right tab and the current period in both links.
- `TestEconomicsAccountsListBar`: the accounts page has one `rst-lbar` with the search and a dropdown holding All and each position; a position filter survives a search (hidden `pos`).
- `TestEconomicsScriptsStillFindTheirElements`: every `getElementById`/`querySelector` argument in the two templates' scripts names an id or class still present in the rendered page.
- - `TestEconomicsInitializerShape`: each page defines its initializer outside `econ-body`, calls it once with `econ-body`, and has no `<script>` element of any type inside `econ-body` (plan 2's no-script rule for fragments), and `econ-body` carries `data-econ` that parses as the page's data; the initializer queries through its `root` argument (no `document.getElementById` or `document.querySelector` inside it).
- The existing economics, metrics and architecture tests pass with their headings updated.
- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestEveryOperatorPage|TestOperatorShellPending|TestEconomics|TestFleetMetrics|TestArchitecture|TestArchPage|TestConsoleSpeed' -count=1`. Expected: the new ones FAIL.
- [ ] **Step 3: Implement**; add OPS-139 to OPS-145 to `operatorPagesCopyBuilt`.
- [ ] **Step 4: Run** Step 2's command, `go test . -run 'TestOperatorPagesCopy|TestConsolePerfCopy' -count=1`, `go test ./internal/console/ -run 'TestOperatorGate' -count=1`, `nice -n 19 go test ./internal/console/ -run '^TestClaimConsoleMutationInvariant$' -count=1`, and the walk without `CI`.
- [ ] **Step 5: Commit**, message `console: Metrics, Economics and Architecture in the operator shell`.
-### Task 13: Operator pages through the view cache, with deferred parts (after plan 2 Task 15 is on `main`)
-
-**Files:**
-- Create: `internal/console/opparts_view.go`, `internal/console/opparts_view_test.go`
-- Modify: `opboxes.go` (the three seams), `opdashboard.go`, the handlers of Task 12 (only if plan 2 Task 15 did not already swap their reads), every operator template (body wrap), `templates/opshell.html` (`op_bottom` includes `{{template "partloader" .}}`), `static/ops.css` (the `deferred` placeholder and `asof` line)
-- Modify: claim census, fixture (`claimRead("deferred part of an operator page; the page's own gate")`) and probe for `GET /fleet/part/{part}`; `perfTargets` (one target per `fleetParts` key); `perf-budgets.txt` (`GET /fleet/part/{part} deferred: deferred part`; delete the `over:` records of `GET /fleet` and `GET /fleet/boxes`, and any other operator `over:` left)
-
-**Interfaces:**
-- Consumes: plan 2's `viewGet`, `viewMode`, `errViewPending`, `viewPart`, `renderView`, `getAssembled`, the `deferred`/`asof`/`partfailed`/`partloader` partials, and Task 15's `fleetJSONView`, `hostRowsView`, `storePendingView`, `storeUsageView`, `metricsView`, `economicsView`, `architectureView` over the package-level loaders in `viewloaders.go` (`loadFleetJSON`, `loadBoxSnapshot`, `loadStorePending`, `loadStoreUsage`, `loadMetricsFacts`, `loadEconomicsDay` and its siblings, `loadArchitectureFacts`), with `metricsFacts` and `buildEconomicsView` per request. Task 13 passes no closure or method value as a loader.
-- Produces:
- - the seams now read through the loaders: `opFleetJSON` → `fleetJSONView(ctx, p, mode)`, `opHostRows` → `hostRowsView`, `opStorePending` → `storePendingView` (still only for a store operator); each seam gains a `mode viewMode` parameter.
- - `const boxesWindow = 60 * time.Second`: the window the per-box entry (`{"", "", partBoxes}`, plan 2's key) is read with. If plan 2 Task 15's `hostRowsView` uses `liveWindow` (30 s), Task 13 gives it a window parameter and passes `boxesWindow` from both the dashboard and Boxes, so they share one entry. *(My call on the exact value, from the coordinator's "~60 s".)*
- - `var fleetParts map[string]viewPart` with `dashboard`, `boxes`, `store`, `metrics`, `economics` and `economics-accounts` (both reading `?period=`; the accounts part also `q`, `pos`, `after`), `architecture`. `Gate` is the page's own (`operatorOnly` through a wrapper returning its `page`; `storePageOperator` for `store`; `handleEconomicsAccounts`' gate for its part); `Fill` the page's fill; `Template` `<name>_body`.
- - route `GET /fleet/part/{part}` → `handleFleetPart`, shaped like plan 2's `handleAppPart`: look up the part (unknown is the missing-route 404), run `Gate` first, `Fill(viewCached)` then `Fill(viewBlocking)` bounded by `viewLoadTimeout`, render with `Cache-Control: no-store`, 503 `partfailed` on a failure.
- - **Plan 2's part rules, which these parts follow:** a deferred fragment contains no `<script>` (the economics initializers and their `carlos:part` listeners live in the page frame; the data is an attribute), and plan 2 Task 7's `partloader` fires `carlos:part` with the inserted element after each replacement (its `TestPartLoaderFiresTheEvent`). The event's payload is plan 2's `detail: {part, root}` (`part` the part name, `root` the inserted element). Each economics page's script adds `document.addEventListener("carlos:part", e => { if (e.detail && e.detail.part === "economics") econInit(e.detail.root) })`, and the accounts page the same with `"economics-accounts"` and `econAccountsInit`; each initializer finds `#econ-body` inside `root` (the part's root is that wrapper or contains it) before it binds anything.
- - test-only: plan 2's `HoldNext("list", match)` (plan 2 Task 2, on the S3 fake's real requests) holds the next matching listing request after it has been read; this plan adds no hold helper of its own.
- - every operator template follows plan 2's shape with the operator layout: `{{define "<name>"}}{{template "op_top" .}}{{template "op_page_header" …}}{{if .Deferred}}{{template "deferred" .}}{{else}}{{template "<name>_body" .}}{{end}}{{template "op_bottom" .}}{{end}}`, and `{{define "<name>_body"}}{{template "asof" .}}…{{end}}`. The header and rail stay outside the part. People, Activity and the index read only SQLite and get no part.
-
-On a miss of either `fleet.json` or the box entry, the dashboard's whole body is the deferred part: the callout and the Boxes table must come from the same box evidence (Task 9's `attentionInput.Boxes`), so neither renders without it. A stale entry is served at once, so this costs only the first view after a start or an invalidation. *(My call; replaces the earlier separate `dashboard-boxes` part, which could show a callout built without the box rows beside them.)*
+### Task 13: removed
-**S3 cost of the per-box data.** One `List` of `status/boxes/` plus one `Get` per box, at most once per `boxesWindow` (60 s), and only when an operator views the dashboard or Boxes (the two share the entry; single flight, so concurrent viewers make one load; app pages that read `partBoxes` at their own window share it too). No view, no reads: no timer refreshes it. The cached entry is the raw `boxSnapshot`; `HostRow`s, status words and ages are built per request from it and the clock (rule (a)). With 10 boxes and an operator watching continuously that is at most 11 requests a minute; on top, `fleet.json` is one `Get` per `liveWindow` and the storage queue one `List` plus one `Get` per pending account per its window. A warm dashboard GET makes zero S3 reads, within the at-most-one rule.
-
-- [ ] **Step 1: Write the failing tests:**
- - `TestOperatorPagesWarmMakeNoRemoteCalls`: one sub-test per operator screen on `newPerfFixture` with `seedOperatorWorld`, Paul as operator and store operator: `getAssembled` twice, `perfQuiesce(fx)` (plan 2's `waitBackground`), reset counts, GET: zero S3 and zero host calls.
- - `TestDashboardColdArrivesWithAPlaceholder`: a fresh fixture with latency on: the first GET of `/fleet` answers within 150 ms (time to first byte) with `data-part="/fleet/part/dashboard"` and the rail; `getAssembled` gives the dashboard with the callout.
- - `TestDashboardWaitsForBoxEvidenceAsAWhole`: `held, release := lat.HoldNext("list", func(p string) bool { return p == "status/boxes/" })`; GET `/fleet` (cold): within 150 ms, the whole-body placeholder `data-part="/fleet/part/dashboard"` and no callout; wait for `held`, then join the `fleet.json` and storage-queue loads through the seams in blocking mode (`fx.srv.opFleetJSON(ctx, &page{}, viewBlocking)`, `fx.srv.opStorePending(ctx, &storePage, viewBlocking)`, 5 s deadline); GET `/fleet` again: still the whole-body placeholder, never a callout without box rows. `release()`; the assembled page's callout and Boxes table agree (the dark seeded box is Silent in the table and listed as OPS-24 in the callout). Then advance `fx.clock` across the fifteen-minute line for the fresh box as in Task 9's test: the next assembled view, served from the cache, marks it Silent in both places. Finally `fx.srv.waitBackground()`.
- - `TestEconomicsEditAndSaveAfterColdLoad` (acceptance; skipped unless `exec.LookPath("chromium")` succeeds, and run locally before the task closes): on a fresh `newPerfFixture` (economics cold), a `127.0.0.1` test server in front of `fx.srv` adds Paul's session cookie and, for `/fleet/economics` only, appends a harness script before `</body>` that waits for the `carlos:part` event plan 2's real `partloader` dispatches (no synthetic event; the harness only listens, checking `e.detail.part === "economics"`), then, after the page's own listener has run, sets the first number input inside `#econ-live` to a new value, dispatches `input`, then copies `#scenario-json-field`'s value into a new `<pre id="harness-out">`. `chromium --headless=new --no-sandbox --disable-gpu --virtual-time-budget=15000 --dump-dom <url>` (60 s `exec.CommandContext`, profile under `t.TempDir()`). The dumped DOM's `harness-out` is valid scenario JSON that differs from the server's `scenarioJSON` in exactly that knob. The test then POSTs it to `/fleet/economics/scenarios` with a name and the CSRF token as the form does, follows the redirect, and the economics page lists the saved scenario.
- - `TestEconomicsListenerMatchesThePartLoaderPayload` (no browser): the rendered `partloader` (plan 2's partial, from the real template set) dispatches `carlos:part` with a `detail` carrying `part` and `root`; each economics frame's listener reads `e.detail.part` and `e.detail.root` and nothing else from `detail`, compares `part` with a name that is a `fleetParts` key (`economics`, `economics-accounts`), and passes `root` to its initializer. A listener that read `e.detail.id` or passed `e.detail` itself fails it.
- - `TestEconomicsPartIsInitialisedNotJustPresent` (no browser): the assembled cold economics page has the `carlos:part` listener in the frame and no `<script>` of any type inside the part body; plan 2's own no-script check over every registered part passes for `economics` and `economics-accounts`.
- - `TestAttentionAndBoxesAgreeFromTheCache` (Task 9's case, now cached): on `newPerfFixture` with `fx.clock`, the same heartbeat and summary; warm `/fleet` (`getAssembled`, `perfQuiesce`), Healthy and no box item; `ResetKeys()`; move `fx.clock` 2 minutes (inside every window); GET: the row is Silent and the callout lists OPS-24, with zero S3 requests (the staleness is judged per request from the cached snapshot).
- - `TestBoxReadsOncePerWindowOnlyOnView`: with `fx.clock`: three dashboard GETs and one Boxes GET within 60 s make one `status/boxes/` listing and one `Get` per seeded box in total (counted with plan 2's `Keys()`); moving the clock 61 s and making no request makes no read; the next view serves the old rows and starts exactly one refresh; two concurrent views after the window start one.
- - `TestEveryFleetPartGatesLikeItsPage`: for each `fleetParts` key, signed out and a non-operator get the missing-route 404 body and start no load (`perfLatency.Calls()` unchanged); an operator who is not a store operator gets the 404 for `store` and starts no `store-pending` load.
- - Operator writes rely on plan 2 Task 8's read-set invalidation; each gets a warm-before-write test (warm every reader, write through the real door, then read without waiting):
- - `TestDashboardAfterAStoreApproval`: warm `/fleet`, `/fleet/store` and the applicant's account settings (`getAssembled`, `perfQuiesce`); `ResetKeys()`; approve through `POST /fleet/store/{account}/approve`. During the POST, `Writes()` holds the entitlement key and `Keys()` shows the storage queue re-read before the 303. Then `ResetKeys()`: the next `/fleet` shows no storage item, `/fleet/store` no application, the settings page the decision, all with zero S3 requests.
- - `TestDashboardAfterAStoreDecline`: the same through `/decline` with a reason.
- - `TestEconomicsScenarioSaveWarmBeforeWrite`: warm `/fleet/economics`, `/fleet/economics/accounts` and `/fleet/architecture`; save a changed active scenario through `POST /fleet/economics/scenarios`; the next view of each shows the new scenario with zero S3 requests. Again with the economics view's refresh held in flight (`HoldNext("list", …)` on one of its listings, after moving `fx.clock` past the window) when the save lands: after `release()` and `waitBackground`, every page still shows the new scenario, never the old.
- - `TestArchitectureRefreshWarmBeforeWrite`: warm `/fleet/architecture`; `POST /fleet/architecture/refresh`; the redirect target shows the refreshed inventory with zero S3 requests.
- - `TestOperatorPagesJoinLocalStatePerRequest`: warm `/fleet`, `/fleet/store` and `/fleet/economics/accounts`; then, with no object-store write: rename an account in SQLite (the economics accounts table shows the new name at once), delete the account whose storage application is pending (the store page and the dashboard's storage item drop it at once), and move `fx.clock` 16 minutes (the dashboard says the fleet summary is old and the boxes read Stale at once); every one with zero S3 requests.
- - `TestDashboardCountsAreNeverCached`: warm `/fleet`; create a user and an audit row through the store (no object-store write); the next GET's counts and Latest activity include them at once, with zero S3 requests (rule (a)).
- - `TestEveryOperatorPageRendersInTheShell` and the page tests from Tasks 3 to 12 read assembled pages (`getAssembled`) and still pass.
-- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestOperatorPagesWarm|TestDashboardCold|TestDashboardWaitsForBoxEvidence|TestAttentionAndBoxesAgreeFromTheCache|TestBoxReadsOncePerWindow|TestEveryFleetPart|TestDashboardAfterAStore|TestEconomicsScenarioSaveWarm|TestArchitectureRefreshWarm|TestDashboardCountsAreNeverCached|TestOperatorPagesJoinLocalState|TestEconomicsEditAndSave|TestEconomicsListenerMatches|TestEconomicsPartIsInitialised|TestEveryOperatorPage' -count=1`. Expected: FAIL.
-- [ ] **Step 3: Implement.**
-- [ ] **Step 4: Run** Step 2's command, the page tests of Tasks 3 to 12 (`-run 'TestDashboard|TestBoxes|TestPeoplePage|TestActivityPage|TestEconomics|TestFleetMetrics|TestArchitecture|TestStoreQueue|TestOperatorGate'`), `nice -n 19 go test ./internal/console/ -run '^TestClaimConsoleMutationInvariant$' -count=1`, and the walk with `CI=1`: every operator screen within 150 ms with zero remote calls warm, and `grep -c '/fleet.* over:' internal/console/testdata/perf-budgets.txt` prints `0`.
-- [ ] **Step 5: Commit**, message `console: operator pages read through the view cache; deferred parts behind each page's own gate`. If this task lands on `operator-pages-cache`, run Task 15 on that branch with `NAME=operator-pages-cache`.
+It put the operator pages behind perf plan 2's view cache with deferred parts; plan 2 is cancelled (Paul, 2026-10-26). The simpler option was chosen over a short-TTL cache of `fleet.json` and the box reports: operator pages are seldom viewed, and such a cache would need operator-write invalidation and a review of its own for little gain. So `/fleet` and `/fleet/boxes` read what today's `/fleet` reads, once per view, and keep honest `over:` records (Tasks 8, 9). If Paul later wants them inside 150 ms, that is a new plan, briefed against whatever cache the console has by then.
-### Task 14: Screenshots at 1280 and 390 px, light and dark
+### Task 14: Screenshots at 1280 and 390 px, light and dark, every page
**Files:**
-- Create: `internal/console/opshots_test.go`
+- Modify: `internal/console/opshots_test.go` (created in Task 9 Step 6 with four pages; this task adds the rest)
**Interfaces:**
- Consumes: `seedOperatorWorld`, `signInOperator`, the session cookie the fixture's browser holds.
@@ -754,7 +697,7 @@ chromium --headless=new --no-sandbox --disable-gpu --hide-scrollbars \
It asserts each PNG exists and that the light and dark dashboard PNGs differ. No process outlives the test. *(My call: dark through `data-theme` rather than a Chromium flag, so the dark shot is deterministic; "follows the system" is `day.css`'s own `light-dark()` and Rastrillo's contrast tests cover it.)*
-- [ ] **Step 1: Write the test.**
+- [ ] **Step 1: Extend the test** to every page below.
- [ ] **Step 2: Run it:**
```bash
@@ -763,31 +706,28 @@ CONSOLE_OPS_SHOTS_DIR="$SHOTS" go test ./internal/console/ -run '^TestOperatorSc
ls "$SHOTS"/*.png | wc -l # 44
```
-- [ ] **Step 3: Review every PNG with the Read tool**, beside the mockup. Pass at 1280: bar across the top with OPS-1 and the address menu; the rail in spec order with the current page marked; one page header; the dashboard's callout, stats band, 30 bars with the axis, three tables and jobs, in the mockup's order; every moved page's tables inside cards, nothing overflowing the page column. Pass at 390: content pages show the back strip and no rail; the index shows the rail as a list under the bar's title; nothing past the right edge; the stats band wraps. Dark: text readable on every page, pills and callouts tinted, the chart bars visible. Note any difference from the mockup that comes from v0.28.0's stylesheets (see "Decisions") for the branch description.
+- [ ] **Step 3: Review every PNG with the Read tool**, beside the mockup. Pass at 1280: bar across the top with OPS-1 and the address menu; the rail in spec order with the current page marked; one page header; the dashboard's callout, stats band, 30 bars with the axis, three tables and jobs, in the mockup's order; every moved page's tables inside cards, nothing overflowing the page column. Pass at 390: content pages show the back strip and no rail; the index shows the rail as a list under the bar's title; nothing past the right edge; the stats band wraps. Dark: text readable on every page, pills and callouts tinted, the chart bars visible. Note any difference from the mockup for the branch description (v0.29.0's stylesheets are the mockup's, so a difference is this branch's markup or `ops.css`, and gets fixed in Step 4).
- [ ] **Step 4: Fix** any layout fault in `ops.css` or a template (never in the Rastrillo copies), re-run Steps 2 and 3, then `rm -r -- "$SHOTS"`.
-- [ ] **Step 5: Commit**, message `console: opt-in screenshots of the operator pages`.
+- [ ] **Step 5: Commit**, message `console: opt-in screenshots of every operator page`.
-### Task 15: Census, full gate, review, merge
+### Task 15: Census check, full gate, branch review, merge
**Files:**
-- Create (by the tool): the census overlay and `docs/superpowers/notes/census-proposal-<NAME>.md`, where `NAME` is the landing branch (`operator-pages`, or `operator-pages-cache` for a second landing, as "Branch" says)
+- None expected from the census (see Step 1).
-- [ ] **Step 1: Census card.** `make census-card`. For every changed unit write a CLAIMS line (`<file>:<unit><TAB><what changed, and that no read was added or which one was>`): new SQLite reads and one users write, embedded static files, templates, a job registry around existing passes, the `audit` gate classification (Task 6A, reviewed on #280), no new read of root-owned state. `make census-propose NAME=<landing branch> CLAIMS=<file>`: `operator-pages` for the branch holding Tasks 1 to 12 and 14 (and 13, if it lands together), `operator-pages-cache` for a separate Task 13 landing. The second run is a new proposal with its own CLAIMS (only Task 13's units), card and ruling, not a rerun of the first: the tool replaces only its own overlay while it is the chain's last line, and plan 2's overlay sits between them. A `reads`, `new`, `removed` or `other` class is a decision for Paul on #280, not an approval.
-- [ ] **Step 2: Independent approval.** Give the card and the branch diff against amadan `main` to a reviewer of the other model family (Astra for this Claude-written branch); record each verdict on #280 with the reviewer, the proposal NAME and the tip.
-- [ ] **Step 3: Local gate.** `gofmt -l .` (empty), `go vet ./internal/console/ ./cmd/console/`, `go build ./...`, both cross-compiles, the targeted runs from Tasks 2 to 13, `go test . -run 'TestOperatorPagesCopy|TestConsolePerfCopy' -count=1`, one `nice -n 19` run of `TestClaimConsoleMutationInvariant`, one `go test ./internal/console/ -run 'TestJob|TestLastSeen|TestStatic' -race -count=1`, and the walk with `CI=1`. Update `.amadan/test-weights.tsv` for any new test of a second or more.
-- [ ] **Step 4: Push, describe, wait for CI.** `amadan branch describe carlos/platform operator-pages -body -`: what changed, why, the decisions above, the screenshot review notes, the census approval, Task 6A's gate-review verdict on #280. `amadan ci status carlos/platform -branch operator-pages` until exit 0.
-- [ ] **Step 5: Squash, re-run CI on the squashed tip, merge** with the `-expect <tip>` form. Rolling waits for Paul's go-ahead and follows the house roll order (dev boxes, dev console, check, flagship boxes, flagship console); after the roll, read `/fleet` on flagship and the Console speed table's `GET /fleet` row.
+- [ ] **Step 1: Census check.** `make census-card`. The census now covers only what the root binary compiles (C2, `7c9e9d6a`; AGENTS.md "The census: the reviewer decides"), and this branch changes only the console binary's packages (`internal/console` and its templates and static files), a copy gate test at the repo root, and docs, all out of scope. Expected: it names nothing. If it names a unit (a file in scope was touched by mistake or by a merge of `main`), first check whether the change belongs on this branch at all; if it does, follow AGENTS.md "Getting a change approved" (CLAIMS file, `make census-propose NAME=operator-pages CLAIMS=<file>`, a reviewer of the other family decides every class, verdict on #280). Nothing goes to Paul.
+- [ ] **Step 2: Local gate.** `gofmt -l .` (empty), `go vet ./internal/console/ ./cmd/console/`, `go build ./...`, both cross-compiles, the targeted runs from Tasks 2 to 12, `go test . -run 'TestOperatorPagesCopy|TestConsolePerfCopy' -count=1`, one `nice -n 19` run of `TestClaimConsoleMutationInvariant`, one `go test ./internal/console/ -run 'TestJob|TestLastSeen|TestStatic|TestAlertsNow' -race -count=1`, the walk with `CI=1` (`go test ./internal/console/ -run 'TestConsoleScreensMeetTheBudget|TestPerfSessionS3Requests' -count=1`: the new SQLite-only screens within budget with zero remote calls, `/fleet` and `/fleet/boxes` printed against their `over:` records, the session ceiling held). Update `.amadan/test-weights.tsv` for any new test of a second or more. Local runs stay targeted; CI runs the full suite.
+- [ ] **Step 3: Branch review.** Merge `main` first (Global Constraints). One whole-branch Astra review of the diff against amadan `main`, briefed from `REVIEW-BRIEF-TEMPLATE.md`: round 1 of 3, the per-task review verdicts (Tasks 4, 5, 7 with 7A) listed as fixed, and the Review Focus items above as "What to check", plus the gate test on every operator page and the shell markup against the mockup. Stop at the first round with no P1; apply that round's P2s without reopening; P3s go to a follow-up list in the branch description. A fourth round needs Paul's go.
+- [ ] **Step 4: Push, describe, wait for CI.** `amadan branch describe carlos/platform operator-pages -body -`: what changed, why, the decisions above (with the Task 13 and Task 6A removals and the Rastrillo tag), the screenshot review notes, the review verdicts and follow-ups, and that the census card named nothing. `amadan ci status carlos/platform -branch operator-pages` until exit 0.
+- [ ] **Step 5: Squash, re-run CI on the squashed tip, merge** with the `-expect <tip>` form, after `console-perf-quick-wins` has merged. Rolling waits for Paul's go-ahead and follows the house roll order (dev boxes, dev console, check, flagship boxes, flagship console); after the roll, read `/fleet` on flagship and the Console speed table's `GET /fleet` row.
---
## Self-review
-- **Astra round 2 (`d9e0277a`), findings that applied here:** 3, economics initializers run after fragment insertion, with an edit-and-save test after a cold load (Tasks 12, 13); 9, the six account actions are recorded on claim-gated consoles through the gate's `FreeWhenNoApp` rule, with its own gate review (Task 6A; the follow-up discussion is gone); 10, the last-seen hour is reserved under one mutex and write attempts are counted under concurrency (Task 5); 11, swallowed per-item failures mark the run Failed in every pass, with an AST check and an injected alert failure seen on the dashboard (Tasks 7, 9); 12b, plan 2's `HoldNext("list", …)` (no hold helper of this plan's own) and joining in-flight loads through the seams in blocking mode (Task 13); 12c, mux canonicalisation tested apart from the unknown-asset 404 (Task 2).
-- **Astra round 3 (`4d963091`), findings that applied here:** 7, the dashboard reads an in-process projection of what is firing now, kept by the watcher from the published objects, one entry per rule, with firing-then-cleared across a recipient change tested (Task 7A, Task 9); 8, explicit walk targets for every query-selected view (`?show=accounts`, searches, pages, every activity kind, an account filter, a deep `before`) over a populated fixture, with a test that each `show` and `kind` has one (Tasks 9, 10, 11); R2-12c, the traversal test follows each hop of the mux's redirect chain to the final 404, apart from the unknown-asset 404 (Task 2). Economics initializers follow plan 2's no-script rule for fragments (the data moves to an attribute) and its `carlos:part` event (Tasks 12, 13).
-- **Astra round 7, finding 5:** Task 9's fifteen-minute test runs over the direct seams with an injected server clock (`s.now()`, which `opHostRows` now uses) and asserts no read counts; the cached, zero-read version is Task 13's `TestAttentionAndBoxesAgreeFromTheCache`.
-- **Astra round 5, findings that applied here:** 5, the economics listeners read plan 2's `{part, root}` payload and are tested against the real `partloader` (Task 13); 6, the callout and the Boxes table come from one per-request `dashBoxes` slice built from `HostRows` at request time, the separate box part is gone, and the 14-to-16-minute case is tested on the page and after a cold load (Tasks 9, 13); 7, the query-plan witness checks each query's own access pattern, allowing total-count and bounded ordered scans, kind filters go through `audit_by_action` one action at a time, the bite checks are stated correctly, and the scale witness stays (Task 4).
-- **Astra round 4, findings that applied here:** 7, active counts are set-based over new covering indexes, with an `EXPLAIN QUERY PLAN` witness over every statement and a scale run (Task 4); 9, each landing branch has its own census NAME, card, overlay and ruling (Branch, Tasks 13, 15); 10, the Activity filter resolves accounts with an operator-only, tombstone-inclusive lookup, and following a deleted account's link is tested (Tasks 4, 11). Plan 2's restricted load environment: every operator load caches only object-store facts, with per-request builders for the rest (Global Constraints, Task 13).
-- **Plan 2's read-set redesign (coordinator, 2026-10-25).** This plan no longer leans on a per-door effect table. Only the seven object-store loads above are cached; every SQLite count and list, the job registry and the alert projection are read per request; status words and ages are joined per request; the operator writes (store approve and decline, economics scenario save, architecture refresh) are covered by read-set invalidation with warm-before-write tests (Task 13).
-- **Coordinator change (2026-10-25).** The dashboard's Boxes table keeps the mockup's columns from `HostRows` through the view cache (Decisions, Tasks 9 and 13); the spec's "`HostRows`' per-box reads stay off the dashboard" is met by keeping them off the request path of a warm view, with the per-window cost stated in Task 13.
-- **Spec coverage.** §3.1: copy in (Task 2), `go:embed`, own origin, long cache, content hash (Task 2), `VERSION` and hash test (Task 2), MPL notice (Task 2, via `LICENSE` since the files carry no header), no `light.js` (not copied), fetches nothing (Task 3's shell test). §3.2: one layout ported from `console.html` (Task 3), brand and account menu with Customer console and Sign out (Task 3), rail order and labels (Tasks 1, 3), below 800 px index and page (Task 3's `/fleet/index`, Task 14), light and dark through the theme (Tasks 2, 14), `operatorOnly` unchanged (Task 3's gate test, every page task). §3.3: dashboard, page header, needs attention with all five conditions, the stats band, the 30-day bars with screen-reader numbers, newest people, latest activity, boxes, background jobs (Task 9); old `/fleet` content to Boxes (Task 8); errors and edge failures out of scope (not built). §3.4: `last_seen` with the hourly throttle (Tasks 4, 5), account-level audit rows and the feed newest-first with an index for time-window counts (Tasks 4, 6, 11), job registry, in-process, Not run yet after restart (Task 7), counts from SQLite and `fleet.json` through the view cache, per-box rows from `HostRows` through the cache too, never on a warm view's request path (Tasks 4, 9, 13), 150 ms and one S3 read (Tasks 9, 13). §3.5: People and accounts (Task 10), Activity (Task 11), Boxes plus jobs (Task 8), Metrics with Console speed, Storage requests, Economics with seg-tabs and a list-bar, Architecture (Tasks 3, 12), old URLs keep working (all registrations kept; `/fleet` stays 200). §3.6: one `<h1>`, rail `aria-current`, no inline style (Task 3, every page), screenshots (Task 14), every page in the walk (Tasks 2 to 13), Luna copy pass (Task 1). §3.7: lands after plan 1, alongside plan 2 and Part 1, Task 13 after plan 2 Task 15.
-- **Names that cross plans.** From plan 1: `consolePerfSkip`, `PerfGroups`, `consoleSpeedRows`, `newConsoleFixtureWith`, `newPerfFixture`, `perfInventory`, `perfTargets`, `loadPerfBudgets`, `TestConsoleScreensMeetTheBudget`, the budgets grammar. From plan 2: `viewGet`, `viewMode`, `viewCached`, `viewBlocking`, `errViewPending`, `viewPart`, `renderView`, `getAssembled`, `perfLatency` (`Calls`, `SetFail`, `Keys`, `Writes`, `ResetKeys`, `HoldNext`), `perfQuiesce`/`waitBackground`, `s.bg.Go`, the four partials, Task 8's read-set invalidation (no per-door declaration), `viewLoader`, `viewLoadEnv`, `viewloaders.go` and its `load…` functions (`loadFleetJSON`, `loadBoxSnapshot`, `loadStorePending`, `loadStoreUsage`, `loadMetricsFacts`, `loadEconomicsDay`, `loadArchitectureFacts`), `metricsFacts`, `buildEconomicsView`, and Task 15's seven views. This plan's names used across its own tasks: `assetURL`, `opShell`, `opRail`, `opPage`, `op_top`/`op_bottom`, the `op_*` partials and their data types, `opPages`, `opNumber`, `signInOperator`, `operatorScreens`, `opShellPending`, `assertOpShell`, `deployActions`, `accountAuditActions`, `OperatorCounts`, `DayCount`, `PersonRow`, `AccountRow`, `ActivityFilter`, `FeedRow`, `FiringAlert`, `TouchLastSeen`, `OperatorAccountBySqid`, `opQueryPlans`, `OperatorAccount`, the `opSQL…` constants, `noteSeen`, `alertNow`, `alertsNow`, `seedOperatorScale`, `peopleShows`, `auditAccount`, `jobRegistry`, `jobFailed`, `JobStatus`, `opJobRows`, `opFleetJSON`, `opHostRows`, `opStorePending`, `seedOperatorWorld`, `fleetParts`, `handleFleetPart`.
+- **Revision of 2026-10-26 (this one).** Plan 1's names checked against `main` (`ddf3b929`): `consolePerfSkip` and `PerfGroups` live in `server.go`; there is no `latencyStore`, `fx.clock` or `Server.now`, so Task 8 adds `Server.opNow`/`s.now()` and S3 counting uses `recordS3` from `console-perf-quick-wins`. Everything that leaned on perf plan 2 (Task 13, deferred parts, the economics initializer move, the view-cache constraints) is gone; `/fleet` and `/fleet/boxes` keep honest `over:` records. Task 6A is gone (claims shelved). Task 15's census step expects an empty card (C2 scope). Rastrillo moves to v0.29.0, whose stylesheets are the mockup's; `anchor.js` joins the copies. Five workers registered since the copy record was drawn get label rows OPS-149 to OPS-153. Task 9 ends by showing Paul the dashboard. Own reviews only for Tasks 4, 5 and 7 with 7A; one branch review.
+- **Plan review history.** The plan went through Astra rounds 1 to 7 on 2026-10-25 (round 2 `d9e0277a`, round 3 `4d963091`, rounds 4, 5 and 7 recorded below). That is past the three-round budget in AGENTS.md "Stopping rules", so this revision, which removes scope and corrects names, is not sent for another plan review: the per-task reviews and the branch review in Task 15 are the reviews left, each with its own budget of three.
+- **Earlier findings still applied here.** Round 2: 9 (the six account actions, Task 6; its gate half is gone with Task 6A), 10 (the last-seen hour reserved under one mutex, write attempts counted under concurrency, Task 5), 11 (swallowed per-item failures mark the run Failed in every pass, with an AST check and an injected alert failure seen on the dashboard, Tasks 7, 9), 12c (mux canonicalisation tested apart from the unknown-asset 404, Task 2). Round 3: 7 (the dashboard reads an in-process projection of what is firing now, Tasks 7A, 9), 8 (explicit walk targets for every query-selected view over a populated fixture, Tasks 9, 10, 11), R2-12c (Task 2). Round 4: 7 (set-based active counts over covering indexes, the `EXPLAIN QUERY PLAN` witness and the scale run, Task 4), 10 (the operator-only, tombstone-inclusive account lookup, Tasks 4, 11). Round 5: 6 (the callout and the Boxes table come from one per-request `dashBoxes` slice built from `HostRows`, Task 9), 7 (the query-plan witness checks each query's own access pattern, Task 4). Round 7: 5 (Task 9's fifteen-minute test runs over the seams with an injected server clock). Findings that were about plan 2's cache, deferred parts or the claim gate (round 2: 3, 12b; round 4: 9; round 5: 5) no longer apply.
+- **Coordinator change (2026-10-25, revised 2026-10-26).** The dashboard's Boxes table keeps the mockup's columns from `HostRows` (Decisions, Task 9). With no cache, those reads are on the request path, once per view, as today's `/fleet` makes them; this is recorded in "Decisions" as a ruling over the spec's "`HostRows`' per-box reads stay off the dashboard".
+- **Spec coverage.** §3.1: copy in (Task 2), `go:embed`, own origin, long cache, content hash (Task 2), `VERSION` and hash test (Task 2), MPL notice (Task 2, via `LICENSE` since the files carry no header), no `light.js` (not copied), fetches nothing (Task 3's shell test). §3.2: one layout ported from `console.html` (Task 3), brand and account menu with Customer console and Sign out (Task 3), rail order and labels (Tasks 1, 3), below 800 px index and page (Task 3's `/fleet/index`, Task 14), light and dark through the theme (Tasks 2, 14), `operatorOnly` unchanged (Task 3's gate test, every page task). §3.3: dashboard, page header, needs attention with all five conditions, the stats band, the 30-day bars with screen-reader numbers, newest people, latest activity, boxes, background jobs (Task 9); old `/fleet` content to Boxes (Task 8); errors and edge failures out of scope (not built). §3.4: `last_seen` with the hourly throttle (Tasks 4, 5), account-level audit rows and the feed newest-first with an index for time-window counts (Tasks 4, 6, 11), job registry, in-process, Not run yet after restart (Task 7), counts from SQLite and `fleet.json`, per-box rows from `HostRows` (Tasks 4, 9). 150 ms and one S3 read: met by the SQLite-only screens; not met by `/fleet` and `/fleet/boxes`, which keep `over:` records by the ruling in "Decisions". §3.5: People and accounts (Task 10), Activity (Task 11), Boxes plus jobs (Task 8), Metrics with Console speed, Storage requests, Economics with seg-tabs and a list-bar, Architecture (Tasks 3, 12), old URLs keep working (all registrations kept; `/fleet` stays 200). §3.6: one `<h1>`, rail `aria-current`, no inline style (Task 3, every page), screenshots (Tasks 9, 14), every page in the walk (Tasks 2 to 12), Luna copy pass (Task 1). §3.7: lands after plan 1 and after `console-perf-quick-wins`; perf plan 2 is cancelled.
+- **Names that cross plans.** From plan 1 (on `main`): `consolePerfSkip`, `PerfGroups`, `consoleSpeedRows`, `newConsoleFixtureWith`, `consoleFixtureOptions`, `newPerfFixture`, `perfSeed`, `perfLatency` (`Enable`, `Calls`, `Fake`, `AppClient`), `perfInventory`, `perfTargets`, `perfTarget`, `perfWalkTargets`, `perfStructural`, `loadPerfBudgets`, `TestConsoleScreensMeetTheBudget`, `TestPerfSessionS3Requests`, the budgets grammar, `internal/s3fake` (`OnRequest`). From `console-perf-quick-wins`: `recordS3`, `s3Recorder`, `s3Req` (test helpers), and on the request path, untouched by this plan, `memoize`, `s.loadBoxes`, `Server.frames`, `Server.manifestSeen`. This plan's names used across its own tasks: `assetURL`, `opShell`, `opRail`, `opPage`, `op_top`/`op_bottom`, the `op_*` partials and their data types, `opPages`, `opNumber`, `signInOperator`, `operatorScreens`, `opShellPending`, `assertOpShell`, `deployActions`, `accountAuditActions`, `OperatorCounts`, `DayCount`, `PersonRow`, `AccountRow`, `ActivityFilter`, `FeedRow`, `FiringAlert`, `TouchLastSeen`, `OperatorAccountBySqid`, `opQueryPlans`, `OperatorAccount`, the `opSQL…` constants, `noteSeen`, `alertNow`, `alertsNow`, `seedOperatorScale`, `peopleShows`, `auditAccount`, `jobRegistry`, `jobFailed`, `JobStatus`, `opJobRows`, `opFleetJSON`, `opHostRows`, `opStorePending`, `Server.opNow`, `seedOperatorWorld`.