chore(db): drop NON_BUILTIN_SCOPE_FILTER + every ne(scope,'builtin') predicate #940
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.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#940
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 maintainer, I want every read-time guard against
scope='builtin'removed once migration 0010 is in place, so that the codebase stops carrying a defensive scaffold that no longer protects against anything.After migration 0010 lands, the CHECK constraint enforces "no builtin rows" at the storage layer. Every Drizzle
ne(*.scope, "builtin")predicate, theNON_BUILTIN_SCOPE_FILTER = "scope != 'builtin'"SQL fragment, and the various "skip builtin" branches become dead defensive code that hides the simpler invariant.Acceptance criteria
Code
NON_BUILTIN_SCOPE_FILTERfromapps/server/src/domain/agent-config/ladder.ts:164and remove every caller.ne(<table>.scope, "builtin")Drizzle predicate inapps/server/src/infrastructure/database/agent-type-config.tsandapps/server/src/infrastructure/database/sr3-m1-migration.ts.WHERE scope != 'builtin'clauses inapps/server/src/infrastructure/database/sr3-m1-migration.ts.agent-types-settingsPUT handlers (identity / container / routing — dispatch handler had no such branch).Type narrowing
ConfigScope(already narrowed) andpickFromLadder/scopePriorityForget one fewer dead branch — drop the "builtin rows are silently skipped" guard inpickFromLadder.asScopeno longer needs to mention builtin in its error message.Tests
just qa). Filter removal is mechanical — no new test cases needed.seedBuiltinsor similar.Out of scope
SCOPE_ORDERcleanup — separate web story.label_cataloghandler changes — handled inside the "extract label_catalog presets" story.References
feat(db): migration 0010 — collapse 'builtin' from runtime tables