Skip to content

fix(acp): the skill projection reads what withholds kirocrew-core - #14078

Merged
iamwhatever merged 1 commit into
mainfrom
fix/skill-projection-reads-withholding-sources
Sep 26, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/skill-projection-reads-withholding-sources

Conversation

@pepmach

@pepmach pepmach commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Turning off any single kirocrew-core tool in the dashboard's MCP tab breaks every session of the default kirocrew agent on the kiro backend. The toggle writes disabledTools for kirocrew-core into the global ~/.kiro/settings/mcp.json, and the next session start fails with Cannot bind skill_search to this session without losing native MCP restrictions. Check the agent's kirocrew-core server configuration. The agent spec that message points at is clean; the setting that caused the failure is in the global file, so the user hunts in the wrong place. A stale kirocrew-core block from an older release (a timeout, a non-stdio type, a mute) fails the same way, which is how the second report hit it after an upgrade without touching a toggle.

Why it matters

Until the user hand-edits mcp.json or re-enables the tool, the default agent cannot start a session, and the error gives no route back. Two reports in one day, on macOS 0.7.0 and Windows 0.7.1.

What changed (motivation → approach → change)

Punch line The skill projection and the control-plane mount decide kirocrew-core's availability through one predicate over one source set, split by what each source is: the agent spec is judged at preparation and refuses the view; the settings files are read once per session start, by the mount alone, whose verdict comes back with the array and refuses that one session, naming the file, the restriction and the way back -- stub or no stub in the array, with the spawn and every other agent's sessions standing. The direct client, which mounts the declaration natively, keeps a view whose spec restricts other tools.
session_mcp.native_settings_sources (acp/session_mcp.py) The one reader of the settings files kiro-cli enforces beside the agent spec: the global mcp.json the dashboard writes, then the project's .kiro/settings/mcp.json. A file that fails the gated read raises NativeSettingsUnreadable, which names it.
session_mcp.native_mount_withholding (acp/session_mcp.py) The one predicate. For the spec entry and each settings entry that names the server: a non-object entry, a key outside the table the spec rebuild keeps on a managed entry less the one key in it the element does not carry (_NATIVE_ELEMENT_KEYS is agent._MANAGED_MCP_ENTRY_KEYS - {"timeout"}: an injected element replaces the same-named declaration and acp_server_element emits no timeout, so a timeout set there keeps the declaration native rather than run the server on the default with nothing to say so; autoApprove stays in the table as a preference, not a restriction), a transport a user chose that is not stdio, a mute (mcp_entry_is_muted), or a non-empty disabledTools withholds the element, and the verdict says which file and which restriction, and the way back: the dashboard's MCP tab is offered only for a mute or disabledTools in the global settings -- the one file that tab writes -- while a restriction in the spec or the project's file is offered the edit that removes it there, since sending the user to the tab would leave that restriction in place and refuse the next session again. Kiro Crew's own marks on an entry restrict nothing: the registry transport value _enforce_managed_mcp_ownership stamps under agent.mcp_registry_mode -- on the spec's managed entry while that mode is on, the one state in which Crew writes it; the predicate reads the mode itself (crews_registry_marker = the spec's declaration AND registry mode on), because outside registry mode kiro-cli drops a marked entry wherever it is declared, so the same value on the spec with the mode off (a marker the rebuild has not yet removed, or a line someone wrote) and in a settings file in any state is one that would have the mount launch a server kiro-cli refuses, and it withholds like any non-stdio type -- and the x-kirocrew / x-kirocrew-derived bookkeeping keys (_NATIVE_INERT_KEYS) -- kiro-cli reads none of them as a setting. Every user-authored value the verdict repeats passes through _named, which runs the first _NATIVE_NAMED_WINDOW (1024) characters through the package's one sink cleaner (mcp_session_report.sanitize_sink_text: redact, drop control characters, then cut) and cuts the result at _NATIVE_NAMED_CHARS (64) characters -- the value is text from a settings file, the project's checked out with the repository, and the verdict reaches the gateway's log, where a newline or an escape sequence in a tool name would write a line of its own; cleaning the window whole before the cut means a credential is redacted before a cut could split it, and the window rather than the file is what a value costs (the redactors are regular expressions whose time grows faster than the text on some shapes: 100,000 digits measured at 10.8 s). _NATIVE_NAMED_TOOLS (8) bounds how many values are named, and a settings path goes through the same cleaner and is cut from the front at _NATIVE_NAMED_PATH_CHARS (256) so the tail that locates the file survives: the verdict is retained per agent for the life of the runtime while the file it quotes is read up to the reader's 50 MB ceiling. The way back is one sentence in both arms (_remedy): where the tab writes the file, "re-enable the server in the dashboard's MCP tab, or set disabled to false there"; where it does not, the edit stands alone, "set disabled to false there", since "re-enable the server" would only restate it.
kiro_control_plane_servers (acp/session_mcp.py) Calls both instead of merging the sources and spelling the predicate itself. Same elements mounted, same fail-closed withholding on an unreadable file. It returns the array together with the verdicts it withheld on (NativeControlPlaneMount: elements, and withheld by server name -- the NativeMountWithholding, or the NativeSettingsUnreadable that withheld every element), both from its one read of the settings files; the predicate is reached before the array is consulted, so a name a broker stub already carries gets no element either way but its restriction is still judged and surfaced. When it withholds an element it logs the verdict at DEBUG -- the one trace of why for an agent outside the projection, which gets no refusal message.
prepare_native_skill_projection (acp/skill_projection.py) Asks the predicate on the spec's kirocrew-core entry AS AUTHORED, before the managed launch replaces it (the replacement carries only autoApprove, disabledTools and timeout, so a type or an extra key would otherwise be dropped unjudged and the control plane mounted despite it), and over the spec alone: a restriction authored there is static for the view's life and takes the refusal arm that already serves a disabled skill_search. The settings files are deliberately not read here -- they are written while a runtime is warm and shared by every agent of the process, so a restriction there must not cost the spawn; this module reads no settings file at all. The new per_session_element keyword (default True, the shared runtime) says whether an element will replace the declaration: with False -- the direct client -- the spec predicate is not asked, because no element replaces anything there and a restriction the view copies (disabledTools on other tools, a timeout) reaches the session as written; skill_search itself disabled or excluded still refuses the view.
_unpooled_control_planes (acp/runtime.py) For a projected search agent whose element the mount did not produce -- a settings file withheld it, or a broker stub already in the session array pre-empted it -- the runtime refuses that one session on the mount's OWN verdict (mount.withheld["kirocrew-core"]) with the file-naming sentence, at every session/new and session/load. It reads nothing again: the earlier NativeSkillProjection.withholding re-read the files for this decision, and between the mount's read and that one a toggle undone in between answered "allowed", sending the session to the generic wrong-file guard (or, behind a stub, carrying it while its array was built under the restriction); the method is gone. A stub is accepted only when the mount's read allows the element, because its overlay was written once, from the files as they were, and carries a kiro-cli-only restriction no better than the element does. The pre-existing wrong-file guard remains for what it was written for: an element neither granted nor pre-empted while the files allow it.
AcpClient._spawn (acp/client.py) Prepares its projection with per_session_element=False: the direct client runs one kiro-cli process for one session, carries the identity on the process environment and mounts kirocrew-core natively from the view, so the element question does not arise there. On the previous head a spec disabledTools: ["learn_add"] -- a supported customization -- refused the view and the direct client's spawn died with an uncaught ValueError.
_spawn_admitted (acp/runtime.py) A view the spec refused stops the spawn that would load it, and what it raises is AcpRuntimeError carrying the projection's sentence (Agent 'kirocrew': kirocrew-core is withheld by the agent spec: ...) -- the error the provider's startup paths handle around spawn() -- instead of the projection's bare ValueError, which left spawn() as an internal failure with the actionable text unread.
docs acp-client.md and memory-skills-hooks.md say which files decide and when, that the mount is their one reader and hands its verdict on with the array, that the direct client mounts the declaration natively and keeps a view with restrictions on other tools, that the authored entry is what the spec judgement reads, that a stub is judged past, which marks are Crew's own and not restrictions, what bounds the message, and that every value and path it repeats goes through the package's sink cleaner over a bounded window before the cut.

Two functions answered one question from different files. kiro_control_plane_servers withholds the kirocrew-core per-session element when any declaration the session is subject to (the spec entry, the global settings, the project settings) carries a restriction the element cannot express, because mounting it without the restriction would widen the tool surface behind the user's back. prepare_native_skill_projection decided whether the agent may rely on that element by reading the spec's kirocrew-core entry alone, so kirocrew stayed in search_agents, and _unpooled_control_planes turned the disagreement into the hard AcpRuntimeError at session/new; with the broker on, a stub already in the array was accepted without any question, so a toggle written after the overlay went unenforced on that path.

With one predicate over one source set, an agent whose SPEC withholds the element is refused at preparation and never enters the search set, so the session/new guard is unreachable for that shape and the spawn that would load its view fails as AcpRuntimeError carrying the reason. An agent whose spec is clean gets its view and its alias, and the settings decide each session, read once by the mount, whose verdict the runtime refuses on: Agent 'kirocrew': kirocrew-core is withheld by the global MCP settings (<path>): its disabledTools lists learn_add; re-enable those tools in the dashboard's MCP tab, or remove the disabledTools entry there to restore skill search. That refusal is per session, so the spawn and the other agents' sessions on the shared runtime stand, undoing the toggle restores the next session without a respawn, and a broker stub written before the toggle does not carry a session past it. The session is refused rather than started without the element because the view already dropped the agent's skill resources on the element's promise and a natively mounted kirocrew-core carries no identity and answers identity_unattested to every skill_search. On the direct client no element replaces the declaration, so the same spec disabledTools on other tools keeps the view and reaches the session as written. Mounting the element without the restriction stays closed, and agents that never asked for the element (no skill mapping, not the default agent) are untouched. Backend only, no UI change.

Backwards compatibility

Compatible: no config key, file or contract is added, renamed or removed. The shapes that fail on main at session/new with the misdirected error are refused with the named one instead -- at preparation for a spec-authored restriction, at that session's start for a settings restriction; every unrestricted shape mounts and projects the same way (test_no_restriction_anywhere_leaves_the_search_agent_exactly_as_before is green on main and on this head), and so do the type: registry stamp on the spec entry and Crew's bookkeeping keys; a registry value in a settings file keeps the declaration native as it does on main. A timeout on the entry keeps the declaration native as it does on main, and the verdict now names the key. A view the spec refuses fails the spawn as AcpRuntimeError, the type the startup paths already translate, instead of a bare ValueError. A broker stub ahead of the element still carries a session while the files allow the element; after a toggle it no longer does, which is the enforcement the toggle promised. The direct client behaves as on main for a spec disabledTools on other tools or a timeout: the view stands and kiro-cli honours the restriction natively. Internal API: kiro_control_plane_servers returns a NamedTuple (elements, withheld) instead of the bare array; its one production caller is the runtime, and the tests that read the array take .elements.

Tests

test/test_native_skill_projection_sources.py is new: 76 tests, 74 red on main (measured against an origin/main checkout at 4d683462c2 with its own sources). A tool disabled in the global settings, in the project settings, a mute, a non-object entry, a headers key and an http transport in a settings file each leave the view and the alias in place and refuse the search agent's session by file and restriction on a warm runtime, and the mount withholds the same element. A mute or a disabledTools in the global settings is offered the dashboard's MCP tab as the way back; the same restriction in the project's file or the spec is offered only the edit that removes it there. A disabledTools, a mute or an http transport authored in the spec refuses the view at preparation naming the spec, and a type: http or headers spec entry is refused before the managed launch replaces it and is not mounted either. A timeout on the spec entry refuses the view at preparation naming the spec and the key; on the global or the project entry it leaves the view and refuses that session naming the file and the key, and the mount emits no element -- because the element acp_server_element builds from that entry carries no timeout. _NATIVE_ELEMENT_KEYS is the spec rebuild's own table less timeout, and every key the element emits is in it. A view the spec refused (a disabledTools, an http type) fails spawn() as AcpRuntimeError carrying the projection's exact sentence, caused by its ValueError, before any process is started. The registry transport value on the spec entry withholds nothing while registry mode is on (a user's sse is still judged there); with the mode off the same value on the spec is refused naming the spec and the type -- the view at preparation, and the session mount for the search agent and for an agent outside the projection alike, with no element -- and in the global or the project file it refuses that session naming the file and the type in either mode, and the mount emits no element (red on the previous head: with the mode off the marked spec entry was accepted and the element mounted). Crew's provenance marker and derived record leave the agent projected and the element mounted while a mute beside the marker is still judged. No restriction anywhere leaves the search agent exactly as before (green on main too). Unreadable settings refuse the session and name the file. A session of an agent the spec refused reaches no guard. A broker stub in the session array does not carry a restricted search agent's session -- for the global toggle and for a project-level mute -- and does carry it while the files allow the element; on one warm runtime a stub carries the first session, a toggle written before the second refuses it naming the file, and undoing the toggle restores the third. On one warm runtime without a stub, a global toggle, a project mute or a corrupted global file written before the second session refuses that session with Agent 'kirocrew': plus the exact sentence the mount's own verdict renders, never the Cannot bind skill_search guard. The direct client's _spawn(), driven over a mocked process with a spec disabledTools: ["learn_add"], reaches the launch under the view's alias with the list on the view's kirocrew-core entry and the search tool granted, while the same spec on the shared runtime still refuses the view (red on the previous head: ValueError out of _spawn()); per_session_element=False keeps a disabledTools on other tools and a timeout and still refuses skill_search itself disabled. The mount hands on the verdict it withheld on from its one read -- for a toggle, for a toggle behind a stub, for an unreadable file (every identity-bound name), and an empty map when the files allow -- and a session start reads the settings files exactly once whatever the answer and whatever the array carries (red on the previous head: two reads whenever the guard was reached). A toggle undone between the mount's read and a second one can no longer send the session to the wrong guard or carry it behind a stub: the session is refused for the verdict its array was built on, naming the file, after one read (red on the previous head both ways). Structural pins show create_session and load_session both reach _unpooled_control_planes, that it refuses on mount.withheld outside the stub acceptance and mentions neither a re-read nor the projection method that used to do it, that the projection type has no withholding attribute, that preparation asks the predicate over the spec alone and the mount over the same entry with the global and project sources, once, and that neither module keeps a private copy of the merge or the predicate -- the projection module names no settings reader at all. The settings-source order, the unreadable cause and the bounded tool list are pinned, seven shapes of a 100,000-character value each render to an exact cut string under _NATIVE_NAMED_TOOLS * (_NATIVE_NAMED_CHARS + 2) + 256 characters while a name exactly at the bound is repeated whole, and a settings path past _NATIVE_NAMED_PATH_CHARS is named by its tail in the source label, the unreadable error and its explanation alike, while a short one is repeated whole in the platform's own rendering (the pin compares against str(Path(...)), so it holds on the Windows shard too). A tool name and a key carrying a newline, a carriage return and an escape sequence render with none of them and every character of the sentence printable, a credential-shaped tool name renders redacted, and a settings path carrying a newline and an escape sequence is repeated cleaned in the source label, the unreadable error and its explanation alike (red on the previous head: the newline and the credential reached the sentence as written); a value padded with newlines ahead of 100,000 characters still renders the exact cut string, and a value the window did not hold whole renders what the cleaner left of it plus the marker, under the ceiling. The remedy is one sentence in both arms: with the tab, "re-enable the server in the dashboard's MCP tab, or set disabled to false there" (and the same for disabledTools); without it, the edit alone, and the whole rendered sentence is pinned both ways (red on the previous head: "re-enable the server set disabled to false there"). The direct client's mocked process binds _UNALLOCATABLE_PID, the shared spelling from test/test_update_provider.py, so a cleanup path that signals it reaches no live process on the runner (SAST kirocrew.mock-pid-allocatable on the previous head), and the spawn hands its process factory straight through the Windows cleanup admission the way the sibling spawn tests do (test_acp_spawn_offload), since the admission owns the factory and creates the child through the loop's own transport where a mocked create_subprocess_exec is never reached (the Windows shard on the previous head: FileNotFoundError from _create_windows_subprocess_owned); the cleaned-path pin compares the tail in the platform's own rendering (str(Path(...))), the Windows shard's other red.

