go-agentic/TODO.md
Claude 092f19e7a0
docs: mark Redis backend as done in TODO.md
Virgil committed Redis AllowanceStore at 0be744e.

Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 11:29:15 +00:00

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 AllowanceStore interface (multi-process safe) — 0be744e
  • Add SQLite backend for AllowanceStore interface (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.goAgentInfo struct (ID, Name, Capabilities []string, Status enum, LastHeartbeat, CurrentLoad int, MaxLoad int), AgentStatus enum (Available/Busy/Offline)
  • AgentRegistry interfaceRegister(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)
  • MemoryRegistry implementationsync.RWMutex guarded 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.goTaskRouter interface with Route(task *Task, agents []AgentInfo) (string, error) returning agent ID
  • DefaultRouter implementation — capability matching (task.Labels ⊆ agent.Capabilities), then least-loaded agent (CurrentLoad / MaxLoad ratio), priority weighting (critical tasks skip load balancing)
  • ErrNoEligibleAgent sentinel 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.goDispatcher struct wrapping AgentRegistry, TaskRouter, AllowanceService, and Client
  • Dispatch(ctx, task) (string, error) — Route → allowance check → claim via client → record usage. Returns assigned agent ID
  • DispatchLoop(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.goStatusSummary struct (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 agent
  • FormatStatus(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.goStreamLogs(ctx, client, taskID, writer) error — polls task updates and writes progress to io.Writer
  • Tests — mock client with progress updates, context cancellation

Workflow

  1. Virgil in core/go writes tasks here after research
  2. This repo's dedicated session picks up tasks in phase order
  3. Mark [x] when done, note commit hash