Skip to content

test(site): check the download page's release fields (#229) - #252

Merged
juancguerrerodev merged 12 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/site-release-229
Dec 6, 2026
Merged

juancguerrerodev merged 12 commits into
DojoCodingLabs:mainfrom
saurabhbhoir456:test/site-release-229

Conversation

@saurabhbhoir456

@saurabhbhoir456 saurabhbhoir456 commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #229

The site's download page shows the latest preview APK from apps/site/lib/release.ts: its file name, link, SHA-256 and
the signing certificate's SHA-256, copied by hand for every release (CONTRIBUTING.md, For maintainers). The only check
was a regular expression in check-site.mjs refusing an empty field, after a full build. A SHA-256 one character short,
or a link to another tag's APK, would ship, and people check the APK against that hash.

What this PR does

  • Adds apps/site/test/release.test.ts (Vitest, like the other files in apps/site/test), importing RELEASE from
    ../lib/release.ts and REPO_URL from ../lib/site-config.mjs. release.ts is unchanged, and the regular
    expression in check-site.mjs is left as it is.
  • The checks live in a small pure function in the test file, releaseProblems(release, headingAnchors), returning a
    list of problems that say what is wrong. When published is false it returns no problems and checks nothing else.
    When true: sha256 and certSha256 are each 64 lowercase hex characters; file looks like
    hermit-<version>.apk; url starts with ${REPO_URL}/releases/download/ and ends with /${file}; the tag in
    url is v followed by the same version as in file; and recipeUrl points at the same tag with an #anchor
    that matches a heading in docs/devices.md (read locally and slugged as GitHub slugs headings).

Tests

  • Today's published RELEASE has no problems.
  • An unpublished placeholder release gives no problems.
  • Made-up releases: a good one gives no problems; a short hash, an upper case hash (either field), a link to another
    tag, a file name that does not match, a recipe link to another tag, and a recipe anchor with no heading each give
    exactly one problem naming the field at fault. Made-up hashes are 64 copies of one letter, as agreed there.

No network: the test never downloads the APK or opens a link.

How to check

pnpm --filter @hermit/site test
pnpm --filter @hermit/site test test/release.test.ts
pnpm --filter @hermit/site typecheck

Verified here: the new file passes 8/8 against today's release.ts. The full site suite in this Windows checkout also
shows the pre-existing badges.test.ts hash failure (reproduced on the clean tree earlier; a line-ending artifact of
this checkout), untouched by this change.


Pull request template

What and why

Closes #229.

Adds checks for the download page's release fields: hashes, file name, tag agreement and the recipe anchor.

Vision fit

Principle 4, honest about limits: the hashes people check the APK against are verified by test, published or not.

Non-negotiables

  • This keeps every non-negotiable in AGENTS.md as it is.
  • Or it changes one, and this is the accepted RFC: n/a

Checklist

  • It closes one issue, linked above, or it's a small fix (a typo, a broken link, a wrong comment). A feature has an accepted proposal.
  • I wrote the failing test first. It fails without this change and passes with it. Tests were added for the existing release fields; a broken expectation was checked to fail during development.
  • These pass: pnpm check:privacy, pnpm typecheck, pnpm lint, pnpm test and node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. Gate note: privacy and guard pass on this checkout today; the rest was run per package as listed under AI agents, not as one root gate on this Windows machine, where unrelated pre-existing failures appear in the site badges, the devices table and mobile source scans.
  • No new network call, telemetry, analytics, ads or crash reporting. (A new request in an app adapter is explained below, with its host, skill and risk.)
  • No new dependency, or the reason for each one is below.
  • Every UI string is in packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes.
  • Tests, fixtures and screenshots use made-up data only.

Model path

  • This doesn't touch the model path: packages/model, agent, skills or eval, the prompt, the router, tool descriptions, normalizers, examples or the model file.
  • It does. The eval numbers from before and after are below, run as docs/evals.md says. No held-out case was tuned on.

Screenshots

  • No UI change.
  • UI change. Each changed screen is below, in both themes and both languages, with made-up data.

New dependencies and network calls

None. No new dependency and no new network call.

AI agents

  • No AI agent wrote any part of this.
  • An AI agent helped. Which one, and what it did: Tinsel Alpha, an AI coding agent running in OpenCode, drafted the change and this description and ran the checks below, in a session directed by the author, who reviewed each step's report before it was pushed.
  • I read and ran everything in this pull request, and I can explain it.

What was run: pnpm --filter @hermit/site exec vitest run test/release.test.ts (8/8), including after removing the published assertion per review; site typecheck; eslint.

@juancguerrerodev

Copy link
Copy Markdown
Contributor

One fix before this can merge: release.test.ts:81 asserts the release is published, but the issue's item 3 asks the check to hold either way. And the template, as on #234. 🦀

@saurabhbhoir456

Copy link
Copy Markdown
Contributor Author

Fixed: the published assertion is gone, so the check on today's RELEASE holds either way (the unpublished-placeholder case was already covered). The pull request template is filled in too.

@juancguerrerodev
juancguerrerodev merged commit 43c04fb into DojoCodingLabs:main Dec 6, 2026
4 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.

Site: test the download page's release fields

3 participants