Feature plan: Step 1 · Step 2 · Step 3 · Step 4

Debug mode: enabled

Effort study: railspike-effort / v3/operator_cockpit; host ledger operator_cockpit.md. Standing P2 enrollment.

Extended estimates: enabled. Stage work figures are not summed; the cycle estimate is judged separately.

Cycle estimate: 0.80

Approved planning commits: Step 1 a159b346, Step 2 44176de3, on feature/operator_cockpit.

Completion Contract

  • Normal entry: Tools in the main navigation on a desktop browser; the header on any page, desktop or iPhone.

  • End-to-end outcome: with FORUM_OPERATOR_COCKPIT_ENABLED on, /tools/ shows the ten-module annunciator above the launcher. /tools/status.txt gives the same status as text. The header shows the most serious level on every page. Each level change adds one block to state/logs/status_history.txt.

  • Recovery: a check that throws or runs past its time limit shows unlit with "check failed" and expandable details. The rest of the page renders. If the header shows nothing, /tools/status.txt still answers.

  • Deployment and external checks: deploy to zenmemes.com with Deploy now, turn the flag on, time /tools/ on prod, and check the header on the operator's iPhone SE.

  • Release condition: flag on in prod, every success criterion from Step 2 met or recorded as failed.

Key Risks

  • High risk: a slow or failing check could slow or break the Tools page for everyone. Validate in Stage 1 with a check that sleeps and one that throws. Mitigation: each check runs under its own time limit and its own error catch.

  • Stale header in cached pages. High-traffic mode serves stored HTML. Validate in Stage 6 with the mode on. Mitigation: the header reads status by script from /tools/status.txt, never from the page.

  • History noise. Parallel views could append the same change twice. Validate in Stage 5 with two parallel requests. Mitigation: append under a file lock after comparing with the last block.

  • Public sources. Everyone sees commands. Validate in Stage 2 that no source shows an absolute path or secret. Mitigation: repository-relative paths only.

Concepts touched: tools launcher (changed in Stage 2: annunciator above the launcher); application update, read-model rebuild, internal task queue, staged submission, usage reports, fastmod scoring, visitor statistics, high-traffic mode (read, unchanged). New in Stage 7: docs/concepts/status_check.md and docs/concepts/status_history.md.

Stage 1 — Check contract, two Site checks and the text address

Estimate: 0.15

  • Goal: an agent can read real Rebuild and Worker status at /tools/status.txt.

  • Dependencies: approved Step 3 and its commit.

  • Expected changes: new flag FORUM_OPERATOR_COCKPIT_ENABLED in FeatureFlagRegistry.php, off by default. A status check contract: StatusCheck::run(): StatusResult, where a result holds module, area, level (warning, caution, todo, none, nosource, failed), value, reason and source. A runner that gives each check a time limit and catches errors. Rebuild and Worker checks read OperatorStatusCollector::collect(). The other eight modules return nosource for now. /tools/status.txt prints one key=value block per module, plus a top= line.

  • Verification approach: unit tests for each level rule; a test check that sleeps and one that throws both come back failed and do not stop the others. Smoke set plus the new tests.

  • Estimate details: driver: contract plus runner; uncertainty: low.

  • Risks or open questions: the time limit can't interrupt PHP mid-call; the runner measures and marks a slow check, it doesn't kill it.

  • Canonical components/API contracts touched: OperatorStatusCollector.php (reused, unchanged); FeatureFlagRegistry.php (one flag); text format follows /api/status in CodebaseStateController.php.

Stage 2 — Annunciator on /tools/

Estimate: 0.15

  • Goal: the operator sees the annunciator above the launcher, with or without JavaScript.

  • Dependencies: Stage 1.

  • Expected changes: a new partial templates/partials/annunciator.php, rendered by ToolsPageController::index() when the flag is on. Two labelled rows, Site and Community, in fixed order. Each module shows an inline stroke icon, its name, value, one-line description, a level pill (warning, caution, to do) and its source as code. Unlit and "no source yet" modules stay quiet. A "check failed" module uses a native <details> for its error. Styles go in public/assets/tools.css with fixed level colours that keep contrast in Gloss and Gloss Dark.

  • Verification approach: page test for both rows, order and pill words; a no-script render check; manual look in Gloss, Gloss Dark and one see-through theme. Check that every source is repository-relative.

  • Estimate details: driver: markup and theme-safe styles; uncertainty: low to medium, because of theme variety.

  • Risks or open questions:

    • Impact: the launcher may pass 720 px and need scrolling. Early warning: tests/browser/tools_launcher.mjs. Mitigation: accept scrolling with the flag on and update the concept entry's numbers.

  • Canonical components/API contracts touched: ToolsPageController.php, templates/pages/tools.php, tools.css; no change to ToolsPageSupport::registry().

Stage 3 — Deploy and Tests checks

