From 95c7df04da94a721d68a0cceed43345ecf4d81e4 Mon Sep 17 00:00:00 2001 From: Virgil Date: Mon, 30 Mar 2026 16:57:06 +0000 Subject: [PATCH] fix(ax): join lib embed paths consistently Co-Authored-By: Virgil --- docs/RFC.md | 1 + pkg/lib/lib.go | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/RFC.md b/docs/RFC.md index 05be4e8..7536066 100644 --- a/docs/RFC.md +++ b/docs/RFC.md @@ -423,6 +423,7 @@ Every exported function MUST have a usage-example comment: ## Changelog +- 2026-03-30: lib task bundle and recursive embed traversal now use `JoinPath` for filesystem paths, removing the last string-concatenated path joins in `pkg/lib`. - 2026-03-30: runner workspace status projections now use explicit typed copies, and `ReadStatusResult` gained direct AX-7 coverage in both runner and agentic packages. - 2026-03-30: transport helpers preserve request and read causes, brain direct API calls surface upstream bodies, and review queue retry parsing no longer uses `MustCompile`. - 2026-03-30: direct Core process calls replaced the `proc.go` wrapper layer; PID helpers now live in `pid.go` and the workspace template documents `c.Process()` directly. diff --git a/pkg/lib/lib.go b/pkg/lib/lib.go index 867fe35..ed29eae 100644 --- a/pkg/lib/lib.go +++ b/pkg/lib/lib.go @@ -196,12 +196,12 @@ func TaskBundle(slug string) core.Result { if !r.OK { return core.Result{Value: b, OK: true} } - nr := data.ListNames(core.Concat("task/", slug)) + nr := data.ListNames(core.JoinPath("task", slug)) if nr.OK { for _, name := range nr.Value.([]string) { for _, ext := range []string{".md", ".yaml", ".yml", ".txt", ""} { fullName := core.Concat(name, ext) - if fr := taskFS.ReadString(core.Concat(slug, "/", fullName)); fr.OK { + if fr := taskFS.ReadString(core.JoinPath(slug, fullName)); fr.OK { b.Files[fullName] = fr.Value.(string) break } @@ -358,7 +358,7 @@ func listNamesRecursive(mount, dir string) []string { return nil } - path := core.Concat(mount, "/", dir) + path := core.JoinPath(mount, dir) nr := data.ListNames(path) if !nr.OK { return nil @@ -368,10 +368,10 @@ func listNamesRecursive(mount, dir string) []string { for _, name := range nr.Value.([]string) { relPath := name if dir != "." { - relPath = core.Concat(dir, "/", name) + relPath = core.JoinPath(dir, name) } - subPath := core.Concat(mount, "/", relPath) + subPath := core.JoinPath(mount, relPath) // Try as directory — recurse if it has contents if sub := data.ListNames(subPath); sub.OK { @@ -389,7 +389,7 @@ func listNames(mount string) []string { return nil } - r := data.ListNames(core.Concat(mount, "/.")) + r := data.ListNames(core.JoinPath(mount, ".")) if !r.OK { return nil }