Repository navigation
refactor: extract static data tables and tighten test hygiene - #310
Merged
Merged
Conversation
- Move the 554-line NewErrorContext body into a package-level pattern table; the constructor is now 9 lines. - Move the capability catalog and migration-rule catalog to package-level vars with per-instance deep copies so callers cannot mutate the shared data. - Delete the unused testutil.MockLLMServer helpers (174 lines). - Add a testaudit guard that fails when assertion-free Test* functions grow past a baseline (currently 229). - Add real assertions to previously assertion-free tests in cmd and internal/engine/observability.
Patel230
added a commit
that referenced
this pull request
Oct 2, 2026
…ene (#310) - Move the 554-line NewErrorContext body into a package-level pattern table; the constructor is now 9 lines. - Move the capability catalog and migration-rule catalog to package-level vars with per-instance deep copies so callers cannot mutate the shared data. - Delete the unused testutil.MockLLMServer helpers (174 lines). - Add a testaudit guard that fails when assertion-free Test* functions grow past a baseline (currently 229). - Add real assertions to previously assertion-free tests in cmd and internal/engine/observability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounded structural/hygiene work from the review.
NewErrorContext(554 lines) is now a 9-line constructor over a package-level pattern table. The capability catalog and migration-rule catalog are package-level vars with per-instance deep copies so callers cannot mutate shared data.testutil.MockLLMServerhelpers (174 lines).testauditguard fails when assertion-freeTest*functions grow past a baseline (229). Added real assertions to previously assertion-free tests incmdandinternal/engine/observability.Verified:
go vet,golangci-lint(0 issues), fullgo test ./...,make boundaries, coverage 68.1%.Not in this PR (genuinely multi-PR, behavior-sensitive): splitting
internal/engine/internal/tool, decomposing the TUIchatModel.Updatestate machine, retyping theToolinterface across ~150 tools, and routingcmd/pr.go's diff logic throughinternal/engine/diff.