test: AX-7 contract lock — 840 tests, 79.9% coverage, 92% GBU #20
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: core/agent#20
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "dev"
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?
Summary
What changed
Refactoring
Test coverage
Architecture
Remaining (blocked on go-process v0.7.0)
Test plan
go test ./...— all 840 tests passgo build ./...— zero compile errorsCo-Authored-By: Virgil virgil@lethean.io
Concurrency config now supports both flat and nested formats: claude: 1 # flat — 1 total codex: # nested — 2 total, per-model caps total: 2 gpt-5.4: 1 gpt-5.3-codex-spark: 1 canDispatchAgent checks pool total first, then per-model limit. countRunningByModel added for exact agent string matching. ConcurrencyLimit custom YAML unmarshaler handles both int and map. Co-Authored-By: Virgil <virgil@lethean.io>Services are now registered during Core construction: core.New( core.WithService(agentic.Register), core.WithService(monitor.Register), core.WithService(brain.Register), ) - Remove initServices() closure — services created once in conclave - Commands use c.ServiceStartup()/c.ServiceShutdown() for lifecycle - Service instances retrieved via c.Config() for MCP tool registration - run/orchestrator reduced to ServiceStartup + block + ServiceShutdown - run/task uses conclave's agentic instance Co-Authored-By: Virgil <virgil@lethean.io>Phase 4 complete: - Auto-PR handler emits PRCreated message - Verify handler listens for PRCreated, emits PRMerged/PRNeedsReview - findWorkspaceByPR() for workspace lookup from PR events - Remove legacy inline fallback from dispatch goroutine Phase 5 complete: - agents.yaml loaded once at startup into c.Config() - canDispatchAgent reads from c.Config() (no re-parsing) - drainQueue uses c.Lock("drain") when Core available Co-Authored-By: Virgil <virgil@lethean.io>- agentic.PrepSubsystem implements Startable/Stoppable - monitor.Subsystem implements Startable/Stoppable (OnStartup/OnShutdown) - Register factories use c.RegisterService() — auto-discovers interfaces - Register factories return instances via Result.Value - main.go uses ServiceFor[T]() instead of ConfigGet — typed retrieval - No more c.Config().Set("x.instance") workaround Co-Authored-By: Virgil <virgil@lethean.io>Register factories no longer call c.RegisterService() explicitly. WithService auto-discovers name from package path and registers. Eliminates double-registration error. Uses WithOption("name", "core-agent") for Options struct. Co-Authored-By: Virgil <virgil@lethean.io>- process: registered as WithService in core.New() - MCP: registered as WithName("mcp") in core.New(), retrieves agentic/monitor/brain via ServiceFor during construction - Commands use ServiceFor to access services — no captured vars - initMCP closure eliminated - No service creation after core.New() completes Co-Authored-By: Virgil <virgil@lethean.io>- core.New() includes mcp.Register — auto-discovers subsystems - mcp/serve commands use c.Service("mcp") for typed retrieval - ServiceStartup called once before Cli().Run() - run/task and run/orchestrator registered by agentic.OnStartup - Removed ServiceFor generics — c.Service() returns instances directly Co-Authored-By: Virgil <virgil@lethean.io>Covers agentCommand, containerCommand, buildAutoPRBody, emitEvent, countFileRefs, modelVariant, baseAgent, resolveWorkspace, findWorkspaceByPR, and extractPRNumber with _Good/_Bad/_Ugly cases. All 66 pass. Uses t.TempDir() + t.Setenv("CORE_WORKSPACE") for filesystem-dependent tests. Co-Authored-By: Virgil <virgil@lethean.io>Delete edge_case_test.go, coverage_push_test.go, dispatch_extra_test.go. Rewrite dispatch_test.go with proper naming: TestDispatch_Function_{Good,Bad,Ugly}. Every function in dispatch.go now has Good/Bad/Ugly test groups. Tests for non-dispatch functions will be restored to their correct files. agentic 72.6% (temporary regression — tests being redistributed) Co-Authored-By: Virgil <virgil@lethean.io>Rewrite tests with TestFile_Function_{Good,Bad,Ugly} convention. Split remote_dispatch_test.go → remote.go tests + remote_status_test.go. Resume tests consolidated with all 3 test categories. agentic 73.2% (recovering after catch-all deletion) Co-Authored-By: Virgil <virgil@lethean.io>New properly named tests: - TestStatus_Status_Ugly — dead PID detection (blocked/completed/failed) - TestPaths_DefaultBranch_{Good,Bad,Ugly} — main/master/non-git - TestAutoPR_AutoCreatePR_{Good,Bad,Ugly} — early returns + no commits - TestPrep_BuildPrompt_{Good,Bad,Ugly} — basic/empty/persona+issue 558 agentic tests, 74.0% coverage Co-Authored-By: Virgil <virgil@lethean.io>Mechanical rename of all test functions to follow the convention: TestFilename_FunctionName_{Good,Bad,Ugly} Examples: TestForgeMergePR_Good_Success → TestVerify_ForgeMergePR_Good_Success TestAgentCommand_Good_Gemini → TestDispatch_AgentCommand_Good_Gemini TestReadStatus_Bad_NoFile → TestStatus_ReadStatus_Bad_NoFile Gap analysis now works: 137 functions still need 260 missing categories. 566 tests, agentic 74.3% — naming is now the tooling. Co-Authored-By: Virgil <virgil@lethean.io>