Skip to content

fix(site): the demo generator puts the apply link in literally and reads files only; the README says the sample's dates are those of the last deploy; the Docker claim guard matches more phrasings - #897

Merged
pbertsch merged 3 commits into
mainfrom
fix/demo-generator-nits
Nov 18, 2026
Merged

pbertsch merged 3 commits into
mainfrom
fix/demo-generator-nits

Conversation

@pbertsch

@pbertsch pbertsch commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Three nits from the review of the sample dashboard change (#891), and the nits from the review of the Docker claim guard (#896), folded in because both are small and in scripts/.

  • A URL in the apply link can no longer be read as a replacement pattern. build-demo.mjs put the design-partner URL into the pages with replaceAll(placeholder, applyForm), where a string replacement reads $&, $1, $$, $` and $'. The URL comes from sellable.json and holds none today; it now goes in through a function (() => applyForm), which is literal. Test: TestDemoGeneratorKeepsDollarSignsInTheApplyLink renders a template with a URL that holds all five and requires the output to be the URL unchanged (the URL is passed through the environment: the first version of my test put it in a JavaScript template literal, and the backtick in it made the test itself fail to run).

  • A folder under demo-templates/ whose name ends in .html is not a page. The generator now reads files only (withFileTypes, isFile()), and has a --templates <dir> option (default demo-templates) so this can be tested: TestDemoGeneratorReadsFilesOnlyFromTheTemplates generates from a temporary folder holding a file and a folder named folder.html and requires exactly one output page, with its dates moved. The links test (TestDemoPagesResolveFromTheirTemplates) has the same folder case for /demo/folder.html, which pins the !st.IsDir() check.

  • The dates are those of the last deploy, and the docs say so. website/README.md has a "The sample dashboard" section: how the pages are generated, that the dates move to the build day (UTC), that they stay as they are until the site is built again, so the sample ages between deploys, and that a scheduled rebuild would keep it fresh and is not set up. The pages already say that the dates move with each build.

  • The Docker claim guard matches more phrasings and says what it misses (scripts/site_docker_claim_test.go): "Docker image(s)", "container image(s)" and now "OCI image(s)", with a space, a hyphen, a line break, &nbsp; or &#160; between the words; docker pull; "Docker Hub"; and ghcr.io/. The header says what it still does not catch: a phrase split by markup (<b>Docker</b> image), other HTML entities, other languages and other wordings ("pull the image from GHCR"). Before changing it I checked that the wider pattern matches nothing in the scanned places today. The reviewer's other points: the skips of docs/prd and docs/evidence and the two sanity floors (at least 30 files read, at least 5 workflow files found) were not pinned by any test; the temporary-tree test now plants a claim in both folders, which must not be reported, and the floors are a function with a table test. A typo in a comment ("an ghcr.io") is fixed.

No CHANGELOG bullet: nothing here is visible to a user of the CLI, the agent or the site's content (the generator output is identical for the real URL); it is a robustness change, a test and a README section.

Checked

  • Four mutants for the generator, then nine for the guard (the prd and evidence skips, each floor, and each part of the wider pattern: oci, &nbsp;, the hyphen, docker pull, docker hub), each file restored from a cp backup, each killed by the test meant for it (the nine: TestDockerClaimsUnderReadsEveryRoot, TestDockerGuardFloors, TestDockerImageClaimPattern). The four generator mutants: the string replacement back (the dollar-sign test), folders read as pages and --templates ignored (the files-only test), the IsDir check dropped (the links test).
  • All tests of scripts/ pass (the gate below); no new ignored or generated file is involved.
  • make ci-local and the disclosure scan: see the head.

Not checked / limits

  • A scheduled rebuild (so the dates do not age) was not built; it changes the deploy workflow and is a separate decision.

Test plan

  • go test ./scripts/, mutants above
  • make ci-local, disclosure scan clean
  • Review

…ads files only; the README says the sample's dates are those of the last deploy
@pbertsch
pbertsch requested a review from a team as a code owner November 18, 2026 18:09
…ntity-spaced phrases, docker pull and Docker Hub, says what it misses, and pins its skips and floors
@pbertsch pbertsch changed the title fix(site): the demo generator puts the apply link in literally and reads files only; the README says the sample's dates are those of the last deploy fix(site): the demo generator puts the apply link in literally and reads files only; the README says the sample's dates are those of the last deploy; the Docker claim guard matches more phrasings Nov 18, 2026
@pbertsch
pbertsch merged commit 15fba79 into main Nov 18, 2026
11 checks passed
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