chore(label-catalog): extract factory presets to code constants #936
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#936
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 an operator, I want the factory label set to live in TypeScript constants, so that the runtime no longer depends on
scope='builtin'rows in thelabel_catalogtable.Today the
label_catalogtable seeds a'builtin'row per factory label and the dashboard merges builtin + global + repo at read time. Builtin rows are read-only at runtime (apps/server/src/http/handlers/label-catalog.ts:236returns 403 on PUT/DELETE). Pulling the set into code makes the factory list reviewable, removes the read-time scope merge, and unblocks the migration that drops the'builtin'enum value (tracker #934).Acceptance criteria
Constants
apps/server/src/setup/label-presets.tsexportsLABEL_PRESETS: ReadonlyArray<{ name; color; description }>covering every label currently inserted atscope='builtin'(audit existing rows on the dev DB to seed the list).~/.claude/CLAUDE.md(e.g.area:agents#0ea5e9,type:user-story#ec4899).Reads
apps/server/src/http/handlers/label-catalog.tsGET handlers read the factory layer fromLABEL_PRESETSand merge withglobal+reporows in memory; SQL no longer touchesscope='builtin'.apps/server/src/infrastructure/forge/labels.ts(the bridge that pushes labels to a Forgejo repo) sources its factory list fromLABEL_PRESETS.Tests
LABEL_PRESETSis non-empty and every entry has a 6-digit hex colour.Out of scope
LABEL_PRESETSintoscope='global'rows on first install — that's the wizard story.References
apps/server/src/http/handlers/label-catalog.ts,apps/server/src/infrastructure/forge/labels.ts