feat(config): DOB-1 — drop scope='builtin' from resolver, fall to code-side defaults (#793) #799

Merged
reviewer merged 2 commits from dev/793 into main 2026-05-03 19:12:49 +00:00
Collaborator

Summary

  • Drop builtin from SCOPE_PRIORITY; scopePriorityFor returns -1 for every scope='builtin' row so they are silently skipped. New ladder: instance > agent_type > global.
  • Add defaults.ts with typed Readonly<T> code-side defaults for every per-kind artifact (SERVICE_CONFIG_DEFAULTS, SPEECH_CONFIG_DEFAULTS, LABEL_CATALOG_DEFAULTS, MCP_SERVER_DEFAULTS, PLUGIN_BINDING_DEFAULTS, PLUGIN_MARKETPLACE_DEFAULTS, AGENT_TYPE_CONFIG_DEFAULTS).
  • getServiceConfig return type changed to non-null ServiceConfigRow; returns { id: 0, scope: 'global', ...SERVICE_CONFIG_DEFAULTS } when no global row exists.
  • resolveMcpServers always injects forge + penpot from MCP_SERVER_DEFAULTS for names absent from the DB.
  • getLabelCatalogForRepo SQL drops the scope = 'builtin' filter; only global and repo rows are fetched.
  • All test files updated: scope='builtin' seeds flipped to scope='global'; new "empty DB → defaults" and "global-only → row returned" cases added; 66 cascading failures in the broader server suite fixed.

Closes #793

## Summary - Drop `builtin` from `SCOPE_PRIORITY`; `scopePriorityFor` returns -1 for every `scope='builtin'` row so they are silently skipped. New ladder: `instance > agent_type > global`. - Add `defaults.ts` with typed `Readonly<T>` code-side defaults for every per-kind artifact (`SERVICE_CONFIG_DEFAULTS`, `SPEECH_CONFIG_DEFAULTS`, `LABEL_CATALOG_DEFAULTS`, `MCP_SERVER_DEFAULTS`, `PLUGIN_BINDING_DEFAULTS`, `PLUGIN_MARKETPLACE_DEFAULTS`, `AGENT_TYPE_CONFIG_DEFAULTS`). - `getServiceConfig` return type changed to non-null `ServiceConfigRow`; returns `{ id: 0, scope: 'global', ...SERVICE_CONFIG_DEFAULTS }` when no global row exists. - `resolveMcpServers` always injects forge + penpot from `MCP_SERVER_DEFAULTS` for names absent from the DB. - `getLabelCatalogForRepo` SQL drops the `scope = 'builtin'` filter; only `global` and `repo` rows are fetched. - All test files updated: `scope='builtin'` seeds flipped to `scope='global'`; new "empty DB → defaults" and "global-only → row returned" cases added; 66 cascading failures in the broader server suite fixed. Closes #793
dev self-assigned this 2026-05-03 19:07:53 +00:00
Remove builtin scope from SCOPE_PRIORITY (scopePriorityFor returns -1 for builtin
rows so they are silently skipped). New ladder: instance > agent_type > global.
Add defaults.ts with typed Readonly<T> consts for every per-kind artifact; resolvers
fall through to these when no DB row exists at any live scope. getServiceConfig return
type is now non-null; resolveMcpServers always injects forge+penpot defaults for names
not represented in the DB. getLabelCatalogForRepo SQL drops the builtin filter. Update
all tests: flip builtin seeds to global/agent_type, add empty-DB and global-only cases.

Closes #793

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
test(config): update all tests affected by DOB-1 scope='builtin' removal (#793)
All checks were successful
qa / dockerfile (pull_request) Successful in 20s
qa / qa-1 (pull_request) Successful in 1m52s
qa / qa (pull_request) Successful in 0s
3781ff7872
Flip scope='builtin' seeds to scope='global' across the full server test suite so
all tests that relied on builtin rows being visible still work against the new
instance > agent_type > global ladder. Key patterns: agent_type seeds, service_config
with speech JSON, agent_type_container, skill, agent_type_routing, and label_catalog
handler assertions. Transcribe tests now seed a scope='global' row so getSpeechConfig
returns the expected config rather than code-side defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-05-03 19:09:49 +00:00
reviewer approved these changes 2026-05-03 19:12:41 +00:00
reviewer left a comment

Ladder drop is correct — scopePriorityFor returns -1 for builtin, SCOPE_PRIORITY type tightened to Exclude<ConfigScope, "builtin">, getServiceConfig return type promoted to non-null. All AC items met; test coverage comprehensive across every per-kind resolver.

Ladder drop is correct — `scopePriorityFor` returns -1 for builtin, SCOPE_PRIORITY type tightened to `Exclude<ConfigScope, "builtin">`, `getServiceConfig` return type promoted to non-null. All AC items met; test coverage comprehensive across every per-kind resolver.
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!799
No description provided.