DOB-1: Resolver — drop scope='builtin', fall through to code-side defaults #793
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
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
charles/claude-hooks#793
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
As a platform engineer, I want every per-kind resolver to walk a 3-layer ladder (
instance > agent_type > global) and fall back to a typed code-side default const when no row matches, so that nothing inherits from ascope='builtin'row anymore — DB rows hold operator data, code holds the bare-minimum default.This is the foundation story for the milestone. Once the resolver no longer consults
builtinrows, the boot-time JSON-sync path and the rows themselves become safe to delete (DOB-2 → DOB-5).Acceptance criteria
Resolver
pickFromLadder(or per-kind equivalent) skipsscope='builtin'rows when ranking. TheSCOPE_PRIORITYmap drops thebuiltin: 0entry. New ladder:global=0, agent_type=1, instance=2.apps/server/src/domain/agent-config/defaults.tsmodule exporting typedReadonly<T>consts.resolveSkill,resolveSystemPrompt,resolvePlugins(incl. enabled-shadow logic),resolveMcpServers,resolveAgentTypeConfig,getServiceConfig,getLabelCatalog. Each has explicit unit-test coverage of the new fallback path.getAgentType()likewise: when noscope='global'row exists for a type, returnnull(or a typedAGENT_TYPE_DEFAULTS-shaped row, depending on caller contract — pick one and document inline).Defaults module
apps/server/src/domain/agent-config/defaults.tsships with:SERVICE_CONFIG_DEFAULTS,SPEECH_CONFIG_DEFAULTS(move fromresolver.ts),LABEL_CATALOG_DEFAULTS,MCP_SERVER_DEFAULTSper built-in MCP (forge, penpot, …), and any other kind currently seeded bysyncBuiltinsFromRepo.as const satisfies Tso a future schema change to T fails the build at the const, not at runtime.Tests
scope='global'row present → resolver returns that row, defaults ignored.scope='builtin'rows being implicitly seeded must be updated to writescope='global'rows inbeforeEach(the actual data shape is unchanged — the scope label flips).Out of scope
scope='builtin'rows already in the DB — DOB-2 owns the migration.syncBuiltinsFromRepoitself — DOB-4. (Until DOB-4 ships, the loader still runs at boot but the resolver no longer reads its rows; this is intentional so the rollout can land in stages.)config/*.json— DOB-5.References
specs/config-to-db.md(parent),specs/agent-config-customization.md§ Resolver.apps/server/src/domain/agent-config/resolver.ts(pickFromLadder,SCOPE_PRIORITY, per-kind resolvers).builtinmiddle tier.scope='builtin'at runtime — defaults live in code, not DB #934