golangci config drift guard: failure message loops the operator when the org standard legitimately updates #34
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Follow-up to PR #31, which added an offline sha256 drift guard to
backend/Makefile'slinttarget. The guard itself is correct and fails closed — these are three wording defects in its failure output, graded non-blocking during review and deliberately not sent back for a second rework cycle.NB1 — the failure message tells the operator to do the thing that loops
The guard conflates two very different situations and prints the same message for both:
backend/.golangci.ymllocally. The message is right: restore it from the org standard.Restore it verbatim from sneak/prompts; do not edit it.— which is exactly what they just did. Following the instruction reproduces the failure indefinitely.The message never names
GOLANGCI_CONFIG_SHA256inbackend/Makefile, which is the one thing that actually has to change in case 2. Whoever next syncs the config gets a confusing debugging session for no reason.This is the one worth fixing. Given that the whole point of #14 was that the org standard had drifted, case 2 is not hypothetical — it is the expected steady-state maintenance path.
NB2 — a missing hash tool is misreported as config drift
If
sha256sum/shasumis absent or fails,actualcomes back empty, the comparison fails, and the operator is told their config has drifted. It has not.Verified during review that this fails closed (
make lint SHA256SUM=definitely-not-a-real-commandexits 1), which is the property that actually matters — so this is a diagnosis bug, not a safety bug. Same wrong message if.golangci.ymlis missing entirely, and on a BSD host where the tool issha256rather thansha256sumand the Makefile falls into theelsebranch.NB3 — PR #31's body still says "local
make check"Root
make checknever reaches the backend. The surrounding qualifier saves the meaning, so this is not a recurrence of the earlier N4 finding, but the phrase is still loose. Cosmetic; fix only if touching the PR body for another reason. Not worth a commit on its own.Definition of done
GOLANGCI_CONFIG_SHA256inbackend/Makefileif the org standard itself changed. Naming the constant is the essential part.make lint SHA256SUM=definitely-not-a-real-commandand confirm a non-zero exit..golangci.ymlproduces its own distinct message.sha256sum backend/.golangci.yml=021cc83f4e6fc7c31b95b34b846723dfcf20b66b7baeea1dc40406e643346bcb).cd backend && make checkpasses offline; rootmake checkpasses;docker build -f Dockerfile.backend .passes.TODO.mdupdated in the same commit.(closes #N).Implementation requirements
backend/.golangci.yml. This issue is about the Makefile's error handling only.golangci-lint config verify— that was PR #31's original approach and it was rejected because it fetches its schema over an unpinned live HTTPS request. See the blocking finding on #31 for the full reasoning.1.0.0milestone. It does not block a tag.backend/Makefilefor #16 or #21, folding it in is reasonable — say so on this issue rather than opening a redundant PR.maketargets andscript/entrypoints only.Location update: the guard is moving to
backend/script/lintThis issue was written against
backend/Makefile'slinttarget, which is where PR #31 put the drift guard. PR #38 relocates it.Under #38,
backend/Makefile'slintbecomes a thin shim (@script/lint) and the guard moves into a newbackend/script/lint, rewritten from a make recipe into POSIX sh — theSHA256SUMmake-variable branch becomes asha256()shell function preferringsha256sumwith ashasum -a 256fallback. Same logic, same failure text, different file and different language.So when this issue is implemented:
backend/script/lint. If it has not, editbackend/Makefile. Do not work from the line numbers in this issue's original description.GOLANGCI_CONFIG_SHA256in both versions, so grepping for that name is the reliable way to find it.Everything else in this issue is unchanged. NB1 (the message loops the operator when the org standard legitimately updates) and NB2 (a missing hash tool is misreported as drift) both survive the move verbatim — #38 relocated the logic without altering the error text.
One addition surfaced by #38's review: the guard's error text leads with the wrong remedy. It opens by telling the operator to restore the file from the org standard, which is the correct advice in only one of the two cases. Whichever case is more likely should not be the one buried second. Worth deciding deliberately rather than leaving the existing order by default.