Persist curator definitions: store, State Store RPCs, REST CRUD, config seed #485
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: sam/archie#485
Reference in new issue
Block a user
Make curator definitions durable and API-authoritative: the store owns them, config seeds them, and the WebUI edits them.
Today there is no
[curator]config block, no curator definition table, no curator RPCs, andGET /api/curatorsis read-only. The proven shape to mirror is bindings/mappings:internal/store/bindings.go's schema constant plus typed error sentinels plusInsert/Get/List/Update/Delete/Approveon*Store, theinternal/domain/bindingentity the store persists, andinternal/webui/api_binding.go's CRUD handlers behindauthorizeTaskMutation.Scope
internal/domain/curator(domain owns the type; the store persists it), with acurator_definitionstable, indexes, fixed-width RFC3339 timestamps, and typed sentinels (not-found, duplicate name, invalid definition) ininternal/store/curators.go.[[curators]]seeds definitions at startup (insert-if-absent); a config row never overwrites a store row, and the store wins a name collision. A store definition that collides with a code-registered curator's name is refused with a clear log rather than silently replacing a Go engine with data.state.protogains the matching request/response messages and RPCs,staterpc.Clientgains the façade, and sentinels cross viamapError/unmapError.docs/prds/state-store-contract.md(the authority for this boundary) is updated in the same change, per AGENTS.md's "never add a Go interface method without a matching RPC"./api/bindings:GET|POST /api/curators,GET|PATCH|DELETE /api/curators/{id}, all guarded byauthorizeTaskMutation; the existing read-onlyGET /api/curatorsresponse keeps its current fields so the dashboard keeps working.DefaultIntervalGo constants stop being read at registration; the value becomes seed data (written into config by setup), never a pass-time fallback.RuntimeConfig{}'s empty pass-timeout / max-concurrent defaults become config values.Non-goals
Acceptance criteria
state.protohas a matching RPC for every persisted definition method, withTestOpenStoresNeverOwnsTaskDBstill passing (the daemon/Gateway never openarchie.db).GET|POST|PATCH|DELETE /api/curatorsmirror/api/bindingssemantics including auth, and the pre-existingGET /api/curatorsfields are unchanged.Security and failure paths
authorizeTaskMutation, identical to bindings; no unauthenticated or weaker write path.mapError/unmapErrorcanonical message strings are wire contract: changing one breakserrors.Ison clients without any visible behaviour change.Dependencies
docs/prds/state-store-contract.md) being extended in the same change.shelltool (gh issue edit|comment|create|close, authenticated via~/.config/gh/hosts.yml). Dedicated issue tools (#161) are a convenience, not a prerequisite. See the correction comment on #789.Merged from the other tracker
Phase 3. Persist definitions: domain entity in internal/domain/curator + curator_definitions table in internal/store/curators.go (schema const, indexes, RFC3339, typed sentinels); config seeds insert-if-absent with the store authoritative on collision; state.proto messages+RPCs, staterpc.Client facade, mapError/unmapError, and docs/prds/state-store-contract.md updated in the same change; REST GET|POST /api/curators and GET|PATCH|DELETE /api/curators/{id} behind authorizeTaskMutation, existing GET fields unchanged; retire skillcurator/sessioncurator DefaultInterval from the registration path and RuntimeConfig{} code defaults.
Acceptance: definition created over REST survives restart and runs; deleted definition is not resurrected by config seed; config never overwrites a store row; every persisted method has a matching RPC with TestOpenStoresNeverOwnsTaskDB still passing; REST mirrors /api/bindings incl. auth; no pass-time constant supplies interval/cooldown/tools/model/memory engine.
Security/failure: authorizeTaskMutation is the only mutation authority; canonical mapError/unmapError message strings are wire contract; delete cancels the in-flight pass before the row goes.
Deps: phases 1+2; State Store contract extension in the same change; tools registry work for the orchestrator curator's forge issue tools. GitHub: #792. Design: docs/prds/dynamic-curators.md.
Acceptance criteria
Curator REST CRUD persists definitions across restart, respects store-over-config authority, enforces mutation authorization, and cancels active passes on deletion.
Notes
CORRECTION (2026-09-12): the 'forge issue tools are a blocker' finding was wrong. No dedicated issue tool exists and no MCP server was ever configured, BUT the chat agent's is unconfined (chat.unrestricted_filesystem=true), so already works. Dedicated tools (#161) are convenience, not a prerequisite. VERIFIED STATE: (1) ToolBuilder has NO implementation anywhere - only the interface decl at domain/curator/registrar.go:86 and the fail-closed guard at registry.go:123; bootstrap.go builds the Registrar with no Tools field. (2) curatorLLMRunner at app/archied/main.go:551 drops ChatRequest.Tools - a SECOND independent blocker; fixing ToolBuilder alone still yields tool-less passes. (3) No definition persistence, no Unregister, no Runtime.Add/Remove. (4) runtime.go:202-211 logs nothing on not-due, so the skill curator's absence from logs is indistinguishable from health. EVIDENCE: standalone prototype at ~/projects/issue-orchestrator drove a real tool loop against live GitHub issues with local model defiant-fable-q6: 3 issues, 2 model steps, ~60s. Proof the loop works on local HW.
Imported from beads
archie-core-trnd.3· GitHub #798 · body merged from the fuller GitHub #792 · type task · priority P1 · created 2026-09-12sam wrote (originally 2026-10-08):
4q28.18 now provides authoritative curators resource, dashboard editor and live registration through existing control-plane contract. Keeping this ticket open because its explicit acceptance also requires retiring built-in interval/runtime defaults and proving an executed model pass, beyond that narrower ticket.