SVC-1: Schema + builtin-sync for service_config #750
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#750
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?
Bundle directive
This story ships in one PR with #743 (AT-1) and #754 (LBL-1) — the foundation layer. Assign #743, not this issue. The PR closes all three (
Closes #743 #750 #754).As a platform engineer, I want a
service_configtable and a builtin-sync pass that mirrorsconfig/service.jsonintoscope='builtin', so that runtime reads of deploy-time service infra (forge URL, container image, watchdogs, auth, node_flows, penpot, MCP command) can move off the file system onto a DB-backed source of truth.Acceptance criteria
Schema
migrations/<n>-service-config.tscreates theservice_configtable with the columns + scope check (builtin/globalonly) + UNIQUE(scope) constraint perspecs/config-to-db.md§ Architecture.secrettable — the schema migration reads the file's bytes (one-shot), writes them tosecret, stores the FK inservice_config.webhook_secret_ref, and renames the file to.<basename>.migrated.bak.Builtin sync
syncServiceConfigBuiltin(serviceJsonPath)writes the singlescope='builtin'row. Idempotent.getServiceConfig()returns the most-specific row acrossglobal → builtin.Tests
scope='global'override oncontainer_imageis preserved across a re-sync that bumps the builtin's value.Out of scope
References
specs/config-to-db.md§ Story SVC-1, § Architecture.Shipped via PR #761 (commit
28027b9) as part of the foundation bundle alongside #743 (AT-1) and #754 (LBL-1). The PR body lacked theCloseskeyword so this issue stayed open by mistake — closing now.Coverage:
migrations/<n>-service-config.tscreatedsyncServiceConfigBuiltin(serviceJsonPath)writes the singlescope='builtin'row, idempotentgetServiceConfig()resolvesglobal → builtinsecrettableClosing.