Repository navigation
refactor(toplevel): unchain the auto-tier path ternary in ui_index - #18785
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 72212ad Description read[DESCRIPTION-READ] f78861f98210d4f6893fbc6396afa4f0a8645b3f9f4d9c005ea582c302c19dea 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: |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (1 items) — 1 justifiedIntent: let a reader of
[FIRST-PRINCIPLES-REVIEWED] 72212ad Description read[DESCRIPTION-READ] 9f2ee264b664bf6d337370c9d7dfe2745b1b2aaceef22fee3b89372a78d88792 That sha256 names the PR description this verdict read. Recompute it with |
|
The red checks on
main's own The stale index is tracked in #18749, and #18753 fixes it. Once that lands I'll rebase onto it, re-run the gates and push. I won't rerun or override this red in the meantime. |
load_index chose which auto tier file to read with a nested conditional expression. Write it as a plain default instead: the caller's auto_path, or AUTO_INDEX_PATH when neither auto_path nor path was given. Every combination of arguments still picks the same auto tier file as before, or no file where it picked none.
fbf3e59 to
72212ad
Compare
|
Rebased onto |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved. One local expression restated; the new default picks the same auto-tier file as before in every case. All AI reviews pass on 72212ad, and no change request is open.
Problem / Motivation
Goal: Make
ui_index.load_indexsay plainly which auto-tier file it reads, without changing which file it reads.src/kiro_crew/ui_index.pypicks the auto-tier file insideload_indexwith a nested conditional expression:auto_path if auto_path is not None else (AUTO_INDEX_PATH if path is None else None). To see that the packaged auto tier is the default only when the caller named neither file, a reader has to unpack whichelsebelongs to whichif.Why it matters
That default is a rule the docstring states and
test_the_default_auto_file_is_the_dashboard_bundlespins: an explicit committed index (a test, a scratch build) is read with the auto tier the caller names, or none. As a nested ternary it is easy to misread as "AUTO_INDEX_PATHwheneverauto_pathisNone", which is the one reading that would mix the packaged auto tier into a scratch index.Not a goal
load_indexreads, how it caches them, or how the auto tier is validated.toplevelsweep).What changed (motivation → approach → change)
load_indexpicks its auto-tier file exactly as before, now written as a plain default instead of a nested ternary: start from the caller'sauto_path, and useAUTO_INDEX_PATHonly when bothauto_pathandpathareNone. That reads in the same order as the docstring. Run over every combination ofNone, an ordinary path,Path("")andPath(".")for both arguments, the old and new forms return the identical object in all 16 cases. mypy infersPath | Nonefrom the parameter, so no annotation is added.This is the module-simplification detector's one actionable site in
toplevel; the other four it lists are excluded (three in the keystonesafety_override.py, one test-pinned inskills.py) and are left alone.Before opening, eight read-only review subagents checked the diff from separate angles: AUTOSDE rules, behaviour preservation, import semantics, security keystone and boot path, comment and claim accuracy, local mirrors of the Codex and Claude review contracts, and the deterministic
code-review.yml/ PR Hygiene checks. The behaviour lens applied the claimed rewrite toorigin/main's syntax tree and got HEAD's tree exactly. None of the eight found a code defect. The claim lens raised four wording findings against the commit message and this description; independent refuters upheld two, both fixed (the commit message implied a file is read in every case, when one case reads none; the test-file list counted two substring-only matches as references), and refuted two, left as written.Backwards compatibility
Compatible: the same arguments select the same auto tier file as before, or none where they selected none, so the cache key and every
find_ui/browse_uianswer are unchanged.Removes nothing: one expression is restated; no path, key, reader or public name goes away.
Tests
No test change. The 24 test files that
git grep -l -e ui_index -e find_ui -e load_index -- testselects pass on the Python 3.12 CI-parity venv: 1685 passed, 12 skipped. Two of them,test_cli_manifest_signature.pyandtest_spec_builder_routes_coverage.py, match only as a substring (upload_indexes, spec_builder's own_load_index) and add margin, not coverage. Among the rest,test_the_default_auto_file_is_the_dashboard_bundlescovers both the default branch and the explicit-pathbranch, andtest_find_ui_auto.py's two-file cases cover an explicitauto_path.Gates run locally on the rebased head, all exit 0:
flake8,isort --check-only,mypy src/kiro_crew,check_black_formatting.py,check_subprocess_encoding.py,check_sync_io_in_async.py,check_agent_sdk_boundary.py,check_comment_history.py,check_brand_name.py,check_harness_parity.py,docs_lint.py --test,docs-lint.sh,check_per_file_coverage.py --testandverify_vendor_manifest.py.scripts/scrub-lint.shdoes not exist on main and semgrep is not installed on this host, so neither ran here; CI's SAST job runs semgrep. Backend-only diff: nothing underwebsite/,.github/orscripts/changes, so CI reportsonly_backend=trueand the frontend suites are not affected.Manual verification
N/A — unit coverage sufficient: every branch of the rewritten default is exercised by
test_find_ui_auto.py, and the change is one local expression with no I/O of its own.Screenshots / video
Why no screenshot: backend-only restatement of one Python expression; nothing renders differently.
Related Issues
Part of #16523
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.