Curator runtime mutation: Registry.Unregister + Runtime.Add/Remove #484
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: sam/archie#484
Reference in new issue
Block a user
A definition change must take effect without restarting the daemon. Today it cannot:
RegistryexposesRegisterbut noUnregister, andRuntimeexposesStart/Nudge/Stopbut noAdd/Remove, andStart()snapshots the registry's curator set into one goroutine per curator. Membership is therefore fixed for the process lifetime.Scope
Registry.Unregister(name), valid while the registry is running, with the same failure isolation the registry already applies (a rejected removal affects only that curator).Runtime.Add(engine)/Runtime.Remove(name):Removecancels the removed curator's in-flight pass context and stops its goroutine within a bounded wait;Addregisters and starts one.Non-goals
Start()'s startup ordering or shutdown sequencing for the curators already registered.Acceptance criteria
Registry.UnregisterandRuntime.Add/Runtime.Removeexist with tests covering add-then-pass, remove-cancels-in-flight, and update-replaces.Security and failure paths
Dependencies
Implementation status (audit-verified 2026-09-12)
RegistryexposesRegister(registry.go:89) and noUnregister.RuntimeexposesStart/Nudge/Stop(runtime.go:79/116/135) and noAdd/Remove;Start()snapshots the registry's membership into one goroutine per curator, so membership cannot change while running.RuntimeConfigis passed empty (bootstrap.go:1033), soPassTimeoutandMaxConcurrentPassesare code defaults with no config surface — a live-path constant, contrary to the epic's no-hard-coded-configuration rule.runtime.go:202-211returns silently whenCheckreports not-due; a not-due curator emits no log line at all. This is why the skill curator's total absence from logs is indistinguishable from health.Merged from the other tracker
Phase 2. Registry.Unregister(name) while running; Runtime.Add/Runtime.Remove(name) where Remove cancels the in-flight pass context and stops the goroutine within a bounded wait; app-layer apply sequence (stop old, register new, start).
Acceptance: add-then-pass works without restart; remove cancels an in-flight pass and leaves no goroutine; update replaces without a stale loop; removal bounded even when a pass ignores cancellation; startup ordering/shutdown for existing curators unchanged.
Security/failure: removal must not orphan a loop; a failed stop is reported, not swallowed; never hold the registry mutex across a pass.
Deps: phase 1 engine. GitHub: #791. Design: docs/prds/dynamic-curators.md.
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.
Close reason
49444e17: Runtime.Add/Remove with per-loop cancel and bounded wait, lifecycle StartOne/Unregister, ReplaceDefinitions diffs instead of stop-the-world. A loop that outlives a bounded stop blocks re-add and restart instead of running twice.
Imported from beads
archie-core-trnd.2· GitHub #806 · body merged from the fuller GitHub #791 · type task · priority P2 · created 2026-09-12 · closed 2026-10-25sam wrote (originally 2026-10-08):
4q28.18 adds live replacement and validates before draining passes, with add/remove PostgreSQL/gRPC acceptance. This older ticket stays open: bounded cancellation of an ignoring pass and add-then-model-pass acceptance have not been demonstrated.