chore(db): drop NON_BUILTIN_SCOPE_FILTER + every ne(scope,'builtin') predicate #947

Merged
reviewer merged 2 commits from dev/940 into main 2026-05-08 09:26:24 +00:00
Collaborator

Removes all read-time guards against scope='builtin' now that migration 0010 enforces this invariant at the storage layer.

Test plan

  • Dropped NON_BUILTIN_SCOPE_FILTER constant from ladder.ts and all callers
  • Removed all ne(*.scope, "builtin") Drizzle predicates in agent-type-config.ts
  • Removed WHERE scope != 'builtin' clause from sr3-m1-migration.ts
  • Dropped INSERT-from-builtin-defaults branches in all four agent-types-settings PUT handlers; existence checks now use LIMIT 1 without scope filter
  • Updated test fixtures from scope='builtin' to scope='global'/scope='agent_type'; renamed tests whose titles referenced the removed DOB-1 guard
  • just qa clean (server tests: 3262 pass, 0 fail)

Closes #940

Removes all read-time guards against `scope='builtin'` now that migration 0010 enforces this invariant at the storage layer. ## Test plan - Dropped `NON_BUILTIN_SCOPE_FILTER` constant from `ladder.ts` and all callers - Removed all `ne(*.scope, "builtin")` Drizzle predicates in `agent-type-config.ts` - Removed `WHERE scope != 'builtin'` clause from `sr3-m1-migration.ts` - Dropped INSERT-from-builtin-defaults branches in all four `agent-types-settings` PUT handlers; existence checks now use `LIMIT 1` without scope filter - Updated test fixtures from `scope='builtin'` to `scope='global'`/`scope='agent_type'`; renamed tests whose titles referenced the removed DOB-1 guard - `just qa` clean (server tests: 3262 pass, 0 fail) Closes #940
dev self-assigned this 2026-05-08 09:22:16 +00:00
Migration 0010 enforces no builtin rows at the storage layer; the
defensive read-time guards are now dead code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
test(db): update fixtures that used scope='builtin' rows
All checks were successful
qa / db-schema (pull_request) Successful in 37s
qa / sql-layer-check (pull_request) Successful in 7s
qa / i18n-string-check (pull_request) Successful in 9s
qa / dockerfile (pull_request) Successful in 26s
qa / qa-1 (pull_request) Successful in 1m12s
qa / qa (pull_request) Successful in 0s
54d433e17d
Replace builtin-scope DB inserts with global/agent_type equivalents now
that asScope() no longer accepts 'builtin'. Rename tests whose titles
referenced the removed DOB-1 guard.

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

Clean removal of dead guards — migration 0010 invariant holds, all ne(scope,'builtin') predicates and NON_BUILTIN_SCOPE_FILTER correctly dropped. Existence checks switched to LIMIT 1, INSERT fallbacks simplified to null defaults. CI green, 3262 tests pass.

Nit (non-blocking): agent-type-config.ts comment at mergeMcpBucket step 3 now says "non-global scopes" but the implementation still strips locked keys from all operator layers — fine to fix in a follow-up.

Clean removal of dead guards — migration 0010 invariant holds, all `ne(scope,'builtin')` predicates and `NON_BUILTIN_SCOPE_FILTER` correctly dropped. Existence checks switched to `LIMIT 1`, INSERT fallbacks simplified to null defaults. CI green, 3262 tests pass. Nit (non-blocking): `agent-type-config.ts` comment at `mergeMcpBucket` step 3 now says "non-global scopes" but the implementation still strips locked keys from all operator layers — fine to fix in a follow-up.
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!947
No description provided.