fix(ax): align service comments with AX examples

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-03-30 21:47:44 +00:00
parent 5e5e19d6de
commit 32c2a33284
9 changed files with 10 additions and 34 deletions

View file

@ -1,9 +1,5 @@
// SPDX-License-Identifier: EUPL-1.2
// IPC handler for agent lifecycle events.
// Auto-discovered by Core's WithService via the HandleIPCEvents interface.
// No manual RegisterHandlers call needed — Core wires it during service registration.
package agentic
import (
@ -11,10 +7,9 @@ import (
core "dappco.re/go/core"
)
// HandleIPCEvents implements Core's IPC handler interface.
// Auto-registered by WithService — no manual wiring needed.
// HandleIPCEvents applies agent lifecycle messages to the prep subsystem.
//
// _ = prep.HandleIPCEvents(c, messages.AgentCompleted{Workspace: "core/go-io/task-5"})
// _ = prep.HandleIPCEvents(c, messages.AgentCompleted{Workspace: "core/go-io/task-5", Status: "completed"})
// _ = prep.HandleIPCEvents(c, messages.SpawnQueued{Workspace: "core/go-io/task-5", Agent: "codex", Task: "fix tests"})
func (s *PrepSubsystem) HandleIPCEvents(c *core.Core, msg core.Message) core.Result {
switch ev := msg.(type) {

View file

@ -81,8 +81,7 @@ func NewPrep() *PrepSubsystem {
}
}
// SetCore wires the Core framework instance via ServiceRuntime.
// Deprecated: Use Register with core.WithService(agentic.Register) instead.
// Use core.New(core.WithService(agentic.Register)) for new code.
//
// prep.SetCore(c)
func (s *PrepSubsystem) SetCore(c *core.Core) {

View file

@ -13,13 +13,8 @@ type processActionHandlers struct {
service *process.Service
}
// ProcessRegister is the service factory for go-process.
// Registers the process service under the canonical "process" name and exposes
// the Core `process.*` Actions expected by `c.Process()`.
//
// core.New(
// core.WithService(agentic.ProcessRegister),
// )
// c := core.New(core.WithService(agentic.ProcessRegister))
// processService, _ := core.ServiceFor[*process.Service](c, "process")
func ProcessRegister(c *core.Core) core.Result {
if c == nil {
return core.Result{Value: core.E("agentic.ProcessRegister", "core is required", nil), OK: false}

View file

@ -6,14 +6,11 @@ import (
core "dappco.re/go/core"
)
// Register is the service factory for core.WithService.
// Returns the PrepSubsystem instance — WithService auto-discovers the name
// from the package path and registers it.
//
// core.New(
// c := core.New(
// core.WithService(agentic.ProcessRegister),
// core.WithService(agentic.Register),
// )
// prep, _ := core.ServiceFor[*agentic.PrepSubsystem](c, "agentic")
func Register(c *core.Core) core.Result {
subsystem := NewPrep()
subsystem.ServiceRuntime = core.NewServiceRuntime(c, AgentOptions{})
@ -36,8 +33,5 @@ func Register(c *core.Core) core.Result {
c.Config().Enable("auto-merge")
c.Config().Enable("auto-ingest")
// IPC handlers auto-discovered via HandleIPCEvents interface on PrepSubsystem.
// No manual RegisterHandlers call needed — WithService wires it.
return core.Result{Value: subsystem, OK: true}
}

View file

@ -47,8 +47,6 @@ func New(bridge *ide.Bridge) *Subsystem {
return &Subsystem{bridge: bridge}
}
// Name keeps the subsystem address stable for core.WithService and MCP.
//
// name := subsystem.Name() // "brain"
func (s *Subsystem) Name() string { return "brain" }

View file

@ -56,8 +56,6 @@ func NewDirect() *DirectSubsystem {
}
}
// Name keeps the direct subsystem address stable for core.WithService and MCP.
//
// name := subsystem.Name() // "brain"
func (s *DirectSubsystem) Name() string { return "brain" }

View file

@ -47,8 +47,6 @@ func NewProvider(bridge *ide.Bridge, hub *ws.Hub) *BrainProvider {
}
}
// Name keeps the provider address stable during API registration.
//
// name := p.Name() // "brain"
func (p *BrainProvider) Name() string { return "brain" }

View file

@ -80,7 +80,7 @@ type Subsystem struct {
var _ coremcp.Subsystem = (*Subsystem)(nil)
// Deprecated: prefer Register with core.WithService(monitor.Register).
// Use core.New(core.WithService(monitor.Register)) for new code.
//
// monitorService.SetCore(c)
func (m *Subsystem) SetCore(coreApp *core.Core) {

View file

@ -54,9 +54,8 @@ func New() *Service {
}
}
// Register is the service factory for core.WithService.
//
// core.New(core.WithService(runner.Register))
// c := core.New(core.WithService(runner.Register))
// service, _ := core.ServiceFor[*runner.Service](c, "runner")
func Register(coreApp *core.Core) core.Result {
service := New()
service.ServiceRuntime = core.NewServiceRuntime(coreApp, Options{})