Delete tools.go and remove tool-dependency pollution from go.mod - #6
Merged
Conversation
bborbe
marked this pull request as ready for review
August 9, 2026 15:08
There was a problem hiding this comment.
PR Review: Delete tools.go and remove tool-dependency pollution from go.mod
Scope: dependency hygiene refactor — no application behavior changes
Must Fix (Critical)
None.
Should Fix (Important)
None.
Nice to Have (Optional)
None.
Notes:
The migration is complete and correct. Key verifications performed:
| Check | Result |
|---|---|
go.mod line count | 26 lines (was ~448) ✓ |
Direct deps in go.mod | 4 genuine app deps only ✓ |
| Tool deps removed | golangci-lint, osv-scanner, addlicense, etc. all gone ✓ |
| Replace directives | All 5 removed ✓ |
go-git in go.mod | Not present ✓ |
go-git imports in source | Confirmed none — was tool-only transitive ✓ |
pkg/errors usage | Present in git-sync.go — correctly retained ✓ |
| Pollution patterns | None found ✓ |
tools.env | Untouched, versions correctly pinned ✓ |
| Makefile tools | Already using go run pkg@$(VERSION) with -mod=mod ✓ |
| golang.org/x CVEs fixed | net v0.57.0, sync v0.22.0, sys v0.47.0, text v0.40.0 ✓ |
| CHANGELOG.md | Unreleased entries added describing both changes ✓ |
| Mechanical funnel | 0 findings across 74 YAML rules ✓ |
Selector mode traceability: Classified all changed files — go.mod/go.sum changes are dependency hygiene (no rule triggers); tools.go deletion is structural (no rule triggers); CHANGELOG.md update is documentation (no rule triggers). No judgment rules triggered. Selector clean — no adjudication needed.
precommit skipped (selector mode) — CI covers lint+test
{
"verdict": "approve",
"summary": "Clean dependency hygiene refactor: tools.go deleted, go.mod shrunk from 448 to 26 lines, tool-only deps and 5 replace directives removed, go-git CVEs eliminated, golang.org/x bumped to clear 4 previously-masked HIGH CVEs. No source file imported go-git — confirmed it was exclusively a transitive tool dep. All tool versions remain properly pinned via tools.env and Makefile already invokes all tools via go run.",
"comments": [],
"concerns_addressed": [
"security: go-git removed — no source file imports it (confirmed via grep), GHSA-hc8v-wwc9-vgxm and GHSA-qgq7-7hm3-q39j eliminated",
"security: golang.org/x/{net,sync,sys,text} bumped to fix CVE-2026-25681, CVE-2026-27136, CVE-2026-39821, CVE-2026-56852",
"correctness: tools.go deleted, tools.env correctly unchanged, all tools still pinned",
"correctness: 5 replace directives removed, no dependency resolution issues",
"tests: precommit runs via CI (selector mode skipped), Makefile already uses go run for all tools"
]
}
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 freeto 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.
Removes
tools.goso CLI tools are no longer Go module dependencies. Tool versions stay pinned viatools.env+go run pkg@\$(VERSION), which the Makefile already used.Result
go.modgo-gitreplacedirectivesgo-gitwas tool-only pollution — no source file in this repo imports a git library. Deletingtools.goremoves it and both CVEs (GHSA-hc8v-wwc9-vgxm, GHSA-qgq7-7hm3-q39j).Commits
chore: bump go-git to v5.19.2— unblocks the dark-factory preflight baseline, which was red on the very CVEs this PR removes.Delete tools.go and remove tool-dependency pollution from go.mod— the migration (dark-factory).fix: restore BSD license header on generated mocks—go generaterewritesmocks/mocks.goheaderless;addlicensere-adds it as the last precommit step, so a failure before that step leaves it stripped.fix: bump golang.org/x deps— removing the tool deps letgo mod tidyfall back to minimal versions, surfacing 4 HIGH CVEs the tool deps had been masking.Verification
make precommitgreen (osv-scanner + trivy both clean)grep go-git go.mod→ empty; pollution grep → empty;tools.goabsent