| id | 204 |
|---|---|
| title | Fix internal/fix importing internal/engine |
| status | ✅ |
| summary | internal/fix/fix.go imports internal/engine for CheckRules, ConfigureRule, and DedupeDiagnostics. The layering map places engine above fix. Move the three functions to a lower shared package. |
| model | |
| depends-on |
internal/fix/fix.go imports internal/engine for three functions. The layering map places engine above fix. The import inverts that arrow. Moving the three functions to a package both engine and fix can import restores the intended direction.
DedupeDiagnosticsmoved tointernal/lint: it only operates onlint.Diagnosticvalues and has no other dependencies.CheckRulesandConfigureRulemoved to a newinternal/checkerpackage: both needconfig.RuleCfg,rule.Rule, andlint.File. Theconfigpackage already importsrule, so addingconfigtorulewould create arule → config → rulecycle. A newinternal/checkerpackage sits below bothinternal/engineandinternal/fixwith no import of either.
- Read
CheckRules,ConfigureRule, andDedupeDiagnosticsand identify their dependencies. - Choose the target package (
internal/lint,internal/rule, or a new package). Document the choice here. - Move the three functions.
- Update all callers in
internal/engineandinternal/fix. - Verify
internal/fixno longer importsinternal/engine. - Add a contract test in
internal/integration/that fails ifinternal/fiximportsinternal/engine. - Run
go build ./...andgo test ./....
-
grep -r --include='*.go' '".*internal/engine"' internal/fix/returns nothing. - A contract test guards the boundary.
-
go build ./...clean. -
go test ./...passes. -
go tool golangci-lint runclean.