Repository navigation
fix(prepare-pr): bound green_age package-above-module import overlap to the direct parent - #14867
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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 (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the reported repro: on PR #12178's file set the bounded matcher plus facade-follow should now yield FRESH without dropping the real overlaps. What this change shipsInventory (6 items) — 6 justifiedIntent: stop the prepare-pr freshness gate calling every file an import-overlap for importing the shared root package — a FIX (repro on PR #12178, closes #12389).
[FIRST-PRINCIPLES-REVIEWED] 85cc695 Description read[DESCRIPTION-READ] ba738f3e20c27747f614ce35e5c2255dd96e89fb50ea12fc945122c71a554bc4 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the fix against PR #12178's actual file set — the 85-overlap repro is cited but only synthetic fixtures are tested. [DESIGN-REVIEWED] 85cc695 Description read[DESCRIPTION-READ] e408d770008acab0046956bed0912e804381e9394f8e407fa9d63ff13d90f476 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 Review — ✅ no blocking findingsReviewed Review detailsAdvisory only: no blocking defect — the new parenthesized-import scan locates the closing paren before stripping comments, so a FINDING — src/kiro_crew/builtin_skills/kirocrew-dev/prepare-pr/scripts/green_age.py:233 — [OPUS-REVIEWED] 85cc695 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
8c09699 to
3d3ef90
Compare
3d3ef90 to
023b3f6
Compare
…to the direct parent Closes #12389
023b3f6 to
85cc695
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed on behalf of the maintainers (readiness sweep 2026-09-29): readiness passed, the required PR Readiness check is green on this head, no live CHANGES_REQUESTED, no open blocking review threads; where the PR's files also moved on main since its merge-base, the PR's own tests were run on the main+PR merge tree and passed. Approving and squash-merging.
Problem / Motivation
Goal:
green_age.pystops calling a file an import-overlap just because it imports the shared root package._imports_touchtreats an imported package as reaching every changed module below it, at any depth. Every file withfrom kiro_crew import Xyields the bare tokenkiro_crew, so it "imports" every changed module in the repo. On PR #12178 this produced 85 falseimportoverlaps and aSTALEverdict (exit 30).Why it matters
A false
STALEtells the author to rebase and push again. On a fast-moving main that rebase goes stale within minutes, every new head re-rolls the review lanes, and on a PR carrying a commit-bound override it voids the override.Not a goal
kiro_crew.ledger.storestill reaches a changedkiro_crew/ledger/__init__.py, because importing a submodule runs its parents).same-dir,test-stemorpathoverlap classes.What changed (motivation → approach → change)
Root cause: the package-above-module match was
changed.startswith(target + "."), which is true for every ancestor package, includingkiro_crewitself.kiro_crew__init__.pyimports toward it (a facade)A deeper package now counts only when its own
__init__.pyon the base, read through the sameread_movedblob reader, imports toward the changed module. That keeps facades such askiro_crew.subagent_managerre-exportingadmissionas real dependencies. A top-level token never reaches a module; its real names match exactly.imported_modulesnow reads a parenthesizedfrom X import (across lines to its close paren, sofrom kiro_crew import (\n model_registry,\n)bindskiro_crew.model_registry. Before, only the bare root token was bound, and the root token no longer matches. A trailing# commenton an import line no longer hides the name before it.classify_overlapreads each blob at most once per run, so following a facade's__init__.pycosts onegit showper package, not one per changed module.Backwards compatibility
Compatible: the script only reports fewer overlaps; the documented case (import
kiro_crew.ledger, changedkiro_crew/ledger/store.py) still matches.Tests
test/test_prepare_pr_green_age.py:test_a_package_import_reaches_its_direct_child_module: importing a module's own package still overlaps.test_an_ancestor_package_import_does_not_reach_a_grandchild_module: the root token and a grandparent no longer match.test_the_root_package_token_does_not_reach_a_top_level_module: barekiro_crewmisseskiro_crew.security; the exact import still matches.test_a_facade_package_reaches_the_deep_module_its_init_re_exports: a package whose__init__.pyimports.admissionreachesadmission.gate; without that import it does not.test_a_parenthesized_import_binds_every_name_across_lines: a multi-line import with a comment binds each name.test_an_inline_comment_does_not_drop_the_imported_name:from kiro_crew import agent # ...still bindskiro_crew.agent.test_each_blob_is_read_at_most_once_per_run: two moved callers of one facade read its__init__.pyonce.Each new rule was mutation-checked: disabling the facade read, the multi-line read, the comment strip, the read-once cache, or the root guard turns exactly its own test red.
Manual verification
N/A — unit coverage sufficient; the change is one pure string predicate.
Related Issues
Closes #12389
Pattern harvest
Not generalizable: a one-off unbounded prefix match in one script's import matcher; the sibling
same-dirclass already has its own bound.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)