4.1 KiB
4.1 KiB
TODO.md -- go-agentic
Phase 1: Test Coverage
- Verify all 5 test files pass standalone after split (
go test ./...) - Add integration test for full task lifecycle: claim -> process -> complete
- Add edge-case tests for allowance exhaustion mid-task
- Fill coverage gaps: embed, service types, git operations, config YAML/env paths, error store mock
- Target 85%+ coverage achieved: 85.6% (from 70.1%) —
23aa635
Phase 2: Allowance Persistence
- MemoryStore is in-memory only -- state lost on restart
- Add Redis backend for
AllowanceStoreinterface (multi-process safe) - Add SQLite backend for
AllowanceStoreinterface (single-node fallback) - Config already supports YAML -- wire backend selection into config loader
Phase 3: Multi-Agent Coordination — 646cc02
3.1 Agent Registry
- Create
registry.go—AgentInfostruct (ID, Name, Capabilities []string, Status enum, LastHeartbeat, CurrentLoad int, MaxLoad int),AgentStatusenum (Available/Busy/Offline) AgentRegistryinterface —Register(AgentInfo) error,Deregister(id string) error,Get(id string) (AgentInfo, error),List() []AgentInfo,Heartbeat(id string) error,Reap(ttl time.Duration) []string(returns IDs of reaped agents)MemoryRegistryimplementation —sync.RWMutexguarded map,Reap()marks agents offline if heartbeat older than TTL- Tests — registration, deregistration, heartbeat updates, reap stale agents, concurrent access
3.2 Task Router
- Create
router.go—TaskRouterinterface withRoute(task *Task, agents []AgentInfo) (string, error)returning agent ID DefaultRouterimplementation — capability matching (task.Labels ⊆ agent.Capabilities), then least-loaded agent (CurrentLoad / MaxLoad ratio), priority weighting (critical tasks skip load balancing)ErrNoEligibleAgentsentinel error when no agents match capabilities or all are at capacity- Tests — capability matching, load distribution, critical priority bypass, no eligible agent error, tie-breaking by agent ID (deterministic)
3.3 Dispatcher
- Create
dispatcher.go—Dispatcherstruct wrappingAgentRegistry,TaskRouter,AllowanceService, andClient Dispatch(ctx, task) (string, error)— Route → allowance check → claim via client → record usage. Returns assigned agent IDDispatchLoop(ctx, interval)— polls client.ListTasks(pending) → dispatches each. Respects context cancellation- Tests — full dispatch flow with mock client, allowance rejection path, no-agent-available path, loop cancellation
Phase 4: CLI Backing Functions — ef81db7
Phase 4 provides the data-fetching and formatting functions that core agent CLI commands will call. The CLI commands themselves live in core/cli.
4.1 Status Summary
- Create
status.go—StatusSummarystruct (Agents []AgentInfo, PendingTasks int, InProgressTasks int, AllowanceRemaining map[string]int64) GetStatus(ctx, registry, client, allowanceSvc) (*StatusSummary, error)— aggregates registry.List(), client.ListTasks counts, allowance remaining per agentFormatStatus(summary) string— tabular text output for CLI rendering- Tests — with mock registry + nil client, full summary with mock client
4.2 Task Submission
SubmitTask(ctx, client, title, description, labels, priority) (*Task, error)— creates a new task via client (requires new Client.CreateTask method)- Add
Client.CreateTask(ctx, task) (*Task, error)— POST /api/tasks - Tests — creation with all fields, validation (empty title), httptest mock
4.3 Log Streaming
- Create
logs.go—StreamLogs(ctx, client, taskID, writer) error— polls task updates and writes progress to io.Writer - Tests — mock client with progress updates, context cancellation
Workflow
- Virgil in core/go writes tasks here after research
- This repo's dedicated session picks up tasks in phase order
- Mark
[x]when done, note commit hash