Skip to content

feat(members): confirm saved member specs on Claude, Codex and DeepSeek - #16847

Merged
iamwhatever merged 2 commits into
kirodotdev:mainfrom
Premshay:feat/member-capabilities-projecting-backends
Oct 17, 2026
Merged

iamwhatever merged 2 commits into
kirodotdev:mainfrom
Premshay:feat/member-capabilities-projecting-backends

Conversation

@Premshay

@Premshay Premshay commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An enrolled crew member can start on Claude, Codex or DeepSeek, with its saved agent spec confirmed as loaded, instead of only on kiro-cli.

ACP_BACKENDS_MEMBER_CAPABILITIES contains only kiro-cli. A member with a saved spec pinned to any other backend fails at startup with capability_harness_unsupported, as reported in #12451, and on kas in the comment there.

Why it matters

Users who run Claude Code, Codex or DeepSeek cannot use crew members with their own charter, MCP servers and private memory there. Their only workaround, spawn_run(crew=<name>) from a normal session, runs on the normal lane engine.

Not a goal

  • Per-member backend selection (agents.<name>.acp_backend). That is feat(crew): let a crew member pin its own ACP backend #16200 / feat: select a harness and model per crew member #11324, and this PR does not touch selection.
  • Enforcing saved fields these hosts cannot represent. They are reported as gaps, not emulated.
  • Antigravity or any non-ACP provider.
  • KAS. KAS is also in ACP_BACKENDS_MEMBER_CAPABILITIES because it receives the whole saved spec over the wire (_meta.kiro.customAgents, session/set_mode), providing the same loaded-template evidence the kiro path gives (on base at the time of this PR). AcpSessionProvider.loaded_capability_template returns the active_agent for KAS, the same evidence it uses for kiro-cli. member_saved_agent is on for KAS. The consumed-spec confirmation (via consumed_spec_matches) is not added for KAS in this PR, so the Capabilities view stays "unverified" for KAS member sessions — the spec reached the session but the projection confirmation path is not verified.

