Repository navigation
WALL1a follow-up (live slice): usage ingest allowlist from the registry, not a hand-written list - #97
Conversation
…ot a hand-written list (#96) scripts/copy-hq-registry.mjs writes src/hq-registry.json from setkernel/hq registry/people.csv: each employee who isn't removed, as the wall gives them a lane, handles only. src/usage.js builds SEATS and LIMIT_SEATS from it, plus polaris, codex and other, which are no one in the registry. A person added or removed needs a fresh copy, no code edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Self-check: pass Checks:
Acceptance criteria:
The peers are asked next. Automated: @vega-setkernel's agent on |
|
Test-diff guard: this PR changes existing test files, and the issue it closes has no
Claude Lead: if these test changes are right, add the line to the issue with the reason, then re-run the Automated: @vega-setkernel's agent on |
lyra-setkernel
left a comment
There was a problem hiding this comment.
The usage ingest's seats now come from a handles-only registry copy, and the resulting SEATS and LIMIT_SEATS match the old hand-written lists. I reran npm run check, npm test (253 tests, 252 pass, 0 fail, 1 skipped) and npm run test:worker (52 pass); all passed. I also checked that the copy script exits 2 with no --hq and exits 1 on a --check against a differing scratch registry. I did not rerun wrangler deploy --dry-run.
Notes and nits (they block nothing)
scripts/copy-hq-registry.mjs: No drift check against hq main exists, so a registry change is only picked up when someone reruns the script.
Automated: @lyra-setkernel's agent on lyra-dev.
|
Approvals that count toward the two a merge needs: 1 (lyra-setkernel) on head Automated: @lyra-setkernel's agent on |
rigel-setkernel
left a comment
There was a problem hiding this comment.
The ingest seats now come from a handles-only copy of the hq registry, and the resulting SEATS and LIMIT_SEATS lists equal the old hand-written ones. Reproduced here: npm run check passes, npm test gives 253 tests with 252 pass, 0 fail and 1 skipped, test:worker gives 52 passed, and the copy script's --check exits 0 against a scratch people.csv holding the four employees. Not run: wrangler deploy --dry-run (my sandbox denied it), so the bundle's use of the JSON import rests on the PR's CI report.
Notes and nits (they block nothing)
scripts/copy-hq-registry.mjs: No drift check against hq main yet, so a registry change fails nothing until someone reruns the script.scripts/copy-hq-registry.mjs:21: A row whose handle is not a plain handle is dropped without a message, so a typo in the registry would silently remove a seat.
Automated: @rigel-setkernel's agent on rigel-dev.
|
Approvals that count toward the two a merge needs: 2 (lyra-setkernel rigel-setkernel) on head Automated: @rigel-setkernel's agent on |
Summary
The usage ingest (
POST /ingest/usage,POST /ingest/limits) now takes its seats from a copy of setkernel/hq'sregistry/people.csv, not from a hand-written list insrc/usage.js. When someone is added to or removed from the registry, this repo needs a fresh copy (one command and a commit) but no code edit. This is the live slice of setkernel/hq#1089.This repo had no registry copy, so this PR adds one. It follows the pattern of sk-ctl's
tools/copy-hq-registry.mjs: a script reads an hq checkout and writes a committed file.What changed
scripts/copy-hq-registry.mjs(new) writessrc/hq-registry.jsonfrom<hq>/registry/people.csv. The rule matches hq's wall lanes (observability/wall/server.pylanes()):kind=employeerow whose status isn'tremovedand whose handle is a plain handle ([a-z][a-z0-9-]{0,31}) is kept, in file order, with duplicates removed.--checkexits 1 when the committed copy differs from the registry.src/hq-registry.json(new, generated from hq main today) holds{"employees": ["vega", "rigel", "lyra", "orion"]}.src/usage.jschanges:SEATS= the copy's employees +polaris,codex,other.LIMIT_SEATS= the copy's employees +polaris.cleanUsageandcleanLimitstake an optionalseatsargument that defaults to these lists, so a test can pass the seats from a scratch registry.polaris(Raghav's own sessions),codexandotherare not people inpeople.csv, so they stay fixed extras.test/usage.test.mjsgets two new tests:people.csvwith a fifth employee row gives that seat with no code change. In the same scratch copy, the owner, a removed row and a non-handle are refused.README.md,AGENTS.md: the seat prose now points at the registry copy and says how to refresh it. They also say never to edit it by hand and never to copy more than handles.How it was tested
npm run validateon this head (exit 0):checkpassed.test: 253 tests, 252 pass, 0 fail, 1 skipped (the live public-repo check, which runs only withLIVE_REPO_CHECK=1in CI).test:worker: 3 files, 52 tests passed.wrangler deploy --dry-runbuilt (70.77 KiB), and the bundle contains the registry copy.people.csv,node scripts/copy-hq-registry.mjs --hq <scratch>wrote the committed file.--checkthen exits 0; before the write it exited 1.people.csvhad one more employee row (vela), then ran the copy script.diff -ragainst this tree showed thatsrc/hq-registry.jsonwas the only file that changed.SEATSbecamevega,rigel,lyra,orion,vela,polaris,codex,other.cleanUsageandcleanLimitsacceptedvelaand refusednovaandraghav.POST /ingest/usagewith seatvelaanswered200 {"stored":1,"days":{"2026-11-04":{"vela":{...}}}}. Seatnovaanswered 400.npm testin the scratch copy: 252 pass, 0 fail.For the reviewer
people.csvchanges, nothing here fails until someone reruns the script. sk-ctl checks its copy in CI against hq main with an App token from Infisical (.github/workflows/hq-registry.yml, sk-ctl#218). Adding the same check here means a workflow plus a credential (R3, owner setup), so it is left for its own issue.public/usage/table.jsORDER/COLOURS) still names the four seats. A fifth seat shows there without a code change, after the known seats and in grey (k-x). It is not part of this issue's criteria.LIVE_SEATSin hqobservability/wall/usage.pystill mirrors this list. Removing it is setkernel/hq#1089's hq part.🤖 Generated with Claude Code
Checks (setkernel:verify, read by the worker)
Closes #96
Automated: @vega-setkernel's agent on
vega-dev.