webui: add CI dist-freshness gate for committed frontend build (#80) - #98
Merged
IceRhymers merged 1 commit intoJul 24, 2026
Conversation
Add a `webui-verify-dist` Makefile target that rebuilds the frontend and fails if the committed dist/ diverges from src/, wired into CI's webui job. Uses `git status --porcelain` (not `git diff --exit-code`) so untracked new hashed chunks are caught, not just modified/deleted files. Updates the three docs that claimed no such check existed. Refs #80
IceRhymers
merged commit Jul 24, 2026
9c4f679
into
integration/search-hardening-and-ci-integrity
4 checks passed
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a CI gate that fails whenever the committed
webui/frontend/dist/is stale relative to frontend source/config, with zero change to the no-Node deploy model.make webui-verify-disttarget: rebuilds the frontend (npm ci && npm run build), then checksgit status --porcelain -- webui/frontend/dist. Fails with a diagnostic (status + diff --stat) if non-empty.webuijob of.github/workflows/ci.yml, run after "Frontend tests" at repo root.webui/AGENTS.md:29,webui/frontend/AGENTS.md:28,webui/frontend/README.md:22.make webui-verify-distline to the root README dev-commands section.Deliberate deviation from the issue's literal
git diff --exit-code: usesgit status --porcelain -- <path>instead, because.gitignorere-includeswebui/frontend/dist/(!webui/frontend/dist/) and vite emits content-hashed filenames — a source change typically produces a new untracked chunk alongside a deleted old one.git diff --exit-codeonly catches modified/deleted tracked files and misses the untracked new chunk;git status --porcelaincatches all three cases. Empirically confirmed in this PR's negative self-test (see below).Out of scope (per plan): no
enginespinning inpackage.json, no Node in deploy, no changes towebui/main.py, no pre-commit hooks.Refs #80
Test plan
make lint— green (ruff check, ruff format --check, mypy incl. webui) afteruv sync --all-groups --all-extrasmake test— green: 1057 passed, 237 deselectedmake webui-test— green: 12 test files, 207 tests passedmake webui-verify-diston the clean branch → exit 0,git status --porcelain -- webui/frontend/distcleanwebui/frontend/src/App.tsx, ranmake webui-verify-dist→ failed (exit 1), correctly listed a deleted tracked chunk (D), a modifiedindex.html(M), and a new untracked hashed chunk (??) — confirming the porcelain-vs-diff deviation catches whatgit diff --exit-codewould miss. Reverted the edit, rebuilt, re-ran → exit 0, dist clean again (original hash restored).webuijob on this PR is the gate working on real CI.webuiCI job (Node 20 perci.yml). A red first CI run here should be treated as a real determinism finding to fix before merge, not a flake.npm ci, target not chained offwebui-build, emptydiff --staton untracked-only staleness) — accepted as-is per the plan's explicit "self-contained target" design choice.Notes
integration/search-hardening-and-ci-integrity), which stays open/draft and must not be merged directly. Squash-merge this child only after CI is verified green.dist/.