Repository navigation
ci: warn on a stale find_ui index; fail only at release or when a PR causes it - #18997
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. [UX-REVIEWED] 66deb29 Description read[DESCRIPTION-READ] db225922100be59818242c2494af55176fe853afe1f453b82e43d98b02c93a56 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Once no open PR's base predates exit 3, check whether What this change shipsInventory (8 items) — 8 justifiedIntent: stop a stale committed find_ui index from breaking builds for people who didn't cause it, while still failing releases and the PRs that cause it. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 66deb29 Description read[DESCRIPTION-READ] 30dc1a56a879eaa96ae6d4d5cd436c08e2e168ea25025a97e0bf1293b29d5793 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Once Watch
[DESIGN-REVIEWED] 66deb29 Description read[DESCRIPTION-READ] 5a76b207b1586fe88fde1a4593355c5e0393c8ba0fd2cc7595ceb025bba10865 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
e84dbdb to
4fdf86f
Compare
|
Dispositions for the e84dbdb round, fixed or answered in 4fdf86f:
|
4fdf86f to
b19439b
Compare
|
First Principles item 4 on b19439b (strict via input + env vs one pre-build job): kept. The maintainer chose this shape when the design was agreed: release's calls to the reusable build workflows pass an input that makes the build's own check fatal. A path one pre-build job cannot cover: any future caller of build-wheel/desktop/windows that publishes and forgets to |
… for PR-caused staleness npm run build now runs gen-ui-index --check --warn-if-stale, so a stale committed index warns instead of failing local builds, PR build lanes, main's Build and nightly. CI's freshness step fails a PR only when its base is fresh and its merge ref is stale; an already-stale base warns. release.yml passes ui_index_strict to its build lanes, which sets KC_UI_INDEX_STRICT=1 and makes the build fail before any lane publishes. The release runbook regenerates on the release branch before the RC.
b19439b to
66deb29
Compare
Problem / Motivation
Goal: A stale committed find_ui index stops breaking every build on main, nightly, PRs and local machines, while a release and a PR that causes the staleness still fail on it.
src/kiro_crew/docs/ui-index.generated.jsonandguidePlans.gen.tsare committed, and the index digest covers every input, the 12 catalogs included. Each PR is fresh at its own head, but branch protection does not require an up-to-date branch, so fresh PRs merge into a stalemain.npm run buildstarted with a strictgen-ui-index.mjs --check, so a stalemainbroke main's Build, the nightly, every PR's Build Wheel / Build Desktop / E2E (merge ref), and every localmake build. Five regen-only PRs were opened on 2026-10-10 alone (#18753, #18803, #18958, #18799, #18800).Why it matters
Every open PR and every contributor's local build goes red for a staleness none of them caused, until someone lands a regen commit. Then the next merge can stale it again.
Not a goal
find_uireads it.What changed (motivation → approach → change)
Symptom: a stale
mainfails every build. Cause: the only freshness gate was a whole-tree check insidenpm run build, so it fires on whoever builds next, not on whoever caused it. Change: the check now depends on where it runs.npm run build(local,make build, PR build lanes, main's Build, nightly)gen-ui-index.mjs --check --warn-if-stalefrontend-linton a PR / merge group, base fresh.github/scripts/ui_index_freshness.pychecks the merge ref, thenbase.shafrontend-linton a PR / merge group, base already stalefrontend-linton a push to mainrelease.ymlbuild lanesui_index_strict: true->KC_UI_INDEX_STRICT=1overrides--warn-if-stalewebsite/scripts/gen-ui-index.mjs: stale now exits 3 (1 stays "generator problem"); new--warn-if-stale(only with--check);KC_UI_INDEX_STRICT=1turns it off. Under warn the auto tier is still written so the build can go on. The modes live in a small pure module,scripts/lib/ui-index-freshness.mjs. A generator problem still fails every mode..github/scripts/ui_index_freshness.py: classifies the merge ref; when stale onpull_request/merge_group, checks outbase.shaas a detached worktree sharingnode_modulesand classifies that. A base from before exit 3 existed is read as stale by its message. An unreadable base fails closed.build-wheel.yml,build-desktop.yml,build-windows.yml: new boolean inputui_index_strict(default false, declared on every trigger), mapped to the workflow-level envKC_UI_INDEX_STRICT.release.ymlpasses true on all three;nightly.ymldoes not.npm run buildand not in a separate pre-check job in release.yml: the check then runs on the exact tree each lane packages, in the same step that produces the bundle, so no release lane can build an index-mismatched bundle whatever job graph it sits in (a pre-check job only guards lanes that remember toneedit). It also lets anyone reproduce a release build locally withKC_UI_INDEX_STRICT=1 npm run build. The cost is one boolean input per reusable build workflow, declared on each trigger because the env expression reads it on both.--warn-if-stalein Actions, the generator also prints a::warningannotation, so a stale index shows on the run page of a green build and not only in its log.docs/ci/ci-and-reviews.md(new subsection with the table),docs/build/release.mdrunbook step 2 (runnpm run gen:ui -- --checkon the target commit; if stale, land a regen onrelease/X.Ybefore the RC tag),docs/architecture/mcp.md, the generator header and the ci.yml step comment.docs/decisions/records nothing about this check.Backwards compatibility
Compatible: every command that passed before still passes;
--checkwithout the new flag still fails on a stale index (exit 3 instead of 1, both non-zero).This loosens a gate (
npm run buildno longer fails on a stale index). Readers of that gate:Reader: .github/workflows/release.yml:build-wheel -- release -- passes ui_index_strict, so its
npm run buildstill fails; test_ui_index_freshness.py::TestWorkflowWiring::test_release_builds_are_strictReader: .github/workflows/release.yml:build-desktop -- release -- same input, read by packaging/build-desktop.sh's
npm run build; test_release_builds_are_strict[build-desktop]Reader: .github/workflows/release.yml:build-windows -- release -- same input; soft-fail lane as before; test_release_builds_are_strict[build-windows]
Reader: .github/workflows/ci.yml:frontend-lint -- release -- still fails a PR that stales a fresh base; test_a_pr_that_makes_a_fresh_base_stale_fails
Reader: .github/workflows/nightly.yml:build-wheel -- release -- now warns by design, never strict; test_nightly_never_asks_for_strict
Reader: src/kiro_crew/ui_index.py:_attach_auto -- chat -- a build from a stale tree ships an auto tier built against another index; the loader refuses it and answers
auto_tier: "unavailable"with the committed tiers intact; test_find_ui_auto.py::test_a_bad_auto_file_disables_only_the_auto_tierTests
test/test_ui_index_freshness.py(24):classify(exit 0/3, the old exit-1 stale message, problems stay broken);mainfor each table row (PR-caused fail, merge-group fail, inherited warn, push warn, unreadable base / no base sha / broken base fail closed, generator problem fails everywhere);checkout_baseagainst a real two-commit git repo; workflow wiring (ci.yml step env, release passes strict to all three, nightly never does, each reusable build maps the input toKC_UI_INDEX_STRICTwith default false on every trigger).website/src/uiLocations/uiIndex.test.ts"gen:ui --check freshness modes" (8): verdict for each mode, env parsing,npm run buildcarries--warn-if-stale,--warn-if-stalealone is refused, and the real generator on this tree (warn-only exits 0; strict equals plain--check).Mutations, each run alone and restored, each reddened the named test:
freshnessVerdictignoresstrictstrict: false--warn-if-staledecidepasses a fresh baseclassifyui_index_stricton build-wheelui_index_strict(*) That one reddens only while the tree is stale (it was, before #18975 landed). On a fresh tree the three modes agree by construction, so it cannot tell them apart.
test/test_prepare_pr_profiles.py: the new script is named inexempt_scriptswith its reason (the prepare-pr floor already runs the plaingen:ui -- --check; the base comparison needs an Actions event).Also run: 7858 workflow/release/find_ui/build tests pass;
src/uiLocations/vitest 401 pass; eslint, black, isort, flake8 clean on touched files; docs-lint passes. actionlint is not installed on this host, so it was not run.Manual verification
npm run buildexit 0 with the WARNING lines;KC_UI_INDEX_STRICT=1 npm run buildexit 3.::warning::... base ... is already stale. That exercised the old-exit-1 path.::error::This change makes the find_ui index stale; as a push, exit 0 with a warning.inputs-> workflow-levelenvmapping is checked by a test reading the YAML, not by Actions executing it.Related Issues
Refs #18995
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.