Skip to content

feat(status): sk-status's code moves here as workers/status, not deployed - #104

Merged
setkernel-gate[bot] merged 5 commits into
mainfrom
lead/status-home
Nov 9, 2026
Merged

setkernel-gate[bot] merged 5 commits into
mainfrom
lead/status-home

Conversation

@realRaghavGupta

@realRaghavGupta realRaghavGupta commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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's status/ at c1e3253 with its tests and self-hosted fonts:

    • the Board Durable Object;
    • the internal and public views;
    • the Access check;
    • the phone page.

    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 to workers/meter.

  • package.json: test:status (node --test with the cloudflare:workers stand-in), check covers its src/, and validate runs 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-ctl Worker, 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 validate locally (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.
    • The dry-run of sk-status shows routes ctl.setkernel.net/status and /status/*, env.BOARD (Board) and env.GUARD.
  • I scanned the added lines for the org's 64 private repository names. The only hits were hq and setkernel-cloudflare, which this repo already names, and the Infisical project slug sk-ctl-workers.

Risk class

R1: code and tests only, with no deploy and no workflow change.

— Claude Lead

🤖 Generated with Claude Code

realRaghavGupta and others added 2 commits November 9, 2026 09:12
….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
lyra-setkernel previously approved these changes Nov 9, 2026

@lyra-setkernel lyra-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: validate and visual-diff both completed with success.
  • Acceptance criteria: none to check. The PR closes no issue: it says Refs setkernel/hq#1449, and closing_issues is 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...HEAD in full for the status commit 5536301: workers/status/**, package.json and AGENTS.md. For the stacked meter commit ac8e3e5 (#103), I read only the deploy.yml part.
  • 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 --check on every file in workers/status/src/ and workers/meter/src/: all pass.
  • Not run locally: the full npm run validate, including the wrangler deploy --dry-run --config workers/status/wrangler.toml step. npm isn't on this sandbox's PATH. CI's validate passed on this head, and that job runs both.
  • Correctness of workers/status:
    • Without STATUS_ACCESS_AUD, verifyAccessJwt returns null, so every request gets a 401.
    • A malformed STATUS_CLIENTS gives an empty Map, so no service token gets in.
    • A public token gets a 403 on everything except /status/public.json.
    • publicView builds 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 to https://claude.ai/.
    • The ../../meter/src/flags.js import resolves: readGuard and refusal are exported there.
  • Nothing goes live from this commit: grep -n status .github/workflows/deploy.yml finds no sk-status job. Every wrangler call in the meter job passes --config workers/meter/wrangler.toml.
  • Secrets and privacy:
    • No secrets are added.
    • f79ca12a... is the KV namespace id, which workers/meter/wrangler.toml and the meter README already name.
    • The fonts are self-hosted Manrope woff2 files with OFL-Manrope.txt. The only fallback is the generic sans-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

  1. workers/status/src/board.js:2-3 points to a README.md, "Feeding it" section, but workers/status/README.md has no section with that name. The writer is described under "How it works" and at the top of the file.
  2. The PR body says that, apart from the <title>/<h1> rename, "Nothing else changes in behaviour". I couldn't compare against c1e3253 in the source repository because it isn't in this clone, so I haven't checked that claim.

orion-setkernel
orion-setkernel previously approved these changes Nov 9, 2026

@orion-setkernel orion-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 5536301.

No merge blockers in the status commit (5536301). Approving. Read the stacking note below before merging.

What I checked

  • Checks: validate and visual-diff both completed with success on 5536301. CI's validate already runs test:status and the dry-run of workers/status/wrangler.toml.
  • Issue: the PR only refs setkernel/hq#1449, so closing_issues is 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 --check on each of the 5 files in workers/status/src/: all OK.
    • The wrangler dry-run was not run locally because wrangler isn't installed here. I rely on CI's green validate for it.
  • Correctness (status commit): I read all of workers/status/src/.
    • The Access check fails closed: no aud means null claims and a 401 (access.js, verifyAccessJwt).
    • A public-scope service token gets a 403 on anything but public.json (index.js:72).
    • publicView is 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 rev values, and pruning runs inside the same transaction (board.js).
    • The cross-folder import ../../meter/src/flags.js resolves, and it exports readGuard and refusal.
  • What goes live: the status commit adds no deploy job. workers/status appears only in package.json (check, test:status, the dry-run in validate), so it is not deployed from here.
  • Fonts: Manrope is self-hosted as woff2 under workers/status/public/status/fonts/ with OFL-Manrope.txt. The last fallback is generic sans-serif, which meets the org font rule.
  • Secrets: none in the diff. The KV namespace id and the Infisical slug sk-ctl-workers are identifiers, not secrets. The KV id also appears in #103's workers/meter/wrangler.toml.
  • Scope: workers/status/**, package.json and AGENTS.md. Without the issue's ## Files likely touched I 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 -i passes only CLOUDFLARE_API_TOKEN to wrangler.
  • Scripts are off at install (--ignore-scripts).
  • An empty $now falls through to the rollback path.
  • The report job now includes meter.

I did not check these, and they belong to #103's review:

  • whether wrangler deployments status --json, versions view --json and rollback --message --yes behave as the script assumes (no wrangler here);
  • whether the Infisical identity setkernel-live-deploy accepts the new meter job (see the first nit).

Nits (non-blocking)

  1. For #103: AGENTS.md (Deploy) still says the OIDC identity accepts this workflow "in the deploy and rollback jobs only". The new meter job 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.
  2. workers/status/src/board.js:2 points to README.md, "Feeding it", but workers/status/README.md has no such section (its headings are How it works, Routes, The guard, What it costs, Commands, The first deploy).
  3. workers/status/src/index.js:1-5 and model.js still 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.

realRaghavGupta and others added 2 commits November 9, 2026 09:27
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>

@lyra-setkernel lyra-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: the meter step now writes a rollback output from an EXIT trap, and report adds a sk-meter line and the owner label.
  • AGENTS.md: the Deploy paragraph.
  • Comments in workers/meter/tools/baseline.mjs and drill.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: validate and visual-diff both completed with success.
  • Acceptance criteria: none to check. The PR says Refs setkernel/hq#1449, and closing_issues is 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.yml parses as YAML, with jobs check, deploy, smoke, rollback, smoke-again, meter and report.
    • I pulled out the meter and report run scripts and ran bash -n on each: both pass.
    • Not checked: actionlint and shellcheck aren't installed here, and I didn't run the scripts.
  • The new meter/report logic, read by hand:
    • state starts as not-deployed. It becomes failed right after wrangler deploy succeeds.
    • It is cleared on success, and set to nothing-live or done on the matching paths.
    • The only commands that can make bash -e exit after the deploy are wrangler rollback and the exits themselves. live and versions view are guarded with ||, and the post-rollback live runs inside an if condition. So failed means the rollback failed or didn't take, as report says.
    • If the job fails before the step (npm ci or the Infisical login), the output is empty. report then adds no sk-meter line, which is right because nothing was deployed.
    • The output rollback doesn't clash with the rollback job: report reads it as needs.meter.outputs.rollback.
    • more is 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

  1. workers/status/src/board.js:2-3 still points to README.md, "Feeding it". workers/status/README.md has no such heading: it has How it works, Routes, The guard, What it costs, Commands and The first deploy.
  2. (#103) deploy.yml meter step: if the job is cancelled or times out while wrangler deploy is running, the trap may still record not-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.
  3. (#103) In report, when sk-meter passed, meter_text is empty, so the issue body gets a blank line. This is cosmetic.

@orion-setkernel orion-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: validate and visual-diff both completed with success.
  • Acceptance criteria: none to check. The PR says Refs setkernel/hq#1449 and closing_issues is 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, with owner) and the merge commit bb4b6cc. I read git diff 5536301 bb4b6cc in full: .github/workflows/deploy.yml, AGENTS.md, workers/meter/tools/baseline.mjs and workers/meter/tools/drill.mjs. The workers/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 --test on the three test files): 30 tests, 30 pass, 0 fail.
    • meter tests (node --test on the six test files): 81 tests, 81 pass, 0 fail.
    • node --check on the three workers/meter/tools/*.mjs: all pass.
  • Not run: npm run validate in full, including the wrangler dry-runs. npm isn't on this sandbox's PATH. CI's validate passed 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 deploy fails: -e exits with not-deployed.
  • The deploy succeeds and this run's message is live: state= and exit 0, so the output is empty and report adds no sk-meter line.
  • No version was live before: nothing-live, and the issue gets owner.
  • wrangler rollback fails: -e exits with failed, and the issue gets owner.
  • The rollback runs but the old version isn't at 100%: the state stays failed, and the issue gets owner.
  • The rollback takes: done, with no owner.
  • A step before the script fails (npm ci or the Infisical login): the output is empty, and report still shows meter failure in 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

  1. workers/status/src/board.js:2-3 still cites README.md, "Feeding it", but workers/status/README.md has no such heading. Its headings are How it works, Routes, The guard, What it costs, Commands and The first deploy.
  2. AGENTS.md now says the OIDC identity setkernel-live-deploy is 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 first meter run will fail at login.
  3. deploy.yml report: when meter_text is 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 orion-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 HEAD is empty, and git diff --quiet 5536301 HEAD -- workers/status exits 0. The new commit is a merge only. The status code is the code I reviewed on 5536301.
  • Acceptance criteria: none to check. The PR says Refs setkernel/hq#1449, and closing_issues is 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.toml and workers/status/README.md changes again:
    • test:status, check and validate pick up workers/status.
    • The only new wrangler call is deploy --dry-run --config workers/status/wrangler.toml.
    • grep -n status .github/workflows/deploy.yml finds no sk-status job, so nothing deploys it.
  • Reran locally (Node 24):
    • node --import ./workers/status/test/setup.js --test on the three status test files: 30 tests, 30 pass, 0 fail.
    • node --test on the six meter test files: 81 tests, 81 pass, 0 fail.
    • node --check on the 5 files in workers/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's validate passed on this head, and it runs both.
  • Correctness, secrets, fonts: these are unchanged from my review of 5536301:
    • The Access check fails closed.
    • A public token gets a 403 everywhere except public.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)

  1. workers/status/src/board.js:2-3 still cites README.md, "Feeding it". workers/status/README.md has no such heading: its headings are How it works, Routes, The guard, What it costs, Commands and The first deploy.
  2. workers/status/src/index.js and model.js still cite private-repo issue numbers (hq#208 and others). They're harmless, but readers of this public repo can't follow them.

@lyra-setkernel lyra-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 b3b6308 brings in main, which has #103 squashed as 4a2859d.
  • git diff --stat origin/main...HEAD lists only workers/status/** (16 files), package.json and AGENTS.md.
    • .github/workflows/ is not in the diff.
    • workers/meter/ is not in the diff either.
  • git diff --quiet 5536301 HEAD -- workers/status exits 0, so the status code is the same as what I reviewed on 5536301.

What I checked

  • Checks on the head:
    • validate and visual-diff completed with success.
    • gate completed with neutral. That isn't a failure.
  • Acceptance criteria: none to check. The PR says Refs setkernel/hq#1449, and closing_issues is 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.js on the merged main code: 81 tests, 81 pass, 0 fail.
    • node --check on each of the 5 files in workers/status/src/: all pass.
  • Not run locally: the full npm run validate, including wrangler deploy --dry-run --config workers/status/wrangler.toml. npm and wrangler aren't available in this sandbox. CI's validate passed on this head, and it runs both.
  • Cross-folder import: workers/status/src/index.js:14 imports readGuard and refusal from ../../meter/src/flags.js. On the merged main, workers/meter/src/flags.js exports both, at lines 29 and 43.
  • package.json:
    • test:status uses the cloudflare:workers stand-in through --import.
    • check now covers workers/status/src/*.js.
    • validate adds test:status and the status dry-run, with its own --outdir.
    • The existing scripts are unchanged.
  • AGENTS.md: the new lines describe workers/status and the new commands, and they match package.json.
  • Nothing goes live on merge: grep -n status .github/workflows/*.yml finds no sk-status job. Its hits are only the existing wrangler deployments status commands 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 public service token gets a 403 on everything except public.json.
    • publicView is 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

  1. workers/status/src/board.js:2-3 still points to README.md, "Feeding it". workers/status/README.md has no such heading. Its headings are How it works, Routes, The guard, What it costs, Commands, and The first deploy.

@setkernel-gate
setkernel-gate Bot merged commit 5536745 into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants