Repository navigation
build(ui-index): drop the digest and count lines that every UI change edited - #37406
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check: the diff only touches build scripts, the generated index, Python loaders, tests and docs, and adds or changes no user-visible control. [UX-REVIEWED] 6711548 Description read[DESCRIPTION-READ] a73178c71a1eefa6cdadc3b132315d75112d5a2d4cd631dca588264264cc421d 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 One rider: the branch that keeps a file's own Notes
What this change shipsInventory (7 items) — 6 justifiedIntent: let two PRs that change UI on different dashboard pages merge without a forced rebase of the generated find_ui index. FIX (#37396, with a measured conflict rate and a
[FIRST-PRINCIPLES-REVIEWED] 6711548 Description read[DESCRIPTION-READ] b0b3fb9f521178063d4cd125377e60039225743f66b81367c6955dfcf044ab58 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. I checked every reader of the removed Notes
[DESIGN-REVIEWED] 6711548 Description read[DESCRIPTION-READ] c4cb337e309348207010e45488dce131db9115ef34db5dd9079ea6f032eb48dd 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 Review detailsNo findings. Notes:
[OPUS-REVIEWED] 6711548 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: |
022d68a to
40d5023
Compare
Code change approver recommendation: ApproveWhy: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. Removes input_digest and the per-kind counts from the committed ui-index so unrelated UI PRs stop conflicting. The generator now stamps the auto tier with sha256 of the exact serialized string it writes (gen-ui-index.mjs:404-410), and Python computes the same value with parse_index_text, used by load_index, _attach_auto and guide_catalog.ui_auto_tier. .gitattributes forces eol=lf, and JSON escapes CR inside strings, so the hashes agree across platforms. I swept src/, .github/, the scripts and the website tests for input_digest and coverage.counts/tiers/registered_controls readers: none remain beyond the generator's summary and report, which now read built.stats/autoBuilt.stats. Fixtures that carry an explicit input_digest keep it. Under --warn-if-stale, a stale committed file still refuses the auto tier, as before, and any edit to the committed file now breaks the match, which makes the trust check slightly stricter. The facade TYPE_CHECKING list is updated, and the frozen base-name inventory isn't affected. New Python and vitest tests pin the behaviour. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
40d5023 to
6711548
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
The review checked head 6711548 and found nothing that blocks. The generator now hashes the exact text it writes. parse_index_text recomputes the same digest from the file, a CRLF checkout included. All three readers of input_digest (_attach_auto, _envelope, ui_auto_tier) still get a value. A search of src, website, scripts and .github found no remaining reader of coverage.counts, coverage.tiers or registered_controls. Each moved reader has a test that goes red if its hunk is reverted, and the end-to-end test that runs the real generator fails rather than skips in CI.
Done well: the body backs its claims with measurements, including a git merge-tree run over two real main commits, and its Reader list names the test that covers each removed key.
Optional:
build_digestdid change in 7 of the 39 commits the body counts (for example 176820c and a02e90c). Two PRs that both change guide plans, or both add a condition or gate, still conflict on those summary rows. The new sentence in docs/ci/ci-and-reviews.md around line 754 could say so.- website/scripts/lib/ui-index.mjs:781 names
index_input_digest, which does not exist. The function isparse_index_text. - The branch in ui_index_load.py:75 that keeps a file's own
input_digestis reached only by test fixtures. You could drop it later if the fixtures compute their own digest.
Problem / Motivation
Goal: Two PRs that change dashboard UI on different pages can both merge without one of them rebasing for
src/kiro_crew/docs/ui-index.generated.json.The generated find_ui index starts with two lines that change on almost every UI change, whatever page it touches:
input_digest(a hash of the whole index) and thecoverageline (a count of locations per kind). So two PRs that touch unrelated pages still edit the same two lines, and git reports a conflict. On 2026-11-14,mainchanged the file 8 times in 24 hours and 39 times in 7 days, and 10 of the 12 open PRs that change it were conflicting.Why it matters
Every such conflict means a rebase, a regenerated file, a push and a full CI restart (about an hour). A rebase also gives the PR a new head, so any review sign-off or override recorded for the old head no longer counts. By the time CI is green again,
mainhas often changed the file again. Release-branch backport PRs hit the same conflict.Not a goal
What changed (motivation → approach → change)
The two lines change because they summarize the whole file. Neither has to live in it:
input_digestis only read to check that the build-time auto tier was built from this index. The file no longer carries it. The generator stamps the auto tier with sha256 of the exact text it writes, and the Python reader computes the same hash from the file it reads (parse_index_textinui_index_load.py, used byload_indexandguide_catalog.ui_auto_tier). Python's text read turns CRLF into LF, so a Windows checkout gets the same hash. A file that still names a digest keeps it.--report.buildUiIndexnow returns them asstats, and the committedcoveragekeeps only its fixedscopetext.build_digeststays in the file: it covers only guide plans and observable ids, and changed in none of the 39 commits.The two docs that described the digest are updated.
Backwards compatibility
Compatible: the freshness check still compares the whole file byte for byte, and every reader of the removed keys now gets them from the code path listed below.
Reader: src/kiro_crew/ui_index_load.py:_attach_auto -- chat --
input_digestcomes fromparse_index_textinload_index; test_find_ui_browse.py auto-tier tests and test_find_ui_auto.py::test_the_generated_auto_tier_is_well_formedReader: src/kiro_crew/ui_index.py:_envelope -- chat -- reads
idx.raw["input_digest"], whichload_indexfills in; test_find_ui.pyReader: src/kiro_crew/guide_catalog.py:ui_auto_tier -- chat -- reads the base index through
parse_index_text; test_guide_observe.py::test_an_auto_location_is_observed_through_its_stamped_siteReader: website/scripts/gen-ui-index.mjs:summary and writeReport -- release -- read counts and tiers from
built.stats/autoBuilt.stats;npm run gen:uioutput unchangedReader: website/src/uiLocations/autoTier.test.ts -- release -- asserts on
statsand on the committed file's coverage holding onlyscopeTests
test_the_committed_index_digest_is_computed_from_its_text(new): the digest is sha256 of the text, a CRLF file gives the same digest, a file that names one keeps it, and the committed file has noinput_digest.autoTier.test.ts(new case): the committed file has noinput_digestand itscoverageholds onlyscope. Existing count assertions now readstats.test_the_generated_auto_tier_is_well_formedruns the real generator and checks the auto tier'sbase_input_digestequals the digest the reader computes.continue with github, fails the same way onmainand is test_find_ui_auto: the Continue with GitHub golden fails wherever the generator runs #32670), the 3uiLocationsvitest files (190 passed),gen-ui-index.mjs --check, flake8, isort, black, mypy, eslint,tsc -p tsconfig.app.json, the flake-pattern ratchet and the repo's semgrep rules (0 findings).Manual verification
A simulation with two real
maincommits that changed UI on different pages: #37050 (Notifications settings) and #29423 (Security settings). Both start from #37050's parent, each with its source change applied andnpm run gen:uirun.git merge-tree --write-tree A BCONFLICT (content): Merge conflict in src/kiro_crew/docs/ui-index.generated.jsonWith this PR,
gen-ui-index.mjs --checkalso passes on the merged tree with no regeneration: the merge of the two generated files equals what the generator writes for the merged source.Related Issues
Closes #37396
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)