Estimate: 0.10

  • Goal: Deploy shows to do when the site is behind, and Tests shows warning when the latest run failed.

  • Dependencies: Stage 1.

  • Expected changes: Deploy reads the last stored update result through AppUpdate::check() with a maximum age, so a view never starts git fetch. With no stored result it reads "not checked". Tests reads the newest run in state/test_run_history.sqlite; with no file it returns nosource.

  • Verification approach: unit tests with a stored check that is behind, current and missing; a history database with a failed run, a passing run and no file. Time a view to confirm no fetch.

  • Estimate details: driver: the stored-check path in AppUpdate; uncertainty: low.

  • Risks or open questions: if check() with a maximum age still fetches when the store is empty, add a read-only accessor to AppUpdate instead.

  • Canonical components/API contracts touched: AppUpdate.php (read only, or one small accessor); tests/Support/TestRunHistoryStore.php format (read only).

Stage 4 — Community checks

Estimate: 0.15

  • Goal: Keys, Reports, Staged and Fastmod light up from real data; Traffic shows its value.

  • Dependencies: Stage 1.

  • Expected changes: Keys counts pending keys with the same query as users_pending.php. Reports counts uploads in the last day from UsageReportStore. Staged counts entries in StagedSubmissionStore. Fastmod counts queued work in SqliteFastScoreStore and turns caution above a limit, default 200, set in one constant. Traffic reads this hour's visits and the high-traffic flag and never lights.

  • Verification approach: one unit test per check with an empty and a non-empty store; confirm a missing store returns nosource, not failed.

  • Estimate details: driver: four stores with different access paths; uncertainty: medium, the Fastmod queue shape is the least known.

  • Risks or open questions: a disabled feature (usage reports off) must read "off", not "no source yet". Mitigation: each check reads its feature flag first.

  • Canonical components/API contracts touched: UsageReportStore.php, StagedSubmissionStore.php, SqliteFastScoreStore.php, pending-key query in users_pending.php's controller (all read only).

Stage 5 — Status history file

Estimate: 0.10

  • Goal: each level change is kept in state/logs/status_history.txt.

  • Dependencies: Stages 1, 3 and 4.

  • Expected changes: after a run, the runner compares each module's level with its last block and appends a Key: value block for each change: time, module, old level, new level, value. The append happens under a file lock. nosource and failed count as levels, so a broken source is recorded too.

  • Verification approach: unit test for one change, no change and two changes; two parallel runs append one block; confirm state/logs/ is not in the content export or public backup.

  • Estimate details: driver: lock and compare; uncertainty: low.

  • Risks or open questions: the file grows forever. One block per change is small; a size limit can follow if needed.

  • Canonical components/API contracts touched: block format of deploy_history.txt in AppUpdate.php (reused); existing lock helper used by AppUpdate.

Stage 6 — Header status and "seen"

Estimate: 0.15

  • Goal: every page shows the most serious level in the header; a viewer can mark it seen.

  • Dependencies: Stage 1.

  • Expected changes: app_header.php gets an empty status slot beside the deploy prompt, only with the flag on. A new public/assets/operator_status.js reads /tools/status.txt with a time limit, fills the slot with a pill and count, and links to /tools/. "Seen" is stored per browser with the level and value; a seen status shows a small dot whose <details> gives the reason. A new level or value clears seen. Without JavaScript, the slot stays empty.

  • Verification approach: browser test on Board, Recent and a cached thread page with high-traffic mode on; seen survives a reload and clears on change.

  • Estimate details: driver: script, storage and cached-page case; uncertainty: medium.

  • Risks or open questions: the header is crowded on narrow screens. Mitigation: on narrow screens show only the pill, no count.

  • Canonical components/API contracts touched: app_header.php, layout.php script list, pattern of deploy_prompt.js.

Stage 7 — Prod acceptance, iPhone replay and concept entries

Estimate: 0.10

  • Goal: the Completion Contract holds on zenmemes.com and on the operator's iPhone SE.

  • Dependencies: Stages 1–6, merged and deployed by the maintainer.

  • Expected changes: new concept entries status_check.md and status_history.md; update tools_launcher.md. No application change unless acceptance fails.

  • Verification approach: flag on in prod. Count modules with a real source (target seven). Time /tools/ (target under 300 ms). On the iPhone SE in Safari, load Board and confirm the header pill; then open /tools/status.txt as the fallback. Force one change and confirm one history block. Record each result as passed, failed or pending.

  • Estimate details: driver: prod access and the phone check; uncertainty: medium, the iPhone check needs the maintainer.

  • Risks or open questions: if fewer than seven sources work on prod, record which and why, and keep the rest "no source yet".

  • Canonical components/API contracts touched: docs/concepts/.

Study snapshot

FieldValue
CheckpointStep 3 handoff
Projected total0.80, reaffirmed
Stage work (not summed)0.15, 0.15, 0.10, 0.15, 0.10, 0.15, 0.10
Reference / protocolR1 / P2
RaterClaude, single exposed rater
Baseline44176de3
ApprovalApproved Step 3 by the maintainer, 2026-11-30

— Claude · 2026-11-30 UTC · Model: Claude Opus 5.5