test/test_native_skill_projection.py: the native_tree fixture pins the global mcp.json into the temp tree so the projection's read never touches the host's own file. test/test_session_token_identity.py reads the mount's .elements. The prepare_native_skill_projection doubles in test/test_acp_client.py, test/test_acp_spawn_offload.py and test/test_subagent_shared_scratch.py accept the new keyword. test/test_acp_runtime.py, test/test_acp_session_mcp.py, test/test_harness_parity.py, test/test_kas_spawn.py, test/test_acp_client.py, test/test_acp_spawn_offload.py and test/test_subagent_shared_scratch.py pass with them, and so do test/test_mcp_gateway_control_plane_repair.py, test/test_acp_mcp_ref_guard.py, test/test_mcp_session_report.py, test/test_mcp_session_report_wiring.py (the sink cleaner session_mcp now imports), test/test_agent.py, test/test_codex_session_mcp.py and test/test_kas_agents.py unchanged: 2459 named tests together on this head, each module run by name with -n0.

Local review: no local review lane read 3c16f831d8; the server round was its first read. No local lane read 1126a47bef either. One pinned local GPT lane (gpt-5.6-sol, the CI lane's contract extracted from the base) read 6d66eaa8fa and returned no blocking finding and one advisory -- the remedy for a project-scoped mute or disabledTools sent the user to the dashboard's MCP tab, which writes only the global file -- fixed in f5aa916ab1. The server GPT lane read f5aa916ab1 and blocked on the registry marker being exempt in a settings file too (a value kiro-cli drops outside registry mode, so the mount would launch a server kiro-cli refuses); 4df5d87797 exempts the marker on the spec's managed entry only, red-first, and feab9c1c3c is its replay onto 7b2da39c53. The server round on feab9c1c3c blocked on the direct client refusing a view for a spec disabledTools naming other tools, and its design lane suggested the mount surface its own verdict rather than the runtime re-reading the files; both landed in 6df6cec26d, red-first, which no local lane read (the fleet's execution cap left none). The server round on 6df6cec26d blocked on the refusal repeating a settings value as the file spells it -- a newline or an escape sequence in a disabledTools name reaching the gateway's log as a line of its own -- and found the remedy's no-tab arm running two clauses together, while SAST flagged the direct-client test's mocked pid as one a live process can own; all three landed in 8a16f3f007, red-first, which no local lane read (execution cap). The server round on 8a16f3f007 blocked on the registry exemption being keyed on the spec's declaration alone -- with registry mode off, a marked core entry on any agent's spec had the mount launch the managed stdio server kiro-cli itself drops -- and the Windows shard failed the two new tests above; both landed in d5109674f9, red-first where the sources decide, which no local lane read (execution cap). The server round on d5109674f9 is clean: GPT with one advisory -- this test module's docstring described the projection as reading the same files the mount reads, while the implementation judges the spec at preparation and the settings files at each session start -- Opus with no findings, Design and First Principles PASS. This head rewrites that docstring to describe the split and changes nothing else; no local lane read it (execution cap): the server round is this head's first model read. On this head Backend Tests (Windows) (1) failed one test outside this PR's files, test/test_history_index_worker.py::test_a_contended_write_waits_instead_of_failing (assert 0.296 >= 0.3: the runner's sleep returns early), which is #13215 (billygerhard, platform: windows); that job is rerun once, and every other shard and lane on this head is green.

Overlap

Rebased onto main 4d683462c2 after #14268 merged; the Windows reds from #14249 clear. One commit on that tip: the replay's tree is identical to git merge-tree --write-tree of the previous head against it (empty diff), and the round-7, round-8 and round-9 changes are amended into the same commit. main has since moved to 47594b83 (five commits; one of them, #12684, touches src/kiro_crew/acp/client.py, which this PR also touches, and its suite was still running when this head was pushed): git merge-tree --write-tree of this head against it is clean, and the base is left on the verified-green 4d683462c2 rather than replayed onto an unverified tip. git merge-tree --write-tree of this head against #13635's head d5d0db6bc0 (the session_mcp.py BOM strict reader) and against #13974's head 0f22bd0542 (the skill_projection.py and runtime.py tail: per-run work dirs and refused alias unlinks) each return a clean tree with no conflict, so whichever of the overlapping pairs lands second rebases onto the other with no conflicting hunk as of these heads.

Manual verification

N/A — unit coverage sufficient: the runtime tests drive _unpooled_control_planes with a projection prepared from a real global mcp.json carrying the toggle's exact shape, before and after the toggle lands, which is the session/new path both reports failed on.

Related Issues

Second report of the same failure: #13786 (0.7.1, Windows desktop app; recovered by deleting and re-adding the kirocrew-core block).

Follow-up: #14125 -- let a kirocrew session run with a kirocrew-core tool toggle expressed (the element or a gate carrying the restriction, or a dashboard warning at toggle time) instead of refusing it. The Design lane's watch on this PR: the toggle's apparent promise (lose one tool) and its effect (lose the default agent's sessions until the toggle is undone) still diverge; this PR fixes the diagnosis and the drift between the two readers, not that trade-off, which #14125 owns.

Fixes #13639

Pattern harvest

Rule candidate: review-prompt
Pattern: two readers of one configuration question that each merge the sources themselves — the predicate that mounts a server and the projection that promises the mount — drift on the source set; the merge and the predicate belong in one function both call.

Rule candidate: review-prompt
Pattern: a reader that waives a restriction because another path will supply the server (a broker stub, a cached element) is trusting presence as proof; the waiver holds only if that path is built from the same sources and can carry the same restriction, and when either is false the sources alone must decide.

Rule candidate: review-prompt
Pattern: a verdict computed once at spawn over files that other writers keep editing is a snapshot; every later decision that depends on it must re-read or be refused, and a validator run on a normalized copy of a declaration instead of the declaration itself lets every field the normalization drops pass unjudged.

Rule candidate: review-prompt
Pattern: a key table borrowed whole from a neighbouring writer answers that writer's question ("what may a spec entry retain"), not this reader's ("what can the element express"); when an element replaces the declaration it is named after, the admitted keys are the ones the element emitter actually emits, so derive the table from the emitter or subtract what it leaves behind, and pin the two against each other.

Rule candidate: review-prompt
Pattern: a producer that reads shared files and returns only the positive half of its answer (the elements it built) forces its consumer to read the same files again for the negative half (why one is missing); between the two reads the files can change, and the consumer then acts on an answer the producer never gave -- return the verdict with the data it was computed from, one read, one answer.

Rule candidate: review-prompt
Pattern: a check that exists because one MECHANISM cannot carry a field (a per-session element replacing a declaration) must be gated on that mechanism being in play; run where the declaration stays native and the field is honoured as written, it refuses a supported customization for a problem that does not arise there.

Rule candidate: review-prompt
Pattern: bounding how much of a user-authored value a message repeats is not the same as cleaning it -- a cut value still carries the newline or escape sequence that writes its own log line, and the value's file may arrive with a repository checkout; the message goes through the sink cleaner before the cut, and the cleaner reads a window rather than the file, or the bound on the message becomes an unbounded regular-expression cost on the reader.

Rule candidate: review-prompt
Pattern: an exemption for a marker the product writes itself must be keyed on the STATE in which the product writes it, not on the PLACE where it usually sits; keyed on the place alone, it grants the marker in exactly the state where the consumer that reads the marker drops the entry, and a line anyone can add to that place becomes a way past the guard.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

@pepmach
pepmach requested review from a team and dwu96 September 26, 2026 01:42
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 9d1503ef631d6c0144e13a149029ee472a5c2d51 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify a kirocrew-core restriction hand-authored in the primary agent's spec now fails the shared spawn (all agents), not just that agent's sessions — confirm the AcpRuntimeError text reaches the dashboard.

Suggestions

  • The spec-side refusal moved from per-session to spawn-time: for a restriction in the primary agent's spec, other agents' sessions that previously rode the spawn now lose it too. If that blast radius proves real in practice, a follow-up could exclude the errored agent from the projection while spawning under a healthy view rather than aborting the spawn.

[DESIGN-REVIEWED] 9d1503e

@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Intent: Make the skill projection and the control-plane mount decide whether kirocrew-core can be mounted from the same settings files through one shared predicate, so a tool disabled from the dashboard (or a stale restricted entry in a settings file) refuses the default agent at preparation with a message naming the file, the restriction and the way back, instead of failing every session at session/new with an error that points at the agent spec.
Not a goal: Mounting kirocrew-core without its restriction, changing the doctrine that a restriction narrows the spec's grant, touching broker pooling, the BOM, the session/new error text in the runtime, or any UI.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of 9d1503ef631d6c0144e13a149029ee472a5c2d51 — 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/CONCERNS are advisory.

First-Principles-Verdict: PASS

Verify on kiro-cli itself the one external claim the settings-file registry-marker arm withholds on: outside registry mode kiro-cli drops a marked entry wherever it is declared.

What this change ships

Inventory (10 items) — 10 justified

Intent: FIX — a dashboard tool toggle (or a stale settings entry) broke every session of the default agent with an error naming the wrong file; the refusal now names the real file, restriction, and way back.

  1. A tool toggled off in the dashboard refuses only that agent's sessions, naming the global settings file and the MCP-tab way back — justified
  2. A restriction in the project's mcp.json, or an unreadable settings file, refuses the session naming that file — justified
  3. A kirocrew-core restriction authored in the agent spec fails the spawn with a named reason instead of every session generically — justified
  4. Entries carrying Crew's own bookkeeping keys (x-kirocrew, derived record) no longer falsely withhold the element — justified
  5. The spec's registry-mode marker is exempted; the same value anywhere else withholds, naming the type — justified
  6. A spec restriction the managed replacement would silently drop (a type, an unknown key) is judged as authored and refuses the view — justified
  7. Undoing a toggle restores the next session without respawn; the verdict travels with the array, so no second read misroutes the refusal — justified
  8. kiro_control_plane_servers returns elements plus withheld verdicts (one production consumer counted: the runtime session guard; non-core verdicts feed the DEBUG trace) — justified
  9. per_session_element=False keeps the direct client's base behavior: spec restrictions on other tools reach the session as written — justified
  10. Refusal messages bound and sanitize user-authored values and paths through the existing sink cleaner (mcp_session_report.sanitize_sink_text, reused not duplicated) — justified

[FIRST-PRINCIPLES-REVIEWED] 9d1503e

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 9d1503ef631d6c0144e13a149029ee472a5c2d51 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9d1503e

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 9d1503ef631d6c0144e13a149029ee472a5c2d51: <one-sentence reason>

@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 Sep 26, 2026
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 9d1503e

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable 9d1503ef631d6c0144e13a149029ee472a5c2d51: <one-sentence reason>

@pepmach
pepmach force-pushed the fix/skill-projection-reads-withholding-sources branch from 3c16f83 to a73e7e3 Compare September 26, 2026 03:41
@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 Sep 26, 2026
@pepmach
pepmach force-pushed the fix/skill-projection-reads-withholding-sources branch from a73e7e3 to 1126a47 Compare September 26, 2026 04:59
@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 Sep 26, 2026
@pepmach
pepmach force-pushed the fix/skill-projection-reads-withholding-sources branch from 1126a47 to f5aa916 Compare September 26, 2026 06:41
@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 Sep 26, 2026
@pepmach
pepmach force-pushed the fix/skill-projection-reads-withholding-sources branch from f5aa916 to 4df5d87 Compare September 26, 2026 07:00
@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 Sep 26, 2026
@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 Sep 26, 2026
@pepmach
pepmach force-pushed the fix/skill-projection-reads-withholding-sources branch from 8a16f3f to d510967 Compare September 26, 2026 19:51
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 26, 2026
The control-plane mount withholds kirocrew-core's per-session element when the agent spec, the global MCP settings or the project's MCP settings carries a restriction the element cannot express; the skill projection decided the same question from the spec alone, so a tool disabled from the dashboard left every session of the default agent failing at session/new with an error naming the wrong file. Both readers ask one predicate over one source set, and a withheld element refuses the agent at preparation with a message naming the file, the restriction and the way back.
@pepmach
pepmach force-pushed the fix/skill-projection-reads-withholding-sources branch from d510967 to 9d1503e Compare September 26, 2026 20:46
@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: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 26, 2026
@pepmach

pepmach commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author
  • declared — a kirocrew-core restriction hand-authored in the primary agent's own spec refuses the shared spawn by design; the follow-up shape is named, no change now span=f326474bc6aa

What the head does: prepare_native_skill_projection judges the spec's kirocrew-core entry at preparation. A restriction there refuses that agent's view (errors[agent]; the other agents' views stand). The shared process launches --agent <primary>, so a refused PRIMARY view aborts the spawn as AcpRuntimeError carrying the sentence that names the spec and the edit that undoes it (runtime.py _spawn_admitted); a refused non-primary view costs only that agent's sessions, whose session/set_mode is refused with the same sentence (skill_projection.py NativeSkillProjection.agent).
Why refuse at spawn rather than run: without its view the primary agent would launch with kirocrew-core mounted natively, carrying no identity and answering identity_unattested to every skill_search -- silent skill loss under the name the user selected. On the base the same spec produced a spawn whose every session of the search agent failed at session/new on the generic Cannot bind skill_search guard; the spawn that "rode" there carried no working default agent either.
Why no change now: the trigger is a hand edit of the primary agent's own spec (the dashboard's toggle writes the global file, which refuses per session and leaves the spawn standing), static for the view's life, and undone by the one edit the sentence names. Whether other agents' sessions on the same runtime are a real loss in practice is unmeasured; this PR is the diagnosis and the drift, not a spawn-under-a-substitute-view policy.
Follow-up shape, if the blast radius proves real: exclude the errored primary agent from the projection and spawn under a healthy view (the lane's words) -- which needs a ruling on which agent the process launches as and how the refused agent's sessions are reported. Recorded here; an issue is filed the first time an install reports it.

@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 Sep 26, 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.

Disabling any kirocrew-core tool from the dashboard makes every skill-search (kirocrew) session un-startable on the kiro backend

2 participants