From e22eaedd1f5dc7b30321f96b1dd214904a7eade4 Mon Sep 17 00:00:00 2001 From: Virgil Date: Tue, 31 Mar 2026 05:09:25 +0000 Subject: [PATCH] fix(ax): align remaining AX comments Co-Authored-By: Virgil --- pkg/agentic/pid.go | 4 +--- pkg/lib/lib.go | 32 ++++++++++++-------------------- pkg/monitor/monitor.go | 5 ++--- pkg/runner/queue.go | 9 ++++----- 4 files changed, 19 insertions(+), 31 deletions(-) diff --git a/pkg/agentic/pid.go b/pkg/agentic/pid.go index e5f8110..8b14fa8 100644 --- a/pkg/agentic/pid.go +++ b/pkg/agentic/pid.go @@ -38,9 +38,7 @@ func ProcessAlive(c *core.Core, processID string, pid int) bool { return false } -// ProcessTerminate stops a managed process. -// -// _ = agentic.ProcessTerminate(c, proc.ID, proc.Info().PID) +// terminated := agentic.ProcessTerminate(c, proc.ID, proc.Info().PID) func ProcessTerminate(c *core.Core, processID string, pid int) bool { if c == nil { return false diff --git a/pkg/lib/lib.go b/pkg/lib/lib.go index 3129dc6..ea0f59c 100644 --- a/pkg/lib/lib.go +++ b/pkg/lib/lib.go @@ -1,7 +1,13 @@ // SPDX-License-Identifier: EUPL-1.2 -// Package lib provides embedded content for agent dispatch. -// Prompts, tasks, flows, personas, and workspace templates. +// 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) +// +// Package lib exposes embedded prompts, tasks, flows, personas, and workspace templates. // // Structure: // @@ -11,15 +17,6 @@ // flow/ — Build/release workflows per language/tool // persona/ — Domain/role system prompts (WHO you are) // workspace/ — Agent workspace templates (WHERE to work) -// -// Usage: -// -// r := lib.Prompt("coding") // r.Value.(string) -// r := lib.Task("code/review") // r.Value.(string) -// r := lib.Persona("secops/dev") // r.Value.(string) -// r := lib.Flow("go") // r.Value.(string) -// r := lib.ExtractWorkspace("default", "/tmp/workspace", data) -// core.Println(r.OK) package lib import ( @@ -163,10 +160,8 @@ func Task(slug string) core.Result { } } -// Bundle holds a task's main content plus companion files. -// -// r := lib.TaskBundle("code/review") -// if r.OK { b := r.Value.(lib.Bundle) } +// bundle := lib.Bundle{Main: "Prompt body", Files: map[string]string{"README.md": "Context"}} +// core.Println(bundle.Files["README.md"]) type Bundle struct { Main string Files map[string]string @@ -220,8 +215,6 @@ func Persona(path string) core.Result { return personaFS.ReadString(core.Concat(path, ".md")) } -// WorkspaceData is the data passed to workspace templates. -// // data := &lib.WorkspaceData{ // Repo: "go-io", Task: "fix tests", Agent: "codex", BuildCmd: "go build ./...", // } @@ -337,9 +330,8 @@ func ListPersonas() []string { return names.AsSlice() } -// listNamesRecursive walks an embed tree via Data.ListNames. -// Directories are recursed into. Files are added as slugs (extension stripped by ListNames). -// A name can be both a file AND a directory (e.g. code/review.md + code/review/). +// names := listNamesRecursive("task", ".") +// core.Println(names) // ["code/review", "code/refactor", ...] func listNamesRecursive(mount, dir string) []string { if result := ensureMounted(); !result.OK { return nil diff --git a/pkg/monitor/monitor.go b/pkg/monitor/monitor.go index a34dd82..a5af4e9 100644 --- a/pkg/monitor/monitor.go +++ b/pkg/monitor/monitor.go @@ -78,9 +78,8 @@ type Subsystem struct { var _ coremcp.Subsystem = (*Subsystem)(nil) -// Use core.New(core.WithService(monitor.Register)) for new code. -// -// monitorService.SetCore(c) +// c := core.New(core.WithService(monitor.Register)) +// monitorService.SetCore(c) func (m *Subsystem) SetCore(coreApp *core.Core) { m.ServiceRuntime = core.NewServiceRuntime(coreApp, Options{}) } diff --git a/pkg/runner/queue.go b/pkg/runner/queue.go index 8312a15..03e80ba 100644 --- a/pkg/runner/queue.go +++ b/pkg/runner/queue.go @@ -32,12 +32,11 @@ type RateConfig struct { BurstDelay int `yaml:"burst_delay"` } -// ConcurrencyLimit supports both flat (int) and nested (map with total + per-model) formats. +// flat := runner.ConcurrencyLimit{} +// _ = yaml.Unmarshal([]byte("1\n"), &flat) // -// claude: 1 → Total=1, Models=nil -// codex: → Total=5, Models={"gpt-5.4": 1} -// total: 5 -// gpt-5.4: 1 +// nested := runner.ConcurrencyLimit{} +// _ = yaml.Unmarshal([]byte("total: 5\ngpt-5.4: 1\n"), &nested) type ConcurrencyLimit struct { Total int Models map[string]int