Skip to content

fix(agent): never rewrite a crew-bound spec Crew does not own - #25325

Merged
buluoray merged 1 commit into
mainfrom
fix/25289-kas-no-rewrite-unowned-spec
Oct 29, 2026
Merged

buluoray merged 1 commit into
mainfrom
fix/25289-kas-no-rewrite-unowned-spec

Conversation

@buluoray

@buluoray buluoray commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Kiro Crew stops rewriting crew-bound agent specs it does not own, so the user's own kiro-cli sessions keep their auto-approvals, while every Crew session still meets the governance ceiling.

When a crew row is bound to an agent spec Kiro Crew did not write (a user-written or package-installed file in ~/.kiro/agents), every gateway rebuild ran the shared-template governance pass and wrote the ceiling-filtered allowedTools / autoApprove back into that file. kiro-cli loads the same file outside Kiro Crew, so the user's own sessions lost those grants, and a package manager that reinstalls the spec fights the rewrite on every restart (observed: 46 allowedTools entries cut to 4 after a restart).

Why it matters

The rewrite damages a file the user owns. On KAS it also protects nothing: the KAS projection already filters both grant lists against the live ceiling at session start.

Not a goal

  • Rows whose kiro_agent already names their own crewmate file (the feat(crew-mode): move every used crewmate to its conductor on upgrade #24954 migration's result), Kiro Crew's own specs, and the fork refresh: their writers are unchanged. The one fork the migration touches is a crewmate's own private copy that shadows its crewmate file, which it retires (owner ruling, item 3 below).
  • Specs no crew is bound to.
  • A new copy mechanism for the v2 (kiro-cli) harness, which is being retired.

What changed (motivation → approach → change)

Depends on #25332, the superseding decision entry (docs/decisions/README.md rule 3 ships it in its own pull request). The scope grew from the first head of this PR (a KAS-only skip) on the owner's rulings recorded there.

Measured first. Since #24954 a migrated crewmate's kiro_agent names ~/.kiro/mates/agents/<id>.json, which this pass never scans. On one live install (11 rows, 13 crewmate files, 65 specs in ~/.kiro/agents): 9 migrated rows reached no ~/.kiro/agents file; 1 row the migration had left in place sat on its own fork (governed by the fork refresh); 0 package-synced or legacy rows were bound to a ~/.kiro/agents spec; 0 ~/.kiro/agents specs claimed a crewmate's name; the default row is Crew-owned. So the pass reached no file there; the fix matters for rows the reporter's install has (a package spec bound to a crew) and for the name-collision case, which _claims matches by construction.

Symptom → cause → change:

  1. The pass never writes a spec Kiro Crew does not own (agent_materialization/fork_refresh.py). The rebuild's shared-template pass now runs only the capability reconcile and reads no template file, so its file-read holds, the held-path record and their probe are removed; the config-unreadable hold stays.
  2. The ceiling still holds on kiro-cli, which honours a spec file's grants before Crew's gate: require_shared_template_within_ceiling refuses a kiro-cli start (from the kiro-cli harness and from AcpClient) on a crew-bound spec Crew does not own while the two governance passes would remove a grant (an empty list is none) from any JSON file claiming the agent, or while such a file cannot be read or has a second hard link. A binding counts when it records the agent's name or the file stem kiro-cli is dispatched under its declared name (dispatch_kiro_agent), and the files claiming both spellings are checked. The same check runs when a shared runtime activates another agent's spec from disk at session/set_mode (it ends the session first), when a config load could not read a file whole (the missing binding may be this one), and for an agent a crewmate ran on before the migration moved it (moved_from_agents, matched under the stem or the name its file declares), since a conversation from before the move keeps its old template. It reads only and names the file and the remedy. It runs only for hosts in a new capability set, ACP_BACKENDS_SPEC_FILE_GRANTS = {kiro}: the hosts that read the file's grants themselves. Every other host gets Crew's projection, which filters both lists (KAS) or forwards neither (the adapted harnesses). An unread markdown file never refuses a start, since kiro-cli does not load that form.
  3. The rows that reached such a file move (mate_config_migration.py, reusing feat(crew-mode): move every used crewmate to its conductor on upgrade #24954's migration):
    • A hooks, permissions or toolsSettings restriction the crewmate file cannot carry no longer keeps a crewmate in place. It moves as it is, no tool is withheld, and its one-time notice names each restriction that no longer applies (dropped_restrictions). A gain is still never written, only offered through the capability card; the ceiling still governs the merged worker spec.
    • A crewmate whose id is shadowed by its own private copy (a fork private to it that its binding runs) moves after the copy is moved to ~/.kiro/mates/retired/ and its lineage dropped, just before the repoint. That runs under the shared spec lock the fork refresh holds across its own rewrite, re-proves the copy is Crew's inside it, and rescans the agent snapshot after. One shadowed by a spec Crew does not own stays, is told once (the notice also says a kiro-cli session on it is refused while it exceeds the ceiling), and that spec is never written.
    • A used row with no member_id (written by a person or a package sync, on a user-level spec Crew does not own, DM thread holds a turn) is given an id and its own V2 store only once its crewmate file is written and proven, published in the same compare-and-set as its repoint (a failure before it retires the allocation), allocated as the upgrade allocates it (provision_member_memory(upgrade=True)) so it keeps its slug. A row that stays keeps its memory. Never default, the default agent, a legacy built-in or an app's row; an unchatted row is left for the synced-crewmate prune. Its earlier conversation keeps its old template and store; its notice says a new chat starts on its conductor.
  4. Specs updated in the same commit: governance.md (shared-template section), crew-mode.md (migration), harness-onboarding.md (the new set); the set is classified in scripts/check_harness_parity.py.

Rejected: a config-only "on KAS" skip (the first head here). The kiro-cli floor is always reachable through a spawn override, so it needed a per-start rewrite, which the owner then ruled out: Crew never writes a spec it does not own. Rejected: withholding the tools a dropped restriction guarded; the owner ruled the row moves as is and is told.

Backwards compatibility

Breaking, by owner decision (#25332): a kiro-cli start on a crew-bound spec Kiro Crew does not own whose grants exceed the ceiling is now refused, where it used to run after the rebuild rewrote the file; a crewmate that used to stay for a hook, permissions or toolsSettings restriction now moves and that restriction does not apply on its worker, which its notice names; a used id-less row becomes a crewmate with its own memory; its earlier conversation keeps its old template and store, a kiro-cli start on that template is checked against the ceiling, and the notice says a new chat starts on its conductor. Writer sweep on origin/main: the only writer of such a file was fork_refresh._govern_json_spec, removed here (test_governed_spec_tail allowlist now empty).

Reader: src/kiro_crew/mate_config_migration.py:migrate_existing_crewmates -- release -- startup moves each row bound to a user-level spec; test_an_unmigrated_row_on_a_package_spec_moves_and_leaves_that_spec_byte_identical
Reader: src/kiro_crew/acp/harness/kiro.py:resolve_spawn -- chat -- a kiro-cli start on an over-ceiling unowned spec is refused with the file and remedy; test_kiro_spawn_refuses_a_bound_unowned_spec_over_the_ceiling
Reader: src/kiro_crew/acp/client_start.py:_spawn -- subagent -- the AcpClient route runs the same check; test_a_kiro_cli_client_spawn_runs_the_check_first
Reader: src/kiro_crew/mate_upgrade_notice.py:claim_kept_notice -- crew page -- a crewmate left behind is told once why; test_a_crewmate_the_migration_left_behind_tells_its_user_why_once
Reader: src/kiro_crew/memory_stores.py:provision_member_memory -- app -- upgrade defaults to False, so every create path allocates as before; test_a_used_synced_row_with_no_identity_gets_one_and_moves

Tests

  • test/test_shared_template_unowned_spec.py (11): a bound third-party spec is byte-identical after a rebuild; a KAS session from it cannot auto-approve a ceiling-denied tool; a kiro-cli start on it is refused and the file untouched; within-ceiling, KAS, unbound and Crew-owned starts are not refused; every claimant is checked; a hard-linked or unreadable binding refuses; the AcpClient route runs the check.
  • test/test_mate_config_migration.py: an unmigrated row on a package spec moves and leaves that spec byte-identical; a dropped toolsSettings / permissions / hook moves with no tool withheld and the notice names it; a gain is not written (existing); shadowed by its own fork moves and retires the copy; shadowed by a third-party spec stays and the spec is byte-identical; a used id-less synced row is minted (upgrade allocation) and moves, while unchatted, app, legacy and Crew-owned-spec rows are not.
  • test/test_acp_harness_contract.py: the kiro-cli harness refuses on the check.
  • test/test_conductor_allowed_tools_survive.py: the three tests that pinned the rewrite and its file-read holds are replaced by one: an over-ceiling bound template is left as written, holds nothing, the memo advances, and a kiro-cli start on it is refused.
  • Obsolete tests that pinned the in-place rewrite and its file-read holds were removed or flipped to "left as written" in test/test_agent_refactor_fork_refresh.py; test/test_mate_upgrade_notice.py now keeps its left-behind crewmate with a name clash instead of a restriction.

Each mutation applied alone and reverted; the named tests go red (plus one copilot test that is red on unmodified origin/main on this host):

Mutation Red
A dropped restriction keeps the crewmate again test_a_crewmate_whose_template_denies_writes_moves_and_is_told[permissions/toolsSettings], test_a_hook_the_worker_base_lacks_moves_and_is_named, test_an_agent_whose_prompt_does_not_resolve_keeps_its_stated_limits
The notice stops naming dropped restrictions same four
A gain is written test_a_grant_the_worker_would_gain_is_withheld_for_the_card
The start check never refuses test_a_kiro_cli_start_on_it_is_refused_and_the_file_is_untouched, test_every_claimant_of_the_name_is_checked
The kiro-cli harness skips the check test_kiro_spawn_refuses_a_bound_unowned_spec_over_the_ceiling
The shadowing private copy is not retired test_a_crewmate_shadowed_by_its_own_private_copy_moves_and_the_copy_is_retired
An unchatted row is minted test_a_used_synced_row_with_no_identity_gets_one_and_moves, test_a_binding_without_a_member_id_is_left_alone_without_a_word
Minting without the upgrade allocation test_a_used_synced_row_with_no_identity_gets_one_and_moves
A file-stem binding matched by stored name only test_a_binding_on_the_file_stem_is_checked_under_its_declared_name
Retirement skips the ownership recheck under the lock test_a_private_copy_that_changed_is_not_retired
Retirement skips the snapshot rescan test_retirement_rescans_the_agent_snapshot
Identities minted before the move is proven test_a_used_row_that_cannot_move_is_not_given_an_identity
set_mode activation skips the check test_activating_a_disk_spec_over_the_ceiling_ends_the_session_before_set_mode
An incomplete config load treated as unbound test_a_config_load_missing_a_file_still_checks_the_agent
A moved crewmate's old template not checked test_the_spec_a_moved_crewmate_ran_on_is_still_checked, test_an_unreadable_ledger_checks_the_agent_rather_than_skipping_it
A moved stem binding matched by stored name only test_a_moved_stem_binding_is_checked_under_its_declared_name
The start check writes an audit record test_a_refused_start_writes_no_withheld_record
A failed move keeps a published identity test_a_minted_row_whose_move_fails_before_publish_keeps_its_memory
The check path's autoApprove strip audits test_a_refused_auto_approve_only_spec_writes_no_record
A private copy with a markdown twin is retired test_a_private_copy_with_a_markdown_twin_is_not_retired
A failed step after retiring leaves the copy retired test_a_retirement_whose_move_fails_puts_the_copy_back[lineage], [repoint]
An unreadable ledger skips the check test_an_unreadable_ledger_checks_the_agent_rather_than_skipping_it
A warm runtime skips the check for a session that inherits the spawn agent test_a_warm_session_that_inherits_the_spawn_agent_is_checked_before_the_request[create], [load]
A KAS runtime is checked at session start test_a_kas_runtime_is_not_refused_at_session_start
The check compares documents, so an empty autoApprove list refuses test_empty_grant_lists_on_a_governed_server_are_not_refused
An unread markdown file refuses a JSON start test_a_hard_linked_markdown_file_does_not_refuse_a_json_start
The check runs on hosts that never read the file grants (opt-out set) test_only_a_host_that_reads_the_file_grants_is_refused[*]
The KAS projection's ceiling filter removed (first head) test_a_kas_session_from_that_spec_still_cannot_auto_approve_a_denied_tool

Related suites (392 files matching mate/memory_store/crewmate/member/fork/governance/kas/harness/capability/client): 15,989 passed; every failure left reproduces on unmodified origin/main on this Linux host (copilot launch goldens, a KAS config round-trip, an auto-improvement essential-source test, a sandbox mask test, a living-UI test).

Manual verification

The measurement above was read from a live install's config.json, ~/.kiro/agents, ~/.kiro/mates/agents and fork lineage, read-only. No gateway was restarted against this branch, so the migration's live run, the retire step and the minting path were exercised only in tests. Not run on Windows or macOS: the retire step uses os.replace within one home, checked against source only.

Screenshots / video

N/A: no UI change; the notice wording is server text.

Related Issues

Closes #25289. Depends on #25332.

Sibling sweep

Swept: git grep -n "_atomic_json_write\|atomic_write" -- src/kiro_crew/agent_materialization src/kiro_crew/mate_config_migration.py
Sibling: src/kiro_crew/agent_materialization/fork_refresh.py -- changed here
Sibling: src/kiro_crew/agent_materialization/default_spec_commit.py -- not affected -- writes Crew's own primary spec only

Pattern harvest

Not generalizable: the defect was one pass treating a user-owned file as Crew's to govern; test_governed_spec_tail already pins the set of direct spec writers, now empty for user templates.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license (see CONTRIBUTING.md).

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners October 28, 2026 17:11
@buluoray
buluoray requested a review from dodgeblaster October 28, 2026 17:11
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of e778f7133b1ed2ad8e1f9a10577fc71279c94f86 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. A recorded owner decision covers the stop on rewriting unowned specs and the fail-closed kiro-cli start check. The description is cut off inside its Backwards compatibility section, so its reader list was not judged in full.

Notes

  • require_shared_template_within_ceiling loads KiroCrewConfig and the migration ledger before it checks whether Crew owns the spec. Its catch-all except Exception then refuses the start. So a config or ledger failure would refuse every named kiro-cli start, Crew-owned agents included. Deciding ownership first would keep that failure off session start for Crew's own specs.
  • The deleted fork_refresh hold, probe and hard-link tests pinned the rewrite this PR removes, and the 2026-10-28 decision entry supersedes that rule. That makes them a reversed decision, not a gap. This holds only if docs(decisions): every crewmate on a user-level agent moves to the conductor #25332 merges first.
  • The fork-retire step and the id allocation for rows with no member_id are one-way changes to persisted data. Retired copies stay in ~/.kiro/mates/retired/, so a rollback is still possible by hand, but the PR describes no automated undo.

[DESIGN-REVIEWED] e778f71

Description read

[DESCRIPTION-READ] 835063f958ea10b563a64f3f55a1f3fe5928195937a353e07febc4708def79a0

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of e778f7133b1ed2ad8e1f9a10577fc71279c94f86 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. Two riders loosen what existing crewmates get, and their support is an owner decision entry rather than an RFC status.

Notes

  • Item 4 — rides along: on its own, item 1 already stops the rewrite for a row that stays where it is. Dropping a hook, permissions or toolsSettings restriction loosens a user's own guard. That conflicts with the accepted rfc-mate-owned-agent-config §6 exit criterion "no capability silently gained or lost". The only thing stopping it is the notice. Its support is docs/decisions/2026-10-28-…, not an RFC status. Subtraction: defer dropped_restrictions and the "moves as it is" branch to their own PR, and keep a restricted row in place (its spec is no longer written, and item 2 refuses its over-ceiling starts).
  • Item 6 — rides along: §6 of the RFC covers "existing crewmates". It does not cover id-less rows becoming crewmates with their own V2 store. Whether it does is a judgement call, so this is a note and not trigger (c).

What this change ships

Inventory (10 items) — 7 justified

Intent: the user's own kiro-cli sessions keep the auto-approvals in their agent files, and Crew sessions still stay inside the ceiling. This is a FIX.

  1. Rebuild no longer writes filtered grants into a crew-bound spec Crew does not own — justified
  2. kiro-cli start, resume and mode switch are refused on an over-ceiling, unreadable or hard-linked unowned spec — justified
  3. Held-path record and its probe deleted — justified
  4. Crewmates kept in place for a restriction now move, and the restriction no longer applies — rides along
  5. A crewmate's own private shadowing copy is retired, then the crewmate moves — rides along
  6. Used id-less rows get an id and their own memory store, then move — rides along
  7. One-time notice names the dropped restrictions and the kiro-cli refusal — justified
  8. New ACP_BACKENDS_SPEC_FILE_GRANTS set — justified
  9. Ceiling filters gain a read-only audit=False mode — justified
  10. provision_member_memory(upgrade=True) keeps a row's existing slug — justified

[FIRST-PRINCIPLES-REVIEWED] e778f71

Description read

[DESCRIPTION-READ] b37932c851cfd651a54c23dc1ca9af68ab79707c83ee7f4c8c38096872f07a1f

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision e778f7133b1ed2ad8e1f9a10577fc71279c94f86 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of e778f7133b1ed2ad8e1f9a10577fc71279c94f86 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e778f71

False positive or not applicable? A repository writer can comment:
/ai-review override gpt e778f7133b1ed2ad8e1f9a10577fc71279c94f86 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed e778f7133b1ed2ad8e1f9a10577fc71279c94f86 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] e778f71

Verdict parsed from the review's SHA-scoped output markers for commit e778f7133b1ed2ad8e1f9a10577fc71279c94f86.

False positive or not applicable? A repository writer can comment:
/ai-review override fable e778f7133b1ed2ad8e1f9a10577fc71279c94f86 false-positive: <reason, 20 to 500 characters>

@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from b6aaae2 to ebf34df Compare October 28, 2026 18:01
@buluoray buluoray changed the title fix(agent): leave crew-bound specs Crew does not own unwritten on KAS fix(agent): never rewrite a crew-bound spec Crew does not own Oct 28, 2026
@buluoray

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: the scope of this PR changed at the owner's request, and the title, Goal and body now describe the new head ebf34df6b9.

The first head skipped the rewrite only when every configured harness arm was KAS and re-filtered the file before a kiro-cli start. The owner then ruled that Kiro Crew never writes a spec it does not own, and that the rows still bound to one move onto their own crewmate file. This head implements that: the pass writes no such spec, a kiro-cli start on one the ceiling would narrow is refused, and the migration moves the remaining rows (restrictions the crewmate file cannot carry move with it and are named in the notice). The superseding decision entry is #25332, which this PR depends on.

@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from ebf34df to b4bb5de Compare October 28, 2026 18:45
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 28, 2026
@buluoray
buluoray enabled auto-merge (squash) October 28, 2026 18:53
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 28, 2026
@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from b4bb5de to b1d2ac4 Compare October 28, 2026 20:16
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 28, 2026
@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from b1d2ac4 to 6061958 Compare October 28, 2026 21:27
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 28, 2026
@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from 6061958 to 396b761 Compare October 28, 2026 22:01
@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from 81e3ae4 to 085e38d Compare October 29, 2026 04:14
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Oct 29, 2026
@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from 085e38d to 46e0afd Compare October 29, 2026 09:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 29, 2026
@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from 46e0afd to b221ad2 Compare October 29, 2026 12:47
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 29, 2026
@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from b221ad2 to 95f2036 Compare October 29, 2026 17:11
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 29, 2026
The shared-template governance pass rewrote every crew-bound spec Crew does
not own to filter its allowedTools/autoApprove, writing the user's own file
in ~/.kiro/agents. kiro-cli loads that same file outside Crew, so the user's
own sessions lost those grants, and a package manager reinstalling the spec
fought the rewrite on every restart.

Per the owner decision superseding the 2026-10-27 migration entry:

- The pass never writes such a spec. KAS filters both lists against the
  live ceiling in its projection; a kiro-cli start on such a file is refused
  while the governance passes would narrow it (or it cannot be read), so no
  Crew session auto-approves a ceiling-denied tool.
- The startup migration moves the rows that still reach such a file onto
  the conductor and their own crewmate file. A hooks/permissions/
  toolsSettings restriction the file cannot carry no longer keeps a crewmate
  in place: it moves as is and its one notice names each dropped
  restriction. A gain is still only offered through the capability card.
- A crewmate shadowed by its own private copy (a fork) moves after the copy
  is retired to ~/.kiro/mates/retired/; one shadowed by a spec Crew does not
  own stays, is told once, and that spec is never written.
- A used row with no member_id (person- or package-written, DM thread holds
  a turn) is given an id and its own V2 store first, allocated as the
  upgrade allocates it so it keeps its slug.

Closes #25289
@buluoray
buluoray force-pushed the fix/25289-kas-no-rewrite-unowned-spec branch from 95f2036 to e778f71 Compare October 29, 2026 18:25
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 29, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared-template governance rewrites crew-bound agent specs Kiro Crew does not own

2 participants