Repository navigation
fix(members): honour the inherited-resources opt-out in snapshots - #14413
iamwhatever merged 1 commit into
Conversation
|
Intent: A crew member whose workspace turns off kiro-cli's inherited resources works from the context its template declares, as its native agent does, instead of getting the operator's global steering back in every turn. |
4f2adb1 to
e62eb73
Compare
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Confirm on kiro-cli itself that the opt-out skips exactly the implicit scan (global steering, root The defect has checkable provenance: base What this change shipsInventory (8 items) — 8 justifiedIntent: a member in a workspace that opts out of kiro-cli's inherited resources works from its template's context, not the operator's global rules — a FIX.
[FIRST-PRINCIPLES-REVIEWED] 58a07fd |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the live opted-out member session end-to-end — the PR's Manual verification section itself flags that as still unchecked. Suggestions
[DESIGN-REVIEWED] 58a07fd |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsFINDING -- src/kiro_crew/agent_sdk/drivers/acp.py:616 -- function-local |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed Review detailsOpted-out kiro non-member chats re-send the project FINDING — src/kiro_crew/context.py:2245 — [OPUS-REVIEWED] 58a07fd |
|
e62eb73 to
9cf1d3a
Compare
|
self-added: no
|
|
self-added: no
|
|
9cf1d3a to
3a389a5
Compare
|
|
self-added: yes
|
|
self-added: yes
|
3a389a5 to
147d0cd
Compare
|
self-added: yes
|
|
self-added: no
|
|
self-added: no
|
|
|
|
self-added: yes
|
|
self-added: yes
|
c00d20c to
3371864
Compare
|
Rebased: main moved in docs/system-specs/modules/security.md, scripts/measure_path_gate_ttl.py, src/kiro_crew/dashboard/handlers/files.py, src/kiro_crew/executors.py, src/kiro_crew/security/paths.py, test/test_pathres_loop_starvation.py, test/test_security.py, test/test_security_gate_liveness.py, test/test_security_path_resolve_bounded.py since this head went green (19b157d -> c203fac); CI re-running. |
A member whose workspace sets chat.disableInheritingDefaultResources still received the operator's global steering, AGENTS.md and undeclared workspace steering in its V2 essential snapshot, because the snapshot scanned them unconditionally. kiro-cli gives such an agent only the resources it declares, so the snapshot re-added the very rules the member was configured without. The opt-out is kiro-cli's own setting, so it binds only sessions kiro-cli serves; every other harness keeps inheriting. Each member turn reads the verdict once, from the preference the native skill projection records (Crew's own overlay included), and hands it to the snapshot, the kiro harness's launch-document model and the folder-steering dedup. Settings that cannot be read keep inheritance. A profile validation pass reads no setting and measures the inheriting envelope, the largest any harness can build. The snapshot skips the implicit scans when it opts out, and a folder that declares one of the skipped steering trees delivers those documents itself, once: the folder reader skips a file whose canonical path the template already delivered, compared as a string before its label is folded, so no path is resolved again and two files whose labels fold alike both arrive. Non-member kiro chats follow the same verdict, so their folder steering no longer skips trees kiro-cli will not load. The projection routes its existing decision through the same function.
3371864 to
58a07fd
Compare
|
self-added: no
|
|
self-added: yes
|
|
Problem / Motivation
Goal: A crew member whose workspace turns off kiro-cli's inherited resources works from the context its template declares, as its native agent does, instead of getting the operator's global steering back in every turn.
A member bound to a workspace that sets
chat.disableInheritingDefaultResources: truestill received the operator's global steering (~/.kiro/steering), the workspaceAGENTS.mdand undeclared workspace steering in its per-turn essential snapshot. The native agent in the same workspace loads none of them. The member therefore works from two rule sets: the one its launch gave it and the one the snapshot adds back on every turn.Why it matters
The setting is how an operator gives a member its own rules. Global steering is usually the operator's personal rules for their own assistant, and some of them contradict what a member is set up to do: an operator rule that every ticket comment needs approval, given to a member meant to post on its own, is one example. There is no way to keep those rules out of a member today, because the snapshot undoes the workspace opt-out without saying so. It also costs context, since every global steering file is sent again on every turn.
Not a goal
What changed (motivation → approach → change)
A member whose workspace opts out of kiro-cli's default resources gets the same context in its snapshot as its native agent: its prompt, its declared resources and
SOUL.md, plus any steering its chat folder declares. The opt-out is kiro-cli's own setting, so it changes only sessions kiro-cli serves; a member on any other harness keeps inheriting.context.py,_build_v2_essentials)member_essential_context.py,documents_for_member)AGENTS.mdand undeclared.kiro/steeringscanskiro_launch_documents, same file)context.py,collect_folder_steeringinfolder_steering.py).kiro/steeringroots as already delivered only while the workspace inherits; under the opt-out the folder reader skips, before reading it, a document whose canonical path the member's snapshot already holdsacp/skill_projection.py)agent_sdk/drivers/acp.py, and for a member throughmember_inherits_default_resourcesThe snapshot mirrors what the native agent loads, but it listed the default sources itself and never read the opt-out. The skill projection does read it. It also pins the native key to
truein every workspace it manages and records the user's real choice beside it, so a reader of the raw key would see an opt-out wherever Crew runs. Every path therefore asks the projection's own decision, which reads the recorded choice. Settings that cannot be read keep inheritance: malformed or deeply nested JSON, and aKIRO_HOMEthat is a symlink loop.The folder-steering dedup assumed kiro-cli always sent both
.kiro/steeringtrees, for members and plain kiro chats alike. It follows the same decision, so an opted-out chat gets those trees once, through its folder, instead of from nowhere. The template can still declare some of those files, so the folder reader skips a file whose canonical path the member's snapshot already carries. It compares that path as a string, before the file's label is folded for the prompt, so it resolves no path again and two different files whose labels look alike both arrive. Each document reaches the session exactly once whichever way the workspace chooses.A profile validation pass cannot know which harness the member's next session uses, so it measures the inheriting envelope, the largest any harness can build.
The system specs (
modules/memory-skills-hooks.md,modules/providers.md) and theskip_delivered_rootsdocstring infolder_steering.pyname the opt-out and where it applies.Backwards compatibility
Compatible: nothing is rejected, renamed or removed. A workspace that inherits, the default, builds the same snapshot and the same folder steering. Only a workspace or user that set
chat.disableInheritingDefaultResourcestotruesees a difference, and only on sessions kiro-cli serves; that difference is the documented meaning of the setting. Profile validation measures the same inheriting envelope it measures today.Tests
test/test_member_essential_context.py: an opted-out kiro workspace keeps only declared sources and still loads steering its template declares; the same workspace changes nothing for a member on another harness (claude_code, codex, a config-authored harness); a kiro member turn reads the setting exactly once and another harness never reads it;documents_for_membertakes the decision and never reads the setting; a profile validation pass reads no setting and measures the inheriting envelope; Crew's overlay is not read as an opt-out, for local and global sources; a global opt-out applies unless the workspace overrides it; only the literaltrueopts out; malformed and deeply nested settings keep inheritance, the deep case running with cyclic GC paused as the testing conventions require; aKIRO_HOMEsymlink loop keeps inheritance and the snapshot still builds; the kiro launch documents follow the opt-out; a folder that declares both.kiro/steeringtrees, while the template declares the project tree too, delivers their always-inclusion documents exactly once, to an opted-out member, to an inheriting one and on another harness; the opted-out dedup resolves no label, a file name the label fold changes still matches, and two different files whose labels fold alike both arrive, whichever of them the template declares.test/test_folder_steering.py: a delivered canonical path is neither read nor returned while a sibling whose label folds the same is returned, and no delivered path is ever resolved or validated.test/test_folder_steering_provider_dedup.py: the opt-out removes only the kiro-cli path from_project_steering_delivered, whose kiro-cli verdict is the agent SDK driver's reading of the setting; an opted-out kiro chat receives the project, global and folder rules exactly once, in the fresh section and after a compaction; an inheriting kiro chat still skips the trees after a compaction; an opted-out workspace changes nothing for another harness.test/test_native_skill_projection.py: the shared reader agrees with the projection before and after its overlay, across workspace, global and malformed values, and follows a live global preference under the overlay.With the production change reverted, the opt-out cases fail on their assertions and the reader's parity cases fail because the reader does not exist. Without the kiro-only gate the other-harness member loses its steering; without the decision in
_project_steering_deliveredthe opted-out kiro chat gets the trees zero times; without the validation guard the validation envelope misses the operator rule. Without theRecursionErrorcatch the deeply nested case raises, and without theRuntimeErrorcatch theKIRO_HOMEloop case raises. With the folder roots always skipped, the opted-out folder case gets its operator rule zero times; without the canonical-path skip it gets the template's always guide twice; a label comparison in its place drops one of two files whose labels fold alike; and arealpathin that check fails the no-resolution tests.Manual verification
Unit coverage runs the snapshot, the launch documents, the folder dedup and the projection against real settings files on disk. A live member session in an opted-out workspace is still to be checked.
Related Issues
no linked issue: found while giving a crew member its own rules; no open issue tracks it.
Pattern harvest
Not generalizable: the member snapshot and the folder-steering dedup were the loaders that decided about kiro-cli's inherited resources without the projection's decision; every one of them now reads one function.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)