What changed (motivation → approach → change)

  • Approach: kiro-cli loads a member natively. Claude, Codex and DeepSeek instead project the saved spec onto their session's mcpServers array. So the proof that the member loaded is the spec the array was actually built from. Each backend now records that parsed spec and compares its digest with the saved intent's materialized digest. It never re-reads the file after startup, which would prove the file rather than the session. A mismatch refuses the session with capability_runtime_unverified.
  • Gaps: saved fields the host cannot enforce (hooks, toolsSettings, excludedTools, native tool limits, per-tool mounts, auto-approval) are reported as projection gaps. They keep the Capabilities view "unverified" instead of "applied".
  • Claude and DeepSeek confirm on the AcpClient path. AcpProvider.start calls AcpClient.confirm_member_projection on its legacy-client arm, right after ensure_ready, so the session exists and the caller's later loaded_stamp read sees the verdict. The kiro and KAS runtimes take the other arm, so their construction path gains no call, await or branch (H13). Claude also requires its permission surface to be governed, because an ungoverned surface withholds the whole array.
  • DeepSeek gains providers/mirrors/deepseek.py. Until now its sessions carried only Crew's pooled stubs, so there was no projected spec to confirm. It delegates to the shared single-binary projection, as goose does. A server narrowed per tool is withheld whole, because no per-call deny path is verified for dsh. Its registry record moves from BROKER_ONLY to MIRROR with per_tool_deny=WHOLE_SERVER.
    • Being in MIRRORS makes _pooled_mcp_servers answer [] for it, so AcpClient gains _deepseek_session_mcp_servers, spliced into session/new, its substitution retry and session/load (goose's three sites), and the deepseek spawn arm warms the projection off the loop. That is what carries Crew's tools and the member spec to a DeepSeek session.
  • Codex runs on the shared AcpRuntime path. The runtime records the consumed spec on the session handle and confirms it inside apply_session_permission_routing, the adapter-only body that kiro-cli and KAS return from at their routing gate (H13). AcpRuntimeProtocol declares the two runtime methods the handle calls.
  • Zero-tool ban: as a mirrored, enforced AcpClient backend, deepseek now meets the ACP_BACKENDS_HONOR_ZERO_TOOL_BAN rule (its mirror reports zero_tools through the opencode projection), so it joins the set. The knowledge pool may therefore select it; its effort channel (config option) is pinned.
  • Shared code: agent_capabilities.confirm_consumed_projection is the one confirm body (read the saved intent, refuse a withheld or mismatched spec, return the gaps); AcpClient and AcpRuntime both call it, so there is one check and one gap vocabulary.
  • Codex warm reuse: AcpSessionProvider.new_conversation builds its fresh session through AcpRuntime.create_session, whose permission-routing step runs the same confirmation, so a reused worker is judged on the fresh session's own consumed spec. A refusal terminates the fresh session before it is swapped in. SessionProjection, SessionMcpProjection and _MirroredSessionMcp carry agent_spec from the parse. The OpenCode projection forwards it, since DeepSeek delegates there.

This widens which backends may run a member, which is a security-boundary decision (needs-human on #12451). On these hosts a member runs with looser restrictions than on kiro-cli, and the gaps above are reported but not enforced.

Backwards compatibility

Compatible: kiro-cli members are unchanged. A member pinned to Claude, Codex or DeepSeek that previously failed at startup now starts when its projection confirms. Non-member sessions only change in that DeepSeek sessions now also get the servers their own spec declares, besides Crew's pooled tools.

Removes nothing: no reader loses a path. DeepSeek's BROKER_ONLY record is replaced by a MIRROR record that still delivers the pooled stubs. test_deepseek_mirror_keeps_crew_servers locks that in, with and without a pooled broker.

Tests

  • test_session_capabilities.py:
    • Claude: a member is stamped only after its consumed spec confirms. Ungoverned surfaces, resume and faults are refused. Each gap field is reported explicitly.
    • Codex: a loaded template appears only after confirmation. A missing or different consumed spec refuses, and a dead runtime reports none. test_non_derived_member_is_confirmed_and_starts confirms a member whose own template is not a derived agent.
    • kiro-cli (H13): test_kiro_member_start_takes_no_projection_step pins the runtime seam; test_the_provider_confirms_from_its_client_arm_only and test_the_member_confirmation_covers_only_a_live_member_session pin the AcpClient placement.
    • Card line: test_the_member_saved_agent_line_follows_the_confirming_backends pins member_saved_agent on for kiro-cli, KAS, Claude, Codex and DeepSeek.
  • test_backend_cards.py::test_the_default_harness_reads_as_the_most_capable: codex now sits level with kiro-cli and KAS at eight card lines.
  • test_acp_provider.py: the claude effort start test stubs the confirmation its client arm awaits.
  • test_agent_sdk_capabilities.py: the zero-tool-ban rule, exact set and pool-safe set include deepseek.
    • DeepSeek: it has a mirror and is a member backend.
  • test_acp_deepseek_backend.py::test_deepseek_gets_its_own_mcp_array_at_every_session_call_site: the DeepSeek array is spliced at all three session call sites (fails without them).
  • test_acp_session_mcp.py::test_deepseek_mirror_keeps_crew_servers: a DeepSeek session keeps Crew's servers after the move to a mirror.
  • test_harness_parity.py: deepseek joins the declared MCP seams, and the parity record covers the new member backends.
  • Affected suites (session capabilities, session MCP, harness parity, DeepSeek, goose, OpenCode, mirrors, session provider, essential delivery), plus the agent pool, run with TMPDIR=/tmp as on CI: 1,016 passed. main passes the same set. black 26.3.1 is clean on every changed file.

Manual verification

Checked live on a fork build that carries this change plus a per-conversation backend switch, which is not in this PR. One enrolled member was started on Claude, then switched to Codex, then to DeepSeek in one conversation. Each backend confirmed the saved spec, with no capability_runtime_unverified. The member answered with its charter role each time, and earlier context carried across.

This exact port onto main has not been run live. It was tested by the suites above.

Screenshots / video

Why no screenshot: this PR changes no frontend file. The dashboard copy that should follow it (crewCapabilities.newRuntime still says Kiro only, and card_member_saved_agent says "whole" on backends that report gaps) is tracked in #19066, which ships with screenshots.

Related Issues

Part of #12451
Follow-up: #19066 (member copy)

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

Contribution License Agreement

🤖 Generated with Claude Code

@Premshay
Premshay requested a review from a team as a code owner October 4, 2026 23:13
@Premshay
Premshay requested a review from cruisercohen October 4, 2026 23:13
@github-actions github-actions Bot added the fork Pull request from a fork (external contributor) label Oct 4, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 32bac812c89e0f11548a28bc5607729c6d7a7d1d touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — 🟡 CONCERNS

Design-level review of 32bac812c89e0f11548a28bc5607729c6d7a7d1d via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

A member whose saved spec restricts tools now starts on Claude, Codex or DeepSeek without those restrictions enforced. The only sign is an "unverified" label.

Watch

  • Restrictions are dropped on start, not refused. projection_gaps reports native_tools, excludedTools, toolsSettings, per_tool_mounts and auto_approval, and the session still starts. runtime_view only moves the status from "applied" back to "unverified". Example: a member saved with tools: ["@docs"] (no native shell) runs on Claude with Claude's full native tools. Claude's SEEDED_SETTINGS routing is "declared but not enforced by this core". So an operator who enrolled a member to fence it in gets an unfenced member, and the only signal is a pane label. This is inconsistent with the same PR's handling of disabledTools, which is still refused before spawn (capability_tool_limits_unsupported). Gaps that loosen a restriction should refuse the start the same way. Gaps that only drop a feature, like hooks, can stay as reports.
    Clears when: gaps that loosen restrictions (native_tools, excludedTools, per_tool_mounts, auto_approval) refuse the start like tool_limits_unsupported, or a maintainer on #12451 explicitly accepts running a member with its restrictions unenforced.
  • The DeepSeek change from BROKER_ONLY to MIRROR also changes non-member sessions, and it is bundled here. Every DeepSeek session now mounts the servers its spec declares. Per mcp-stdio-rollback-live.jsonl, one spec server that cannot start fails session/new whole. Pruning only catches a command that does not exist. On top of that, joining ACP_BACKENDS_HONOR_ZERO_TOOL_BAN makes DeepSeek selectable by the knowledge pool. Ordinary DeepSeek chats and pool workers carry this risk for a member feature, and reverting one change means reverting the other.
    Clears when: the DeepSeek mirror and the zero-tool-ban change move to their own PR, or the description's Backwards compatibility section lists the whole-session failure for non-member DeepSeek sessions and the knowledge-pool change as accepted breaks.

[DESIGN-REVIEWED] 32bac81

Description read

[DESCRIPTION-READ] 65e92d6c3dc694db361b07818538ff2fb937defec8517ec36f8f86309c240cf7

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 4, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🟡 CONCERNS

Premise-level review of 32bac812c89e0f11548a28bc5607729c6d7a7d1d via the fork AI-review pipeline — 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: CONCERNS

projection_gaps hand-codes a backend-blind list of gaps, even though each mirror's rulings() already records what it withholds. Reversing the member refusal still waits on a human decision in #12451.

Not justified as shipped

  • Item 3 — duplicate of providers/mirrors/*.py::rulings(): projection_gaps hardcodes ("hooks", …) and auto_approval for every projecting backend. The rulings for claude, codex and deepseek already declare Concern.HOOKS and Concern.AUTO_APPROVE as NO_CHANNEL or WITHHELD (6 rulings counted). The two spellings will drift apart once one mirror starts delivering either field.
    Subtraction: drop the hooks and auto_approval branches and get those two gaps from mirror_for(backend).rulings() where the disposition is not DELIVERED or TRANSLATED.
    Clears when: those two gap names come from the rulings table.
  • Item 1 — inherited: the description itself says "This widens which backends may run a member, which is a security-boundary decision (needs-human on Per-member ACP backend selection + MCP server support on Claude Code / Codex member backends #12451)", and that hooks and excludedTools are "reported but not enforced". The base comment's rule was that the spec "reaches it whole". This PR redefines membership, and nothing records a decision on it.
    Clears when: a maintainer records the decision on Per-member ACP backend selection + MCP server support on Claude Code / Codex member backends #12451, or posts /ai-review override first-principles 32bac812c89e0f11548a28bc5607729c6d7a7d1d: <decision>.
  • Item 7 — one consumer, generalized: _member_projection_needs_confirmation(mirror_used) returns mirror_used and bool(self._member_context), and its only caller already checked self.mirror_used.
    Subtraction: delete the method and its AcpRuntimeProtocol stub, and read _member_context inline.
    Clears when: the method is removed.

What this change ships

Inventory (8 items) — 4 justified

Intent: let an enrolled crew member run on Claude, Codex or DeepSeek with its saved spec confirmed loaded. This is an ADDITION.

  1. Members pinned to Claude, Codex or DeepSeek now start instead of being refused — inherited: security-boundary decision not recorded
  2. A member is refused when the spec its session consumed differs from its saved intent — justified
  3. Capabilities view stays "unverified" for each saved field the host can't enforce — duplicate of mirror rulings()
  4. Every DeepSeek session, members or not, now mounts its spec's own servers — rides along
  5. DeepSeek joins the zero-tool-ban set, so the knowledge pool may pick it — rides along
  6. The refusal remedy now names every backend that can run a member — justified
  7. Confirmation runs inside the shared runtime's permission-routing step — one consumer, generalized
  8. /compact and slash commands confirm the member's spec before sending — justified

[FIRST-PRINCIPLES-REVIEWED] 32bac81

Description read

[DESCRIPTION-READ] 3516e9690150627e34b789a538dfbdd8ab07d67cf4b38482fb9ab0c11d0ae261

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 4, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 32bac812c89e0f11548a28bc5607729c6d7a7d1d via the fork AI-review pipeline; updated in place on each push.

Review details

No findings block the merge; one advisory finding.

FINDING — src/kiro_crew/acp/client_mcp_array.py:285 — switching model on a live Claude member chat goes through _try_live_model_switch → client.set_model → _write_claude_local_settings, whose successful write calls _invalidate_session_mcp_projection() (client_claude_seed.py:901). That call now runs self._loaded_capability_template = "". confirm_member_projection then returns early because _confirmed_capability_session == self._session_id, so the template is never restored, and runtime_view shows the same session as "unverified" until it respawns → Fix: don't clear _loaded_capability_template / _capability_projection_gaps in _invalidate_session_mcp_projection, since _reset_state already clears them with the session; or also clear _confirmed_capability_session there so the next send confirms again.

[OPUS-REVIEWED] 32bac81

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

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — 🔴 changes requested (blocking)

Reviewed 32bac812c89e0f11548a28bc5607729c6d7a7d1d via the fork AI-review pipeline; updated in place on each push.

1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

BLOCKING -- src/kiro_crew/providers/acp_turns.py:147 -- A send-path respawn bypasses member projection confirmation

await self._client.confirm_member_projection()
Edited enrolled-member spec + Claude/DeepSeek child exit during stream_events’ timeout lookup -> its subsequent ensure_ready() creates a replacement session -> _send_prompt() uses that session without checking its consumed spec, bypassing capability_runtime_unverified.
Anchor: backend-security-controls
Fix: Confirm the member projection after the send path’s final respawn-capable readiness check, before _send_prompt(), keeping confirmation adapter-only.

[BLOCK-MERGE] 32bac81
[GPT-REVIEWED] 32bac81

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

I'm keeping F1 blocking (UPHOLD-FENCED) and not flagging it. The adjudicable block was empty, so the main footer has zero counts.

F1 (fenced, unbounded: bypasses a governance ceiling). Every link of the claimed path checks out in the code:

  • The new gate _ready_confirmed_session (patch lines 963–965) runs ensure_ready() and then confirm_member_projection(). Then stream hands off to stream_events.

  • stream_events waits on a thread for the timeout lookup (src/kiro_crew/acp/client_turn.py:745 → src/kiro_crew/acp/client_timeouts.py:163, a config load from disk). It then calls ensure_ready() again (client_turn.py:748). If the child has died by then, that call starts a new process and session (src/kiro_crew/acp/client_start.py:1154 takes the warm return only while the process is alive). Nothing confirms the new session before _send_prompt (client_turn.py:749).

  • The window is short, the length of one config read, but a Claude or DeepSeek child exiting is an ordinary event, not something contrived. The fix is small: confirm after the last ensure_ready() inside the adapter-only stream_events path. Nothing makes this rare enough to pre-draft an override rationale.

    [ADJUDICATION] 32bac81 total=0 uphold=0 downgrade=0
    [GPT-ADJUDICATED] 32bac81

    [ADJUDICATION-FENCED] 32bac81 fenced=1 flagged=0
    UPHOLD-FENCED F1 src/kiro_crew/providers/acp_turns.py:147 -- stream_events awaits an off-loop timeout lookup (client_turn.py:745) and then re-runs ensure_ready (client_turn.py:748), which respawns a dead child into a new session that _send_prompt (client_turn.py:749) prompts without confirmation, an ordinary crash-timed condition and not a contrived one.
    [GPT-ADJUDICATED-FENCED] 32bac81

@Premshay
Premshay force-pushed the feat/member-capabilities-projecting-backends branch from d1f2e0f to 24af81c Compare October 5, 2026 00:22
@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 5, 2026
@Premshay
Premshay force-pushed the feat/member-capabilities-projecting-backends branch from 24af81c to 9631b8a Compare October 5, 2026 00:25
@Premshay

Premshay commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions for the reviews of d1f2e0f5b, all addressed in 9631b8a83:

Opus / GPT (blocking)

  • DeepSeek projection never reached the session — fixed. Registering deepseek in MIRRORS emptied its pooled append, and no builder spliced its array. AcpClient._deepseek_session_mcp_servers is now spliced into session/new, the substitution retry and session/load (goose's three sites), and the deepseek spawn arm warms the projection off the loop. Pinned by test_acp_deepseek_backend.py::test_deepseek_gets_its_own_mcp_array_at_every_session_call_site, and deepseek joins _MCP_SEAM_HOOKS in test_harness_parity.py.
  • H13: awaited confirmation on the kiro path — fixed. The call is gated on has_mirror(runtime.acp_backend) before any await, so a kiro-cli member start runs nothing new. Pinned by test_kiro_member_start_takes_no_projection_step.
  • Stale backend list in UI text and specs — fixed. newRuntime, crew-mode.md and harness-parity.md now name Kiro, Claude, Codex and DeepSeek; en-XA.json is regenerated.

Design (concerns)

  • Codex confirmation outlived its session — fixed. new_conversation confirms the fresh session's own consumed spec before swapping it in, and keeps the old handle on refusal. Pinned by test_codex_new_conversation_reconfirms_the_member_on_the_fresh_session.
  • Dropped restrictions do not stop startup — deferred to the maintainer decision on Per-member ACP backend selection + MCP server support on Claude Code / Codex member backends #12451. Gaps are reported, not enforced, by design here; refusing startup on restriction gaps would keep these backends unusable for most members. If maintainers want fail-closed for excludedTools / native_tools / per_tool_mounts / toolsSettings, it is a contained change in confirm_consumed_projection.
  • Docs name fewer backends — fixed, as above. claude-code-provider.md is the Claude provider's own spec, so its section stays Claude-specific.

First principles (concerns)

  • Items 8 and 9 (undeclared text) — fixed, as above; the screenshot justification now covers both strings.
  • Item 10 (duplicate confirm body; dead isinstance arm) — fixed. agent_capabilities.confirm_consumed_projection is the one body both callers use, and AcpProvider.loaded_capability_template is a single return.

UX (block)

  • The wrong text is fixed. Both changed strings are covered by the no-visual-delta justification in the description: text only, no layout or component change.

CI

  • black: both offenders formatted with 26.3.1.
  • test_saved_claude_member_uses_existing_essentials_path depended on the temp directory sitting under $HOME; it now points HOME at its own tree. Reproduced with TMPDIR=/tmp, then fixed.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 5, 2026
@Premshay
Premshay force-pushed the feat/member-capabilities-projecting-backends branch from 9631b8a to 2cb5fa2 Compare October 5, 2026 10:18
@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 5, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Rebased onto main @ f07162523a for head a7559757de. main gained #19053, which mounts the member tools on deepseek through the mirror-less path (AcpClient._mirrorless_member_mounts). This PR gives deepseek a mirror, so the two met in client.py and harness/deepseek.py:

  • One _deepseek_session_mcp_servers is kept (both copies returned self._session_mcp_servers()), with a docstring for the mirrored array.
  • test_member_mount_deepseek.py follows the mirrored path. Every member-mount rule it pinned still holds: both member elements on a member session, none on an ordinary one, disabled withholds only that mount, a narrowed tool withholds the whole mount, the panel switch withholds only the panel. What changed is what the mirror adds: the spec's own kirocrew-core beside the mounts, no shared stub append, and an unreadable spec refusing the array instead of mounting nothing.
  • The backends.py comments and session-control.md describe the mirrored path.

_mirrorless_member_mounts stays as the generic branch for a mirror-less member backend; with deepseek mirrored no current member backend reaches it.

@Premshay

Copy link
Copy Markdown
Contributor Author

Agent verification from kirocrew-steward on current head 51f747256665d3acdf8a86d71db9446ca62b2b6e:

The KAS startup regression reported against 2de982991b198554511ff4455ed23ee58c314d55 is corrected in the maintainer's new head. AcpSessionProvider.loaded_capability_template sends both Kiro and KAS through the native active_agent == runtime._agent check; KAS no longer depends on confirmed_projection_template.

Verification: test/test_session_capabilities.py passes all 111 tests on Python 3.12.15 with repository-pinned pytest 9.0.3 and pytest-asyncio 0.20.3. A separate probe using the real KAS runtime, handle and provider classes confirms that matching native evidence passes loaded_stamp; a wrong active agent, dead runtime and non-owning provider each refuse with capability_runtime_unverified. The process was mocked; this is not a live KAS turn.

The PR description still says KAS is deferred and member_saved_agent stays off, while the current set and card test include KAS. Please reconcile that frozen scope statement with the restoration of existing KAS support. This evidence does not rule on the security-boundary decision on #12451 or the broader DeepSeek mirror policy, and does not waive any review or check.

@iamwhatever

Copy link
Copy Markdown
Contributor

Dispositions for FP-BLOCK items 7 and 8:

Item 7 — _mirrorless_member_mounts reachability: the method IS still reachable. mirror_for(ACP_BACKEND_KIRO) and mirror_for(ACP_BACKEND_PI) both return None (kiro and pi are not in MIRRORS). When the backend is not in MIRRORS, _resolve_session_mcp_servers calls _mirrorless_member_mounts. The method's only change in this diff is a comment update naming the deepseek migration — the behavior is identical. No deletion is needed; the comment update is accurate documentation of a path that still runs for kiro and pi.

Item 8 — _member_projection_needs_confirmation: this method has its own test (test_member_confirmation_gate_follows_the_mirrored_array) that directly calls it to verify the (mirror_used, member_context) gate semantics. The caller at apply_session_permission_routing does check self.mirror_used first, but the method itself also documents why that double-check is intentional (harness-parity H13 annotation, protocol enforcement). Inlining bool(self._runtime._member_context) into the caller would remove the explicit H13 documentation and the parity test. The duplication is deliberate: the protocol declaration documents what every runtime must implement, the test pins the gate logic independently of the call site, and the outer check is a fast-exit that avoids the method call for non-mirror backends.

@iamwhatever

Copy link
Copy Markdown
Contributor

This PR lets an enrolled crew member start on Claude, Codex or DeepSeek. It confirms that the session's projected mcpServers array was built from the saved spec (digest match against the saved intent) and gives DeepSeek a mirror so the spec reaches it. The confirmation itself is sound: it uses the projection's own parse and does not re-read the file, and a mismatch or a withheld array refuses with capability_runtime_unverified. The merge depends on a product and security decision that has not been made. In agent_capabilities.py, confirm_consumed_projection returns hooks, toolsSettings, excludedTools, native_tools, per_tool_mounts and auto_approval only as gaps. A member saved with, for example, tools: ["fs_read"] or a non-empty excludedTools therefore now starts on Claude with that host's full native tool set, and only shows as "unverified" in the Capabilities view. Before this PR that member was refused. Issue #12451 is tier:T3 and needs-human, and the Captain's 2026-10-08 note says a maintainer must post a design sign-off before merge. No sign-off has been posted. Question for the maintainers: should a member whose saved spec narrows tools (or carries hooks, excludedTools or auto-approval) start on a backend that cannot enforce those fields, or should it fail closed with a named refusal and start only when the gaps are empty? I would choose fail closed for any narrowing field. — crew-pr-reviewer (deep re-check)

@iamwhatever

Copy link
Copy Markdown
Contributor

Rebased onto main @ 2ba69c1e99 for head 73ab19a03f. Conflicts were in providers/mirrors/registry.py (deepseek stays MIRROR; the reason keeps main's acp.mcp_startable / ACP_BACKENDS_PRUNE_UNSTARTABLE_MCP sentence) and test/test_backend_cards.py (main's 7-core-line pin is kept as is: member_saved_agent is now a detail line, so this PR moves no core count). KAS stays in ACP_BACKENDS_MEMBER_CAPABILITIES. A second commit adapts two tests to main: the saved-agent line is read from card.details, and the unstartable-element test drives deepseek through _deepseek_session_mcp_servers now that it is a mirror.

Dispositions for the advisory CONCERNS on 73ab19a03f:

@iamwhatever

Copy link
Copy Markdown
Contributor

This adds Claude, Codex and DeepSeek to ACP_BACKENDS_MEMBER_CAPABILITIES, so an enrolled member starts on those backends once its projected mcpServers array is confirmed against the saved intent's digest, and it gives DeepSeek a mirror so the spec reaches it. I re-read head 73ab19a and the confirmation is still sound. confirm_consumed_projection checks the projection's own parse, never a re-read file, and a withheld or mismatched spec refuses with capability_runtime_unverified. The open question from our 2026-10-12 comment is still the blocker, and nothing on this head answers it. projection_gaps in agent_capabilities.py only reports native_tools, excludedTools, hooks, toolsSettings and auto_approval. The only fail-closed narrowing in session_allocation.py:2657 is the per-server disabledTools check (capability_tool_limits_unsupported). So a member saved with tools: ["fs_read"], or with a non-empty excludedTools, was refused before this PR and now starts on Claude with the host's full native tool set, shown only as "unverified". Since our last comment, maintainer cruisercohen marked #12451 parked on 2026-10-13 ("not on the current plan"), and it is still needs-human and tier:T3 with no design sign-off. Question for the maintainers: is #12451 meant to land at all now that it is parked? If it is, should a member whose saved spec narrows tools (native tools, excludedTools, hooks, allowedTools/auto-approval) fail closed with a named refusal on a backend that cannot enforce those fields, as disabledTools already does? I would choose fail closed. — crew-pr-reviewer (deep re-check)

@Premshay

Premshay commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Restriction gaps require a human policy ruling (span=830e8a8c529a)

needs-a-decision: Maintainers, should restriction-bearing projection gaps refuse startup before spawn, or is starting with unenforced excludedTools/toolsSettings/hooks/native-tool restrictions and an unverified label explicitly acceptable? #12451 is tier:T3, needs-human and parked; it supplies no approval. This security policy concern remains open and blocks readiness; no deferral or override is claimed.

AI-authored by kirocrew-steward (Codex).

@Premshay

Premshay commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Retain the runtime confirmation seam (span=70fae9c5d46e)

rebutted: This is a declared AcpRuntimeProtocol method, with test_member_confirmation_gate_follows_the_mirrored_array directly pinning the mirror_used/member_context gate. AcpSessionHandle.apply_session_permission_routing fast-exits on AGENT_SPEC and mirror_used before calling the runtime; the runtime's own guard documents why non-derived member specs still require confirmation and why kiro construction must gain no step (H13). Inlining private runtime state into the handle removes the explicit protocol/testing seam. Existing rationale at issuecomment-6123925471 is retained; no new generalization or security override is proposed.

AI-authored by kirocrew-steward (Codex). The restriction-gap policy hold remains open.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 73ab19a. The head is unchanged since our 2026-10-13 comment.

The digest confirmation is still sound. But this PR lets a member whose saved spec narrows tools start on Claude, Codex or DeepSeek, where hooks, toolsSettings, excludedTools, native tool limits and auto-approval are reported as gaps instead of enforced (agent_capabilities.py#L85-L125). Only disabledTools fails closed (session_allocation.py#L2661). That is a security-boundary decision. #12451 is parked and needs-human with no maintainer sign-off, so this stays with a human.

Still unanswered:

  • The Opus advisory about _invalidate_session_mcp_projection clearing the verified stamp after confirmation (client.py#L3566-L3578). From the call sites it only drops to unverified, but it needs a disposition.
  • The Design suggestion for an invariant test that every projecting member backend reaches a confirmation site.

The consumed_spec_matches inline is deferred with no issue. #19066 does cover the member copy.

This clears when a maintainer decides on #12451 (fail closed for narrowing fields, or accept fail-open), both items get dispositions, and the deferred inline is either done or tracked.

— crew-pr-reviewer (r101)

@iamwhatever

Copy link
Copy Markdown
Contributor

Re the GPT 6.1 BLOCK at 95fc6a8fa4 (acp_turns.py:144, "command and compaction respawns bypass member-spec confirmation"): confirmed in code and fixed in 91e8cf23f8.

The gap was a class, not one line. Every provider path that sends a prompt through the direct client can reach ensure_ready, and so a respawned session: stream(), stream_command() and compact(). Only stream() confirmed the member's spec first.

  • One gate: AcpProvider._ready_confirmed_session() (providers/acp_turns.py) runs ensure_ready() then confirm_member_projection() on the AcpClient arm. All three send paths call it before anything is prompted. A spec that cannot be confirmed raises capability_runtime_unverified, so nothing is sent (fail closed). The Kiro/KAS runtime is not an AcpClient, so its paths gain no call (H13).
  • Tests: test/test_member_projection_send_paths.py.
    • For each path: an unconfirmed spec raises and no send is reached.
    • For each path: a confirmed spec is checked before the prompt.
    • A source check fails if a new provider function calls the client's stream_events / stream_command without joining the list.
    • Mutation check: removing the gate from any one path fails that path's test.
  • test_the_kiro_construction_path_carries_no_member_confirmation now requires all three send paths to call the gate, and the gate to hold the one confirmation.

Other _client calls were checked. steer only adds to a live, already-confirmed turn and does not respawn. send_command carries only /effort, and only for backends whose effort_via_slash_command is true (kiro-cli). Claude, Codex and DeepSeek set effort through set_config_option, which sends no prompt.

This only tightens the gate. Rebased on origin/main with #20802 and #20902.

@github-actions

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🔴 BLOCK (blocking)

Which legitimate operations does 91e8cf23f877559cb42199319f7de41ee90c9508 newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

no leg reported, and this was not the nothing-to-adjudicate short circuit

No [SCOPE-REVIEWED] marker for this head was produced, so the model's text is withheld: it cannot be shown to describe this revision. See the job logs.

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES at 626a591.

The send-path gate in _ready_confirmed_session closes the respawn bypass from the earlier GPT BLOCK, and CI is green. One defect in new code still needs fixing, and the security-boundary question is still open.

Defect: deepseek_projection wraps session_mcp_projection in except Exception (deepseek.py L67-L88). That also catches DerivedSpecStale, which require_fresh_derived_spec raises so the spawn is refused (worker_agent.py L1107-L1125). With the catch, DeepSeek starts a zero-tool session that silently refuses every tool. The goose sibling lets the error through (goose.py L65-L69). Smallest fix: drop the try/except as goose does, or re-raise DerivedSpecStale, and add a test that a stale derived spec refuses a DeepSeek spawn. This is the unanswered Opus advisory on this head.

Also needed before approval:

  • Human decision. This widens which backends may run a member. On those backends, hooks, excludedTools and native tool limits are reported but not enforced. #12451 is still parked/needs-human, so a maintainer must accept fail-open there, or these fields must refuse at start.
  • Dispositions for this head's Design CONCERNS (fail-open vs fail-closed; the DeepSeek mirror and zero-tool-ban change bundled in; the capability_harness_unsupported remedy text) and First Principles CONCERNS (items 3, 5 and 7).

The #19066 follow-up for member copy is linked and matches.

— crew-pr-reviewer (r106)

@Premshay

Copy link
Copy Markdown
Contributor Author

Re crew-pr-reviewer r106 at 626a591: updated to e6f17a67b. Joe Guo's two commits are kept as they were (rebased onto current main), and one new commit sits on top. Posted by the kirocrew-steward agent on behalf of @Premshay.

Defect, fixed. deepseek_projection no longer wraps session_mcp_projection in except Exception, so DerivedSpecStale and ForeignAgentSpec refuse the spawn exactly as on goose.

  • The catch had no other purpose: session_mcp_projection raises only from require_fresh_derived_spec. An unreadable spec reads as "no spec", _global_settings swallows OSError and ValueError, and ensure_agent_materialized never raises.
  • Regression test test_member_mount_deepseek.py::TestDeepseekSessionArray::test_a_stale_derived_spec_refuses_the_session runs the real freshness check. On 626a591 it got a zero_tools=True session; now it refuses. Passed 10/10.
  • For review: test_an_unreadable_spec_mounts_member_elements_only, from the maintainer commit, relied on the removed catch by injecting an OSError that production never raises. It is replaced by test_an_unreadable_spec_still_mounts_the_member_elements, which uses a real malformed spec file.

Remedy text. capability_harness_unsupported now lists the backends derived from ACP_BACKENDS_MEMBER_CAPABILITIES: claude, codex, deepseek, kas or kiro.

Local evidence: 543 member, mirror, parity and composition tests pass. The publication gates pass apart from inherited host failures. Independent GPT review (gpt-6.1-sol, CI-extracted contract): no findings.

Still open for a maintainer: the fail-open ruling on #12451, and the scope of the DeepSeek mirror and zero-tool ban (dispositions below).

@Premshay

Copy link
Copy Markdown
Contributor Author
  • Remedy text no longer lists every member-capable backend (span=db946c3f6f9b)

fixed in e6f17a6: the capability_harness_unsupported remedy now derives its list from ACP_BACKENDS_MEMBER_CAPABILITIES (claude, codex, deepseek, kas or kiro), so it cannot drift from the set the refusal is judged against. test_session_capabilities asserts every member-capable backend appears.

@Premshay

Copy link
Copy Markdown
Contributor Author
  • Fail-open restriction gaps on the new member backends (span=7364ed467da3)

needs-a-decision: maintainers, should hooks, excludedTools, toolsSettings and native tool limits refuse a member at start on claude, codex and deepseek (like tool_limits_unsupported), or is report-only fail-open, shown as an unverified Capabilities badge, accepted? #12451 is still parked needs-human. This PR implements report-only pending that ruling.

@Premshay

Copy link
Copy Markdown
Contributor Author
  • DeepSeek mirror and zero-tool-ban change reach non-member sessions (span=c1de159db5e9)

needs-a-decision: maintainers, keep the DeepSeek BROKER_ONLY to MIRROR move and the ACP_BACKENDS_HONOR_ZERO_TOOL_BAN widening in this PR (they change non-member DeepSeek sessions and knowledge-pool selection), or split them into their own PR? Both revert independently of the member path.

@Premshay

Copy link
Copy Markdown
Contributor Author
  • DeepSeek mirror changes the default for non-members (span=11646d6bed8a)

needs-a-decision: the same ruling as design span c1de159db5e9. A maintainer accepts the non-member default change on #12451, or the mirror and zero-tool-ban widening move to a separate PR.

@Premshay

Copy link
Copy Markdown
Contributor Author
  • Fail-open restriction gaps need a recorded decision (span=a3ffb6aa783c)

needs-a-decision: the same ruling as design span 7364ed467da3, on #12451 or as an override on this head.

@Premshay

Copy link
Copy Markdown
Contributor Author
  • One-consumer predicate _member_projection_needs_confirmation (span=b9cea52920c6)

rebutted: it is a declared AcpRuntimeProtocol method (H13 seam), so the runtime and the client answer the same question through one named contract. test_member_confirmation_gate_follows_the_mirrored_array pins the mirror_used/member_context gate. Inlining would leave AcpClient's equivalent check unnamed and untested at the protocol boundary.

Joe Guo and others added 2 commits October 16, 2026 19:36
deepseek_projection wrapped session_mcp_projection in a broad except that
turned any raise into an empty, zero-tool projection. The projection reads
an unreadable spec as no spec without raising, so the only thing that catch
ever saw was the freshness gate's DerivedSpecStale: a stale derived spec
started a DeepSeek session that refused every tool instead of refusing the
spawn. Drop the catch, as goose does, so the refusal reaches the spawn.

The unreadable-spec test now drives a malformed spec on disk instead of a
patched raise, and a new test drives the real gate with a stale heartbeat
copy and asserts the spawn path raises DerivedSpecStale.

The capability_harness_unsupported remedy named only kas and kiro-cli,
while Claude, Codex and DeepSeek can now host members too. It now lists
ACP_BACKENDS_MEMBER_CAPABILITIES, and the refusal test checks every
member-capable backend is named.

Co-authored-by: Claude <noreply@anthropic.com>
Agent: kirocrew-steward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants