Skip to content

fix: resolve project-wide lint debt - #120

Merged
yvonnedevlinrh merged 3 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/resolve-project-wide-lint-debt
Oct 1, 2026
Merged

yvonnedevlinrh merged 3 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/resolve-project-wide-lint-debt

Conversation

@yvonnedevlinrh

@yvonnedevlinrh yvonnedevlinrh commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #119.

  • Resolve project-wide errcheck, staticcheck, and unused-code findings without weakening quality gates
  • Propagate actionable transaction, cleanup, subprocess, database, and writer failures while preserving public contracts
  • Add deterministic regression tests for behavioral error paths
  • Record every baseline finding and complete OpenSpec review and implementation gates

How to Test

GOTOOLCHAIN=go1.25.13 golangci-lint run ./...
GOTOOLCHAIN=go1.25.13 go vet ./...
GOTOOLCHAIN=go1.25.13 go test ./... -count=1 -race -coverprofile=coverage.out
GOTOOLCHAIN=go1.25.13 make check-coverage
GOTOOLCHAIN=go1.25.13 go test -tags parity ./test/parity/... -count=1 -race
GOTOOLCHAIN=go1.25.13 govulncheck ./...
GOTOOLCHAIN=go1.25.13 go build -o bin/replicator ./cmd/replicator

Expected results: zero lint findings, all tests pass, all coverage ratchets pass, no vulnerabilities are reported, and the production binary builds.

How to Demo

Run golangci-lint run ./... to confirm the repository reports zero findings. Run the race and parity suites to demonstrate preserved behavior and response shapes.

Key Files Changed

  • cmd/replicator/: CLI cleanup and writer error handling
  • internal/comms, internal/org: safe transaction rollback and error preservation
  • internal/db, internal/query, internal/stats: database and row lifecycle handling
  • internal/forge, internal/gitutil: subprocess and worktree failure handling
  • internal/mcp, internal/mcpclient, internal/memory: protocol and integration error handling
  • test/parity/: fallible report generation with deterministic writer tests
  • openspec/changes/resolve-project-wide-lint-debt/: approved specification, finding inventory, and completion markers

Known issues

Duplicated transaction helpers. runReservationTransaction (internal/comms/reservation.go) and runEpicTransaction (internal/org/epic.go) are byte-for-byte identical in logic. Will be addressed in follow up issue #121

This PR was generated by /uf.finale (AI-assisted).

- Propagate actionable cleanup, transaction, and writer errors safely
- Add deterministic regression coverage and resolve all tracked findings
- Preserve public contracts and protected quality gates

Assisted-by: gpt-5.6-sol
Generated with AI assistance (gpt-5.6-sol)
@yvonnedevlinrh
yvonnedevlinrh requested a review from a team as a code owner September 30, 2026 17:04
- Use private permissions for temporary test fixtures
- Document intentional repository-readable files and fixed command inputs
- Apply org-infra goimports formatting

Assisted-by: gpt-5.6-sol
Generated with AI assistance (gpt-5.6-sol)

@marcusburghardt marcusburghardt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A thorough, spec-driven lint remediation resolving 54 errcheck, staticcheck, and unused findings across the full codebase. TDD faithfully applied for every behavioral change. All 8 acceptance criteria from #119 are met. CI passes cleanly. Public contracts preserved.

LOW findings (non-blocking):

  1. worktreeRemovalError custom type is slightly more surface area than needed — simple fmt.Errorf wrapping would suffice
  2. runReservationTransaction / runEpicTransaction duplication is a deliberate design trade-off but lacks a comment citing the decision
  3. scanForgeCounts asymmetric parameters (eager vs lazy) would benefit from a brief comment
  4. #nosec G306 suppression comments use inconsistent phrasing across files

This review was generated by /uf.review-pr (AI-assisted).

@yvonnedevlinrh
yvonnedevlinrh merged commit 7b109bf into unbound-force:main Oct 1, 2026
2 checks passed
@yvonnedevlinrh
yvonnedevlinrh deleted the opsx/resolve-project-wide-lint-debt branch October 1, 2026 13:55
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.

fix: resolve project-wide golangci-lint debt

2 participants