2026-03-18 14:03:06 +00:00
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
|
2026-03-31 05:09:25 +00:00
|
|
|
// lib.MountData(c)
|
|
|
|
|
// prompts := lib.ListPrompts()
|
|
|
|
|
// task := lib.Task("code/review")
|
|
|
|
|
// persona := lib.Persona("secops/dev")
|
|
|
|
|
// data := &lib.WorkspaceData{Repo: "go-io", Task: "fix tests", Agent: "codex"}
|
|
|
|
|
// workspace := lib.ExtractWorkspace("default", "/tmp/workspace", data)
|
2026-03-18 14:03:06 +00:00
|
|
|
package lib
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"embed"
|
refactor: AX compliance sweep — replace banned stdlib imports with core primitives
Replaced fmt, strings, sort, os, io, sync, encoding/json, path/filepath,
errors, log, reflect with core.Sprintf, core.E, core.Contains, core.Trim,
core.Split, core.Join, core.JoinPath, slices.Sort, c.Fs(), c.Lock(),
core.JSONMarshal, core.ReadAll and other CoreGO v0.8.0 primitives.
Framework boundary exceptions preserved where stdlib types are required
by external interfaces (Gin, net/http, CGo, Wails, bubbletea).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-13 09:32:00 +01:00
|
|
|
"sync/atomic"
|
refactor: migrate core/agent to Core primitives — reference implementation
Phase 1: go-io/go-log → core.Fs{}, core.E(), core.Error/Info/Warn
Phase 2: strings/fmt → core.Contains, core.Sprintf, core.Split etc
Phase 3: embed.FS → core.Mount/core.Embed, core.Extract
Phase 4: cmd/main.go → core.Command(), c.Cli().Run(), no cli package
All packages migrated:
- pkg/lib (Codex): core.Mount, core.Extract, Result returns, AX comments
- pkg/setup (Codex): core.Fs, core.E, fixed missing lib helpers
- pkg/brain (Codex): Core primitives, AX comments
- pkg/monitor (Codex): Core string/logging primitives
- pkg/agentic (Codex): 20 files, Core primitives throughout
- cmd/main.go: pure Core CLI, no fmt/log/filepath/strings/cli
Remaining stdlib: path/filepath (Core doesn't wrap OS paths),
fmt.Sscanf/strings.Map (no Core equivalent).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 06:13:41 +00:00
|
|
|
|
|
|
|
|
core "dappco.re/go/core"
|
2026-03-18 14:03:06 +00:00
|
|
|
)
|
|
|
|
|
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
//go:embed all:prompt
|
|
|
|
|
var promptFiles embed.FS
|
2026-03-18 14:03:06 +00:00
|
|
|
|
|
|
|
|
//go:embed all:task
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
var taskFiles embed.FS
|
2026-03-18 14:03:06 +00:00
|
|
|
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
//go:embed all:flow
|
|
|
|
|
var flowFiles embed.FS
|
2026-03-18 14:03:06 +00:00
|
|
|
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
//go:embed all:persona
|
|
|
|
|
var personaFiles embed.FS
|
2026-03-18 14:03:06 +00:00
|
|
|
|
|
|
|
|
//go:embed all:workspace
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
var workspaceFiles embed.FS
|
|
|
|
|
|
|
|
|
|
var (
|
2026-03-30 00:41:43 +00:00
|
|
|
promptFS *core.Embed
|
|
|
|
|
taskFS *core.Embed
|
|
|
|
|
flowFS *core.Embed
|
|
|
|
|
personaFS *core.Embed
|
|
|
|
|
workspaceFS *core.Embed
|
|
|
|
|
data *core.Data
|
|
|
|
|
|
refactor: AX compliance sweep — replace banned stdlib imports with core primitives
Replaced fmt, strings, sort, os, io, sync, encoding/json, path/filepath,
errors, log, reflect with core.Sprintf, core.E, core.Contains, core.Trim,
core.Split, core.Join, core.JoinPath, slices.Sort, c.Fs(), c.Lock(),
core.JSONMarshal, core.ReadAll and other CoreGO v0.8.0 primitives.
Framework boundary exceptions preserved where stdlib types are required
by external interfaces (Gin, net/http, CGo, Wails, bubbletea).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-13 09:32:00 +01:00
|
|
|
mountDone atomic.Bool
|
2026-03-30 00:41:43 +00:00
|
|
|
mountResult core.Result
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
)
|
|
|
|
|
|
2026-03-30 21:58:24 +00:00
|
|
|
// lib.MountData(c)
|
|
|
|
|
// r := c.Data().ReadString("prompts/coding.md")
|
|
|
|
|
// r := c.Data().ListNames("flows")
|
2026-03-26 06:38:02 +00:00
|
|
|
func MountData(c *core.Core) {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-26 06:38:02 +00:00
|
|
|
d := c.Data()
|
2026-03-30 00:41:43 +00:00
|
|
|
d.Set("prompts", promptFS)
|
|
|
|
|
d.Set("tasks", taskFS)
|
|
|
|
|
d.Set("flows", flowFS)
|
|
|
|
|
d.Set("personas", personaFS)
|
|
|
|
|
d.Set("workspaces", workspaceFS)
|
2026-03-26 06:38:02 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-30 00:41:43 +00:00
|
|
|
func ensureMounted() core.Result {
|
refactor: AX compliance sweep — replace banned stdlib imports with core primitives
Replaced fmt, strings, sort, os, io, sync, encoding/json, path/filepath,
errors, log, reflect with core.Sprintf, core.E, core.Contains, core.Trim,
core.Split, core.Join, core.JoinPath, slices.Sort, c.Fs(), c.Lock(),
core.JSONMarshal, core.ReadAll and other CoreGO v0.8.0 primitives.
Framework boundary exceptions preserved where stdlib types are required
by external interfaces (Gin, net/http, CGo, Wails, bubbletea).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-13 09:32:00 +01:00
|
|
|
if mountDone.Load() {
|
|
|
|
|
return mountResult
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mountedData := &core.Data{Registry: core.NewRegistry[*core.Embed]()}
|
|
|
|
|
|
|
|
|
|
for _, item := range []struct {
|
|
|
|
|
name string
|
|
|
|
|
filesystem embed.FS
|
|
|
|
|
baseDir string
|
|
|
|
|
assign func(*core.Embed)
|
|
|
|
|
}{
|
|
|
|
|
{name: "prompt", filesystem: promptFiles, baseDir: "prompt", assign: func(emb *core.Embed) { promptFS = emb }},
|
|
|
|
|
{name: "task", filesystem: taskFiles, baseDir: "task", assign: func(emb *core.Embed) { taskFS = emb }},
|
|
|
|
|
{name: "flow", filesystem: flowFiles, baseDir: "flow", assign: func(emb *core.Embed) { flowFS = emb }},
|
|
|
|
|
{name: "persona", filesystem: personaFiles, baseDir: "persona", assign: func(emb *core.Embed) { personaFS = emb }},
|
|
|
|
|
{name: "workspace", filesystem: workspaceFiles, baseDir: "workspace", assign: func(emb *core.Embed) { workspaceFS = emb }},
|
|
|
|
|
} {
|
|
|
|
|
mounted := mountEmbed(item.filesystem, item.baseDir)
|
|
|
|
|
if !mounted.OK {
|
|
|
|
|
mountResult = mounted
|
|
|
|
|
return mountResult
|
2026-03-30 00:41:43 +00:00
|
|
|
}
|
|
|
|
|
|
refactor: AX compliance sweep — replace banned stdlib imports with core primitives
Replaced fmt, strings, sort, os, io, sync, encoding/json, path/filepath,
errors, log, reflect with core.Sprintf, core.E, core.Contains, core.Trim,
core.Split, core.Join, core.JoinPath, slices.Sort, c.Fs(), c.Lock(),
core.JSONMarshal, core.ReadAll and other CoreGO v0.8.0 primitives.
Framework boundary exceptions preserved where stdlib types are required
by external interfaces (Gin, net/http, CGo, Wails, bubbletea).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-13 09:32:00 +01:00
|
|
|
emb := mounted.Value.(*core.Embed)
|
|
|
|
|
item.assign(emb)
|
|
|
|
|
mountedData.Set(item.name, emb)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data = mountedData
|
|
|
|
|
mountResult = core.Result{Value: mountedData, OK: true}
|
|
|
|
|
mountDone.Store(true)
|
2026-03-30 00:41:43 +00:00
|
|
|
|
|
|
|
|
return mountResult
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 21:37:15 +00:00
|
|
|
func mountEmbed(filesystem embed.FS, baseDir string) core.Result {
|
|
|
|
|
result := core.Mount(filesystem, baseDir)
|
2026-03-30 00:41:43 +00:00
|
|
|
if result.OK {
|
|
|
|
|
return result
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err, ok := result.Value.(error); ok {
|
|
|
|
|
return core.Result{
|
2026-03-30 21:37:15 +00:00
|
|
|
Value: core.E("lib.mountEmbed", core.Concat("mount ", baseDir), err),
|
2026-03-30 00:41:43 +00:00
|
|
|
OK: false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return core.Result{
|
2026-03-30 21:37:15 +00:00
|
|
|
Value: core.E("lib.mountEmbed", core.Concat("mount ", baseDir), nil),
|
2026-03-30 00:41:43 +00:00
|
|
|
OK: false,
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-03-18 14:03:06 +00:00
|
|
|
|
2026-03-30 22:54:19 +00:00
|
|
|
// r := lib.Template("coding")
|
|
|
|
|
// if r.OK { content := r.Value.(string) }
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
func Template(slug string) core.Result {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return result
|
|
|
|
|
}
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
if r := Prompt(slug); r.OK {
|
|
|
|
|
return r
|
2026-03-18 14:09:17 +00:00
|
|
|
}
|
|
|
|
|
return Task(slug)
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:54:19 +00:00
|
|
|
// r := lib.Prompt("coding")
|
|
|
|
|
// if r.OK { content := r.Value.(string) }
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
func Prompt(slug string) core.Result {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return result
|
|
|
|
|
}
|
2026-03-26 06:38:02 +00:00
|
|
|
return promptFS.ReadString(core.Concat(slug, ".md"))
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:54:19 +00:00
|
|
|
// r := lib.Task("code/review")
|
|
|
|
|
// if r.OK { content := r.Value.(string) }
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
func Task(slug string) core.Result {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return result
|
|
|
|
|
}
|
2026-03-18 14:03:06 +00:00
|
|
|
for _, ext := range []string{".md", ".yaml", ".yml"} {
|
2026-03-26 06:38:02 +00:00
|
|
|
if r := taskFS.ReadString(core.Concat(slug, ext)); r.OK {
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
return r
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-03-30 19:07:45 +00:00
|
|
|
return core.Result{
|
|
|
|
|
Value: core.E("lib.Task", core.Concat("task not found: ", slug), nil),
|
|
|
|
|
OK: false,
|
|
|
|
|
}
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 05:09:25 +00:00
|
|
|
// bundle := lib.Bundle{Main: "Prompt body", Files: map[string]string{"README.md": "Context"}}
|
|
|
|
|
// core.Println(bundle.Files["README.md"])
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
type Bundle struct {
|
|
|
|
|
Main string
|
|
|
|
|
Files map[string]string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:54:19 +00:00
|
|
|
// r := lib.TaskBundle("code/review")
|
|
|
|
|
// if r.OK { b := r.Value.(lib.Bundle) }
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
func TaskBundle(slug string) core.Result {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return result
|
|
|
|
|
}
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
main := Task(slug)
|
|
|
|
|
if !main.OK {
|
|
|
|
|
return main
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
b := Bundle{Main: main.Value.(string), Files: make(map[string]string)}
|
|
|
|
|
r := taskFS.ReadDir(slug)
|
|
|
|
|
if !r.OK {
|
|
|
|
|
return core.Result{Value: b, OK: true}
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
2026-03-30 16:57:06 +00:00
|
|
|
nr := data.ListNames(core.JoinPath("task", slug))
|
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
|
|
|
if nr.OK {
|
|
|
|
|
for _, name := range nr.Value.([]string) {
|
|
|
|
|
for _, ext := range []string{".md", ".yaml", ".yml", ".txt", ""} {
|
|
|
|
|
fullName := core.Concat(name, ext)
|
2026-03-30 16:57:06 +00:00
|
|
|
if fr := taskFS.ReadString(core.JoinPath(slug, fullName)); fr.OK {
|
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
|
|
|
b.Files[fullName] = fr.Value.(string)
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
}
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
return core.Result{Value: b, OK: true}
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:54:19 +00:00
|
|
|
// r := lib.Flow("go")
|
|
|
|
|
// if r.OK { content := r.Value.(string) }
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
func Flow(slug string) core.Result {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return result
|
|
|
|
|
}
|
2026-03-26 06:38:02 +00:00
|
|
|
return flowFS.ReadString(core.Concat(slug, ".md"))
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:54:19 +00:00
|
|
|
// r := lib.Persona("secops/developer")
|
|
|
|
|
// if r.OK { content := r.Value.(string) }
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
func Persona(path string) core.Result {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return result
|
|
|
|
|
}
|
2026-03-26 06:38:02 +00:00
|
|
|
return personaFS.ReadString(core.Concat(path, ".md"))
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-30 00:20:03 +00:00
|
|
|
// data := &lib.WorkspaceData{
|
|
|
|
|
// Repo: "go-io", Task: "fix tests", Agent: "codex", BuildCmd: "go build ./...",
|
|
|
|
|
// }
|
2026-03-18 14:03:06 +00:00
|
|
|
type WorkspaceData struct {
|
|
|
|
|
Repo string
|
|
|
|
|
Branch string
|
|
|
|
|
Task string
|
|
|
|
|
Agent string
|
|
|
|
|
Language string
|
|
|
|
|
Prompt string
|
|
|
|
|
Persona string
|
|
|
|
|
Flow string
|
|
|
|
|
Context string
|
|
|
|
|
Recent string
|
|
|
|
|
Dependencies string
|
|
|
|
|
Conventions string
|
|
|
|
|
RepoDescription string
|
|
|
|
|
BuildCmd string
|
|
|
|
|
TestCmd string
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 19:14:14 +00:00
|
|
|
// r := lib.ExtractWorkspace("default", "/tmp/ws", &lib.WorkspaceData{
|
2026-03-26 06:38:02 +00:00
|
|
|
// Repo: "go-io", Task: "fix tests", Agent: "codex",
|
|
|
|
|
// })
|
2026-03-30 22:54:19 +00:00
|
|
|
//
|
|
|
|
|
// core.Println(r.OK)
|
2026-03-30 21:22:54 +00:00
|
|
|
func ExtractWorkspace(templateName, targetDir string, data *WorkspaceData) core.Result {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
if err, ok := result.Value.(error); ok {
|
2026-03-30 19:14:14 +00:00
|
|
|
return core.Result{
|
2026-03-30 21:22:54 +00:00
|
|
|
Value: core.E("lib.ExtractWorkspace", core.Concat("mount workspace template ", templateName), err),
|
2026-03-30 19:14:14 +00:00
|
|
|
OK: false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return core.Result{
|
2026-03-30 21:22:54 +00:00
|
|
|
Value: core.E("lib.ExtractWorkspace", core.Concat("mount workspace template ", templateName), nil),
|
2026-03-30 19:14:14 +00:00
|
|
|
OK: false,
|
2026-03-30 00:41:43 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 21:22:54 +00:00
|
|
|
r := workspaceFS.Sub(templateName)
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
if !r.OK {
|
|
|
|
|
if err, ok := r.Value.(error); ok {
|
2026-03-30 19:14:14 +00:00
|
|
|
return core.Result{
|
2026-03-30 21:22:54 +00:00
|
|
|
Value: core.E("lib.ExtractWorkspace", core.Concat("template not found: ", templateName), err),
|
2026-03-30 19:14:14 +00:00
|
|
|
OK: false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return core.Result{
|
2026-03-30 21:22:54 +00:00
|
|
|
Value: core.E("lib.ExtractWorkspace", core.Concat("template not found: ", templateName), nil),
|
2026-03-30 19:14:14 +00:00
|
|
|
OK: false,
|
2026-03-22 08:10:56 +00:00
|
|
|
}
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
}
|
|
|
|
|
result := core.Extract(r.Value.(*core.Embed).FS(), targetDir, data)
|
|
|
|
|
if !result.OK {
|
|
|
|
|
if err, ok := result.Value.(error); ok {
|
2026-03-30 19:14:14 +00:00
|
|
|
return core.Result{
|
2026-03-30 21:22:54 +00:00
|
|
|
Value: core.E("lib.ExtractWorkspace", core.Concat("extract workspace template ", templateName), err),
|
2026-03-30 19:14:14 +00:00
|
|
|
OK: false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return core.Result{
|
2026-03-30 21:22:54 +00:00
|
|
|
Value: core.E("lib.ExtractWorkspace", core.Concat("extract workspace template ", templateName), nil),
|
2026-03-30 19:14:14 +00:00
|
|
|
OK: false,
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
feat(lib): migrate to Core Embed system with Result returns
- All public functions return core.Result instead of (string, error)
- Mount scopes basedir — no path prefix needed in ReadString calls
- Add Bundle struct replacing (string, map, error) anti-pattern
- listDir takes *core.Embed not embed.FS
- ListTasks/ListPersonas use FS() + BaseDirectory() for WalkDir
- Remove bytes, os, text/template imports
- 22 tests: Prompt, Task, TaskBundle, Flow, Persona, Template,
List functions, ExtractWorkspace (Good/Bad patterns)
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 09:08:35 +00:00
|
|
|
}
|
2026-03-30 19:14:14 +00:00
|
|
|
return core.Result{Value: targetDir, OK: true}
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-30 22:54:19 +00:00
|
|
|
// r := lib.WorkspaceFile("default", "CODEX-PHP.md.tmpl")
|
|
|
|
|
// if r.OK { content := r.Value.(string) }
|
2026-03-30 21:22:54 +00:00
|
|
|
func WorkspaceFile(templateName, filename string) core.Result {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return result
|
|
|
|
|
}
|
2026-03-30 21:22:54 +00:00
|
|
|
r := workspaceFS.Sub(templateName)
|
2026-03-27 06:50:54 +00:00
|
|
|
if !r.OK {
|
|
|
|
|
return r
|
|
|
|
|
}
|
|
|
|
|
embed := r.Value.(*core.Embed)
|
|
|
|
|
return embed.ReadString(filename)
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-31 06:20:14 +00:00
|
|
|
// prompts := lib.ListPrompts() // ["coding", "conventions", "security"]
|
2026-03-26 06:38:02 +00:00
|
|
|
func ListPrompts() []string { return listNames("prompt") }
|
|
|
|
|
|
2026-03-31 06:20:14 +00:00
|
|
|
// flows := lib.ListFlows() // ["go", "php", "release"]
|
2026-03-26 06:38:02 +00:00
|
|
|
func ListFlows() []string { return listNames("flow") }
|
|
|
|
|
|
2026-03-31 06:20:14 +00:00
|
|
|
// templates := lib.ListWorkspaces() // ["default", "review", "security"]
|
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
|
|
|
func ListWorkspaces() []string { return listNames("workspace") }
|
2026-03-18 14:03:06 +00:00
|
|
|
|
2026-03-31 06:20:14 +00:00
|
|
|
// tasks := lib.ListTasks() // ["bug-fix", "code/review", "code/refactor"]
|
2026-03-18 14:03:06 +00:00
|
|
|
func ListTasks() []string {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result := listNamesRecursive("task", ".")
|
2026-03-30 21:37:15 +00:00
|
|
|
names := core.NewArray(result...)
|
|
|
|
|
names.Deduplicate()
|
|
|
|
|
return names.AsSlice()
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 06:20:14 +00:00
|
|
|
// personas := lib.ListPersonas() // ["code/backend-architect", "secops/security-developer", "testing/model-qa"]
|
2026-03-18 14:03:06 +00:00
|
|
|
func ListPersonas() []string {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 21:37:15 +00:00
|
|
|
names := core.NewArray(listNamesRecursive("persona", ".")...)
|
|
|
|
|
names.Deduplicate()
|
|
|
|
|
return names.AsSlice()
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 05:09:25 +00:00
|
|
|
// names := listNamesRecursive("task", ".")
|
2026-03-31 06:20:14 +00:00
|
|
|
// core.Println(names) // ["bug-fix", "code/review", "code/refactor"]
|
2026-03-30 00:41:43 +00:00
|
|
|
func listNamesRecursive(mount, dir string) []string {
|
|
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 16:57:06 +00:00
|
|
|
path := core.JoinPath(mount, dir)
|
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
|
|
|
nr := data.ListNames(path)
|
|
|
|
|
if !nr.OK {
|
2026-03-18 14:03:06 +00:00
|
|
|
return nil
|
|
|
|
|
}
|
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
|
|
|
|
2026-03-18 14:03:06 +00:00
|
|
|
var slugs []string
|
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
|
|
|
for _, name := range nr.Value.([]string) {
|
|
|
|
|
relPath := name
|
|
|
|
|
if dir != "." {
|
2026-03-30 16:57:06 +00:00
|
|
|
relPath = core.JoinPath(dir, name)
|
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
|
|
|
}
|
|
|
|
|
|
2026-03-30 16:57:06 +00:00
|
|
|
subPath := core.JoinPath(mount, relPath)
|
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
|
|
|
|
2026-03-30 21:37:15 +00:00
|
|
|
if childNames := data.ListNames(subPath); childNames.OK {
|
2026-03-30 00:41:43 +00:00
|
|
|
slugs = append(slugs, listNamesRecursive(mount, relPath)...)
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
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
|
|
|
|
|
|
|
|
slugs = append(slugs, relPath)
|
2026-03-18 14:03:06 +00:00
|
|
|
}
|
|
|
|
|
return slugs
|
|
|
|
|
}
|
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
|
|
|
|
|
|
|
|
func listNames(mount string) []string {
|
2026-03-30 00:41:43 +00:00
|
|
|
if result := ensureMounted(); !result.OK {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-30 16:57:06 +00:00
|
|
|
r := data.ListNames(core.JoinPath(mount, "."))
|
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
|
|
|
if !r.OK {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return r.Value.([]string)
|
|
|
|
|
}
|