Add a root Dockerfile.lint that runs `hugo --minify --printPathWarnings`
as a build step, so a successful build IS a clean lint, and reduce
script/lint to building that file. There is no host lint path and
deliberately no "am I already inside a container?" branch, which would
be a host lint path in disguise.
The containerisation boundary is lint only, per the owner ruling on the
issue: formatting is not a lint, so script/fmt and script/fmt-check stay
on the host, unchanged in version, scope and flags. That also removes
the forced duplication of prettier's settings between a script and a
Dockerfile, and with it the keep-in-sync notes that duplication needed.
Dockerfile.lint has exactly one stage on purpose. A whole-file
`docker build -f Dockerfile.lint .` builds only the file's last stage,
and sibling stages off a shared base carry no ordering edge, so a second
stage beside the lint would be silently skipped by exactly the
invocation the canonical org-wide script/lint uses -- a green that
linted nothing, which the per-stage CHECK_EPOCH guard cannot catch
because the stage that did run satisfies it. With one stage there is
nothing to skip and script/lint needs no --target. A comment in the file
says that any second check added here must be chained or carry an
explicit ordering edge, never left as a sibling.
Its first four instructions are byte-identical to the main Dockerfile's
and in the same order, so the expensive `RUN script/bootstrap` layer
that compiles the pinned Hugo from source is shared between the two
images rather than paid twice.
Resolve the recursion by direction, not detection. `make check` calls
script/lint, and script/lint is now a `docker build`, so `RUN make
check` in an image would attempt a docker build inside a build step
where there is no daemon. The main Dockerfile therefore runs the
individual non-lint checks -- script/test and script/fmt-check, as
separate RUN lines under the CHECK_EPOCH guard -- matching the canonical
shape, and only the lint is absent from it. script/cibuild runs
script/lint first, for fail-fast feedback: on a runner with no cached
bootstrap layer a lint failure should not wait behind a Hugo build from
source. CI coverage is therefore unchanged, and it runs the same scripts
a developer runs.
Caching is waived for the lint in the shape this repo already settled:
ARG CHECK_EPOCH with no default, guarded with
`[ -n "$CHECK_EPOCH" ] || exit 1`, and the value expanded into the
linted command as well as the guard, so invalidation never rests on
BuildKit's treatment of an unreferenced ARG. Every image-building
entrypoint generates and passes it -- script/cibuild, script/docker,
script/lint -- each as a whole assignment rather than inline, for the
`set -e` reason script/cibuild documents.
script/lint builds with `--output type=cacheonly`: the build is run for
its exit status, not for an image, and because the lint layer is
cache-busted on every invocation an exporting build leaves one dangling
image per lint run. On a host shared with other work that accumulates.
The build cache is unaffected, so script/bootstrap still hits, and
failures still propagate.
Two divergences from REPO_POLICIES.md, stated rather than buried:
- REPO_POLICIES.md:92, "all Dockerfiles must run `make check`". That
rule and "every lint run happens in Docker" cannot both hold once
`make check` contains the lint.
- REPO_POLICIES.md:102-168, which requires a separate lint stage whose
result the build stage depends on through
`COPY --from=lint /src/go.sum /dev/null`, on the stated grounds that
without the edge "the build stage would not wait for lint to finish
and a lint failure might not fail the overall build". No such edge
exists here: the lint is its own file and its own build, sequenced
by script/cibuild rather than by BuildKit. Both sections are
superseded upstream by 12e8db8 in sneak/prompts, which deletes the
Go multistage lint stage and its ordering trick for the same reason
-- that stage ran `make lint`, which is now a docker build.
Verified: two consecutive script/lint runs on an unchanged tree both
executed hugo for real, distinct epochs echoed, script/bootstrap CACHED,
second run 0.85s; a whole-file `docker build -f Dockerfile.lint .` with
the argument and no --target ran the lint for real; a bare build with no
argument failed closed on the guard; a planted template error failed the
lint with hugo's own render error and made script/cibuild exit non-zero
in 0.6s with the main image build never starting; a planted over-long
line failed the host script/fmt-check; both reverted and re-run clean;
`make check`, script/docker and script/cibuild all green with every
check layer observed executing rather than served from cache, and the
bootstrap layer CACHED in both images. The deploy path is byte-identical
to main: .gitea/, script/bootstrap, script/test and .dockerignore are
untouched.
22 KiB
Workflow
- branch (from
main) - do the work in Next Step
- move Next Step to the top of Completed Steps
- move the top item of Future Steps into Next Step
- commit (
TODO.mdchanges in the same commit as the work) - merge to
mainif the branch is not protected, otherwise open a PR - push
Status
pre-1.0
No git tags. The site is live and now has the scripts-to-rule-them-all scaffold
(Makefile, script/, Dockerfile, check.yml), the canonical policy
dotfiles and LICENSE, so the mandated minimum file list is complete. Every
external reference in the repo is now pinned by cryptographic hash (or, for the
wrangler CLI install, an exact version), and the Hugo that builds the published
site is a deliberate pinned version rather than whatever the base image's
package repo serves. The site now ships a Cloudflare Pages _headers file, so
its response security headers are declared in the repo instead of being whatever
the edge defaults to — unverified in production until the next deploy. The lint
now runs inside a container and nowhere else: script/lint is a build of
Dockerfile.lint, with no host path to fall back to. Formatting is not a lint
and stays on the host.
Next Step
Add the missing cibuild and precommit shims to the Makefile, so that every
documented entrypoint has a make target and the documented "always use make
targets" rule is actually satisfiable
(#34). Done when make cibuild and
make precommit exist, are declared .PHONY, and the README Entrypoints
section matches.
Completed Steps
- 2026-08-10: moved the lint into Docker
(#38). A new root
Dockerfile.lintrunshugo --minify --printPathWarningsas a build step, so a successful build is a clean lint, andscript/lintis nothing but a build of that file — no host path and deliberately no "already inside a container?" branch, which would be a host lint path in disguise. The containerisation boundary is lint only, per the owner ruling of the same day: formatting is not a lint, soscript/fmtandscript/fmt-checkstay on the host.Dockerfile.linthas exactly one stage on purpose. A whole-filedocker build -f Dockerfile.lint .builds only the file's last stage, and sibling stages off a shared base have no ordering edge, so any second stage beside the lint would be silently skipped by the invocation the canonical org-widescript/lintuses — a green that linted nothing. With one stage there is nothing to skip andscript/lintneeds no--target. Its first four instructions are byte-identical to the mainDockerfile's, so the expensiveRUN script/bootstraplayer that compiles Hugo from source is shared between the two images rather than paid twice. The recursion this creates was resolved by direction, not detection:make checkcallsscript/lint, so the mainDockerfilecan no longerRUN make check— that would attempt a docker build inside a build step, in a bare Alpine with no docker client and no daemon socket. It runs the individual non-lint checks instead,script/testandscript/fmt-check, matching the canonical shape upstream, andscript/cibuildrunsscript/lintfirst for fail-fast feedback before the main image build starts. So CI still covers all three checks and cannot drift from what a developer runs. Caching is waived for the lint exactly as the mainDockerfilealready does it:ARG CHECK_EPOCHwith no default, guarded with[ -n "$CHECK_EPOCH" ] || exit 1, and the value expanded into the linted command as well as the guard, so invalidation never rests on BuildKit's handling of an unreferencedARG. Every image-building entrypoint generates and passes it —script/cibuild,script/docker,script/lint— which is the failure mode this repo already hit once, a Dockerfile guard asserting a property one entrypoint did not supply.script/lintbuilds with--output type=cacheonly: the build is run for its exit status, not for an image, and since the lint layer is cache-busted every run an exporting build would leave one dangling image per lint on a host shared with other work. Verified rather than assumed: two consecutivescript/lintruns on an unchanged tree both executed hugo for real (second run 0.85s wall,RUN script/bootstrapCACHED, distinct epochs echoed, real build tables printed); a whole-filedocker build -f Dockerfile.lint .with the argument and no--targetran the lint for real, which is the regression test for the skipped-sibling hazard; a bare build with no argument failed closed on the guard; a planted template error failed the lint with hugo's own render error and madescript/cibuildexit in 0.6s without the main image build starting at all; a planted over-long line failed the hostscript/fmt-checkwith[warn] README.md; both violations were reverted and re-run clean. Not changed here, and still true: the lint fails on hugo build errors but not on render-target collisions, which--printPathWarningsonly prints (#25) — containerising the run neither fixes nor worsens that - 2026-08-10: added the
LICENSEfile and made the README say what it says (closes #10). The repo is public (private: falseon the Gitea API, verified rather than assumed), so the owner's standing policy — MIT on any public repo lacking a license — applies.LICENSEis byte-identical to the canonicalsneak/homoiconcopy, confirmed by git blob hash rather than by eye (3274443), and its body is word-for-word the SPDX MIT text with only the line wrapping differing. The README's "Content is provided as-is for community use." — which granted nothing and matched no committed file — is replaced byMIT. See [LICENSE](LICENSE).plus an explicit statement that the licence covers the content incontent/as well as the code, since this repo carries both and MIT names only "the Software". The Description first line now carries the licence, whichREPO_POLICIES.mdrequires and which was the one field it was missing. Nothing published contradicts the choice: the builtpublic/tree carries no copyright, all-rights-reserved or terms-of-use string anywhere, inindex.html,css/style.css,index.xmlorsitemap.xml— the footerbaseof.htmlrenders names@sneakand links the repo but asserts no reservation of rights, and the content is factual mesh channel data with no licence claim of its own. The fmt gate cannot reachLICENSEand needed no.prettierignoreentry:script/fmtpasses prettier the explicit globs'**/*.md'and'**/*.css', and an extensionless root file matches neither. Measured, not assumed — ascript/fmtrun leaves the file's hash unchanged, and a counterfactualLICENSE.mdcopy was reflowed by the same run, which is the direct evidence that it is the extension and not an ignore rule doing the excluding. Deliberately not done, per the issue: per-file licence headers and SPDX identifiers, which no org standard mandates - 2026-08-09: added
static/_headersso Cloudflare Pages serves baseline response security headers (closes #14). Hugo copiesstatic/verbatim intopublic/, which is the deploy root Pages reads the file from; this is the first root-levelstatic/in the repo, and the built tree confirms it unions with the theme's rather than shadowing it —public/css/style.cssandpublic/index.htmlare byte-identical to the previous build and the static file count goes 1 to 2. The live "before" was measured, not assumed: Cloudflare already sendsX-Content-Type-OptionsandReferrer-Policyby default, so the substance here isStrict-Transport-Security,Content-Security-Policy,X-Frame-OptionsandPermissions-Policy. The CSP isdefault-src 'none'withstyle-src 'unsafe-inline', which the built page supports exactly: it has no script, img, link, iframe, form or media element and nostyle=/on*=attribute, only the one inline<style>blockbaseof.htmlfills byreadFile. Verified in a headless Chrome against a local server that parses the committed_headersand applies it as real response headers: zero CSP violations, the inlined stylesheet parses to 17 rules and the computed body padding, tagline colour and link colour all come from the theme CSS, framing the page from another origin is refused byframe-ancestors 'none'(consistent withX-Frame-Options: DENY), and all five named outbound links still navigate with status 200. HSTS carries neitherpreloadnorincludeSubDomains:www.lora.vegasis the only other name in DNS and it is served by this same Pages project, so this file sets HSTS on its responses directly, andincludeSubDomainswould instead bind every future subdomain for a year with no way to walk it back inside the max-age window without also dropping the apex protection. - 2026-08-09: restructured
README.mdinto the canonical section set (closes #11): a Description first line, then Getting Started, Entrypoints, Rationale, Design, TODO, License, Author. The non-standard About / Contributing / Technical Details headings are gone, but nothing they held was dropped — the bullet list of what the site publishes moved under the Description, the contribute contact and the local-preview instructions moved into Getting Started. Getting Started was written against the currentMakefilerather than the old prose: there is nomake buildtarget, so the former "Build:hugo" instruction is nowmake test, and the former "Local Development:hugo server" ismake setupthenmake serve. Two stale claims fixed: the site is deployed by Gitea Actions to Cloudflare Pages, not "GitHub Actions", and the Entrypoints bullet forscript/fmtstill described the top-level-markdown-only scope that #12 replaced with'**/*.md'and'**/*.css'. The License section body is deliberately untouched — it is owned by #10, which is blocked on the owner's choice of license, and the Description sentence is likewise missing the license clause the policy calls for until #10 lands. Design section claims were verified against the tree, not assumed - 2026-08-09: widened the prettier gate from top-level markdown to
'**/*.md'and'**/*.css'(closes #12).themes/loravega/static/css/style.csswas never formatted or gated even though it is inlined into every page; it is now both, and the reformat landed as its own commit ahead of the script change so no commit in the branch is red.content/is excluded in.prettierignore, and that exclusion is measured rather than assumed: withcontent/in scope, prettier re-wrapped one list item incontent/_index.mdand the renderedpublic/index.htmlchanged with it (the wrap became a literal newline between7 PM atand the following<a>). HTML collapses that newline to a space so the page looks identical, but the published bytes are not, and this content carries raw HTML that goldmark passes through verbatim underunsafe = true.themes/loravega/layouts/is excluded too, with the reason recorded: those files are Go templates, not HTML, and prettier has no parser for{{ ... }}— covering them would need a plugin and therefore apackage.json. Verified by extractingpublic/from the built image before and after: with the final scope,index.html,index.xmlandsitemap.xmlare byte-identical and only the verbatim-copiedpublic/css/style.csschanges, in whitespace only — the minified<style>block inlined intoindex.htmlis unchanged, which is the direct evidence that CSS formatting cannot reach the rendered page - 2026-08-09: added the canonical policy dotfiles and hardened both ignore files
(closes #8).
REPO_POLICIES.mdis a byte-identical copy of the canonicalpromptsfile, front matter intact;.editorconfig,.prettierrcand.prettierignoreare the canonical contents..gitignorekeeps its three Hugo lines and gains the OS/editor/node/secrets block plus.claude/, so a clean checkout with agent tooling present isgit status-clean and a stray key or.envcan no longer be committed..dockerignoregained the same coverage but not the same syntax: it matches with Go'sfilepath.Matchrules extended with**, where*does not cross/and an unprefixed pattern is anchored at the context root, so every depth-independent pattern carries an explicit**/prefix and only the genuinely root-anchored entries (.git,public,resources,.hugo_build.lock) go bare. Verified by planting.env,*.key,*.pemandnode_modulestwo directories deep: the unprefixed form shipped all of them into the image and the**/form ships none. Excluding.claude/also takesworktrees/— entire additional checkouts of this repo — out of the build context; #23's two-consecutive-run proof was re-run against the smaller context, since that issue was validated against the old one. Note the canonical upstreamREPO_POLICIES.mdis not clean under this repo's prettier settings, so the reformat is a separate follow-up commit rather than churn mixed into this one - 2026-08-09: stopped
script/cibuildreporting a green it never earned (closes #23).COPY . .is keyed on content, so on an unchanged tree Docker servedRUN make checkfrom cache: the checks never executed and the build still exited 0. Three separate reviewers had already been fooled by it here. TheDockerfilenow declaresARG CHECK_EPOCHbelowCOPY . .with no default (a default is a constant, and a constant is a stable cache key), guards it withRUN [ -n "$CHECK_EPOCH" ] || exit 1, and expands it into the check command;script/cibuildandscript/dockerboth passepoch="$(date +%s%N)$$"— assigned on its own line, because a failing command substitution inside an argument does not tripset -e, and with$$because busyboxdatedrops%Nsilently. This is the canonical shape settled upstream inprompts#26, which has not merged there yet, so it may need re-syncing. Verified with two consecutive runs on an unchanged tree that both executed the checks whileRUN script/bootstrapstayedCACHED, a constant-epoch counterfactual that restored the false green, and a planted prettier failure that failed the build - 2026-08-09: disabled the unused
taxonomyandtermpage kinds inhugo.toml(closes #13). Hugo enables thetagsandcategoriestaxonomies by default; this single-page site has no taxonomy terms and no taxonomy templates, so every build emittedWARN found no layout file for "html" for kind "taxonomy"and generatedcategories/index.xmlandtags/index.xmlthat nothing links to. Re-verified the warning still occurs on the now-pinned hugo v0.164.0 rather than trusting the issue's text, which predates the version move.make testandmake lintare nowWARN-free, so the build's noise floor is zero and the next warning will be visible.public/is otherwise byte-identical —index.html,css/style.cssand the RSSindex.xmlall unchanged — andsitemap.xmlis still generated, now listing only the home page instead of two taxonomy URLs - 2026-08-09: replaced
hugo.toml's deprecatedlanguageCodekey withlocale(closes #18). Hugo deprecatedlanguageCodein v0.158.0, so the Hugo pinned in the preceding commit warns about it; left alone it would become a third routinely-ignored warning, and a latent breakage when the key is removed. Deliberately sequenced after the Hugo version move and in the same branch: under the apk hugo 0.139.0 that CI ran until now,localeis an unknown key that is silently ignored, which downgrades the generated RSS from<language>en-us</language>to<language>en</language>with no warning and exit 0. Verified on hugo v0.164.0 that the RSS<language>still readsen-us, thelangattribute is unchanged, andpublic/is byte-identical to the preceding commit's output - 2026-08-09: installed Hugo at a deliberate, hash-verified version instead of
taking whatever alpine ships (closes #26).
script/bootstrapno longer doespkg_install hugo; it installsgithub.com/gohugoio/hugo@v0.164.0withgo install, which verifies the module againstsum.golang.org. The version is a commented constant, as is the Go toolchain (go1.26.5) — hugo v0.164.0 requires go >= 1.26.0 and alpine 3.21 ships go 1.23.9 withGOTOOLCHAIN=local, so a barego installrefuses to run.CGO_ENABLED=0is deliberate: standard Hugo, not extended, because this site has no SCSS, noresources.ToCSS, no PostCSS and no image processing. This moves the build off apk's hugo 0.139.0, about two years behind, onto the current stable. Rendered output across the wholepublic/tree is unchanged except themeta name=generatorversion string - 2026-08-09: made
script/checkrunscript/lint(closes #9). It previously ran onlyfmt-checkthentest, soscript/lintexecuted nowhere — not inmake check, not in the pre-commit hook, and not in CI, even though theDockerfilerunsmake checkandscript/cibuildbuilds it. It now runstest,lint,fmt-checkin the canonical order, so thehugo --printPathWarningsrender-target-collision signal is no longer discarded.README.md's Entrypoints line was corrected to match - 2026-08-09: hash-pinned every external reference in
.gitea/workflows/deploy.yml(closes #7): both job container images are pinned by digest, all threeuses:are pinned by 40-hex commit SHA, and the wrangler install is pinned to an exact version. The abandonedklakegg/hugo:ext-alpineimage is gone: the build job now runs on the same pinnedalpinedigest theDockerfileuses, with a pre-checkoutapk add nodejs git tarstep (the Actions runner needsnodeinside the job container to execute JavaScript actions), an explicitshell: shdefault, thenscript/bootstrapandscript/test. Thedeployjob is guarded withif: github.ref_name == 'main'so it can never publish from a branch. Also dropped the deadfeat/initial-sitepush trigger and reindented the file to 4-space YAML to matchcheck.yml. This is the second attempt; the first broke the deploy and was reverted, so this one was verified by temporarily triggering the workflow on the PR branch and iterating until thebuildjob ran green for real - 2026-07-25: added the scripts-to-rule-them-all scaffold (closes #4):
script/entrypoints,Makefileshims, a HugoDockerfile(sha256-pinned alpine) plus.dockerignorethat runsmake check,.gitea/workflows/check.ymlrunningscript/cibuild, and a README Entrypoints section.test/lintare a cleanhugo --minifybuild;fmt/fmt-checkrun prettier over the repo's own top-level markdown only - 2026-02-10: design pass: minimal light theme with inline CSS, grey wells for mesh channels and signal groups, horizontal overflow fix, body width tuning, map link update
- 2026-02-10: added README and footer contribute link
- 2026-02-10: added Gitea workflow that builds the site and deploys to Cloudflare Pages
- 2026-02-08: initial Hugo static site for lora.vegas
Future Steps
Startable work first. Everything under "Blocked" waits on somebody or something outside this repo, so nothing there may be picked up as the Next Step.
- Make the prettier scope's exclusion of dot-directories explicit instead of
leaning on
.gitignore(#33) - Fix the README's SSH-only clone URL, and add the two entrypoints the
Entrypoints section omits,
script/precommitandscript/projectname(#36) - Drop the Go toolchain and module cache from the check image's final layer; they are needed to build hugo and dead weight afterwards (#28)
- Add a timeout guard to
script/testandscript/lintso a wedged build fails instead of hanging (#16) - Sync the reformat of
REPO_POLICIES.mdback upstream topromptsso the canonical copy is clean under the shared prettier settings and future syncs are a straight byte copy - Keep mesh channel and signal group listings current
Blocked
- Decide whether
script/lintshould fail on render-target collisions rather than only print them;--printPathWarningsexits 0 today, so the signal is reported and not enforced. Owner call, since it changes what the gate rejects (#25) - Move the artifact actions in
.gitea/workflows/deploy.ymlto v4 once this Gitea Actions instance serves the v4 artifact protocol; they are pinned on the deprecated v3 line because v4 fails here (#20). This touches the live deploy path, so it needs a real workflow run to verify rather than a local check - Move the deploy container to a pinned node 22 so the wrangler pin can advance past 4.86.0 (#21)
- Delete the stale remote branches
feat/initial-siteandsecurity-audit; only the owner can remove them (#15) - After the next deploy, confirm the
_headersfile actually took effect, on bothhttps://lora.vegas/andhttps://www.lora.vegas/:curl -sSIagainst each must showstrict-transport-securityorcontent-security-policy. Cloudflare Pages silently ignores a malformed_headers, and checkingx-content-type-optionswould pass either way because the edge sends it regardless.wwwhas to be checked too and not just the apex: droppingincludeSubDomainsrests onwww.lora.vegasbeing served by this same Pages project, which was established behaviourally from identical response bodies rather than from the Cloudflare dashboard. Ifwwwturns out not to be covered, theincludeSubDomainsdecision has to be revisited (#14) - Decide the HSTS
includeSubDomainsandpreloadposture forlora.vegas. Both are owner calls: neither can be walked back inside the max-age window, andincludeSubDomainsbinds hostnames this repo does not control (#14) - Verify the Cloudflare Pages deploy still works after the workflow changes