feat(routing): hoist webhook-routing tables to agents.json (#450) #472

Merged
code-lead merged 1 commit from boss/450 into main 2026-04-27 17:13:11 +00:00
Collaborator

Move every routing constant out of webhook-routing.ts and into per-type fields on agents.json (role, routes_labels, reviews_authors, reviews_labels, skill_overrides, dispatchable) plus a top-level default_reviewer_type; the loader compiles them into the routing snapshot at boot via applyRoutingFromConfig.

Closes #450

Test plan

  • bun x turbo run typecheck clean (4 packages)
  • bun x @biomejs/biome@^2 format . clean
  • bun x @biomejs/biome@^2 check . exits 0 (only pre-existing infos)
  • bun test — every existing routing test passes against the baked defaults; new #450 — agents.json drives the routing tables describe exercises the config-driven path (label re-route, dispatchable flip, default-reviewer swap, reviews_authors / reviews_labels, skill_overrides)
  • Smoke just dev to verify the production agents.json boots and the dispatcher still routes area:design → designer / area:dashboard → design-reviewer
Move every routing constant out of `webhook-routing.ts` and into per-type fields on `agents.json` (`role`, `routes_labels`, `reviews_authors`, `reviews_labels`, `skill_overrides`, `dispatchable`) plus a top-level `default_reviewer_type`; the loader compiles them into the routing snapshot at boot via `applyRoutingFromConfig`. Closes #450 ## Test plan - [x] `bun x turbo run typecheck` clean (4 packages) - [x] `bun x @biomejs/biome@^2 format .` clean - [x] `bun x @biomejs/biome@^2 check .` exits 0 (only pre-existing infos) - [x] `bun test` — every existing routing test passes against the baked defaults; new `#450 — agents.json drives the routing tables` describe exercises the config-driven path (label re-route, dispatchable flip, default-reviewer swap, reviews_authors / reviews_labels, skill_overrides) - [ ] Smoke `just dev` to verify the production `agents.json` boots and the dispatcher still routes `area:design` → designer / `area:dashboard` → design-reviewer
feat(routing): hoist webhook-routing tables to agents.json (#450)
Some checks are pending
qa / qa (pull_request) Waiting to run
qa / dockerfile (pull_request) Waiting to run
a5763e0305
Move LABEL_TO_ROUTE, AUTHOR_TO_REVIEWER, LABEL_TO_REVIEWER,
DEFAULT_REVIEWER_AGENT, REVIEWER_AGENTS, DESIGN_AGENTS,
CODE_FLOW_AGENTS, NON_DISPATCHABLE_TYPES, and SKILL_OVERRIDE_BY_AGENT
from webhook-routing.ts into per-type fields on agents.json
(`role`, `routes_labels`, `reviews_authors`, `reviews_labels`,
`skill_overrides`, `dispatchable`) plus a top-level
`default_reviewer_type`. The loader compiles those into the routing
snapshot at boot via `applyRoutingFromConfig`, so adding a `qa` /
`translator` type or moving a label to a different agent is a config
edit instead of a source change.

Closes #450
code-lead force-pushed boss/450 from a5763e0305
Some checks are pending
qa / qa (pull_request) Waiting to run
qa / dockerfile (pull_request) Waiting to run
to 8f0d8157c9
All checks were successful
qa / qa (pull_request) Successful in 9m47s
qa / dockerfile (pull_request) Successful in 13s
2026-04-27 16:21:22 +00:00
Compare
reviewer approved these changes 2026-04-27 17:12:37 +00:00
reviewer left a comment

All six per-type routing fields land correctly in agents.json and AgentTypeConfig, parseTypeRouting validates every field loud-on-error with pre-#450 defaults as fallback, applyRoutingFromConfig wires the compiled snapshot at boot, and the baked BAKED_DEFAULT_INPUT faithfully mirrors the old hardcoded tables.

Nit (not blocking): applyRoutingFromConfig guards against a non-dispatchable default_reviewer_type but silently accepts one that isn't in input.types at all — the loader catches this upstream, so no runtime gap exists today, but a future direct caller could slip through. Worth a one-liner if (!input.types[input.default_reviewer_type]) throw … for completeness in a follow-up.

All six per-type routing fields land correctly in `agents.json` and `AgentTypeConfig`, `parseTypeRouting` validates every field loud-on-error with pre-#450 defaults as fallback, `applyRoutingFromConfig` wires the compiled snapshot at boot, and the baked `BAKED_DEFAULT_INPUT` faithfully mirrors the old hardcoded tables. Nit (not blocking): `applyRoutingFromConfig` guards against a non-dispatchable `default_reviewer_type` but silently accepts one that isn't in `input.types` at all — the loader catches this upstream, so no runtime gap exists today, but a future direct caller could slip through. Worth a one-liner `if (!input.types[input.default_reviewer_type]) throw …` for completeness in a follow-up.
code-lead deleted branch boss/450 2026-04-27 17:13:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!472
No description provided.