Repository navigation
Description
Summary
CI (.github/workflows/ci.yml) gates lint + typecheck + test:run + build + ladle:build — but the release-readiness review found three blind spots that let real regressions accumulate silently, plus one EOL runtime:
- No dependency-vulnerability scan.
pnpm audit --prodcurrently reports 64 vulnerabilities — 1 critical ([email protected] prototype pollution), 23 high ([email protected] ×7, [email protected] ×15 among them). This accumulated with every gate green, because nothing in CI ever ran an audit (.claude/reports/RELEASE_READINESS.md§3.6, §4, ship-blocker chore(claude): add Claude Code config + harmonize lint/format/typecheck #3). - No bundle-size budget. The eager payload grew to 477 KiB gzipped (entry + all modulepreloads in
dist/index.html), ~3–5× a reasonable third-party-embed budget, unnoticed — andembed.jsemits zero modulepreload hints, so the embed's true graph is invisible to any check that only looks atindex.html(§1.1, §1.6 item 6). - The smoke lane never exercises the embed, and can silently no-op. Both existing specs (
tests/smoke/root.smoke.test.ts,tests/smoke/spa-fallback.smoke.test.ts) fetch the standalone page only (assertingid="syatlas"and the<title>);embed.jsand<sahaj-atlas>— the actual product a host installs — are never smoke-tested. And the smoke job skips silently: the run step is gatedif: ${{ steps.preview.outputs.preview_url != '' }}and the specs usetest.skipIf(skipWithoutPreview)(tests/smoke/_helpers/preview.ts), so a green "Smoke" check can mean "nothing ran" (§4; Appendix D "Smoke lane" row).
Separately, the two Accent translation workflows run an EOL runtime: actions/checkout@v3 + actions/setup-node@v3 + node-version: 16 (.github/workflows/sync-accent.yml:21-24, .github/workflows/push-accent.yml:12-15; Appendix D).
Proposed changes
- Audit gate. Add a dependency-vulnerability scan — e.g.
pnpm audit --prod --audit-level highas a CI step, or a scheduled reporting workflow. The implementer weighs the tradeoff and writes it down in the workflow file: a hard PR gate flakes when a new upstream advisory lands mid-PR; a scheduled report can't block a regression. Sequencing note: the audit is red today — a hard gate can only land green after the sibling dependency-update ticket resolves the current findings (or with an explicit baseline/allowlist). Either way, the end state is: a new high/critical advisory becomes visible, never silent. - Size-budget check. A script (new file under
scripts/) that measures the eager payload from a production build, matching how the readiness report measured: (a) the entry + everymodulepreloadchunk referenced bydist/index.html, gzipped; and (b)embed.js+ its static import graph, gzipped (it has no modulepreloads to enumerate — walk its imports). Fail CI when over a committed budget, set with headroom above the current ~477 KiB so this ticket doesn't block on the separate perf work — the budget's job is to catch unnoticed growth, and it gets ratcheted down as the lazy-loading ticket lands. - Embed smoke spec. A new
tests/smoke/embed.smoke.test.tsthat fetches/embed.jsfrom the preview and asserts: HTTP 200, non-empty body, and the body containscustomElements.define(the widget registration —src/Widget.tsx). Fetch-level is the floor (the smoke lane is fetch-based by design — see.claude/rules/tests.md); a browser-level boot of<sahaj-atlas>is a stretch goal, noted but not required (the repo's Playwright MCP covers local verification, not CI). - Loud smoke skip. When no preview URL is discovered, the smoke job must not read as a plain green pass: emit a workflow annotation (
::warning::) + a$GITHUB_STEP_SUMMARYline at minimum, and consider failing outright when the PR is same-repo (secrets present, so a missing preview means the Cloudflare deploy itself failed). The invariant: a green Smoke check implies the specs actually ran. Keep the graceful skip for forked PRs and local runs. - Accent workflow runtime bump.
actions/checkout@v3→v4,actions/setup-node@v3→v4,node-version: 16→22insync-accent.yml+push-accent.yml— and nothing else. CLAUDE.md says to leave the accent workflows alone unless the task is about them; this task is exactly (and only) their runtime, so the diff is version lines only, no logic changes. - Stretch (optional): an automated axe-core a11y pass over the Ladle stories (§5 / Appendix C note "No axe/automated a11y in CI or Ladle"). Skip if it balloons the ticket.
Acceptance criteria
- A dependency-vulnerability scan exists (CI step or scheduled workflow); a new high/critical advisory produces a failed check, a neutral-but-visible outcome, or a report — never a silent green. The chosen hard-gate vs. scheduled tradeoff is documented in a comment in the workflow file.
- A size-budget check runs in CI against the production build and fails over budget; it measures both (a)
dist/index.htmlentry + all modulepreload chunks and (b) theembed.jsstatic import graph — each gzipped; the budget value(s) are committed in-repo with headroom above the current eager payload. - A smoke spec fetches
/embed.js: asserts 200, non-empty, containscustomElements.define; guarded withtest.skipIf(skipWithoutPreview)like its siblings. - The smoke job's no-preview path is loud: an annotation and/or step-summary entry (or a failure on same-repo PRs) — a green Smoke check now implies specs ran.
-
sync-accent.yml+push-accent.ymlrun checkout@v4 / setup-node@v4 / Node 22; the diff touches only those version lines. - Local behavior preserved:
pnpm test:smokewithoutPREVIEW_URLstill skips gracefully;pnpm lint && pnpm typecheck && pnpm test:runpass. - (Stretch, optional) axe-core pass over Ladle stories wired into CI.
- Write an implementation report to
.claude/reports/<issue-number>-<short-slug>.md— in the MAIN checkout at /Users/devindra/Documents/Projects/SahajAtlasWeb even when implementing from a worktree (the folder is gitignored) — covering what changed, what was deliberately NOT changed, and which readiness-report findings are resolved.
Files affected
.github/workflows/ci.yml— audit step (if gated), size-budget step, loud smoke skip.github/workflows/audit.yml(new, only if the scheduled-report route is chosen).github/workflows/sync-accent.yml,.github/workflows/push-accent.yml— runtime versions onlytests/smoke/embed.smoke.test.ts(new);tests/smoke/_helpers/preview.tsif a helper is neededscripts/check-bundle-size.mjs(new; name at implementer's discretion) + committed budget value(s)package.json— additive script entries only
Parallel implementation: this ticket OWNS the files listed above (.github/workflows/*, tests/smoke/*, new scripts/ files for the size check); sibling release-hardening tickets run concurrently — avoid edits outside owned files except strictly additive ones (e.g. a new package.json script). In particular, the current audit findings themselves belong to the dependency-update sibling; this ticket only builds the gate, and must coordinate its landing order with that fix if hard-gating.
References
.claude/reports/RELEASE_READINESS.md§1.1, §1.6 (item 6), §3.6, §4, Appendix D (local, gitignored — main checkout only).github/workflows/ci.yml— smoke job gated onif: ${{ steps.preview.outputs.preview_url != '' }}tests/smoke/_helpers/preview.ts—skipWithoutPreviewvite.config.ts— the widget entry emitsembed.js(entryFileNames).claude/rules/tests.md— the two-lane test contract (smoke lane is fetch-based)- Prior art for measuring the eager payload: entry + every modulepreload in
dist/index.html, gzipped, measured both ways around a change
Metadata
Metadata
Assignees
Labels
Type
Fields
Hold Until
Activity
ci(accent): remove the dead translation-sync workflows
fix(build): find the preview URL on the check run, not just a comment (…
chore(build): make preview discovery survive a slow cloudflare deploy (…
chore(claude): finish the accent removal and stale-doc sweep (#133)
docs(claude): move task-only guidance out of the always-loaded root g…
docs(claude): move task-only guidance out of the always-loaded root g…