[agent/claude] Phase 2: Replace stdlib strings/fmt with Core primitives acr... #8

Closed
Virgil wants to merge 1 commit from agent/phase-2--replace-stdlib-strings-fmt-with into dev
Member

Task

Phase 2: Replace stdlib strings/fmt with Core primitives across all pkg/ files.

Use the workspace from the previous migration (branch agent/reference-implementation--migrate-core-a).

REPLACEMENTS:

  • strings.Contains(s, sub) → core.Contains(s, sub)
  • strings.HasPrefix(s, p) → core.HasPrefix(s, p)
  • strings.HasSuffix(s, p) → core.HasSuffix(s, p)
  • strings.TrimSpace(s) → core.Trim(s)
  • strings.Split(s, sep) → core.Split(s, sep)
  • strings.SplitN(s, sep, n) → core.SplitN(s, sep, n)
  • strings.Join(parts, sep) → core.Join(sep, parts...) NOTE: args are swapped
  • strings.ReplaceAll(s, old, new) → core.Replace(s, old, new)
  • strings.ToLower(s) → core.Lower(s)
  • strings.ToUpper(s) → core.Upper(s)
  • strings.TrimPrefix(s, p) → core.TrimPrefix(s, p)
  • strings.TrimSuffix(s, p) → core.TrimSuffix(s, p)
  • strings.NewReader(s) → core.NewReader(s)
  • strings.Builder{} → core.NewBuilder()
  • fmt.Sprintf(f, args...) → core.Sprintf(f, args...)
  • fmt.Sprint(args...) → core.Sprint(args...)

KEEP AS-IS (no Core equivalent):

  • fmt.Sscanf (parsing)
  • fmt.Fprintf (writer output)
  • strings.Map (rune mapping)
  • strings.Repeat
  • strings.Count
  • strings.Index

After replacing, remove unused "strings" and "fmt" imports. If fmt is still needed for Sscanf/Fprintf, keep it. If strings is still needed for Map/Repeat/Count, keep it.

Run: go build ./... && go vet ./... && go test ./...

Agent: claude
Commits: 1
Branch: agent/phase-2--replace-stdlib-strings-fmt-with


Auto-created by core-agent dispatch system.
Co-Authored-By: Virgil virgil@lethean.io

## Task Phase 2: Replace stdlib strings/fmt with Core primitives across all pkg/ files. Use the workspace from the previous migration (branch agent/reference-implementation--migrate-core-a). REPLACEMENTS: - strings.Contains(s, sub) → core.Contains(s, sub) - strings.HasPrefix(s, p) → core.HasPrefix(s, p) - strings.HasSuffix(s, p) → core.HasSuffix(s, p) - strings.TrimSpace(s) → core.Trim(s) - strings.Split(s, sep) → core.Split(s, sep) - strings.SplitN(s, sep, n) → core.SplitN(s, sep, n) - strings.Join(parts, sep) → core.Join(sep, parts...) NOTE: args are swapped - strings.ReplaceAll(s, old, new) → core.Replace(s, old, new) - strings.ToLower(s) → core.Lower(s) - strings.ToUpper(s) → core.Upper(s) - strings.TrimPrefix(s, p) → core.TrimPrefix(s, p) - strings.TrimSuffix(s, p) → core.TrimSuffix(s, p) - strings.NewReader(s) → core.NewReader(s) - strings.Builder{} → core.NewBuilder() - fmt.Sprintf(f, args...) → core.Sprintf(f, args...) - fmt.Sprint(args...) → core.Sprint(args...) KEEP AS-IS (no Core equivalent): - fmt.Sscanf (parsing) - fmt.Fprintf (writer output) - strings.Map (rune mapping) - strings.Repeat - strings.Count - strings.Index After replacing, remove unused "strings" and "fmt" imports. If fmt is still needed for Sscanf/Fprintf, keep it. If strings is still needed for Map/Repeat/Count, keep it. Run: go build ./... && go vet ./... && go test ./... **Agent:** claude **Commits:** 1 **Branch:** `agent/phase-2--replace-stdlib-strings-fmt-with` --- Auto-created by core-agent dispatch system. Co-Authored-By: Virgil <virgil@lethean.io>
Virgil added 1 commit 2026-03-22 04:11:35 +00:00
Migrate all pkg/ files from strings.Contains/HasPrefix/HasSuffix/TrimSpace/
Split/SplitN/Join/ReplaceAll/ToLower/ToUpper/TrimPrefix/TrimSuffix/NewReader/
Builder and fmt.Sprintf/Sprint to their core.* equivalents from dappco.re/go/core.

