Repository navigation
Mission Control: the board and live status at /admin/board - #190
Merged
Merged
Conversation
A staff page behind a new key, site:board.read, which migration 0004 adds and grants to admin. Each load probes the other production hosts from the Function, in parallel with a 3 s deadline each, then renders the MasterMind board (board.v1) from KV BOARD, key board:v1, every string escaped. Without the binding, the key or valid JSON it says the board is not connected and lists the three steps that connect it; a KV error is a warning. No script, the CSP is unchanged, and staff.css carries the styles (v=20261031). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VHrJ4hmTtR1RFNpc215EK7
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it shows
GET /admin/board, titled Mission Control, for holders of a new key,site:board.read("See Mission Control: the board and telemetry"). Server-rendered with no script, under the existing CSP, in the staff layout and navigation. In order:BOARD, keyboard:v1. It says when the board was computed and how long ago, and warns once it is older than 36 hours, as board.v1 requires.telemetrykey. Each metric shows its status (OK, Breach or Unknown), value and unit, owner, basis, threshold and reason, followed by the open incidents. An unknown metric shows "Unknown" and its reason, never its value field, so never a 0.Every board string is untrusted and is escaped with the site's
esc(). Links go only to GitHub, built only from anowner/reponame, a hex sha, a PR number or a GitHub issue URL that passes its pattern; anything else stays text. Unknown keys are ignored, and a value of the wrong type renders as absent. Long lists are capped (decisions 20, portfolio 60, asks and gates 40, metrics and incidents 20) and say "Showing N of M".Mission Control appears in the staff navigation (first under Team) and on the launchpad, for holders of the key only.
How it degrades
BOARDbinding (today)board:v1keyboard:v1key yethandle()in the test)generatedAttelemetrykey (today)Live verification
The checks as
server/probes.jssends them: no cookie, no Origin,User-Agent: SyberLabs-Mission-Control/1,redirect: manual. The four preview routes get a POST with no body. Each takes POST (Flyspacesrc/app/api/*/route.tsat42785f9), answers 503 first in the preview, then refuses a request with no Origin, so a check cannot spend. The connector gets a JSON-RPCinitializewithContent-Type: application/jsonandAccept: application/json, text/event-stream.These results come from the branch's own
runProbes(), run on 2026-10-31 from this session's machine (through its egress proxy). It ran in Node and inside workerd (wrangler devwith wrangler 4.141.0 fromdeploy/):initializeresult.serverInfoThree earlier Node runs at 02:32Z and curl at 02:18Z gave the same eight statuses. In workerd, a ninth check pointed at a local server that accepts connections and never answers ended at 3,001 ms as a timeout, while the other eight finished normally.
readBoardagainst a real local KV binding in workerd returnedunbound,missing,okandmalformedfor those four cases.Tests
node --test 'server/test/**/*.test.js': 208 tests, 208 pass, 0 fail (192 before: 15 new inserver/test/board.test.jsand 1 new inmigration.test.js).board.test.jscovers:/auth/signin?next=%2Fadmin%2Fboardwith an empty body. A session without the key gets a 403 naming the key's label. Neither runs a check or reads KV.get), a missing key, malformed JSON,[],nulland a string each render "not connected" with the three steps, and the checks still run. A KV throw (async or sync) renders the warning, with no exception text and no steps.generatedAt.initialize. No response body reaches the page.hasServerInfoandrepoName.migration.test.js: the file list now includes0004_board.sql. On a database shaped like production (0001 to 0003, admins, a viewer with a custom role, entries, audit rows, a saved backup), 0004 adds exactly one permission row and one admin grant and leaves every other row unchanged. A second run is refused whole.migration.test.js,guards.test.js), the admin launchpad cards (app.test.js), and thestaff.csslink version (views.test.js; the stylesheet is unhashed, so its link moves to?v=20261031).node scripts/site-chrome.mjs --check: 16 pages up to date.node --test scripts/account-nav.test.mjs: 9 pass.npm ci --prefix deploy, thendeploy/node_modules/.bin/wrangler pages functions build --outdir dist/_worker.js --compatibility-date 2026-10-01. It compiled, at 267 KB.pnpm build:siteand the QA sweep. No public page changes; CI runs both.Connect the board (Seth)
wrangler.tomlas[[kv_namespaces]]withbinding = "BOARD".CLOUDFLARE_API_TOKEN(with Workers KV Storage: Edit),CLOUDFLARE_ACCOUNT_IDandBOARD_KV_NAMESPACE_ID.board:v1, and it shows here.This PR does not add the binding: no namespace id exists yet, and a placeholder would break production deploys. Until step 3 the page shows live status and these three steps.
One more step, needed once before anyone can open the page: apply
migrations/0004_board.sqlto the production D1 databasesyberlabs-accounts, the same way 0001 to 0003 were applied. For example,wrangler d1 migrations apply syberlabs-accounts --remoteapplies only the files it has not recorded. Until then nobody holdssite:board.read, so/admin/boardanswers 403 for everyone and stays out of the navigation (fail closed). The migration adds one permission row and one admin grant and touches no other row.Merging deploys production
Merging to
mainruns the Pages workflow, which builds and publishes syberlabs.io. There is no separate release step.Keys and sign-offs
node tools/ledger/cli.mjs floor origin/main...HEAD(MasterMind, pointed at this checkout) saysauto: no protected surface touched, so this needs an independentReviewed-by.wrangler.tomlis untouched.server/routes.jsandserver/CONTRACT.mdwith Count each staff Function response as one site.request data point #189, in different hunks.Known limits
fetchfrom another Worker on the same zone. sketch.syberlabs.io is served by Pages. All three were checked from this machine (Node and workerd) but not yet from Cloudflare's edge. If a check reads Down in production while the host answers from outside, the same-zone subrequest rule is the first suspect.initializeto the RISE connector. The page is staff-only, so that is a few requests a day.telemetrykey and itsincidentsshape are not specified yet (MasterMind P7). For each incident the page readstitle,checkorid, thenopenedAtorsince,owner, and a GitHub issueurl. It counts an incident as open unless it hasclosedAt, or astateorstatusof closed or resolved.objective,malformedandadvicekeys are not shown here; the MasterMind artifact page keeps them.https://claude.ai/code/session_01VHrJ4hmTtR1RFNpc215EK7
Generated by Claude Code