[agent/claude] Reference implementation: migrate core/agent to use Core pri... #7
No reviewers
Labels
No labels
needs-review
needs-review
needs-review
needs-review
needs-review
athena
athena-gemini
audit
clotho
clotho-gemini
codex
darbs-claude
security
wiki
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: core/agent#7
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "agent/reference-implementation--migrate-core-a"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task
Reference implementation: migrate core/agent to use Core primitives instead of separate go-io/go-log packages.
WHAT TO CHANGE (23 files in pkg/):
Replace
coreio "dappco.re/go/core/io"andcoreio "forge.lthn.ai/core/go-io"imports with Core's built-in Fs.var fs = &core.Fs{}(root "/" = unrestricted, same as coreio.Local)coreio.Local.Read(path)returns (string, error) →fs.Read(path)returns core.Resultcoreio.Local.Write(path, content)→fs.Write(path, content)returns core.Resultcoreio.Local.EnsureDir(path)→fs.EnsureDir(path)returns core.Resultcoreio.Local.List(path)→fs.List(path)returns core.Result (Value is []os.DirEntry)coreio.Local.IsFile(path)→fs.IsFile(path)returns bool (same)coreio.Local.Delete(path)→fs.Delete(path)returns core.ResultReplace
coreerr "dappco.re/go/core/log"andcoreerr "forge.lthn.ai/core/go-log"with Core's built-in error and logging.coreerr.E("op", "msg", err)→core.E("op", "msg", err)(identical signature, package-level function)coreerr.Error("msg", kvs...)→core.Error("msg", kvs...)(package-level default logger)coreerr.Info(...)→core.Info(...)coreerr.Warn(...)→core.Warn(...)Result pattern: Every
coreio.Local.Read(path)that returned(string, error)now returnscore.Result.Convert:
data, err := coreio.Local.Read(p); if err != nil {→r := fs.Read(p); if !r.OK {Then:
data→r.Value.(string)For List:
entries, err := coreio.Local.List(p)→r := fs.List(p); entries := r.Value.([]os.DirEntry)Add usage-example comments (AX convention) to all public types and functions. The comment shows HOW with real values, not just WHAT:
Remove go-io and go-log from go.mod requires. Only dappco.re/go/core should remain.
IMPORTANT: The import for Core is
core "dappco.re/go/core". The Fs struct iscore.Fs{}. The E function iscore.E().After changes:
go build ./...andgo vet ./...must pass.This is the REFERENCE IMPLEMENTATION for how all Core ecosystem packages should migrate. Make it exemplary.
Agent: claude
Commits: 4
Branch:
agent/reference-implementation--migrate-core-aAuto-created by core-agent dispatch system.
Co-Authored-By: Virgil virgil@lethean.io
Replace separate go-io (coreio) and go-log (coreerr) packages with Core's built-in Fs and error/logging functions. This is the reference implementation for how all Core ecosystem packages should migrate. Changes: - coreio.Local.Read/Write/EnsureDir/Delete/IsFile → core.Fs methods - coreerr.E() → core.E(), coreerr.Info/Warn/Error → core.Info/Warn/Error - (value, error) return pattern → core.Result pattern (r.OK, r.Value) - go-io and go-log moved from direct to indirect deps in go.mod - Added AX usage-example comments on key public types - Added newFs("/") helper for unrestricted filesystem access Co-Authored-By: Virgil <virgil@lethean.io>Verification Failed
Command:
go test ./...Exit code: 1
Verification Failed
Command:
go test ./...Exit code: 1
Needs Review
Tests failed after rebase. Auto-merge gave up after retry.
Labelled
needs-reviewfor human attention.Pull request closed