refactor: close region→siteId half-migration on public wire keys - #119
Conversation
Finishes what #118 enumerated: no public response surface uses the `region` JSON key for a site-id value anymore. - Responses renamed outright (precedent #118): eval-agent-tokens list/create (+ legacy admin routes), run-targets agents, eval-agents/dispatchable shared rows (seam key no longer leaks), clash-runner tokens/list. - Clash-runner daemon wire dual-keys `siteId` + `region` (register + assignment payloads) — deployed runners still read `region`; drop the alias after the next runner redeploy (vox-upgrade.sh). - Request bodies canonically take `siteId`; legacy `region` stays ACCEPTED as an alias (eval-schedules, workflow run, clash event/ token/schedule) so scripted API users don't break. Existing tests keep sending the alias — continuous coverage of that path; the canonical key + alias are pinned in site-id-wire.test.ts. - Client writers/readers flipped to siteId on console-eval-agents, console-clash, console-evalsets, console-workflow-detail, run-your-own (incl. the curl doc example). - Internal/seam DTOs (dispatch.ts, permissions.ts, marketplace AgentSummary/setListing context) intentionally untouched — internal naming debt only, no wire impact. Gate: tsc clean, unit 1557/1557, audio 12/12, E2E green (one known rare admin-login flake under full-suite parallelism, 19/19 x3 standalone; agora-e2e 13/13 after a lingering remote ConvoAI session timed out). 🤖 Built with SMT <smt@agora.build>
🤖 Codex Code ReviewFindings
No security issues found in the changed paths. I did not run tests because the environment is read-only. |
🤖 Claude Code ReviewThe refactor is coherent and the server↔client key flip is complete — I checked every response surface that changed against its consumers ( Incidental security improvement worth noting: Findings: 1. The clash-runner The comments say "Deployed clash-runner daemons still read So a PR whose stated purpose is closing the half-migration adds three new dual-keyed 2. Body alias exists, query alias doesn't ( The rationale for 3. Minor:
Validation is intact everywhere the alias was introduced: all five sites run the resolved value through |
…ey (#120) Removes every remaining `region` alias from the API (follow-up to #119, per decision: no backward compatibility needed): - Request bodies read `siteId` ONLY (eval-schedules, workflow run, clash event/token/schedule). The legacy `region` body key is dead. - Token create reads `regionLocationBaseId` ONLY (drops the pre-refactor `region` base-id body alias). - Clash-runner wire: register + assignment payloads emit only `siteId`. Verified safe: the runner daemon never read the site field at all (consumes id/state/match.{id,topic,maxDurationSeconds} only), so no runner redeploy is required. Eval-agentd fleet already upgraded. - Tests: all request bodies flipped to canonical keys (~70 sites); site-id-wire now asserts the legacy key is REJECTED, with a canonical control proving the 400 is the missing key. Gate: tsc clean, unit 1557/1557 (agora-e2e 13/13 + health 281/281 re-verified after a lingering remote ConvoAI session timed out and the local daemon was restarted), audio 12/12, E2E 133 passed / 0 failed. 🤖 Built with SMT <smt@agora.build>
Summary
Follow-up to #118: no public response surface uses the
regionJSON key for a site-id value anymore.GET/POST /api/eval-agent-tokens(+ legacy/api/admin/eval-agent-tokens), run-targets agents,/api/eval-agents/dispatchableshared rows (the marketplace seam's internalregionkey no longer leaks to the wire), clash-runner tokens/list.siteId+region(register response + assignment payloads): deployed runner containers still readregion; drop the alias after the next runner redeploy viavox-upgrade.sh.siteId; the legacyregionbody key remains accepted as an alias (eval-schedules, workflow run, clash event/token/schedule) so scripted API users don't break. Existing tests keep sending the alias — continuous coverage of that path; the canonical key and contract are pinned intests/site-id-wire.test.ts.siteIdon console-eval-agents, console-clash, console-evalsets, console-workflow-detail, run-your-own (incl. the curl doc example).dispatch.ts,permissions.ts, marketplaceAgentSummary/setListingcontext) — internal naming only, zero wire impact.Test plan
npm run checkclean; unit 1557/1557; audio 12/12; E2E green — one known rare admin-login flake under full-suite parallelism (passes 19/19 ×3 standalone); agora-e2e 13/13 against the real ConvoAI API.siteId(neverregion); legacyregionbody alias proven read via a successful create.Generated with SMT smt@agora.build