Repository navigation
fix(context): skip linked steering in member snapshots instead of refusing - #17632
Conversation
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The name filter ( Not justified as shipped
What this change shipsInventory (5 items) — 4 justifiedIntent: a crew member whose
[FIRST-PRINCIPLES-REVIEWED] 5652c89 Description read[DESCRIPTION-READ] c3d4870c4ab771b1d249fcd99fda7af5dd8113b6caed19e106841129462c4713 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS A maintainer still has to settle the "Decision for the owner": should a symlink in implicit steering be skipped with a note by default, or keep refusing until #14007's [DESIGN-REVIEWED] 5652c89 Description read[DESCRIPTION-READ] 27e3ccda5cdaeaee6e775035f742971d806cb25909502f1908d9447aeef09c1a 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: |
1223d69 to
8fe986a
Compare
|
Dispositions for the review round on
|
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: |
8fe986a to
c9913b1
Compare
|
GPT 6.1 BLOCKING (security-class, |
c9913b1 to
2fcd133
Compare
|
First Principles CONCERNS on The note is item 3. The issue's own "Expected" asks for it: "a linked steering file that the snapshot reader refuses is left out of the snapshot and named in an in-band notice". It also satisfies the clearing condition the review names. On a harness that kiro-cli does not serve ( |
2fcd133 to
5652c89
Compare
|
First Principles CONCERNS on |
|
This solves the real problem: one symlink under |
bolichen97
left a comment
There was a problem hiding this comment.
Approving. Passing linked into _matches only from the implicit .kiro/steering/**/*.md scans leaves declared resources failing closed, and a skipped link is never read, so it cannot escape the root. validate_file_path runs before entry.is_dir(), so a refused target is named without probing, and _skipped_linked_note tells the agent the steering is missing instead of letting it assume. This matches the implicit AGENTS.md handling from #16263.
Problem / Motivation
Goal: A crew member starts normally when a file or folder under
~/.kiro/steering(or a project's.kiro/steering) is a symlink.Every session start of a member with a
member_idbuilds the V2 essentials snapshot. The implicit.kiro/steering/**/*.mdwalk inmember_essential_context._matchesraiseslinked document or directoryon the first link it meets, so a user who keeps steering in a git repo and links it into~/.kiro/steeringcannot use the member at all. kiro-cli itself follows these links.Why it matters
Linking steering from one versioned repo is an ordinary setup. Today it makes every member chat fail at session start with no workaround short of copying the files.
Not a goal
steering.sourcespolicy, which can layer on top of this change.file://resources. A template that declares a glob reaching a link still refuses.What changed (motivation → approach → change)
Essential source …/.kiro/steering/…: linked document or directory.AGENTS.mdthat fix(members): read member sources on a home reached through a symlink #16263 already handles._matchestakes an optionallinkedlist. When given, a link the walk meets (a literal path component or a wildcard entry) is appended there and skipped: not read, not descended into. Only the implicit global and project steering scans indocuments_for_memberandkiro_launch_documentspass it.documents_for_memberthen adds one coreessential-context#linked-skippednote naming the skipped links (up to 10, then a count), the same way the managed-prefix note works. The note says only that the snapshot does not carry the link and that the host may still load it natively; it does not tell the model to disregard the file. Only a link the glob could have used is named: a name matching the final component (*.md) or a directory. The directory probe follows the link, so the link is screened throughvalidate_file_pathfirst; a refused target (an untrusted UNC share on Windows) is named without being probed.Signatures the walk refuses and what this change does to each:
.kiro/steering(implicit scan): skipped and named. This is the reported case..kiro/steering(implicit scan): skipped and named, contents never listed..kiroor.kiro/steeringliteral prefix (implicit scan): skipped and named.file://glob: unchanged, still refuses.first_linked_ancestoron a queued directory): unchanged. A skipped link is never queued, so it cannot reach this check.$HOMEitself a symlink): unchanged, already admitted by_admitted_root.Backwards compatibility
Compatible: the only behaviour change is that a session which used to refuse now starts with one extra in-band note. Nothing that works today changes.
Removes nothing: no reader, key, or document that loads today is dropped. The skipped links were never loaded before either, because the whole snapshot refused.
Tests
In
test/test_member_essential_context.py:test_linked_global_steering_file_is_named_instead_of_refusing_the_turn: a linked~/.kiro/steering/context/style.mdis left out unread, named in thelinked-skippednote whose wording does not tell the model to disregard it, and a regular steering file beside it still loads.test_linked_global_steering_directory_is_named_not_enumerated: a linked steering directory is named and its contents are not read.test_linked_non_steering_entry_is_not_named: a linkedREADME.txtunder steering is not reported.test_linked_steering_entry_is_screened_before_its_target_is_probed: a link whose targetvalidate_file_pathrefuses (a Windows UNC target) is named without the link-followingis_dir()probe.test_kiro_launch_documents_leaves_a_linked_global_steering_file_out: the spawn-time native list (acp/harness/kiro.pyresolve_spawn) no longer refuses.test_declared_glob_still_refuses_a_linked_steering_file: the walk withoutlinkedstill raises.The first three fail on
origin/main(0d885e6) with the reported error. Mutation check: removing the note, droppinglinked=[]fromkiro_launch_documents, or removing the name filter or thevalidate_file_pathscreen reddens the matching tests. Whole file: 219 passed, 2 skipped, run withPYTHONPATHset to this worktree'ssrc. black and flake8 are clean on both files.Manual verification
N/A: unit coverage drives the real
ContextBuilder.build_messageandkiro_launch_documentspaths with real symlinks on Linux. Windows junctions and macOS go through the sameis_link_or_junctioncall but were not run on those platforms (unverified).Related Issues
Closes #16672
Related: #14007 (admit approved links by policy), #16263 (refused project
AGENTS.mdbecomes an#omittednote).Pattern harvest
Not generalizable: the implicit-versus-declared split is already the rule for
AGENTS.md/SOUL.md. This applies that rule to the one implicit source that was still missing it.Decision for the owner
The decision is whether a member whose implicit steering contains a symlink should start with that link skipped and named, or keep refusing until a
steering.sourcespolicy approves the target as #14007 proposes. This draft chooses skip-and-notice as the default, because steering is implicit likeAGENTS.mdand refusing every session is worse than a named omission, and it leaves #14007's opt-in admission free to land on top.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; see the Licensing section of CONTRIBUTING.md.