Retained stdlib where no Core equivalent exists: strings.Map, strings.Trim
(cutset), strings.TrimRight, strings.Index, strings.ContainsAny, strings.Replace
(count), fmt.Sscanf, fmt.Fprintf.

Note: core.Join swaps args vs strings.Join (separator first, then parts...).

Co-Authored-By: Virgil <virgil@lethean.io>
Author
Member

Verification Failed

Command: go test ./...

# dappco.re/go/agent/pkg/setup
pkg/setup/config.go:89:13: undefined: lib.RenderFile
pkg/setup/config.go:132:13: undefined: lib.RenderFile
pkg/setup/setup.go:120:16: undefined: lib.ListDirTemplates
pkg/setup/setup.go:129:13: undefined: lib.ExtractDir
# dappco.re/go/agent/pkg/monitor [dappco.re/go/agent/pkg/monitor.test]
pkg/monitor/monitor_test.go:391:25: mon.lastCompletedCount undefined (type *Subsystem has no field or method lastCompletedCount)
pkg/monitor/monitor_test.go:473:14: mon.lastCompletedCount undefined (type *Subsystem has no field or method lastCompletedCount)
# dappco.re/go/agent/pkg/brain [dappco.re/go/agent/pkg/brain.test]
pkg/brain/bridge_test.go:49:26: cannot use hub (variable of type *"dappco.re/go/core/ws".Hub) as *"forge.lthn.ai/core/go-ws".Hub value in argument to ide.NewBridge
?   	dappco.re/go/agent/cmd	[no test files]
ok  	dappco.re/go/agent/pkg/agentic	0.449s
FAIL	dappco.re/go/agent/pkg/brain [build failed]
?   	dappco.re/go/agent/pkg/lib	[no test files]
FAIL	dappco.re/go/agent/pkg/monitor [build failed]
FAIL	dappco.re/go/agent/pkg/setup [build failed]
FAIL

Exit code: 1

## Verification Failed **Command:** `go test ./...` ``` # dappco.re/go/agent/pkg/setup pkg/setup/config.go:89:13: undefined: lib.RenderFile pkg/setup/config.go:132:13: undefined: lib.RenderFile pkg/setup/setup.go:120:16: undefined: lib.ListDirTemplates pkg/setup/setup.go:129:13: undefined: lib.ExtractDir # dappco.re/go/agent/pkg/monitor [dappco.re/go/agent/pkg/monitor.test] pkg/monitor/monitor_test.go:391:25: mon.lastCompletedCount undefined (type *Subsystem has no field or method lastCompletedCount) pkg/monitor/monitor_test.go:473:14: mon.lastCompletedCount undefined (type *Subsystem has no field or method lastCompletedCount) # dappco.re/go/agent/pkg/brain [dappco.re/go/agent/pkg/brain.test] pkg/brain/bridge_test.go:49:26: cannot use hub (variable of type *"dappco.re/go/core/ws".Hub) as *"forge.lthn.ai/core/go-ws".Hub value in argument to ide.NewBridge ? dappco.re/go/agent/cmd [no test files] ok dappco.re/go/agent/pkg/agentic 0.449s FAIL dappco.re/go/agent/pkg/brain [build failed] ? dappco.re/go/agent/pkg/lib [no test files] FAIL dappco.re/go/agent/pkg/monitor [build failed] FAIL dappco.re/go/agent/pkg/setup [build failed] FAIL ``` **Exit code:** 1
Virgil added the
needs-review
label 2026-03-22 04:11:37 +00:00
Author
Member

Needs Review

Tests failed after rebase. Auto-merge gave up after retry.

Labelled needs-review for human attention.

## Needs Review Tests failed after rebase. Auto-merge gave up after retry. Labelled `needs-review` for human attention.
Snider closed this pull request 2026-03-24 11:17:09 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.