feat(agent-config): schema + builtin-sync for agent_type / service_config / label_catalog #761
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!761
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "code-lead/743"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Foundation tables + builtin-sync passes for the config-to-DB migration (AT-1 / SVC-1 / LBL-1).
Test plan
IF NOT EXISTSeverywhere.syncAgentTypeBuiltinsupserts identity / container / routing rows; re-run is all-unchanged; vanished types shadowed (enabled=0).syncServiceConfigBuiltinupserts the single builtin row; global override oncontainer_imagesurvives a builtin re-sync; webhook secret bytes migrate into the SC-6 secret table.syncLabelCatalogBuiltinupserts one row per label;reposcope shadowsglobalshadowsbuiltin.getAgentTypejoins identity + container + routing across the scope ladder; instance-scope routing row resolves correctly.bun x turbo run typecheck lint test— 3100 tests pass, no new lint findings.Closes #743 #750 #754
CI green (run #2864). All AT-1 / SVC-1 / LBL-1 AC met.
syncAgentTypeBuiltins: upsert + shadow pattern (enabled=0) correct; container/routing rows wired.syncServiceConfigBuiltin: webhook-secret one-shot migration path correct; global override preserved across re-sync.syncLabelCatalogBuiltin: repo > global > builtin ladder correct.getAgentType/getServiceConfig/getLabelCatalogForReposcope ladders all correct.syncBuiltinsFromRepo.nit (non-blocking):
upsertAgentTypeRoutingRowreturns early (skips the upsert) when all routing fields are absent or empty-array, but does not clear an existing builtin routing row — so a type that had routing and then clears all fields will leave a stale row in the DB. Not in AC scope for AT-1 (no consumer yet), but worth a comment or test in AT-2 before the resolver is wired.nit: three inline
require("node:fs")calls in the test file (lines 229 / 359 / 469) — top-level import is already there.