Full domain expert session brief with architecture map, 4-phase TODO covering test coverage (critical), hardening, AgentCI pipeline, and Forge↔Gitea sync. Initial findings documenting package inventory, zero-test gaps, and auth resolution. Co-Authored-By: Virgil <virgil@lethean.io>
3.1 KiB
3.1 KiB
TODO.md — go-scm Task Queue
Dispatched from core/go orchestration. Pick up tasks in order.
Phase 1: Test Coverage (Critical)
forge/, gitea/, and git/ have zero tests. This is the top priority.
- forge/ unit tests — Test
New()client creation,GetCurrentUser(), error handling. Mock the Forgejo SDK client. Cover:repos.go(create, list, mirror),issues.go(create, list, assign),prs.go(create, list, merge),labels.go,webhooks.go,orgs.go. Target: 70% coverage. - gitea/ unit tests — Test
New()client creation, repo/issue operations. Mock the Gitea SDK client. Cover:repos.go,issues.go,meta.go. Target: 70% coverage. - git/ unit tests — Test
RepoStatusmethods (IsDirty,HasUnpushed,HasUnpulled). Test status parsing with mock git output. Test bulk operations with temp repos. Cover:git.go,service.go. Target: 80% coverage. - jobrunner handler tests — handlers/ has test files but verify coverage. Add table-driven tests for
dispatch.go,completion.go,enable_auto_merge.go. TestPipelineSignalstate transitions. - collect/ test audit — collect/ has test files for each collector. Run
go test -cover ./collect/...and identify gaps below 60%.
Phase 2: Hardening
- Config resolution audit — forge/ and gitea/ both resolve auth from
~/.core/config.yaml→ env vars → flags. Ensure consistent priority order. Document in FINDINGS.md. - Error wrapping — Ensure all errors use
fmt.Errorf("package.Func: ...: %w", err)orlog.E()consistently. Some files may use barefmt.Errorfwithout wrapping. - Context propagation — Verify all Forgejo/Gitea API calls pass
context.Contextfor cancellation. Add context to any blocking operations missing it. - Rate limiting — collect/ has its own
ratelimit.go. Verify it handles API rate limit headers from GitHub, Forgejo, Gitea.
Phase 3: AgentCI Pipeline
- Clotho dual-run validation —
DeterminePlan()logic is simple (check strategy + agent config + repo name). Add tests for all code paths: standard mode, dual-run by agent config, dual-run by critical repo. - Forgejo signal source tests —
forgejo/source.gopolls for webhook events. Test signal parsing and filtering. - Journal replay —
journal.gowrites JSONL audit trail. Add test for write + read-back + filtering by action/repo/time range. - Handler integration — Test full signal → handler → result flow with mock Forgejo client. Verify
tick_parentcorrectly updates epic progress.
Phase 4: Forge ↔ Gitea Sync
- Mirror sync — Implement repo mirroring from forge.lthn.ai (private) to git.lthn.ai (public). Strip sensitive data (research docs, credentials, internal refs).
- Issue sync — Selective issue sync (public issues only) from Forge to Gitea.
- PR status sync — Update Gitea mirror PRs when Forge PRs merge.
Workflow
- Virgil in core/go writes tasks here after research
- This repo's session picks up tasks in phase order
- Mark
[x]when done, note commit hash - New discoveries → add tasks, flag in FINDINGS.md