Skip to content

refactor: extract static data tables and tighten test hygiene - #310

Merged
Patel230 merged 1 commit into
mainfrom
fix/structural-hygiene
Sep 15, 2026
Merged

Patel230 merged 1 commit into
mainfrom
fix/structural-hygiene

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Bounded structural/hygiene work from the review.

  • Data-as-code: 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.
  • Dead test code: delete the unused testutil.MockLLMServer helpers (174 lines).
  • Test hygiene: new testaudit guard fails when assertion-free Test* functions grow past a baseline (229). Added real assertions to previously assertion-free tests in cmd and internal/engine/observability.

Verified: go vet, golangci-lint (0 issues), full go test ./..., make boundaries, coverage 68.1%.

Not in this PR (genuinely multi-PR, behavior-sensitive): splitting internal/engine/internal/tool, decomposing the TUI chatModel.Update state machine, retyping the Tool interface across ~150 tools, and routing cmd/pr.go's diff logic through internal/engine/diff.

- 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
Patel230 merged commit e77db14 into main Sep 15, 2026
25 checks passed
@Patel230
Patel230 deleted the fix/structural-hygiene branch September 15, 2026 03:57
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant