F4 — watched_repos table + ingress switch + boot migration #485
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#485
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 the watched-repo list to live in SQLite, so that adding/removing a repo does not require editing
agents.jsonand restarting.Acceptance criteria
watched_reposschema added todb.tswith PK(forge_type, owner, name)and columnswebhook_secret,webhook_id,enabled,default_branch,created_at,updated_at.getWatchedRepo(forge,owner,name),listWatchedRepos(),listActiveWatchedRepos()(filters byservice_settings.active_forge_type),upsertWatchedRepo(),disableWatchedRepo().watched_reposis empty andagents.json#/reposis non-empty, copy entries into the table using the sharedwebhook_secret_filecontent, then rewriteagents.jsonwithreposremoved (atomic temp + rename, mode preserved). Back up the original atagents.json.pre-f1.bak. Log a single summary line:[f1-migration] copied N repos from agents.json; backup at agents.json.pre-f1.bak.webhook-config.tsexposesisKnownRepo(forge,owner,name)backed bywatched_repos. Empty table → reject. The empty-list-equals-accept-all back-compat is removed.webhook.ts):webhook_secretfrom the table; falls back to the shared file only whenwebhook_id IS NULL(migrated rows).forge_type !== service_settings.active_forge_type, responds202 Acceptedand returns immediately — no dispatch, debug-level log only. Avoids forge-side retry storms for inactive forges.forge=<type> repo=<owner/name>log line.repos:inagents.jsonis removed by the migration; if it reappears, boot logs a single warning and ignores it.Out of scope
References
docs/specs/forge-auth-repo-selection.md§F4, §5docs/multi-repo.mdDependencies
service_settings.active_forge_typeis read by ingress)