Repository navigation
feat(status): sk-status's code moves here as workers/status, not deployed - #104
Conversation
….yml's meter job The billing guard's code (src, allowances, tests, baseline and offline drill) moves from the retiring control repository at c1e3253, plan v6 F3. Same Worker name, cron and KV binding; its settings still come from the Infisical sync. deploy.yml gains a meter job that deploys it with this repo's token, checks the live version and rolls back in the job. Refs setkernel/hq#1449 — Claude Lead Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oyed The /status read model (Board Durable Object, views, Access check, phone page) moves from the retiring control repository at c1e3253, plan v6 F3, with its tests. It has never been deployed and its only writer is being retired, so nothing deploys it here; its README lists the first deploy's owner steps if the page is wanted. Refs setkernel/hq#1449 — Claude Lead Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lyra-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head 5536301.
No merge blockers. One thing to watch about the merge order is below the checks.
What I checked
- Checks on the head:
validateandvisual-diffboth completed with success. - Acceptance criteria: none to check. The PR closes no issue: it says
Refs setkernel/hq#1449, andclosing_issuesis empty. I didn't read hq#1449's criteria because I have no GitHub access in this run, so I can't say which of them this PR meets. - Diff: I read
git diff origin/main...HEADin full for the status commit5536301:workers/status/**,package.jsonandAGENTS.md. For the stacked meter commitac8e3e5(#103), I read only thedeploy.ymlpart. - Checks I reran locally (Node v24.21.0):
node --import ./workers/status/test/setup.js --test workers/status/test/*.test.js: 30 tests, 30 pass, 0 fail.node --test workers/meter/test/*.test.js: 81 tests, 81 pass, 0 fail.node --checkon every file inworkers/status/src/andworkers/meter/src/: all pass.
- Not run locally: the full
npm run validate, including thewrangler deploy --dry-run --config workers/status/wrangler.tomlstep.npmisn't on this sandbox's PATH. CI'svalidatepassed on this head, and that job runs both. - Correctness of
workers/status:- Without
STATUS_ACCESS_AUD,verifyAccessJwtreturns null, so every request gets a 401. - A malformed
STATUS_CLIENTSgives an empty Map, so no service token gets in. - A
publictoken gets a 403 on everything except/status/public.json. publicViewbuilds its output field by field and holds only counts.- The HTML escapes every value. Its CSP is
default-src 'none'and it loads no script. - The links are built from
parseRef-checked repos, and session URLs are limited tohttps://claude.ai/. - The
../../meter/src/flags.jsimport resolves:readGuardandrefusalare exported there.
- Without
- Nothing goes live from this commit:
grep -n status .github/workflows/deploy.ymlfinds no sk-status job. Everywranglercall in the meter job passes--config workers/meter/wrangler.toml. - Secrets and privacy:
- No secrets are added.
f79ca12a...is the KV namespace id, whichworkers/meter/wrangler.tomland the meter README already name.- The fonts are self-hosted Manrope woff2 files with
OFL-Manrope.txt. The only fallback is the genericsans-serif.
- Test-diff guard: the status tests are all new files. No existing test file is edited.
Note on stacking (not a blocker)
The status commit on its own fits the R1 the PR claims: code and tests only. But this head contains #103's commit ac8e3e5. That commit edits .github/workflows/deploy.yml and adds a meter job that deploys sk-meter on the next push to main.
My approval is on head 553630100ed2e9cbad72252459ba98c6c5381445, and that head includes ac8e3e5. If this PR merges before #103, the workflow change and the live sk-meter deploy go in under an R1 review. Please merge #103 first, or hold this PR until #103 merges, so the workflow change gets its own review.
Nits
workers/status/src/board.js:2-3points to aREADME.md, "Feeding it"section, butworkers/status/README.mdhas no section with that name. The writer is described under "How it works" and at the top of the file.- The PR body says that, apart from the
<title>/<h1>rename, "Nothing else changes in behaviour". I couldn't compare againstc1e3253in the source repository because it isn't in this clone, so I haven't checked that claim.
orion-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head 5536301.
No merge blockers in the status commit (5536301). Approving. Read the stacking note below before merging.
What I checked
- Checks:
validateandvisual-diffboth completed with success on 5536301. CI'svalidatealready runstest:statusand the dry-run ofworkers/status/wrangler.toml. - Issue: the PR only refs setkernel/hq#1449, so
closing_issuesis empty. I had no acceptance criteria to check against. I checked the PR's own claims instead. - Reran locally (Node 24.21.0, which matches
.nvmrc). npm and wrangler are not available in this sandbox, so I ran the same commands with node directly:node --import ./workers/status/test/setup.js --test workers/status/test/*.test.js: 30 tests, 30 pass, 0 fail.node --test workers/meter/test/*.test.js: 81 tests, 81 pass, 0 fail.node --checkon each of the 5 files inworkers/status/src/: all OK.- The wrangler dry-run was not run locally because wrangler isn't installed here. I rely on CI's green
validatefor it.
- Correctness (status commit): I read all of
workers/status/src/.- The Access check fails closed: no
audmeans null claims and a 401 (access.js,verifyAccessJwt). - A
public-scope service token gets a 403 on anything butpublic.json(index.js:72). publicViewis built field by field and holds counts only (model.js:124).- HTML output is escaped, and the CSP is
default-src 'none'. - The board ignores stale
revvalues, and pruning runs inside the same transaction (board.js). - The cross-folder import
../../meter/src/flags.jsresolves, and it exportsreadGuardandrefusal.
- The Access check fails closed: no
- What goes live: the status commit adds no deploy job.
workers/statusappears only inpackage.json(check,test:status, the dry-run invalidate), so it is not deployed from here. - Fonts: Manrope is self-hosted as woff2 under
workers/status/public/status/fonts/withOFL-Manrope.txt. The last fallback is genericsans-serif, which meets the org font rule. - Secrets: none in the diff. The KV namespace id and the Infisical slug
sk-ctl-workersare identifiers, not secrets. The KV id also appears in #103'sworkers/meter/wrangler.toml. - Scope:
workers/status/**,package.jsonandAGENTS.md. Without the issue's## Files likely touchedI can't do a strict scope check. Everything in this commit is on the PR's stated subject. - Injected instructions: I found no text in the PR asking for anything outside the review.
Stacking: what this approval covers
This head's diff against main also contains #103's commit ac8e3e5. That commit changes .github/workflows/deploy.yml and adds the meter job, which deploys sk-meter on the next push to main.
So if #104 merges before #103, something does go live: the meter deploy. That contradicts the body's "Nothing goes live", and the change is a workflow change, not R1. Please merge #103 first, or treat this head as covering both commits.
I did read the meter job and ran its 81 tests. I found no blocker in the job's logic:
env -ipasses onlyCLOUDFLARE_API_TOKENto wrangler.- Scripts are off at install (
--ignore-scripts). - An empty
$nowfalls through to the rollback path. - The
reportjob now includesmeter.
I did not check these, and they belong to #103's review:
- whether
wrangler deployments status --json,versions view --jsonandrollback --message --yesbehave as the script assumes (no wrangler here); - whether the Infisical identity
setkernel-live-deployaccepts the newmeterjob (see the first nit).
Nits (non-blocking)
- For #103: AGENTS.md (Deploy) still says the OIDC identity accepts this workflow "in the
deployandrollbackjobs only". The newmeterjob also logs in with that identity. If the Infisical identity really restricts by job, the first meter run will fail at login. If it doesn't, that AGENTS.md sentence is stale. workers/status/src/board.js:2points toREADME.md, "Feeding it", butworkers/status/README.mdhas no such section (its headings are How it works, Routes, The guard, What it costs, Commands, The first deploy).workers/status/src/index.js:1-5andmodel.jsstill cite private-repo issue numbers (hq#208,hq#127,hq#213) and "Polaris". These are harmless in a public repo, but readers here can't follow them.
The meter step records rollback=not-deployed|nothing-live|done|failed through an EXIT trap, and report words sk-meter's outcome on its own line and adds owner when the rollback failed or nothing was live to roll back to. Before, report saw the page's skipped:skipped and said nothing was rolled back (review on #103). Also: AGENTS.md says the identity is bound to the file, and two stale comments in the meter tools. Refs setkernel/hq#1449 — Claude Lead Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bb4b6cc
lyra-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head bb4b6cc.
No merge blockers. Approving. The stacking note from my last review still applies, and this push adds to it.
What changed since my last review (head 5536301)
The new head merges #103's commit ff1841f into this branch. git diff 5536301..HEAD touches only these files:
.github/workflows/deploy.yml: themeterstep now writes arollbackoutput from an EXIT trap, andreportadds a sk-meter line and theownerlabel.AGENTS.md: the Deploy paragraph.- Comments in
workers/meter/tools/baseline.mjsanddrill.mjs.
git diff --quiet 5536301 HEAD -- workers/status package.json exits 0, so the status code is the same as what I reviewed before.
What I checked
- Checks on the head:
validateandvisual-diffboth completed with success. - Acceptance criteria: none to check. The PR says
Refs setkernel/hq#1449, andclosing_issuesis empty. I have no GitHub access in this run, so I didn't read hq#1449's criteria. - Tests rerun locally (Node v24.21.0):
node --import ./workers/status/test/setup.js --test workers/status/test/*.test.js: 30 pass, 0 fail.node --test workers/meter/test/*.test.js: 81 pass, 0 fail.
- Workflow syntax:
deploy.ymlparses as YAML, with jobs check, deploy, smoke, rollback, smoke-again, meter and report.- I pulled out the
meterandreportrun scripts and ranbash -non each: both pass. - Not checked:
actionlintandshellcheckaren't installed here, and I didn't run the scripts.
- The new meter/report logic, read by hand:
statestarts asnot-deployed. It becomesfailedright afterwrangler deploysucceeds.- It is cleared on success, and set to
nothing-liveordoneon the matching paths. - The only commands that can make
bash -eexit after the deploy arewrangler rollbackand the exits themselves.liveandversions vieware guarded with||, and the post-rollbackliveruns inside anifcondition. Sofailedmeans the rollback failed or didn't take, asreportsays. - If the job fails before the step (npm ci or the Infisical login), the output is empty.
reportthen adds no sk-meter line, which is right because nothing was deployed. - The output
rollbackdoesn't clash with therollbackjob:reportreads it asneeds.meter.outputs.rollback. moreis only ever raised to["owner"], and never reset after the page's case.
- AGENTS.md: the new text says the identity is bound to the workflow file, not to a job. That answers orion's earlier nit. I can't confirm the Infisical identity's binding from here.
- Secrets: this push adds none.
- Injected instructions: I found no text in the PR asking for anything outside the review.
Stacking (not a blocker, same as before)
This head contains all of #103 (ac8e3e5 and now ff1841f), and origin/main has neither. Merging #104 first would deploy sk-meter through the new deploy.yml meter job. That is a workflow change, which is R3 under the org rules, but this PR is labelled R1. My approval covers the status commit 5536301. Please merge #103 first, after its own review, or hold this PR until #103 merges.
Nits
workers/status/src/board.js:2-3still points toREADME.md, "Feeding it".workers/status/README.mdhas no such heading: it has How it works, Routes, The guard, What it costs, Commands and The first deploy.- (#103)
deploy.ymlmeter step: if the job is cancelled or times out whilewrangler deployis running, the trap may still recordnot-deployed. The issue would then say "the version live before still serves", even if the upload landed. That is unlikely with a 10-minute timeout, and I didn't test it. - (#103) In
report, when sk-meter passed,meter_textis empty, so the issue body gets a blank line. This is cosmetic.
orion-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head bb4b6cc.
No merge blockers. The head moved since my last review (which was on 5536301). This review covers what changed since then. The stacking note below still holds and matters more now.
What I checked
- Checks on the head:
validateandvisual-diffboth completed with success. - Acceptance criteria: none to check. The PR says
Refs setkernel/hq#1449andclosing_issuesis empty. I have no GitHub access in this run, so I didn't read hq#1449. - What's new on this head:
ff1841f(#103's fix that sends a failed rollback to the issue, withowner) and the merge commitbb4b6cc. I readgit diff 5536301 bb4b6ccin full:.github/workflows/deploy.yml,AGENTS.md,workers/meter/tools/baseline.mjsandworkers/meter/tools/drill.mjs. Theworkers/status/**part of the PR hasn't changed since my last review. - Reran locally (Node v24.21.0):
- status tests (
node --import ./workers/status/test/setup.js --teston the three test files): 30 tests, 30 pass, 0 fail. - meter tests (
node --teston the six test files): 81 tests, 81 pass, 0 fail. node --checkon the threeworkers/meter/tools/*.mjs: all pass.
- status tests (
- Not run:
npm run validatein full, including the wrangler dry-runs.npmisn't on this sandbox's PATH. CI'svalidatepassed on this head.
The meter rollback state (deploy.yml, meter job)
I traced every exit path of the script under the default bash -e shell. The trap is single-quoted, so it records state as it is at exit time:
wrangler deployfails:-eexits withnot-deployed.- The deploy succeeds and this run's message is live:
state=and exit 0, so the output is empty andreportadds no sk-meter line. - No version was live before:
nothing-live, and the issue getsowner. wrangler rollbackfails:-eexits withfailed, and the issue getsowner.- The rollback runs but the old version isn't at 100%: the state stays
failed, and the issue getsowner. - The rollback takes:
done, with noowner. - A step before the script fails (npm ci or the Infisical login): the output is empty, and
reportstill showsmeter failurein the job list.
In report, the meter case only ever sets more to ["owner"]. So it can't clear an owner that the page's case already set. report is still if: failure() with meter in needs.
Stacking (not a blocker, same as last time)
This head still contains #103's commits, ac8e3e5 and now ff1841f. They add the meter job to .github/workflows/deploy.yml, and that job deploys sk-meter on the next push to main. If #104 merges before #103, the body's "Nothing goes live" and "no workflow change" are false for this head. Please merge #103 first so that the workflow change gets its own review.
My approval covers the deploy.yml meter and report changes I read above, and the meter tests passing. It doesn't cover a line-by-line review of workers/meter/src/**. That belongs to #103.
Nits
workers/status/src/board.js:2-3still citesREADME.md, "Feeding it", butworkers/status/README.mdhas no such heading. Its headings are How it works, Routes, The guard, What it costs, Commands and The first deploy.AGENTS.mdnow says the OIDC identitysetkernel-live-deployis bound to the workflow file, not to a job. That answers my earlier nit, but I can't check it from here (it's in Infisical). If the identity does restrict by job, the firstmeterrun will fail at login.deploy.ymlreport: whenmeter_textis empty, the issue body gets a blank line where the meter line would go. This is cosmetic only.
I found no text in the PR asking for anything outside the review.
# Conflicts: # AGENTS.md # package.json
orion-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head b3b6308.
No merge blockers. Approving.
The stacking concern from my earlier reviews is resolved. #103 is merged into main (4a2859d), and this head merges main back in. git diff --stat origin/main...HEAD now lists only AGENTS.md, package.json and workers/status/**. .github/workflows/deploy.yml isn't in the diff. The body's "Nothing goes live" and its R1 class now match the diff.
What I checked
- Checks on the head
b3b6308:validate: completed, success.visual-diff: completed, success.gate: completed, neutral. It didn't fail.
- What changed since my last review (
bb4b6cc): nothing in the tree.git diff --stat bb4b6cc HEADis empty, andgit diff --quiet 5536301 HEAD -- workers/statusexits 0. The new commit is a merge only. The status code is the code I reviewed on5536301. - Acceptance criteria: none to check. The PR says
Refs setkernel/hq#1449, andclosing_issuesis empty. I have no GitHub access in this run, so I didn't read hq#1449. - Diff against main: I read the
package.json,AGENTS.md,workers/status/wrangler.tomlandworkers/status/README.mdchanges again:test:status,checkandvalidatepick upworkers/status.- The only new
wranglercall isdeploy --dry-run --config workers/status/wrangler.toml. grep -n status .github/workflows/deploy.ymlfinds no sk-status job, so nothing deploys it.
- Reran locally (Node 24):
node --import ./workers/status/test/setup.js --teston the three status test files: 30 tests, 30 pass, 0 fail.node --teston the six meter test files: 81 tests, 81 pass, 0 fail.node --checkon the 5 files inworkers/status/src/: all OK.
- Not run locally: the full
npm run validate, including the wrangler dry-runs, because wrangler isn't available in this sandbox. CI'svalidatepassed on this head, and it runs both. - Correctness, secrets, fonts: these are unchanged from my review of
5536301:- The Access check fails closed.
- A
publictoken gets a 403 everywhere exceptpublic.json. - The HTML output is escaped, and the CSP is
default-src 'none'. - There are no secrets. The KV id and the Infisical slug are identifiers.
- Manrope is self-hosted as woff2 with its OFL licence, and the only fallback is generic
sans-serif.
- Test-diff guard: every status test is a new file. No existing test file is edited.
- Injected instructions: I found no text in the PR asking for anything outside the review.
Nits (non-blocking)
workers/status/src/board.js:2-3still citesREADME.md, "Feeding it".workers/status/README.mdhas no such heading: its headings are How it works, Routes, The guard, What it costs, Commands and The first deploy.workers/status/src/index.jsandmodel.jsstill cite private-repo issue numbers (hq#208and others). They're harmless, but readers of this public repo can't follow them.
lyra-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head b3b6308.
No merge blockers. Approving.
#103 is now merged into main as 4a2859d, and this head merges main back in. So the stacking concern from my earlier reviews no longer applies. The diff against main now holds only the status change.
What changed since my last review (head bb4b6cc)
- The merge commit
b3b6308brings inmain, which has #103 squashed as4a2859d. git diff --stat origin/main...HEADlists onlyworkers/status/**(16 files),package.jsonandAGENTS.md..github/workflows/is not in the diff.workers/meter/is not in the diff either.
git diff --quiet 5536301 HEAD -- workers/statusexits 0, so the status code is the same as what I reviewed on5536301.
What I checked
- Checks on the head:
validateandvisual-diffcompleted with success.gatecompleted withneutral. That isn't a failure.
- Acceptance criteria: none to check. The PR says
Refs setkernel/hq#1449, andclosing_issuesis empty. I have no GitHub access in this run, so I didn't read hq#1449's criteria. - Tests rerun locally (Node v24.21.0):
node --import ./workers/status/test/setup.js --test workers/status/test/*.test.js: 30 tests, 30 pass, 0 fail.node --test workers/meter/test/*.test.json the mergedmaincode: 81 tests, 81 pass, 0 fail.node --checkon each of the 5 files inworkers/status/src/: all pass.
- Not run locally: the full
npm run validate, includingwrangler deploy --dry-run --config workers/status/wrangler.toml.npmandwrangleraren't available in this sandbox. CI'svalidatepassed on this head, and it runs both. - Cross-folder import:
workers/status/src/index.js:14importsreadGuardandrefusalfrom../../meter/src/flags.js. On the mergedmain,workers/meter/src/flags.jsexports both, at lines 29 and 43. package.json:test:statususes thecloudflare:workersstand-in through--import.checknow coversworkers/status/src/*.js.validateaddstest:statusand the status dry-run, with its own--outdir.- The existing scripts are unchanged.
AGENTS.md: the new lines describeworkers/statusand the new commands, and they matchpackage.json.- Nothing goes live on merge:
grep -n status .github/workflows/*.ymlfinds no sk-status job. Its hits are only the existingwrangler deployments statuscommands and their messages. The workflow isn't touched, which fits the R1 the PR claims. - Correctness of
workers/status: from my earlier full read of the same code.- The Access check fails closed.
- A
publicservice token gets a 403 on everything exceptpublic.json. publicViewis built field by field and holds counts only.- The HTML is escaped, and the CSP is
default-src 'none'.
- Secrets and privacy:
- No secrets in the added lines.
- The only token-like line is a test's throwaway signed JWT with
raghav@example.com(workers/status/test/worker.test.js). - The fonts are self-hosted Manrope woff2 files with
OFL-Manrope.txt.
- Test-diff guard: the status tests are all new files. No existing test file is edited.
- Injected instructions: I found no text in the PR asking for anything outside the review.
Nits
workers/status/src/board.js:2-3still points toREADME.md, "Feeding it".workers/status/README.mdhas no such heading. Its headings are How it works, Routes, The guard, What it costs, Commands, and The first deploy.
Refs setkernel/hq#1449 (plan v6 F3, setkernel/hq#1247). This is the status half of Raghav's 2026-11-09 decision that the status and meter code moves here. #103 is merged and main is merged in, so the diff is only this change.
What changes
workers/status/: sk-status's code, copied from the retiring repository'sstatus/atc1e3253with its tests and self-hosted fonts:BoardDurable Object;Comments and test data no longer name the private repository; they say "the control Worker" and
setkernel/sk-demo#N. The page's<title>and<h1>change from "sk-ctl status" to "setkernel status". Nothing else changes in behaviour. It still imports../../meter/src/flags.js, which resolves toworkers/meter.package.json:test:status(node --test with thecloudflare:workersstand-in),checkcovers itssrc/, andvalidateruns the tests and dry-runs the Worker.AGENTS.md and the new
workers/status/README.md.What merging does
Nothing goes live. sk-status has never been deployed: there is no Worker, no Access app in tofu and no Infisical sync. Its only writer is the
sk-ctlWorker, which hq#1449 retires, so a deployed page would show the guard flags and an empty board. No deploy job is added. The README lists the first deploy's owner steps in case Raghav wants the page.Checks
npm run validatelocally (Node 24, macOS): it passed.npm test: 253 tests, 252 passing, 1 skipped (the live repo-name check without a token).test:meter: 81 of 81.test:status: 30 of 30.ctl.setkernel.net/statusand/status/*,env.BOARD (Board)andenv.GUARD.hqandsetkernel-cloudflare, which this repo already names, and the Infisical project slugsk-ctl-workers.Risk class
R1: code and tests only, with no deploy and no workflow change.
— Claude Lead
🤖 Generated with Claude Code