Repository navigation
feat: carry a crewmate's template policy onto its worker (#28501) - #29378
Conversation
Adding an agent's abilities to a crewmate refused any agent that set hooks, permissions or toolsSettings, because the worker kept none of them. Crewmates the upgrade moved off such an agent could not get its tools back. The kit copy now layers the agent's hooks, permission rules and tool settings into the crewmate's file exactly, and the worker merge carries them, never wider than the agent declares. Crew fires the worker session's merged hooks on KAS. A field that cannot land exactly, or a crewmate whose worker is off KAS, is refused with an error naming the field. The crewmate's chat keeps running the stock conductor spec. Closes #26881 (cherry picked from commit 0354d5f) Conflict: src/kiro_crew/docs/agent-spec-fields.md (hooks row). Kept the release text and added only this change's crewmate sentence.
Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)Design-level review of Design-Verdict: PASS Cannot evaluate: no screenshot of this revision's new "Hooks, permissions and tool settings (worker)" group in the Add-abilities preview, or of the field-naming refusal messages. BlockersMissing rendered evidence for a reshaped Add-abilities preview Notes
[DESIGN-REVIEWED] 5ee9870 Description read[DESCRIPTION-READ] b00b7aa2904bd351718ceb0ad2947c10a61307dc34d2c656864cded7b3f37d78 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) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing screenshots. The PR adds a new group to the Add abilities preview and two new refusal messages, and attaches or commits no image, so the blind read was not performed. Evidence gaps
Notes
[UX-REVIEWED] 5ee9870 Description read[DESCRIPTION-READ] 0f8b9b5da53493bfe6f79d77d0164aa8fa5015d8eb8b10872aab965d26a13225 That sha256 names everything this verdict read: the PR description, plus the 3 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a straight cherry-pick of a fix already merged on main; each item removes the #26881 refusal or keeps a carried deny rule from being dropped without notice. Notes
What this change shipsInventory (7 items) — 6 justifiedIntent: let a 0.12 crewmate take abilities from an agent that sets hooks, permission rules or tool settings, instead of being refused. FIX (backport of #28501, part of #26881).
[FIRST-PRINCIPLES-REVIEWED] 5ee9870 Description read[DESCRIPTION-READ] dcac225d761b9bfde6451e404cc46647d607b5cd5e479b4d4f1fd16f49edf3c6 That sha256 names the PR description this verdict read. 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 — ✅ human override acceptedHuman judgment by @buluoray overrides the GPT 6.1 finding for [GPT-OVERRIDE] 5ee9870 This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
e356a72 to
5ee9870
Compare
|
|
/ai-review override gpt 5ee9870 false-positive: docs/decisions/2026-11-02-a-crewmates-worker-carries-its-template-policy.md refuses every toolsSettings key outside its allowlist by name; fs_write allowedPaths/fallbackAction are outside it, so refusing them even when the worker base holds them is the decided behaviour. |
Human judgment recorded@buluoray recorded a false-positive release (class
This decision applies only to this commit. A new push requires a new judgment. |
Sensitive change reviewHead: 5ee9870
|
Problem / Motivation
Goal: Bring #28501 to
release/0.12.0so a crewmate on an insider build can take abilities from an agent that sets hooks, permission rules or tool settings, instead of being refused withtemplate_restrictions_uncarriedand left without that agent's tools.On
release/0.12.0, Add abilities refuses any agent that setshooks,permissionsortoolsSettings, because the crewmate's worker keeps none of them (mate_worker_kit.py). Crewmates the upgrade moved off such an agent lost its tools and cannot get them back (#26881). Users have reported this on 0.12 insider builds.Why it matters
Crewmates ship in 0.12. Without this pick, every 0.12 user whose crewmate was built on an agent with hooks, deny rules, or path or command limits is stuck without that agent's tools, and the next RC ships the refusal that main has already fixed.
Not a goal
What changed (motivation → approach → change)
git cherry-pick -xof main commit0354d5f7d8f426a6b800efc83283b0cb6e08c023(#28501) ontoorigin/release/0.12.0@c8f4728c78. Same 36 files, +1680 -93, as on main.Before picking, I checked for dependencies on main PRs that are not on
release/0.12.0. Every symbol the change imports exists on the release branch (the only ones that do not are in files this change adds), and agit merge-treesimulation showed one conflict only.Conflict:
src/kiro_crew/docs/agent-spec-fields.md, thehookstable row. Main's version of that row also carries a sentence about the pi backend from a different PR. Resolution: keep the release branch's row and add only this change's sentence ("A crewmate's worker is read as its session's merged spec ..."). No code conflicted.What #28501 does (unchanged here):
mate_spec_policy.pylayers a template's hooks, permission rules and tool settings onto the crewmate's worker exactly, and refuses by name (SpecPolicyUncarried) anything that cannot land exactly.worker_additions/merge_worker_speccarry the crewmate file's policy onto the worker.mate_worker.mate_service_scope_spec.acp/session_mcp_crewmate.py).template_restrictions_uncarriedortemplate_policy_backend_unsupportedonly when a field cannot be applied; the dashboard message names the field.docs/decisions/2026-11-02-a-crewmates-worker-carries-its-template-policy.md. Specs:crew-mode.md,agent-spec-fields.md.Backwards compatibility
Compatible: every template accepted before is still accepted with the same file written; a template that was refused for hooks, permissions or tool settings is now accepted on KAS or refused with a narrower, named reason. The crewmate's chat is unchanged.
mate_config_migration.pychanges how restrictions are compared. Readers onrelease/0.12.0:Reader: src/kiro_crew/mate_worker_kit.py:_plan -- crew page -- calls
uncarried_restrictions, which now returns only fields that cannot land exactly;test_mate_spec_policy.py::test_a_template_setting_the_worker_base_sets_differently_is_refused_by_nameReader: src/kiro_crew/mate_config_migration.py:plan_move -- release -- startup migration; the file it writes carries no policy, so
differencesreports the same losses as before;test_mate_config_migration.pyReader: src/kiro_crew/mate_config_migration.py:dry_run -- release -- default-template file path, same
differencescall;test_mate_config_migration.pyReader: src/kiro_crew/mate_config_migration.py:dropped_restrictions -- release -- iterates
toolsSettingskeys, which per-tool entries still yield one by one;test_mate_upgrade_notice.pyReader: src/kiro_crew/mate_config_migration.py:_fallback_keeping_limits -- release -- unreadable-agent fallback, same
differencescall;test_mate_migration_real_kirocrew.pyTests
Proof: not provable -- other: a pick identical to main's code; its tests and mutation checks ran on #28501
test_mate_spec_policy.py(61 tests, added by feat: carry a crewmate's template policy onto its worker #28501) plus everytest/file matching mate, member, crewmate, agent_spec, harness, spec_hook, session_mcp, kas_auto_approve, kas_tool, kas_spec and worker_kit (207 files): 7048 passed, 21 skipped, 3 failed. The 3 failures (test_acp_harness_contract.py::test_a_missing_self_served_binary_names_its_install_command[copilot],test_auto_improvement_members.py::test_assignments_build_real_context_from_only_their_private_store,test_harness_parity.py::test_is_kiro_cli_is_positive) fail the same way on an untouchedrelease/0.12.0checkout on the same host, so they come from the host, not this pick.-n0 -x, 7 sequential batches over the 131test/files that touch a changed module or spec): 6295 passed, 20 skipped, 1 failed. The failure,test_harness_parity.py::test_is_kiro_cli_is_positive, fails the same way on an untouchedrelease/0.12.0checkout on the same host.workerKitErrors.test.ts14 passed;tsc -bclean.mypy src/kiro_crew;check_file_line_cap,check_comment_history,check_brand_name,check_harness_parityagainstorigin/release/0.12.0: all pass.Manual verification
Still required, as on #28501: add an agent with a
preToolUsehook and adenyrule to a crewmate on KAS, then confirm the hook fires and the deny holds in a worker it opens.Screenshots / video
The frontend diff is identical to #28501's, so its screenshots apply unchanged:
Related Issues
Forward-port of #28501 to
release/0.12.0. Part of #26881.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.