Repository navigation
Conversation
Add abilities refused a template whose hooks, permission rules or tool settings equal ones the crewmate's worker base already holds, with template_restrictions_uncarried. The preflight layered the template's whole policy before anything removed what the base holds, so a held fs_write allowedPaths/fallbackAction entry hit the allowlist. The preflight now drops held policy with without_held before layering, as the kit copy already does, and still compares the full template's restrictions with the merged worker. An unreadable base still refuses. Refs #28501
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Add abilities refused a template whose hooks, permission rules or tool settings equal ones the crewmate's worker base already holds, with template_restrictions_uncarried. The preflight layered the template's whole policy before anything removed what the base holds, so a held fs_write allowedPaths/fallbackAction entry hit the allowlist. The preflight now drops held policy with without_held before layering, as the kit copy already does, and still compares the full template's restrictions with the merged worker. An unreadable base still refuses. Mirrors #29392 on main (same diff). Refs #28501
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix reuses the existing What this change shipsInventory (3 items) — 3 justifiedIntent: let a user add a template's MCP server when the template repeats tool limits the worker base already holds. FIX.
[FIRST-PRINCIPLES-REVIEWED] be2209c Description read[DESCRIPTION-READ] 3c2f1656f4c803aae9afa1bb527fa1eddfd73b877566c3cdc2abc4bf2e7de5ea That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The preflight now runs the same Notes
[DESIGN-REVIEWED] be2209c Description read[DESCRIPTION-READ] 042bb3e470525330fcd92e3892cf77e9225d4c6bd7aa311857a1ec7b732b0481 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 |
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: |
Opus 5.5 Review — 🔴 changes requested (blocking)Reviewed The preflight now accepts a template's BLOCKING — src/kiro_crew/mate_config_migration.py:980 [BLOCK-MERGE] be2209c Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
Closing: this change contradicts docs/decisions/2026-11-02-a-crewmates-worker-carries-its-template-policy.md, which refuses every toolsSettings key outside its allowlist by name. Skipping entries the worker base holds would accept such a template silently while the setting still does not apply on the worker (Opus review on this head). The current refusal is the decided behaviour. |
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed be2209c. Two points before merge:
- A held tool setting now skips the refusal, not just the layering conflict (Opus,
mate_config_migration.py:980).uncarried_restrictionsnow removes policy the worker base already holds (without_held) beforemerge_worker_spec. For a template whosetoolsSettingsentry, for examplefs_write.allowedPaths/fallbackAction, equals one inkirocrew-mate-worker.json,layer_policythen never runs_outside_allowlistortools_settings_unenforcedon it. An add or create that used to be refused withtemplate_restrictions_uncarriednaming that field now succeeds, while the template's write fence still never takes effect on the worker. The new test pins that (lost == [] if held). That contradictsdocs/decisions/2026-11-02-a-crewmates-worker-carries-its-template-policy.md. Fix direction, as the lane suggests: run_outside_allowlistandtools_settings_unenforcedover the fullpolicy_of(source)["toolsSettings"]before subtracting the held entries, so a held entry skips only the layering conflict and not the refusal by name. Or, if accepting it is intended, add a superseding decision entry. - PR Hygiene is red: the diff removes behavior, so the description needs a
## Backwards compatibilitysection with oneReader: <path>:<symbol> -- <entry> -- <why>line per reader.
The test shards and E2E were still running when I checked.
Problem / Motivation
Goal: Add abilities accepts a template whose hooks, permission rules or tool settings the crewmate's worker base already holds, instead of refusing it with
template_restrictions_uncarried.#28501 lets a crewmate take an agent's hooks, permission rules and tool settings. Its add preflight (
uncarried_restrictions) layers the template's whole policy onto the worker base before anything removes what the base already holds. So a template that repeats the base's ownfs_writeallowedPaths/fallbackActionis refused, even when the user only wants its MCP server. Found by the GPT review lane on the 0.12 forward-port, #29378.Why it matters
Users whose worker base carries tool limits cannot add a template that carries the same limits. The template stays refused until its settings change, with no workaround in the dashboard.
Not a goal
without_held.What changed (motivation → approach → change)
Symptom:
uncarried_restrictionsnames heldtoolsSettingsentries as lost. Cause: it passes the template's full policy tomerge_worker_spec, whose allowlist check judges entries the base already holds. The kit copy (mate_worker_kit._carry_policy) subtracts them first; the preflight did not.Change:
uncarried_restrictionsinmate_config_migration.pynow removes held policy withmate_spec_policy.without_heldbefore the merge, the same step the kit copy takes. It still compares the full template's restrictions with the merged worker, so a held restriction the merge loses is still reported.crew-mode.mddescribes the preflight.Backwards compatibility
Compatible: a template accepted before is still accepted; a template refused only for policy the base already holds is now accepted. Net-new unsupported settings are still refused.
Removes nothing: no key, record or guard is removed.
Tests
Proof: PROVEN test_mate_spec_policy.py::test_preflight_judges_only_policy_not_held_by_the_base[True], test_preflight_still_detects_a_held_restriction_lost_by_the_merge[hooks|permissions|toolsSettings], test_adding_a_server_with_policy_already_held_by_the_base_succeeds (head be2209c; production hunk reverted by hand, 5 of the 7 new cases fail)
New cases in
test/test_mate_spec_policy.py:Runs (
-n0 -x):test_mate_spec_policy.py69 passed;test_mate_worker_kit.py+test_mate_config_migration.py131 passed. flake8, black (py310), isort, mypy on the touched file,check_comment_history,check_brand_name: pass.Manual verification
N/A - the preflight is a pure function of the template and the worker base, covered end to end by
test_adding_a_server_with_policy_already_held_by_the_base_succeeds.Related Issues
Refs #28501
Part of #26881
Sibling sweep
Swept: git grep -n "worker_additions(base" -- src/
Sibling: src/kiro_crew/mate_worker_kit.py:_carry_policy -- not affected -- already applies without_held before layering
Sibling: src/kiro_crew/mate_worker_kit.py:436 -- not affected -- merges the planned crewmate file, written after without_held
Sibling: src/kiro_crew/mate_worker.py:653 -- not affected -- merges a crewmate file at session start, which the kit wrote without held policy
Sibling: src/kiro_crew/mate_config_migration.py:migration_file -- not affected -- copies no policy keys and does not merge
Sibling: src/kiro_crew/mate_config_migration.py:1127 -- not affected -- merges the migration's planned file, which carries no policy
Sibling: src/kiro_crew/mate_config_migration.py:1334 -- not affected -- merges the written crewmate file, which carries no held policy
Pattern harvest
Not generalizable: one preflight skipped a subtraction its sibling path already performs; the fix shares that step.
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.