go-process:
- Register factory, Result lifecycle, 5 named Action handlers
- Start/Run/StartWithOptions/RunWithOptions all return core.Result
- core.ID() replaces fmt.Sprintf, core.As replaces errors.As
core/agent:
- PrepSubsystem + monitor.Subsystem + setup.Service embed ServiceRuntime[T]
- 22 named Actions + agent.completion Task pipeline in OnStartup
- ChannelNotifier removed — all IPC via c.ACTION(messages.X{})
- proc.go: all methods via s.Core().Process(), returns core.Result
- status.go: WriteAtomic + JSONMarshalString
- paths.go: Fs.NewUnrestricted() replaces unsafe.Pointer
- transport.go: ONE net/http file — HTTPGet/HTTPPost/HTTPDo/MCP transport
- All disallowed imports eliminated from source files (13 quality gates)
- String concat eliminated — core.Concat() throughout
- 1:1 _test.go + _example_test.go for every source file
- Reference docs synced from core/go v0.8.0
- RFC-025 updated with net/http, net/url, io/fs quality gates
- lib.go: io/fs eliminated via Data.ListNames, Array[T].Deduplicate
Co-Authored-By: Virgil <virgil@lethean.io>
54 lines
1.1 KiB
Go
54 lines
1.1 KiB
Go
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
package agentic_test
|
|
|
|
import (
|
|
"context"
|
|
|
|
core "dappco.re/go/core"
|
|
"dappco.re/go/core/process"
|
|
|
|
"dappco.re/go/agent/pkg/agentic"
|
|
)
|
|
|
|
func ExampleRegister() {
|
|
c := core.New(
|
|
core.WithService(process.Register),
|
|
core.WithService(agentic.Register),
|
|
)
|
|
c.ServiceStartup(context.Background(), nil)
|
|
|
|
// All actions registered during OnStartup
|
|
core.Println(c.Action("agentic.dispatch").Exists())
|
|
core.Println(c.Action("agentic.status").Exists())
|
|
core.Println(c.Action("agentic.qa").Exists())
|
|
// Output:
|
|
// true
|
|
// true
|
|
// true
|
|
}
|
|
|
|
func ExampleRegister_actions() {
|
|
c := core.New(
|
|
core.WithService(process.Register),
|
|
core.WithService(agentic.Register),
|
|
)
|
|
c.ServiceStartup(context.Background(), nil)
|
|
|
|
actions := c.Actions()
|
|
core.Println(len(actions) > 0)
|
|
// Output: true
|
|
}
|
|
|
|
func ExampleRegister_task() {
|
|
c := core.New(
|
|
core.WithService(process.Register),
|
|
core.WithService(agentic.Register),
|
|
)
|
|
c.ServiceStartup(context.Background(), nil)
|
|
|
|
// Completion pipeline registered as a Task
|
|
t := c.Task("agent.completion")
|
|
core.Println(t.Description)
|
|
// Output: QA → PR → Verify → Merge
|
|
}
|