Repository source: docs/plans/operator_cockpit/operator_cockpit_step2_feature_description.md
Debug mode: enabled
Effort study: railspike-effort / v3/operator_cockpit; host ledger operator_cockpit.md. Standing P2 enrollment.
Extended estimates: enabled.
Cycle estimate: 0.80
Approved Step 1 commit: a159b346 (Option B, first slice, with the maintainer's answers).
Problem
The operator learns the site's state only by opening System status, Deploy, User Access and other tools one by one. Problems surface late or by accident.
User stories
As the operator, I want one row of modules on Tools that lights up only when something needs me, so that one glance tells me whether to act.
As the operator, I want every value to show the command or query behind it, so that I can check it over SSH or in the SQLite Viewer.
As the operator, I want the most serious level in the header of every page, so that I notice a warning without opening Tools.
As the operator, I want to mark a level as seen and still find out later why it was lit.
As a visitor or an agent, I want the same status in plain text, so that I can read it without a browser.
As the operator, I want each level change kept in a file, so that a later cycle can replay the past.
Core requirements
/tools/shows the annunciator above the existing launcher, for everyone. Two fixed rows: Site (Deploy, Rebuild, Tests, Worker, Backup) and Community (Keys, Reports, Staged, Fastmod, Traffic). Modules never change position.Each module shows an icon, a one-line description, a value, a level and its source command. Levels are warning (failing), caution (degrading) and to do (waiting for the operator), each a small tinted pill with its word. A module with no confirmed source stays unlit and reads "no source yet".
The annunciator renders on the server and works without JavaScript. No check may wait on the network: Deploy uses the last stored update check, never a new
git fetch.The header shows the most serious level on every page, loaded by script from a small text address, so cached and published pages stay correct. "Seen" is kept per browser and leaves a small dot that opens into the reason.
Each level change appends one
Key: valueblock tostate/logs/status_history.txt. The file stays out of every export.
Module sources
| Module | Source | First-version rule |
|---|---|---|
| Deploy | AppUpdate::check() with a maximum age, as the header prompt uses | to do when behind origin/main |
| Rebuild | OperatorStatusCollector read-model status and stale marker | caution when not ready; warning when the rebuild task failed |
| Tests | state/test_run_history.sqlite from tests/run.php | warning when the latest run failed; "no source yet" where no history exists, as on prod |
| Worker | OperatorStatusCollector task queue | warning when tasks wait and the executor is not seen; caution when tasks failed |
| Backup | none: archives are built on download, and nothing records a backup | "no source yet" |
| Keys | pending keys, as users_pending.php lists them | to do when one or more wait |
| Reports | UsageReportStore | to do when reports arrived in the last day |
| Staged | StagedSubmissionStore | to do when any post is staged |
| Fastmod | SqliteFastScoreStore work queue | caution above a backlog limit set in Step 3 |
| Traffic | visitor_statistics_hourly and the high-traffic flag | value only; never lit in this cycle |
Concepts touched: tools launcher (changed: the annunciator sits above it); application update, read-model rebuild, internal task queue, staged submission, usage reports, fastmod scoring, visitor statistics, high-traffic mode (read, unchanged). Proposed new entries: status check and status history.
Delivery scope
Work type: application change, behind a new flag
FORUM_OPERATOR_COCKPIT_ENABLED, off by default.Out of scope: telemetry charts, System facts, flight log, command palette, guarded switches, the replay scrubber, runbook checklists and the copilot. Each becomes its own epic cycle.
Completion boundary
Normal entry: Tools in the main navigation, on a desktop browser.
End-to-end outcome: on zenmemes.com the annunciator shows real values, the header shows the top level on Board and Recent, and a level change adds a block to the history file.
Recovery: a check that throws or times out shows unlit with "check failed" and expandable details, per the error-details guideline. The rest of the page still renders.
Release condition: flag on in prod after a deploy, with the iPhone header still working.
Known user or environment
The operator deploys from an iPhone SE in Safari. The header status must show there, and the Tools page must stay usable there even though its layout is desktop-first. The operator verifies on the phone by loading Board after a level change. If the header shows nothing, the operator opens /tools/status.txt to see the same status as text.
Risks
Slow Tools page. Ten checks run per view. Validate early by timing each check on prod data. Mitigation: one time limit per check; a slow check reads "check failed".
Stale header in cached pages. High-traffic mode serves stored HTML. Validate by loading Board with the mode on. Mitigation: the header reads status by script, never from the page HTML.
History noise. Two views at once can append the same change twice. Validate with two parallel requests. Mitigation: append under a file lock and compare with the last block.
Public sources. Everyone sees commands and counts. Validate that no command shows an absolute server path or a key. Mitigation: show repository-relative paths only.
Shared component inventory
Launcher and registry: reuse
ToolsPageSupport.phpandtemplates/pages/tools.php; the annunciator is a new partial above the launcher.Status data: reuse
OperatorStatusCollector.php, which System status already uses; no second reader of the read model or task queue.Header: extend
templates/partials/app_header.phpbeside the deploy prompt, following the reveal-by-script pattern ofdeploy_prompt.js.History format: reuse the
Key: valueblock format ofdeploy_history.txtinAppUpdate.php.Text form: follow
/api/status'skey=valuestyle inCodebaseStateController.php.
User flow
The operator opens any page. The header shows "1 WARNING" with a red pill.
They click it and land on Tools. Tests in the Site row is lit, with its failing count and its command.
They fix the problem. On the next view, Tests is unlit and the history file gains a block.
Later, a to do appears for Keys. They mark it seen. A dot remains, and opening it reads "2 keys waiting since 14:10".
Success criteria
On prod, all ten modules render, and at least seven have a real source.
/tools/renders with every check in under 300 ms on prod.Header status matches
/tools/status.txton Board, Recent and a cached thread page, on desktop and iPhone.A forced level change writes exactly one history block.
— Claude · 2026-11-30 UTC · Model: Claude Opus 5.5
Study snapshot
| Field | Value |
|---|---|
| Checkpoint | Step 2 handoff |
| Projected total | 0.80 (was 0.75) |
| Reason for change | New understanding: the header needs a text address and a script, because cached pages can't carry live status; and the per-check time limit adds work |
| Reference / protocol | R1 / P2 |
| Rater | Claude, single exposed rater |
| Baseline | a159b346 |
| Approval | Approved Step 2 by the maintainer, 2026-11-30 |