WIP: next #34
Reference in New Issue
Block a user
Delete Branch "next"
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?
Long-lived
nextbranch for the current cycle.WIP:until the milestone is ready.Six commits, one per issue:
51c3945CHECK_EPOCHd173e69fd78aeb3a2184906204161e21653Sections 1-5 are reviewed and passing. Section 6 is in review.
Consuming repos adopt this by re-vendoring
prompts/REPO_POLICIES.mdand both checklists, then taking the canonical.dockerignore,Dockerfile,Dockerfile.lintandscript/entrypoints. Per-unit adoption steps, including what to delete, are in the commit bodies and the section-6 comment.22a5a372e0to417f142a9f417f142a9fto6b9827a6186b9827a618to51c394552e07129f0ec1tobe59376522be59376522tod173e69f85b8d21d1592to533fc61817533fc61817tofd78aeb00361448b0c4eto3a218497b86ddf46e894tod9be89c339d9be89c339to62b31af5bd62b31af5bdto33fb5dde9833fb5dde98to0620416869this is a MESS. delete all these comments and get it together. SIMPLE. make targets invoke strta scripts which are authoritative. lint strta can detect container and branch, that is ok.
globally remember to not be so insanely verbose in issue comments. be concise and to the point without omitting ANY important details. dont get lost in the weeds.
12e8db8b0eto35858dab66Comment history deleted as instructed; keeping this thread short from here.
State: six commits. Sections 1-5 (#26, #28, #29, #27, #30) reviewed and passing. Section 6 (#40,
35858da) failed re-review on a contradictory canonical rule, and is now being reworked to your ruling instead:maketargets shim to the authoritativescript/entrypoints,script/lintdetects a container and branches, somake checkstays whole and the split I had it build is deleted. Comment bloat in the files goes too.Label
needs-rework, assigneeclawbot. Do not merge yet.nextto WIP: next35858dab66to1e21653f44Lint in Docker (closes #40) —
1e21653, redesigned per sneakscript/lintdetects the container and branches:LINT_IN_CONTAINER=1runs thelinter directly, otherwise it builds
Dockerfile.lint. Everything else revertsto its previous shape —
Dockerfilerunsmake check,script/checkrunstest+lint+fmt-check,
script/cibuildis one build, and the Go multistage lintstage and its
COPY --from=lintordering are restored withENV LINT_IN_CONTAINER=1.Detection is on that marker and nothing else.
/.dockerenvis rejected even asa fallback: measured absent inside BuildKit
RUNsteps and present onhosts that are themselves containers, so it fails both ways — and the false
positive silently lints on the host, which is the defect this closes. A false
negative just fails loudly on the missing daemon.
Deleted as superseded: the
script/bootstrapgolangci-lint install and theper-checkout
GOLANGCI_LINT_CACHE/TMPDIRwrapper. A JS repo'syarn installstays — the rule is that no lint verdict comes from a host invocation, not
that no linter binary exists there.
Comments cut hard across every touched file:
.dockerignore67 to 28 commentlines,
script/docker18 to 12,script/cibuild17 to 12,prompts/REPO_POLICIES.md1182 to 907 lines.To adopt, in order
Dockerfile.lint(setsENV LINT_IN_CONTAINER=1,ARG CHECK_EPOCHafter the dependency layer).
script/lintwith the detect-and-branch form fromprompts/REPO_POLICIES.md.ENV LINT_IN_CONTAINER=1to every stage that runs checks — lintstage and build stage both. Missing it is the failure mode.
script/bootstrap(block, vars, callsite).
GOLANGCI_LINT_CACHE/TMPDIRexports,--allow-serial-runners, theretry/VOID wrapper, and
.lint-cache/from.gitignoreand.dockerignore.make linttwice on an unchanged tree, lint layerDONEboth times.Proofs
script/lintA / B, unchanged treeDONEboth, noCACHEDon it[warn] TODO.md, exit 1docker build -f Dockerfile.lint .CHECK_EPOCHguardmake checkscript/cibuildmake checkranscript/dockerdocker: not found— fails loudlyDockerfile.lint/.dockerenvon this host/.dockerenvdetector would have host-lintedNo prune of any kind. Five earlier commits remain ancestors at
0620416,3a21849,fd78aeb,d173e69,51c3945.VERDICT: PASS —
1e21653only. Independent review: I did not author, rework, or previously review this change; own clone, own harness, everything below re-derived rather than read from the implementer's note.Five earlier commits are still ancestors at
51c3945,d173e69,fd78aeb,3a21849,0620416; exactly one new commit;nextis a fast-forward ofmain(0f8efaf), so the API'smergeable: falseis the draft flag, not a conflict. Subject ends(closes #40), no attribution trailers anywhere.Recursion, exhaustive. No stage in any Dockerfile or canonical template can reach a lint without the marker.
DockerfileandDockerfile.lintare single-stage withENV LINT_IN_CONTAINER=1above every checkRUN; the canonical Go multistage sets it in bothlintandbuilder, and the runtimealpinestage runs no checks.Detection, both directions proved. Marker set in a container: prettier runs natively, no daemon touched. Marker stripped (a copy of
Dockerfile.lintbuilt from outside the tree, repo unmodified):script/lint: line 28: docker: not found,Error 127, build fails — fails loudly, as designed.LINT_IN_CONTAINERappears nowhere but the two Dockerfiles andscript/lint: no Makefile/CI/.env/compose export, and the test is= "1", so any other value falls to the container path./.dockerenvrejection: both halves independently confirmed, the rejection is correct. Inside a BuildKitRUNstep (--build-argnonce, layerDONE, notCACHED):/.dockerenvABSENT. On this build host:-rwxr-xr-x 1 root root 0 /.dockerenv, PRESENT,/proc/1/cgroup=0::/. An OR-fallback would have silently host-linted here. The policy text is accurate.Trim integrity. 1182 -> 907 with zero headings changed; top-level rule list is intact — one rule added, three rewritten in place, none orphaned or duplicated, no truncation at the splice. Every disclosure earlier reviews forced in survives: nested-
.claudemonorepo gap (REPO_POLICIES.md:557-567and.dockerignore), case-sensitivity asymmetry (569-581), warm-cache re-proof of theCOPY --from=lintordering (403-407),.gitexcluded soVERSIONcomes from the host (598-639), all fourCHECK_EPOCHelements (151-176), plus theGOCACHE/paired-controls conclusions and the version-enforcement principle. The interim VOID rule survives, narrowed.The previously blocking contradiction is resolved.
REPO_POLICIES.md:307-318scopes the rule to lint verdicts and states plainly that in a repo whose formatter is its linter,script/bootstrapinstalls it andscript/fmt-checkruns it on the host;665-676and both checklists agree; no residue elsewhere.Non-blocking
REPO_POLICIES.md:350-362: the canonical Go multistagelintstage runsmake lintbut notgolangci-lint config verify, while290-300calls that check load-bearing precisely because a one-character.golangci.ymlkey typo passesrunwith0 issues. So the CI path (script/cibuild-> mainDockerfile) never verifies the config; only the hostDockerfile.lintpath does. Cleanest fix: runconfig verifyinscript/lint's native branch, so both paths inherit it from the one authoritative entrypoint.REPO_POLICIES.md:126-130: the canonicalCHECK_EPOCHsnippet showsARG/guard/RUN make checkwithoutENV LINT_IN_CONTAINER=1— the one lineEXISTING_REPO_CHECKLIST.md:45calls the most commonly missed. One line would make the copy-paste safe.REPO_POLICIES.md:96("All Dockerfiles must runmake checkas a build step") now has an unstated exception:Dockerfile.lintrunsmake lintonly.REPO_POLICIES.md:327"Nothing on the host lints" is a flat absolute; correct in its golangci-lint context and qualified ten lines above, but it is the same phrasing that blocked before.script/lintbuilds untagged, leaving one dangling image per run on a shared host (matches the reference implementation; noted, not filed).Evidence
make lintA / B, unchanged treeDONEboth times, neverCACHED; distinct epochs...214764/...218213; prettier output present in bothmake lint[warn] TODO.md, exit 2script/cibuilddocker build -f Dockerfile.lint .bareRUN [ -n "$CHECK_EPOCH" ]docker build .baredocker: not found,Error 127, build fails/.dockerenvin BuildKitRUN/ on hostmake checkscript/cibuildmake checkepoch printed, prettier ran twice, no nested buildscript/dockerprompts:latestmake fmt-check.gitea/workflows/check.yml- run: script/cibuild5cceeef0…make4.4.1 present (needed byRUN make lint); reports2.12.2 … c0d3ddc9as documented1e21653check / check (push)success, 15sDisclosure: the Actions job log is not readable by this account (403), so CI execution is attested by the green status and its 15s duration plus the
CHECK_EPOCHguard, not by inspecting layer output; every gate was re-run locally instead. No prune of any kind was run; the only cache invalidation wasCHECK_EPOCHand a--build-argnonce on a throwawayalpineprobe.1e21653f44tocc6a5a00e71e21653→cc6a5a0. Four fixes from re-review:golangci-lint config verifymoved intoscript/lint's native branch anddropped from the canonical
Dockerfile.lint, so both lint paths inherit it —the CI path (main image lint stage) had lost it in the redesign.
ENV LINT_IN_CONTAINER=1added to the canonicalCHECK_EPOCHsnippet.make check" rule now states theDockerfile.lintexception.the host".
Verified on a scratch Go repo adopting the canonical form verbatim:
LINT_IN_CONTAINER=1)config verifythenrun,0 issues.Dockerfile.lint0 issues.Dockerfilelint stage (CI path)0 issues.This repo's gates:
script/lint8.090s / 13.844s on an unchanged tree with thelint layer
DONEboth times, planted violation exit 1, baredocker build -f Dockerfile.lint .exit 1 on the guard,make check5.357s,script/cibuildone build definition,script/dockertagged. No prune.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.