📝 Bug Description
scripts/deadcode-ratchet.sh runs go run golang.org/x/tools/cmd/deadcode@v0.30.0 without constraining the Go toolchain. On a machine whose default go is older than the repository's go directive, the analyzer binary is built with the default toolchain and then fails on every package, and the resulting error points at the repository's packages instead of at the analyzer's own build, so it reads like a repository problem rather than a local-toolchain problem.
🔄 Steps to Reproduce
- With a default
go 1.24.x on PATH and this repository's go directive requiring 1.25, run bash scripts/deadcode-ratchet.sh from the repository root.
- Observe the errors below (analyzer exit 1).
✅ Expected Behavior
The ratchet either builds the analyzer with a toolchain that satisfies the go directive (for example deriving GOTOOLCHAIN from it) or fails with a message that names the toolchain mismatch and the remedy.
❌ Actual Behavior
<repo>/internal/version/check.go:2:1: package requires newer Go version go1.25 (application built with go1.24)
<repo>/cmd/engram/autosync_status.go:1:1: package requires newer Go version go1.25 (application built with go1.24)
deadcode: packages contain errors
exit status 1
deadcode analyzer failed; refusing a vacuous comparison
🖥️ Environment
- Operating System: Linux (Other)
- Engram Version: n/a — repository scripts on main
- Agent / Client: Other
💡 Additional Context
Workaround that unblocked a contributor run: build the analyzer explicitly with the required toolchain (GOTOOLCHAIN=go1.25.x go install golang.org/x/tools/cmd/deadcode@v0.30.0) and point the script at it via the existing DEADCODE_RATCHET_ANALYZER override. Plain GOTOOLCHAIN=auto does not help, because the analyzer's own module does not require 1.25, so the default toolchain still builds it.
📝 Bug Description
scripts/deadcode-ratchet.shrunsgo run golang.org/x/tools/cmd/deadcode@v0.30.0without constraining the Go toolchain. On a machine whose defaultgois older than the repository'sgodirective, the analyzer binary is built with the default toolchain and then fails on every package, and the resulting error points at the repository's packages instead of at the analyzer's own build, so it reads like a repository problem rather than a local-toolchain problem.🔄 Steps to Reproduce
go1.24.x on PATH and this repository'sgodirective requiring 1.25, runbash scripts/deadcode-ratchet.shfrom the repository root.✅ Expected Behavior
The ratchet either builds the analyzer with a toolchain that satisfies the
godirective (for example derivingGOTOOLCHAINfrom it) or fails with a message that names the toolchain mismatch and the remedy.❌ Actual Behavior
🖥️ Environment
💡 Additional Context
Workaround that unblocked a contributor run: build the analyzer explicitly with the required toolchain (
GOTOOLCHAIN=go1.25.x go install golang.org/x/tools/cmd/deadcode@v0.30.0) and point the script at it via the existingDEADCODE_RATCHET_ANALYZERoverride. PlainGOTOOLCHAIN=autodoes not help, because the analyzer's own module does not require 1.25, so the default toolchain still builds it.