Repository navigation
fix: rewrite the lite spec from its template before refusing a turn - #33965
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change reuses the guest spec's repair-before-refuse path for the lite spec, and the refusal still comes from a second read of the spec. Notes
[DESIGN-REVIEWED] 3e80b0f Description read[DESCRIPTION-READ] 8e57df1dd54bebee6b29838b6425d68ebae2acff19fdf8345096117e8c15c1ec 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the rewrite reuses the guest repair's body and reset loop, and the What this change shipsInventory (7 items) — 7 justifiedIntent: keep history consolidation and the other background helpers running after another tool writes an MCP server into
[FIRST-PRINCIPLES-REVIEWED] 3e80b0f Description read[DESCRIPTION-READ] d77b2500a2cd409b8913a12cf221120dda35a26c4dc43df8a3734a0074bd961e 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 — ✅ 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: |
buluoray
left a comment
There was a problem hiding this comment.
Approved at f6dc330. When another tool injects an MCP server into kirocrew-lite.json, the background helper now rewrites the file from its template and re-reads it before refusing (src/kiro_crew/llm_helpers_parts/background_turns.py:593-619, src/kiro_crew/agent_materialization/service_agents.py:422-469). Only the first read vouches for a live session, and _bg/_consolidate are reset after a rewrite, so the tool-less boundary still fails closed while consolidation recovers without a rebuild.
buluoray
left a comment
There was a problem hiding this comment.
Approve on f6dc330. When another tool injects an MCP server into kirocrew-lite.json, the background helper now rewrites the file from its template and re-reads it before refusing (llm_helpers_parts/background_turns.py:593-619, agent_materialization/service_agents.py:422-469). Only the first read vouches for a live session, and _bg/_consolidate reset after a rewrite, so the tool-less boundary still fails closed while consolidation recovers without a rebuild. The remaining red is the main-wide lazy-import check, not this diff.
f6dc330 to
31c4c75
Compare
|
Rebased: main moved in The red The PR's added and removed lines are unchanged from the approved f6dc330; only their context moved. The push dismisses that approval, so the new head needs a fresh one. |
31c4c75 to
1c28e6f
Compare
|
self-added: yes
|
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates an 18% chance that this change introduces a defect, above the 12% limit for approving on its own. The PR adds a template rewrite of kirocrew-lite.json before a background turn would be refused, then resets _bg and _consolidate. A second read still decides whether the turn runs, so the refusal stays fail-closed. Verified in the code: the vouching fence (the running/begun counts plus the _lite_resets_failed map); the reset advancing _bg's generation even with nothing registered (teardown.py:249), which the _ensure_background_single guard relies on; a discarded _bg start falling through to a normal cold start in get_or_create; the installer and the repair sharing _lite_agent_config(), so a correct file is never seen as drifted; and the guest path keeping its bound and its set of reset sessions. Tests cover each new branch. No regression or trust-boundary problem found. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
buluoray
left a comment
There was a problem hiding this comment.
Request changes on 1c28e6f. The new fence still misses one path. A _bg cold start that loaded the injected spec, and registers after the repair's resets ran, is later confirmed by a turn whose reads both see the restored template. On a backend with no prepared projection, that turn runs on a runtime with the injected server mounted, and main would have refused it. GPT 6.1's fenced security finding still holds at this head. Decisive lines: src/kiro_crew/llm_helpers_parts/background_turns.py:529-535, src/kiro_crew/session_background.py:466-470, src/kiro_crew/acp/client_mcp_array.py:228-231, src/kiro_crew/llm_helpers_parts/background_turns.py:652,698
1c28e6f to
646a3bc
Compare
|
self-added: yes
[operator: bolichen97] |
81c5e6d to
d1870ae
Compare
|
Rebased: main moved in The red The new head also drops one redundant check from |
A tool that writes its own MCP server into every agent spec under the agents directory leaves kirocrew-lite.json mounting a server. The background helper correctly refuses to start a session on such a spec, but nothing put the file back before the next rebuild, so every background turn, history consolidation included, was refused. Before refusing, the helper now rewrites an existing kirocrew-lite.json that is not its template, through the same governed writer the installer uses, and reads the spec again. That second read still decides; a spec that still mounts something is refused as before, and a missing file is never created. The rewrite and the session resets after it run through the same code the guest spec repair uses, so each reset is bounded and one hung teardown cannot hold background turns. A session that started before the rewrite may have loaded the old file, so only the read before the rewrite vouches for a session, and not while a rewrite runs. A rewrite resets the _bg and _consolidate sessions, the two that outlive a turn and can start without the pre-spawn read, the turn's own included, and those resets finish even when the turn is cancelled. On a backend with no prepared projection, which cannot tell such a session from a new one, the turn that rewrote the file is refused and its own session reset, and so is a turn whose pre-spawn read overlapped a rewrite. A _bg start still in flight when the rewrite resets _bg is shut down instead of registered, so no later turn can take a session that loaded the old file. The next turn starts on the rewritten file. Closes #33345
d1870ae to
3e80b0f
Compare
|
self-added: yes
[operator: bolichen97] |
|
Review state on
AI-assisted, sent by CommunityCrew |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approving. Checked on this head:
- Before refusing a turn, the repair rewrites an existing
kirocrew-lite.jsononly when it differs from_lite_agent_config(), the same config the installer writes from. A second read then decides whether the turn runs. - The regression test
test_an_injected_server_is_rewritten_away_and_the_next_turn_runsis red on main and green here. - Each part of the concurrency fence (
runningandbeguncounts, the shield,_lite_resets_failed, the_bggeneration check) has a test that fails when that part is removed. - No new blocking-call or determinism problem. The guest repair now goes through the shared
reset_after_spec_repairand keeps its 30 s bound.
Security: the refusal still fails closed. A missing or linked file is never rewritten. A pre-spawn read taken during or before a repair vouches for nothing. A failed or cancelled reset leaves its provider refused. A _bg cold start that a reset overtook is shut down, not registered. So no session ever starts on a spec that mounts an injected server.
Well done: the guest repair's copied reset loop is gone, and both specs now go through one repair body.
Optional:
service_agents.py:164: the new "keep a newer failed provider" rule has no test. If a repair's reset stub records a second provider whose own reset raises, a test could check that the entry survives. That test would go red on a plainpop.background_turns.py:665: if a member-store consolidation turn is cancelled during the shielded repair wait,_cleanup_memory_consolidation_sessionnever runs. Theexcept BaseExceptioncleanup thatget_or_createalready has could cover this block too.background_turns.py:708: the lite tests never give a fresh provider after a failed reset, so the identity check could be loosened tokey in _lite_resets_failedand no test would fail.
A history consolidation that never reaches a provider (kiro-cli missing, or the lite spec refused before its session starts, as in #33345) arms the session's environment backoff, and that wait widens to a day. Nothing released it when the host recovered, so after the #33965 fix landed every session refused meanwhile still sat out up to 24 hours before consolidating. The first consolidation turn a provider answers after a process start, after the startup scan adds sessions, or after any environment failure now releases the environment backoff of every tracked session. A turn that raised releases nothing. Each session is released once until it next consolidates and keeps its failure count, so a session whose failure is its own resumes widening to the ceiling. A session with a billed attempt on its current span keeps its wait, and nothing is marked consolidated. Part of #33345
A history consolidation that never reaches a provider (kiro-cli missing, or the lite spec refused before its session starts, as in #33345) arms the session's environment backoff, and that wait widens to a day. Nothing released it when the host recovered, so after the #33965 fix landed every session refused meanwhile still sat out up to 24 hours before consolidating. The first consolidation turn a provider answers after a process start, after the startup scan adds sessions, or after any environment failure now releases the environment backoff of every tracked session. A turn that raised releases nothing. Each session is released once until it next consolidates and keeps its failure count, so a session whose failure is its own resumes widening to the ceiling. A session with a billed attempt on its current span keeps its wait, and nothing is marked consolidated. Part of #33345
A history consolidation that never reaches a provider (kiro-cli missing, or the lite spec refused before its session starts, as in #33345) arms the session's environment backoff, and that wait widens to a day. Nothing released it when the host recovered, so after the #33965 fix landed every session refused meanwhile still sat out up to 24 hours before consolidating. The first consolidation turn a provider answers after a process start, after the startup scan adds sessions, or after any environment failure now releases the environment backoff of every tracked session. A turn that raised releases nothing. Each session is released once until it next consolidates and keeps its failure count, so a session whose failure is its own resumes widening to the ceiling. A session with a billed attempt on its current span keeps its wait, and nothing is marked consolidated. Part of #33345
…36632) A history consolidation that never reaches a provider (kiro-cli missing, or the lite spec refused before its session starts, as in #33345) arms the session's environment backoff, and that wait widens to a day. Nothing released it when the host recovered, so after the #33965 fix landed every session refused meanwhile still sat out up to 24 hours before consolidating. The first consolidation turn a provider answers after a process start, after the startup scan adds sessions, or after any environment failure now releases the environment backoff of every tracked session. A turn that raised releases nothing. Each session is released once until it next consolidates and keeps its failure count, so a session whose failure is its own resumes widening to the ceiling. A session with a billed attempt on its current span keeps its wait, and nothing is marked consolidated. Part of #33345
…ox tool (#33345) (#36777) * fix: rewrite the guest spec from its template before refusing a turn (#34253) A tool that writes its own MCP server into every agent spec under the kiro agents directory leaves kirocrew-guest.json mounting that server, and a deny_all_tools channel turn refuses before its spawn on a guest spec that mounts anything. Only a rebuild put the file back, so every non-operator turn was refused until then. When the pre-spawn read refuses, the channel pipeline now rewrites an existing kirocrew-guest.json that is not its template through the same governed writer the installer uses, resets every live session bound to the guest agent, and reads the spec again; that second read decides. A live guest process may still mount the injected server after the file reads clean, since kiro-cli applies a reload only at a turn boundary and not on every version. A turn whose spawn overlaps a repair, which the resets may not reach, is refused: the count of started repairs is read before the vouching read and the read after the start confirms only when no repair started since and none is running. Each reset is bounded so a hung teardown cannot keep every guest turn refused. A missing file is not created. _spec_drift takes its reader's operation label from the caller. Closes #33522 (cherry picked from commit 387ea66) * fix: rewrite the lite spec from its template before refusing a turn (#33965) A tool that writes its own MCP server into every agent spec under the agents directory leaves kirocrew-lite.json mounting a server. The background helper correctly refuses to start a session on such a spec, but nothing put the file back before the next rebuild, so every background turn, history consolidation included, was refused. Before refusing, the helper now rewrites an existing kirocrew-lite.json that is not its template, through the same governed writer the installer uses, and reads the spec again. That second read still decides; a spec that still mounts something is refused as before, and a missing file is never created. The rewrite and the session resets after it run through the same code the guest spec repair uses, so each reset is bounded and one hung teardown cannot hold background turns. A session that started before the rewrite may have loaded the old file, so only the read before the rewrite vouches for a session, and not while a rewrite runs. A rewrite resets the _bg and _consolidate sessions, the two that outlive a turn and can start without the pre-spawn read, the turn's own included, and those resets finish even when the turn is cancelled. On a backend with no prepared projection, which cannot tell such a session from a new one, the turn that rewrote the file is refused and its own session reset, and so is a turn whose pre-spawn read overlapped a rewrite. A _bg start still in flight when the rewrite resets _bg is shut down instead of registered, so no later turn can take a session that loaded the old file. The next turn starts on the rewritten file. Closes #33345 (cherry picked from commit ca95636) * fix: release the stale consolidation backoff once a turn is answered (#36632) A history consolidation that never reaches a provider (kiro-cli missing, or the lite spec refused before its session starts, as in #33345) arms the session's environment backoff, and that wait widens to a day. Nothing released it when the host recovered, so after the #33965 fix landed every session refused meanwhile still sat out up to 24 hours before consolidating. The first consolidation turn a provider answers after a process start, after the startup scan adds sessions, or after any environment failure now releases the environment backoff of every tracked session. A turn that raised releases nothing. Each session is released once until it next consolidates and keeps its failure count, so a session whose failure is its own resumes widening to the ceiling. A session with a billed attempt on its current span keeps its wait, and nothing is marked consolidated. Part of #33345 (cherry picked from commit 0e5b203)
Problem / Motivation
Goal: History consolidation and the other background helper turns keep running on a host where another tool writes its own MCP server into
kirocrew-lite.json, and the background session still never starts on a spec that mounts anything.A credentials sandbox tool writes a
creds-agentMCP entry into every agent spec under~/.kiro/agents/each time it launches,kirocrew-lite.jsonincluded. The background helper refuses to start akirocrew-litesession on a spec that mounts anything, so every background turn is refused before its session starts:Nothing puts the file back until the next rebuild, so history consolidation stops for good: #33345 counts 1,401 refusals and no consolidation in five days, and a new session's Recent History stops on the day the tool started.
Why it matters
Everyone who runs such a tool loses history consolidation and the other background helpers (titles, summaries, skill dedupe), and editing the file by hand does not last because the tool writes it back on its next launch. The background agent reads text Kiro Crew does not author (chat history, issue bodies, transcripts), so the fix must never let it start on a spec that mounts a tool.
Not a goal
kirocrew-guest.jsonfor non-operator channel turns (tracked in Non-operator channel turns stay refused when another tool injects a server into kirocrew-guest.json #33522).kirocrew-lite.json, or changing what the tool-less check accepts.What changed (motivation → approach → change)
The refusal is right; what was missing is a way back.
kirocrew-lite.jsonis Kiro Crew's own file and only a rebuild re-derives it, so once another tool writes into it every background turn is refused until then. The guest spec already has a repair before it would refuse; the lite spec now runs through that same repair code before the helper would refuse.repair_lite_agent_spec(agent_materialization/service_agents.py)kirocrew-lite.jsonthat is not its template and says whether it did, through the same governed writer the installer uses, with a WARNING that names the differing keys and never their values. A missing file stays missing, and a data home that does not own the agents directory leaves the file alone. It andrepair_guest_agent_specshare one body (_repair_spec_from_template), and the installer and the repair build the spec from one_lite_agent_config(). Exported through thekiro_crew.agentfacade (agent.py).reset_after_spec_repair(agent_materialization/service_agents.py)_SPEC_REPAIR_RESET_TIMEOUT_SECS, 30 s), so one hung teardown cannot hold every turn on that spec refused. A provider whose reset raises or times out stays in that spec's failed-reset map, so the clean file never vouches for it. The guest path inmessaging/dispatch_tools.pycalls it in place of its own loop, with the same bound it had.background_turn(llm_helpers_parts/background_turns.py)_bgand_consolidatesessions, the two that outlive a turn and can start without the pre-spawn read, the turn's own when it is one of them, and those resets finish even when the turn is cancelled. On a backend with no prepared projection, which cannot tell such a session from a new one, the turn that rewrote the file is refused and its own session reset, and so is a turn whose read before the spawn overlapped a rewrite or was followed by one before its check after the start. A session left unconfirmed, because its turn was cancelled inside that check or a reset of it raised or timed out, is recorded by key in_lite_resets_failed: the next turn on that same session is refused and resets it, and only a reset that returns forgets it. The lite counters, task set and failed-reset map stay separate from the guest's, so a lite repair never refuses a channel turn. The vouching rule differs from the guest's because_bgcan start outside any turn (_ensure_background), so a session the second read sees may still have loaded the old file; a guest session only starts inside a guest turn. The next turn starts on the rewritten file. The new names are listed in thellm_helpers.pyfacade manifest._ensure_background_single(session_background.py)_bgcold start still in flight when a reset of_bgruns, the rewrite's reset included, is shut down instead of registered, so no later turn can claim a session that loaded the old file. The start reads the key's ownership generation before the spawn, and a reset moves it even with nothing registered yet.src/kiro_crew/docs/agent-spec-fields.mddescribes the repair beside the tool-less check,docs/system-specs/modules/session.mdsays a_bgstart a reset overtook is not registered, anddocs/system-specs/modules/messaging.mdnames the shared reset bound for the guest repair.Backwards compatibility
Compatible: a lite spec that mounts nothing is neither rewritten nor read a second time, and a spec the repair cannot restore is refused exactly as on main. The guest repair keeps its 30 s reset bound and its rewrite log lines. Two things differ there: a reset the guest repair runs that returns now forgets its failed-reset entry only when that entry is still the provider it reset, so a newer provider a refusal recorded meanwhile stays refused; and the warning for a reset that fails reads
Could not reset session <key> after its agent spec was rewrittenon thekiro_crew.agentlogger. Any reset of_bgthat overtakes an_ensure_backgroundcold start now discards that start, and its caller finds no_bg, as after a failed start.Removes nothing: the rebuild already rewrites
kirocrew-lite.jsonfrom this same template on every boot; this rewrites it once more, only when a background turn would otherwise be refused, and every other session opened onkirocrew-lite(thenudge.wakejudge, workflows, the prompt optimizer) is built for that same tool-less template. The guest reset bound moves frommessaging/dispatch_tools.pytoagent_materialization/service_agents.pywith the same value; every reader of it is in this diff.Tests
test/test_messaging_dispatch.py,TestBackgroundTurnRefusesATooledLiteSpec:test_an_injected_server_is_rewritten_away_and_the_next_turn_runs: the issue's injectedtools,allowedTools,mcpServers,permissionsandtoolsSettingsare rewritten back to the template; the_bgturn right after the rewrite, on a session that was already running, resets_bgand_consolidate, is refused and has its own session reset, and the next turn starts.test_a_rewrite_resets_both_background_sessions: a rewrite during a_bg,_consolidateor memory-store turn resets both persistent background sessions, then that turn's own.test_a_hung_reset_does_not_hold_the_rewrite: a rewrite whose resets never return gives up on them after the bound; the turn that triggered it is refused, the rewrite finishes, and a later_bgturn runs.test_a_turn_reading_the_file_while_a_rewrite_resets_is_refused: a second_bgturn whose read sees the rewritten file while the rewrite is still resetting sessions is refused and never runs.test_a_rewrite_begun_after_the_pre_spawn_read_voids_it: a turn that read the template, then had the server injected and the file rewritten by another turn before its check after the start, is refused.test_a_cancelled_turn_still_finishes_its_rewrite_resets: a turn cancelled while its rewrite resets the first session leaves both resets to finish before another turn's read vouches again.test_a_turn_cancelled_in_its_check_after_a_repair_leaves_its_session_refused: a_consolidatecold start that another turn's repair overtakes, cancelled inside its check after the start, leaves the next turn on that session refused and the session reset although the file and the pre-spawn read are clean; the turn after runs.test_a_session_a_failed_reset_left_registered_stays_refused[repair]and[refusal]: a repair's or a refusal's reset that raised leaves the next turn on that session refused although the file reads clean; once a reset returns, the turn after runs.test_the_read_after_the_rewrite_still_decides: a rewrite the file does not keep is refused before any session starts.includePowers, a hardlinked spec) decline the repair the way a data home that does not own the agents directory does, and still refuse before any session starts.kirocrew-lite.jsonare still refused, and no third file is created.test/test_messaging_dispatch.py,TestToollessTurnReadsTheGuestSpecOnDisk:test_a_hung_reset_does_not_hold_the_repairandtest_a_session_whose_reset_failed_stays_unconfirmedset the shared bound to 0 and pass unchanged otherwise.test/test_session.py,TestWarmPool::test_a_background_start_overtaken_by_a_reset_is_shut_down: a reset of_bgwhile its cold start is in flight leaves_bgunregistered and shuts that start's provider down.test/test_agent_spec_hardened_reads.py: the comment over the strict reader'sservice_agents.pycall site names the lite repair beside the knowledge and guest ones.Proof: PROVEN test/test_messaging_dispatch.py::TestBackgroundTurnRefusesATooledLiteSpec::test_an_injected_server_is_rewritten_away_and_the_next_turn_runs, test/test_messaging_dispatch.py::TestBackgroundTurnRefusesATooledLiteSpec::test_a_rewrite_resets_both_background_sessions[_bg], test/test_messaging_dispatch.py::TestBackgroundTurnRefusesATooledLiteSpec::test_a_rewrite_resets_both_background_sessions[_consolidate], test/test_messaging_dispatch.py::TestBackgroundTurnRefusesATooledLiteSpec::test_a_rewrite_resets_both_background_sessions[memory-consolidation:x], test/test_messaging_dispatch.py::TestBackgroundTurnRefusesATooledLiteSpec::test_a_turn_reading_the_file_while_a_rewrite_resets_is_refused (head 3e80b0f)
Red check: the tests in the
Proof:line fail with the production hunks put back to the merge base (prove.py).test_a_hung_reset_does_not_hold_the_rewritefails with only the bound removed fromreset_after_spec_repair(the turn waits on the rewrite until the test's own 60 s limit). Each concurrency test fails with only its own part of the fence removed:test_a_turn_reading_the_file_while_a_rewrite_resets_is_refusedwithout the count of repairs in flight,test_a_rewrite_begun_after_the_pre_spawn_read_voids_itwithout the re-check after the start,test_a_cancelled_turn_still_finishes_its_rewrite_resetswithout the shield (assert [0, 0] == [1, 0]),test_a_background_start_overtaken_by_a_reset_is_shut_downwithout the generation check (assert '_bg' not in {'_bg': _Session(...)}), andtest_a_turn_cancelled_in_its_check_after_a_repair_leaves_its_session_refusedplus both cases oftest_a_session_a_failed_reset_left_registered_stays_refusedwithout_lite_resets_failed(the next turn runs;DID NOT RAISE). With the fix every test of the lite class and ofTestWarmPoolpasses.Determinism: the lite class, the guest class
TestToollessTurnReadsTheGuestSpecOnDisk,TestWarmPoolandtest/test_agent_spec_hardened_reads.py(152 tests) passed 20 runs at-n0and 10 runs at-n 4, each run in its own shuffled order.Manual verification
Verified on a clean host
Ubuntu 24.04.5 LTS (x86_64), Python 3.12.3. This host has no signed-in ACP backend, so a real
SessionManagerdrove the realbackground_turnthat history consolidation uses (task="consolidation",agent="kirocrew-lite",session_key="_consolidate"). The only stub was the provider its factory returns: a mock that carries a real, unstartedAcpClientwith no prepared projection. The installer (rebuild_agent_config) wrotekirocrew-lite.jsoninto an isolatedHOME/KIROCREW_HOME, and the issue'screds-agententries were then written into that file.Before (f9fb5aa): every turn is refused, nothing is spawned, and the file keeps the injected entries:
After (3e80b0f), same script unchanged:
SharedAgentHomeRefused, a data home that does not own the agents directory), the file keeps the injected entries and every turn is still refused before the spawn, with 0 providers started.Gates on 3e80b0f (umask 022):
test_messaging_dispatch.py,test_session.py,test_agent_spec_hardened_reads.py): 197 passed on HEAD; the 16 new or changed tests fail on f9fb5aa.gates[]Python entries (0-43, 60-61): all exit 0 except the scoped backend run (1 failed out of 17,957 run). That failure,ops_mission_control ... test_github_marks_a_full_page_as_truncated, also fails on a cleanorigin/main, so it predates this PR. Entries 45-59 andsetup[](frontend/Playwright) were skipped because the diff has nowebsite/change.scripts/local-gate.py: backend batches 2, 3, 6 and 7 green. Batches 1, 4 and 5 failed only on tests that fail the same way on a cleanorigin/main(theops_mission_controltest above,test_host_git_repo_exec_neutralization ... test_up_to_date_diff_runs_no_textconv_planted_during_the_fetch, and two EIO-injection errors intest_live_target_pointer_visibility/test_sandbox_mount_pinned_target). Its 4 frontend vitest batches were not run because the diff has nowebsite/change.--baseline-commitmerge-base,--error): exit 0test/test_flake_pattern_ratchet.py: exit 0prove.py --base f9fb5aa2a:Proof: PROVEN test/test_messaging_dispatch.py::TestBackgroundTurnRefusesATooledLiteSpec::test_an_injected_server_is_rewritten_away_and_the_next_turn_runs, ...[_bg], ...[_consolidate], ...[memory-consolidation:x], ...test_a_turn_reading_the_file_while_a_rewrite_resets_is_refused (head 3e80b0fbe1e7)Related Issues
Closes #33345
Sibling sweep
Swept: git grep -nE "authored_spec_toolless_verdict(|authored_spec_is_toolless(|authored_spec_declares_zero_tools|effective_spec_declares_zero_tools" -- src/
Sibling: src/kiro_crew/llm_helpers_parts/background_turns.py -- changed here
Sibling: src/kiro_crew/messaging/dispatch_tools.py:213 -- changed here
Sibling: src/kiro_crew/knowledge/llm_pool.py -- not affected -- repair_knowledge_agent_spec rewrites kirocrew-knowledge.json before each worker spawn, and creates a missing file, so it keeps its own body
Swept: git grep -nE "background_key not in self._owner._sessions|_sessions.get(background_key) is session" -- 'src/kiro_crew/*.py'
Sibling: src/kiro_crew/session_background.py:487 -- changed here
Pattern harvest
Rule candidate: review-prompt
Pattern: a fail-closed check on a file Kiro Crew re-derives only at rebuild, with no repair of that file before the refusal
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.