[agent/claude] Write tests for /pkg/agentic/ to improve coverage. Current c... #4

Merged
Virgil merged 1 commit from agent/write-tests-for--pkg-agentic--to-improve into main 2026-03-22 00:45:19 +00:00
Member

Task

Write tests for /pkg/agentic/ to improve coverage. Current coverage is 4.2%.

Focus on these testable functions ONLY — skip anything that needs live API or process spawning:

  • paths.go: WorkspaceRoot, extractPRNumber, any path helper functions
  • prep.go: workspace preparation logic, template rendering
  • status.go: workspace status scanning, status parsing
  • queue.go: queue management functions
  • plan.go: plan file reading/writing

Rules:

  • Use Go testing + testify (assert/require)
  • Test naming: _Good, _Bad, _Ugly
  • Use t.TempDir() for filesystem operations
  • Create fake status.json/workspace dirs for status scanning
  • Skip functions that shell out to git/claude/forge — mark with t.Skip
  • Do NOT modify any non-test files
  • After writing tests, run: go test ./pkg/agentic/ -cover
  • Commit with message: test(agentic): add unit tests for paths, status, queue, plans

Co-Authored-By: Virgil virgil@lethean.io

Agent: claude
Commits: 1
Branch: agent/write-tests-for--pkg-agentic--to-improve


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

## Task Write tests for /pkg/agentic/ to improve coverage. Current coverage is 4.2%. Focus on these testable functions ONLY — skip anything that needs live API or process spawning: - paths.go: WorkspaceRoot, extractPRNumber, any path helper functions - prep.go: workspace preparation logic, template rendering - status.go: workspace status scanning, status parsing - queue.go: queue management functions - plan.go: plan file reading/writing Rules: - Use Go testing + testify (assert/require) - Test naming: _Good, _Bad, _Ugly - Use t.TempDir() for filesystem operations - Create fake status.json/workspace dirs for status scanning - Skip functions that shell out to git/claude/forge — mark with t.Skip - Do NOT modify any non-test files - After writing tests, run: go test ./pkg/agentic/ -cover - Commit with message: test(agentic): add unit tests for paths, status, queue, plans Co-Authored-By: Virgil <virgil@lethean.io> **Agent:** claude **Commits:** 1 **Branch:** `agent/write-tests-for--pkg-agentic--to-improve` --- Auto-created by core-agent dispatch system. Co-Authored-By: Virgil <virgil@lethean.io>
Virgil added 1 commit 2026-03-21 14:03:57 +00:00
Add comprehensive tests for pkg/agentic covering:
- status.go: writeStatus, readStatus, roundtrip, overwrite, error cases
- plan.go: writePlan, readPlan, planPath, roundtrip, directory creation
- queue.go: baseAgent edge cases, config defaults, concurrency checks
- prep.go: envOr, detectLanguage, detectBuildCmd, detectTestCmd, NewPrep

Coverage improved from 4.2% to 9.2%. All tests use t.TempDir(),
coreio.Local for file I/O, and _Good/_Bad/_Ugly naming convention.

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

Verification Failed

Command: go test ./...

# dappco.re/go/agent/pkg/setup
pkg/setup/config.go:88:13: undefined: lib.RenderFile
pkg/setup/config.go:131: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/cmd
cmd/main.go:32:34: cannot use c (variable of type *"dappco.re/go/core".Core) as *"forge.lthn.ai/core/go/pkg/core".Core value in argument to procFactory
cmd/main.go:44:30: undefined: mcp.Options
cmd/main.go:52:19: cannot use mcpSvc (variable of type *"forge.lthn.ai/core/mcp/pkg/mcp".Service) as monitor.ChannelNotifier value in argument to mon.SetNotifier: *"forge.lthn.ai/core/mcp/pkg/mcp".Service does not implement monitor.ChannelNotifier (missing method ChannelSend)
FAIL	dappco.re/go/agent/cmd [build failed]
ok  	dappco.re/go/agent/pkg/agentic	0.394s
ok  	dappco.re/go/agent/pkg/brain	0.727s
?   	dappco.re/go/agent/pkg/lib	[no test files]
ok  	dappco.re/go/agent/pkg/monitor	11.435s
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:88:13: undefined: lib.RenderFile pkg/setup/config.go:131: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/cmd cmd/main.go:32:34: cannot use c (variable of type *"dappco.re/go/core".Core) as *"forge.lthn.ai/core/go/pkg/core".Core value in argument to procFactory cmd/main.go:44:30: undefined: mcp.Options cmd/main.go:52:19: cannot use mcpSvc (variable of type *"forge.lthn.ai/core/mcp/pkg/mcp".Service) as monitor.ChannelNotifier value in argument to mon.SetNotifier: *"forge.lthn.ai/core/mcp/pkg/mcp".Service does not implement monitor.ChannelNotifier (missing method ChannelSend) FAIL dappco.re/go/agent/cmd [build failed] ok dappco.re/go/agent/pkg/agentic 0.394s ok dappco.re/go/agent/pkg/brain 0.727s ? dappco.re/go/agent/pkg/lib [no test files] ok dappco.re/go/agent/pkg/monitor 11.435s FAIL dappco.re/go/agent/pkg/setup [build failed] FAIL ``` **Exit code:** 1
Virgil added the
needs-review
label 2026-03-21 14:04:11 +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.
Virgil merged commit ddaf950654 into main 2026-03-22 00:45:19 +00:00
Sign in to join this conversation.
No description provided.