feat(v0.8.0): full AX migration — ServiceRuntime, Actions, quality gates, transport
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>
2026-03-26 01:27:46 +00:00
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
|
|
|
|
|
package agentic
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
core "dappco.re/go/core"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func Example_writeStatus() {
|
|
|
|
|
dir := (&core.Fs{}).NewUnrestricted().TempDir("example-ws")
|
|
|
|
|
defer (&core.Fs{}).NewUnrestricted().DeleteAll(dir)
|
|
|
|
|
|
|
|
|
|
st := &WorkspaceStatus{
|
|
|
|
|
Status: "running",
|
|
|
|
|
Agent: "codex",
|
|
|
|
|
Repo: "go-io",
|
|
|
|
|
Task: "Fix tests",
|
|
|
|
|
StartedAt: time.Now(),
|
|
|
|
|
}
|
|
|
|
|
err := writeStatus(dir, st)
|
|
|
|
|
core.Println(err == nil)
|
|
|
|
|
// Output: true
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 16:24:06 +00:00
|
|
|
func ExampleReadStatusResult() {
|
|
|
|
|
fsys := (&core.Fs{}).NewUnrestricted()
|
|
|
|
|
dir := fsys.TempDir("agentic-status-result")
|
|
|
|
|
defer fsys.DeleteAll(dir)
|
|
|
|
|
|
|
|
|
|
status := &WorkspaceStatus{
|
|
|
|
|
Status: "completed",
|
|
|
|
|
Agent: "codex",
|
|
|
|
|
Repo: "go-io",
|
|
|
|
|
}
|
|
|
|
|
core.Println(fs.Write(core.JoinPath(dir, "status.json"), core.JSONMarshalString(status)).OK)
|
|
|
|
|
|
|
|
|
|
result := ReadStatusResult(dir)
|
|
|
|
|
core.Println(result.OK)
|
|
|
|
|
core.Println(result.Value.(*WorkspaceStatus).Repo)
|
|
|
|
|
// Output:
|
|
|
|
|
// true
|
|
|
|
|
// true
|
|
|
|
|
// go-io
|
|
|
|
|
}
|
2026-04-01 13:20:05 +00:00
|
|
|
|
|
|
|
|
func ExampleReadStatus() {
|
|
|
|
|
fsys := (&core.Fs{}).NewUnrestricted()
|
|
|
|
|
dir := fsys.TempDir("agentic-status")
|
|
|
|
|
defer fsys.DeleteAll(dir)
|
|
|
|
|
|
|
|
|
|
status := &WorkspaceStatus{
|
|
|
|
|
Status: "blocked",
|
|
|
|
|
Agent: "claude",
|
|
|
|
|
Repo: "go-io",
|
|
|
|
|
}
|
|
|
|
|
core.Println(fs.Write(core.JoinPath(dir, "status.json"), core.JSONMarshalString(status)).OK)
|
|
|
|
|
|
|
|
|
|
read, err := ReadStatus(dir)
|
|
|
|
|
core.Println(err == nil)
|
|
|
|
|
core.Println(read.Repo)
|
|
|
|
|
// Output:
|
|
|
|
|
// true
|
|
|
|
|
// true
|
|
|
|
|
// go-io
|
|
|
|
|
}
|