feat: Core DI migration — service conclave + IPC pipeline #17
No reviewers
Labels
No labels
needs-review
needs-review
needs-review
needs-review
needs-review
athena
athena-gemini
audit
clotho
clotho-gemini
codex
darbs-claude
security
wiki
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: core/agent#17
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/core-di-migration"
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?
Summary
Migrates core-agent from manual service wiring to full Core framework DI.
Phase 1: IPC Message Types
Phase 2: Core Wiring
*core.Coreinjected into PrepSubsystem and monitor.SubsystemPhase 3: IPC Migration
CompletionNotifierinterface removedc.ACTION(messages.AgentCompleted{})replaces callbacksSetCore()Phase 4: Completion Pipeline
findWorkspaceByPR()for PR event routingPhase 5: Config + Locks
c.Config()at startupcanDispatchAgentreads from shared configc.Lock("drain")replaces local mutexService Conclave
Register()factories for agentic/monitor/braincore.New(WithService(agentic.Register), WithService(monitor.Register), ...)initServices()closure eliminatedc.ServiceStartup()/c.ServiceShutdown()Depends on: core/go PR #28 (feat/service-options)
Test plan
go build ./...passesgo test ./pkg/agentic/...passesgo test ./pkg/monitor/...passesgo test ./pkg/messages/...passescore-agent versionworkscore-agent checkworks🤖 Generated with Claude Code
Co-Authored-By: Virgil virgil@lethean.io
Services are now registered during Core construction: core.New( core.WithService(agentic.Register), core.WithService(monitor.Register), core.WithService(brain.Register), ) - Remove initServices() closure — services created once in conclave - Commands use c.ServiceStartup()/c.ServiceShutdown() for lifecycle - Service instances retrieved via c.Config() for MCP tool registration - run/orchestrator reduced to ServiceStartup + block + ServiceShutdown - run/task uses conclave's agentic instance Co-Authored-By: Virgil <virgil@lethean.io>Phase 4 complete: - Auto-PR handler emits PRCreated message - Verify handler listens for PRCreated, emits PRMerged/PRNeedsReview - findWorkspaceByPR() for workspace lookup from PR events - Remove legacy inline fallback from dispatch goroutine Phase 5 complete: - agents.yaml loaded once at startup into c.Config() - canDispatchAgent reads from c.Config() (no re-parsing) - drainQueue uses c.Lock("drain") when Core available Co-Authored-By: Virgil <virgil@lethean.io>- agentic.PrepSubsystem implements Startable/Stoppable - monitor.Subsystem implements Startable/Stoppable (OnStartup/OnShutdown) - Register factories use c.RegisterService() — auto-discovers interfaces - Register factories return instances via Result.Value - main.go uses ServiceFor[T]() instead of ConfigGet — typed retrieval - No more c.Config().Set("x.instance") workaround Co-Authored-By: Virgil <virgil@lethean.io>Register factories no longer call c.RegisterService() explicitly. WithService auto-discovers name from package path and registers. Eliminates double-registration error. Uses WithOption("name", "core-agent") for Options struct. Co-Authored-By: Virgil <virgil@lethean.io>- process: registered as WithService in core.New() - MCP: registered as WithName("mcp") in core.New(), retrieves agentic/monitor/brain via ServiceFor during construction - Commands use ServiceFor to access services — no captured vars - initMCP closure eliminated - No service creation after core.New() completes Co-Authored-By: Virgil <virgil@lethean.io>- core.New() includes mcp.Register — auto-discovers subsystems - mcp/serve commands use c.Service("mcp") for typed retrieval - ServiceStartup called once before Cli().Run() - run/task and run/orchestrator registered by agentic.OnStartup - Removed ServiceFor generics — c.Service() returns instances directly Co-Authored-By: Virgil <virgil@lethean.io>