Repository navigation
fix: skip a declared steering link that leaves the project - #30722
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This is a one-expression fix for a refusal tracked in #18722. It sends the outside link through the existing What this change shipsInventory (4 items) — 4 justifiedIntent: let a crew member start when its project steering tree holds a link that points outside the project. FIX.
[FIRST-PRINCIPLES-REVIEWED] 0b4258f Description read[DESCRIPTION-READ] cb792b5c94975161a1c74ee5ecb39d34eca738d19e2f5aaf8abbcdcee728f99d That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: a relative steering glob now handles a link that leaves the project the way the implicit scan already does, through the existing screened Notes
[DESIGN-REVIEWED] 0b4258f Description read[DESCRIPTION-READ] 48bd2749185c81220fd5e98d2fb11daacc8f0492a7d0e4c88d85b517795a72af 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 |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
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: |
d84ea0b to
8e36c6a
Compare
|
Rebased: main moved in The one red on the previous head, [operator: bolichen97] |
8e36c6a to
8c83937
Compare
|
Rebased: main moved in The one red on the previous head, [operator: bolichen97] |
A crew member whose template declares a relative steering glob, such as the shipped file://.kiro/steering/**/*.md, refused to start when that tree held a link to a file or folder outside the project. The implicit steering scan already leaves such a link out, unread, and names it. The declared glob now does the same: the link is left out unread and named in the linked-steering note, in the member snapshot and in the KAS document reader. A link into managed memory or member state, and a link the path screen refuses, still refuse, as does any link under a relative glob without a steering component.
8c83937 to
0b4258f
Compare
|
Rebased: main moved in docs/system-specs/modules/ (same directory as the spec this PR edits) and in test/test_dashboard_server_composition_contract.py since this head ran CI (94579a2 -> 5c9a750); CI re-running. The previous head's two red backend shards failed on that contract test's lazy-import pin (131 vs 130), which main has since corrected; the patch is unchanged (same patch id). [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved by Crew Captain for the on-call: checks green, PR Readiness passed, review lanes clean on this head.
A crew member whose template declares a relative steering glob, such as the shipped file://.kiro/steering/**/*.md, refused to start when that tree held a link to a file or folder outside the project. The implicit steering scan already leaves such a link out, unread, and names it. The declared glob now does the same: the link is left out unread and named in the linked-steering note, in the member snapshot and in the KAS document reader. A link into managed memory or member state, and a link the path screen refuses, still refuse, as does any link under a relative glob without a steering component. (cherry picked from commit 477eebf) Backport note: release/0.12.0 splits the steering test into steering_glob and left_out in _resource_paths (#31131, #31152); the fix keeps those lines and changes only the relative-declaration fallback for outside= to left_out.
Problem / Motivation
Goal: A crew member whose template declares a project steering glob starts when that steering tree holds a link to a file or folder outside the project, instead of failing before its first prompt.
A template that declares
file://.kiro/steering/**/*.md(the shipped default, and the glob skill projection copies into agent definitions) walks the project's steering tree. When that tree holds a symbolic link whose target is outside the project, the walk raises and the member never starts:The implicit steering scan meets the same link, leaves it out unread, names it in the
essential-context#linked-skippednote, and the member starts. #19393 gave the declared glob that rule only for a link that stays inside the project.Why it matters
Keeping shared steering in one folder and linking it into each project's
.kiro/steeringis an ordinary setup. Today such a member cannot start at all, and the same link is harmless when only the implicit scan reaches it. The KAS document reader (projected_resource_documents) refuses the same way, so a KAS session with the projected steering glob does not start either.Not a goal
steeringcomponent, and a glob-free declared path that is a link. Both keep refusing._declared_files_fit,projected_launch_paths). It still cannot measure a link, so it keeps withholding the record.README.txtbeside*.md). An outside one is named in the note; nothing is read either way.What changed (motivation → approach → change)
Symptom: a relative steering glob raises at a link that leaves the project. Cause:
_resource_pathspassesconfined=Truefor a declared pattern, so_matchesleaves out only a link that resolves inside the root, and it hands theoutsideleave-out (#29319) only to absolute declarations.Change: for a relative steering glob,
_resource_pathspasses the samelinkedlist asoutside. A link that leaves the project then goes through the existingoutsidepath in_matches: the target is screened withvalidate_file_path,_refuse_managed_sourceruns on it, and the link is left out unread and named in the linked-steering note the implicit scan already writes. One expression insrc/kiro_crew/member_essential_context.py; the rest is docstrings.docs/system-specs/modules/memory-skills-hooks.mdstates the rule beside the absolute-declaration exception.Backwards compatibility
Compatible: a member that starts today starts the same; only a member that refused at an outside steering link now starts, with that link named in the existing note. No loaded content changes, because the link was never read.
Removes nothing: the change turns one refusal into a named skip; no key, record, path or function is removed or tightened.
Tests
In
test/test_member_essential_context_inherit_opt_out.py:test_declared_steering_glob_names_a_link_that_leaves_the_project_unread(file, directory, dangling, unrelated name, linked steering root): the member snapshot builds, the outside body is not in it, and the note names the link. It replaces the test that pinned the refusal for these shapes.test_projected_steering_glob_leaves_a_link_outside_the_project_out: the KAS reader returns the regular steering and not the outside body. It replaces the test that pinned the refusal.test_declared_steering_glob_still_refuses_a_link_the_path_screen_refuses: a project steering link into another member's memory store under the crew data home still refuses.Unchanged and still green:
test_a_relative_glob_through_a_link_out_of_the_project_still_refuses(non-steering glob),test_a_link_out_of_home_into_an_admitted_managed_root_still_refuses(managed target),test_launch_record_stays_withheld_while_a_steering_glob_reaches_a_link. The module docstring oftest/test_member_essential_context_outside_links.pynow says a relative non-steering declaration keeps refusing.Red/green: with the production change reverted, the two touched test files give 6 failed, 58 passed in 3 of 3 runs, every failure
MemberEssentialContextError: ... linked document or directory; with it, 64 passed. Determinism: the three new or changed tests passed 20 of 20 at-n0, 10 of 10 at-n 4 --dist loadgroup --max-worker-restart=2besidetest_member_essential_context.pyandtest_member_essential_context_outside_links.py, and the two touched files passed shuffled (seed 24117). Related backend set (scripts/run_scoped_tests.py --surface backend): 1824 passed, 2 skipped.Proof: not provable -- other: with the fix reverted the six new cases fail by raising MemberEssentialContextError in the call, which prove.py counts as an error rather than an assertion (INCONCLUSIVE); the manual red run above shows them red
Manual verification
N/A — unit coverage sufficient: the tests build real symbolic links on Linux and drive the real snapshot builder and KAS document reader. Windows junctions go through the same
is_link_or_junctionandvalidate_file_pathcalls but were not run here (unverified); the cases carryrequires_symlinks.Screenshots / video
N/A: no frontend change.
Related Issues
Closes #18722
outsideleave-out this change reuses, for absolute declarations.src/kiro_crew/member_essential_context.py, in other functions; whichever lands second rebases.Sibling sweep
Swept: git grep -n "linked document or directory" -- src/
Sibling: src/kiro_crew/member_essential_context.py:734 -- changed here
The two hits are the link sites in
_matches(a literal path component at :734 and a wildcard one at :802); the oneoutsideargument reaches both.Pattern harvest
Not generalizable: the declared and implicit walks of one steering tree differing on a link is specific to the essential-context snapshot, and this closes the last gap between them for links that leave the project.
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.