Skip to content

Add the Go module, ./dev and the code quality gates - #1

Merged
dinoderek merged 2 commits into
mainfrom
build/dev-gates
Oct 20, 2026
Merged

dinoderek merged 2 commits into
mainfrom
build/dev-gates

Conversation

@dinoderek

Copy link
Copy Markdown
Owner

Objective

Gives engine a Go module with a version command, and the repo tooling the project-context guideline's Core asks for. ./dev has the verbs doctor, run, test, worktree and deps; there is no deploy verb, and the docs say why. Eight required lanes run in parallel from scripts/lanes.tsv. CI runs the same ./dev test, and Dependabot keeps modules, tools and actions current. go.mod's go and toolchain lines are the one source of the Go version. Docs: docs/quality-gates.md and docs/versions.md. Guideline fixes this exposed are in docs/project-context.md.

Gates

Lane Result Evidence
./dev test (every required lane) PASS format, vet, lint, unit, coverage (92.6% of statements), file-length, imports, versions: all PASS locally; CI run below
  • New or changed tests: every package under internal/ and devtools/internal/ has tests. They cover each check's failure path (unformatted file, a lint finding or //nolint with no baseline row, coverage below the minimum, a file over the limit, a layer violation, each version drift) and the shrink-only baseline in both directions. Worktree create and release run against real git repos; doctor and deps run with fakes.
  • Lint thresholds proven to fire with a throwaway probe file: cognitive complexity 26 > 25, nesting > 4, 6 > 5 parameters, 207 > 200 lines.
  • Not run, with reason: none.

Rulings

Ruling (risk: low): golangci-lint and govulncheck are tool dependencies in the root go.mod.
Why: there is still one version source, and Dependabot bumps them. Agreed with the operator.
If wrong: move them to binaries that ./dev doctor downloads; that touches go.mod, devtools/internal/checks/lint.go and devtools/internal/dev/deps.go.

Ruling (risk: low): the ./dev logic is Go under devtools/, and ./dev itself is a short shell script that pins GOTOOLCHAIN and builds .dev/dev.
Why: the repo has one toolchain, and the tooling is tested and covered like product code.
If wrong: a rewrite of dev alone.

Ruling (risk: low): every baseline is strict both ways. A row whose count is above what remains fails the lane until it is lowered, and a //nolint directive counts as a finding.
Why: it makes "shrink-only" mechanical.
If wrong: relax baseline.Compare.

Review

  • Fresh reviewer: Claude Code subagent (Claude Opus 5.5), with project-context.md Core, the task requirements and both new docs as its checklist, because AGENTS.md lands in the next PR. First round: CHANGES_REQUESTED, with seven defects, all fixed. Second round: APPROVED.
  • Declined findings: a per-step check that setup-go uses go-version-file: go.mod. ./dev forces GOTOOLCHAIN from go.mod whatever setup-go installs, and the versions lane already rejects go-version and GOTOOLCHAIN anywhere in a workflow, so the stricter parse adds no protection. Also left as is: the //nolint scan parses testdata/ Go files, which golangci-lint skips. It fails closed, and the repo has no such fixtures.
  • Review hard: devtools/internal/baseline/baseline.go and devtools/internal/checks/lint.go (where a gate could fail open), dev together with devtools/internal/checks/versions.go (the single-Go-version guarantee).

Deviations

  • Size: about 3,100 hand-written added lines plus about 1,200 generated (go.mod, go.sum), over the ~2,000 budget. The operator agreed to one PR rather than a split.
  • Dependabot names the two tool modules in allow, because their requirements are // indirect. Whether it then bumps them is unverified until its first run; docs/versions.md gives the fallback.

🤖 Generated with Claude Code

dinoderek and others added 2 commits October 19, 2026 22:15
The module ships `engine version` and the repo tooling: ./dev with doctor,
run, test, worktree and deps, and eight required lanes (format, vet, lint,
unit, coverage, file-length, imports, versions) run in parallel from
scripts/lanes.tsv. CI runs ./dev test; Dependabot keeps modules, tools and
actions current. go.mod's toolchain line is the one Go version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Count //nolint directives the way golangci-lint matches them, match
directory triggers at any depth, require -min and -max, fail import rules
whose targets match no package, reject empty lane commands, and replace
the results directory on every run. Docs now say only what the code does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinoderek
dinoderek merged commit e04cc4b into main Oct 20, 2026
1 check passed
@dinoderek
dinoderek deleted the build/dev-gates branch October 20, 2026 17:25
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