feat(agent-config): SC-1 schema, builtin sync, resolver #635
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!635
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/623"
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?
Lands the per-kind tables, shared revision/secret tables, builtin-sync boot pass, and resolver — all unwired from any caller. Schema is queryable but production paths still consume the in-process config behind
AGENT_CONFIG_DB_ENABLEDuntil SC-3 lands.Test plan
bun x turbo run typecheck— server + web + shared + forge-mcpbun x @biomejs/biome check .— no errorsbun test src/domain/agent-config— 26 unit tests pass (pickFromLadder, resolver layering, collection merge, builtin-sync upsert/drift/no-op, override preservation)[startup] agent-config builtin-sync: …line shows expected drift counts on first boot, all-unchanged on secondCloses #623
resolver.tsscopePriorityFor: thebuiltincase always returns priority 0 regardless ofrow.agent_type. ButsyncBuiltinsFromRepoinserts per-type builtin rows (agent_type = "dev","reviewer", etc.) forsystem_prompt,plugin_binding,plugin_marketplace,mcp_server, andagent_type_config. Result:resolveSystemPrompt(reviewer)returns thedevbuiltin row if noreviewerbuiltin exists;resolvePlugins(reviewer)includes alldevbuiltin plugins. Fix inscopePriorityFor:Matches the
agent_typecase and the spec. Add a test:resolveSystemPrompt(reviewer)with only abuiltin, devrow in DB →null.resolver.tsscopePriorityFor: thebuiltincase always returns priority 0 regardless ofrow.agent_type. ButsyncBuiltinsFromRepoinserts per-type builtin rows (agent_type = "dev","reviewer", etc.) forsystem_prompt,plugin_binding,plugin_marketplace,mcp_server, andagent_type_config. Result:resolveSystemPrompt(reviewer)returns thedevbuiltin row if noreviewerbuiltin exists;resolvePlugins(reviewer)includes alldevbuiltin plugins.Fix in
scopePriorityFor(resolver.ts):Mirrors the
agent_typecase. Add a test:resolveSystemPrompt(reviewer)with only a(builtin, dev)row →null.resolver.tsscopePriorityFor: thebuiltincase always returns priority 0 regardless ofrow.agent_type. ButsyncBuiltinsFromRepoinserts per-type builtin rows (agent_type = "dev","reviewer", etc.) forsystem_prompt,plugin_binding,plugin_marketplace,mcp_server, andagent_type_config. Result:resolveSystemPrompt(reviewer)returns thedevbuiltin row if noreviewerbuiltin exists;resolvePlugins(reviewer)includes alldevbuiltin plugins.Fix in
scopePriorityFor(resolver.ts):Mirrors the
agent_typecase. Add a test:resolveSystemPrompt(reviewer)with only a(builtin, dev)row →null.See review body above.
All AC met, CI green.
Nit (non-blocking): global-scope rows in tables with NULLable agent_type/instance_id may not be deduplicated by the UNIQUE constraint due to SQLite NULL-is-distinct semantics. SC-7 should add application-level guards on insert paths.
All AC met, CI green.
Nit (non-blocking): global-scope rows with NULLable agent_type/instance_id may not be deduplicated by the UNIQUE constraint (SQLite NULL-is-distinct). SC-7 should add application-level guards on insert paths.