Skip to content

feat(mcp): mount-only request_server cards for the default agent and the worker - #28720

Merged
bolichen97 merged 1 commit into
mainfrom
feat/mount-only-server-requests-25771
Nov 3, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/mount-only-server-requests-25771

Conversation

@buluoray

@buluoray buluoray commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a chat on the default agent or the worker can ask for an MCP server, and one click on the approval card adds and mounts it, without approving any of its tools.

Today request_server refuses a default-agent or worker caller (409 unsupported, pointing at the MCP page), so the user has to leave the chat, find the MCP page and add the server by hand. The refusal exists because the MCP page's own add also approves every tool of the server (sync_shared_server_refs writes the bare @server into allowedTools), so a card that said "add this server" would have granted more than it said.

Why it matters

The default agent is where almost every chat runs, so it is where a missing server is most often found. Sending the user to another page costs clicks and asks them to learn the MCP page just to finish the task in front of them. A mount-only card keeps them in the chat and grants nothing beyond what the card shows.

Not a goal

  • Changing what the MCP page's own add does. That stays the user's explicit full-grant path.
  • Granting any tool from chat. The card carries no autoApprove or allowedTools, and the record refuses both.
  • A new card or new UI. The existing template.mcp_server card is reused.
  • Anything about conductors or third-party templates, which already take this card.

What changed (motivation → approach → change)

Symptom: a default-agent or worker request answered 409 unsupported and raised no card.

Cause: template_mcp_additions refused DEFAULT_TEMPLATES, because a normal addition on kirocrew.json would be granted on the next rebuild.

Approach: reuse #26604's mount-only disposition (credited), then fix three defects found while reviewing it against main.

  • Mount-only record. A default or worker caller is mapped to the kirocrew template and the card is proposed with mount_only: true; the owner-only apply step records it. kirocrew accepts only a mount-only addition, the worker accepts none (it mirrors the default spec, so one record reaches both), and a hand-edited default entry without the flag is skipped on read. (From feat(mcp): mount a default agent's requested server without grants #26604.)
  • No grant on rebuild. sync_shared_server_refs(mount_only=...) mounts the server (@server in tools) and never writes or keeps the bare @server grant. A per-tool grant the user wrote is kept, since the card lists it under "Already approved" and says existing permissions still apply. When the governance ceiling has an opinion about the server, the ceiling's stricter arm still runs. Mount-only withholds get their own SEL record.
  • Undo really unmounts (new). kirocrew.json is rebuilt on top of itself, so with feat(mcp): mount a default agent's requested server without grants #26604 alone the card's Undo removed the record but left the server mounted forever. reconcile_default_spec now stamps each merged entry x-kirocrew-card-addition and, on the next rebuild, removes a stamped entry whose record is gone, with its bare @server refs, unless an MCP page scope launches that name (an entry with a command or url; a toggle stub does not count), in which case the page owns it and only the stamp goes. Per-tool @server/tool refs are the user's and are kept. The stamp can only make a rebuild remove an entry, never add or grant one.
  • A declined rebuild rolls back (new). _spec_carries now counts kirocrew, so if the rebuild cannot rewrite kirocrew.json the card reports spec_not_rewritten and the record is put back, as for a conductor.
  • Docs: docs/architecture/mcp.md, src/kiro_crew/docs/agent-spec-fields.md and the feature-map row describe the new shape.

The card text is unchanged: it names the server and where it comes from, lists both agents (kirocrew, kirocrew-worker) and the open chats it reaches, names the server's tools, says "nothing is auto-approved; this agent's existing permissions still apply", and lists any grant that already exists.

Governance: every merged server's calls still reach the PreToolUse gate, _filter_auto_approve (POLICY ∩ PROFILE) is untouched, and the record directory keeps its seal (read-only to sandboxed processes, writers only in the gateway or CLI).

Backwards compatibility

Compatible: mount_only is an optional record and card field; an existing record without it keeps its meaning, and existing conductor and third-party additions are untouched.

Reader: src/kiro_crew/template_mcp_additions.py:_template_support -- entry: chat -- the default agent now passes only with mount_only; test_a_default_addition_without_the_flag_or_on_the_worker_is_refused
Reader: src/kiro_crew/agent_materialization/mcp_sources.py:sync_shared_server_refs -- entry: chat|cron|subagent -- the bare grant is withheld only for recorded mount-only names; test_a_mount_only_server_is_mounted_without_a_grant
Reader: src/kiro_crew/agent_parts/spec_rebuild.py:rebuild_agent_config -- entry: chat|release -- a stamped entry is removed only when its record is gone and no MCP page scope carries the name; test_an_undone_addition_the_mcp_page_now_carries_stays

Tests

  • test_template_server_request.py::test_a_default_or_worker_request_raises_a_mount_only_card: both callers get a card recorded mount-only under kirocrew, reaching the worker, and the card says nothing is auto-approved.
  • test_template_server_request.py::test_a_failed_default_spec_rewrite_puts_the_mount_only_record_back: a declined default rebuild leaves no record.
  • test_template_server_request.py::test_a_failed_default_undo_puts_the_mount_only_record_back: a failed Undo restores the record with its mount-only disposition.
  • test_agent_mcp_merge.py: a mount-only addition is mounted without a grant; Undo then rebuild removes the entry and its refs; an undone name the MCP page now carries stays mounted; a hand-planted stamp only removes its own entry; a failed Undo returns the server with its per-tool grant; a page toggle stub (no launch line) does not keep an undone addition mounted.
  • test_secret_uri_launch_paths.py: the bare grant is withheld and a per-tool grant kept; under the governance ceiling the per-tool grant goes too; a separately installed time-2 keeps its approval when only time is recorded mount-only.
  • test_template_mcp_additions.py: round trip and reach, refusal without the flag or on the worker, a planted default entry without the flag is never merged.

Proof: PROVEN test/test_template_mcp_additions.py::test_a_planted_default_entry_without_the_flag_is_never_merged (head e98df8f)

Mutations, each run against its named test: dropping the default→mount-only mapping reddens test_a_default_or_worker_request_raises_a_mount_only_card; dropping the stamped-entry removal reddens test_undoing_a_mount_only_addition_unmounts_it_on_the_next_rebuild; dropping the page-owns-it check reddens test_an_undone_addition_the_mcp_page_now_carries_stays; dropping kirocrew from _spec_carries reddens test_a_failed_default_spec_rewrite_puts_the_mount_only_record_back; stripping per-tool grants, or not withholding the bare grant, reddens test_a_mount_only_server_is_mounted_without_a_grant.

Manual verification

Run on Linux against a test-mode gateway booted from this branch (kirocrew gateway --test-mode) on its own data home and its own KIRO_HOME, so the live gateway and its agent specs were not touched. A pod could not be used: pods on this host do not boot today because the pod's kiro-cli 3.0.0 child cannot find its engine node under the pod's HOME, which is unrelated to this diff.

  1. In a chat on the default kirocrew agent, asked it to call request_server with source registry and registry id ai.b77/time. The card appeared in that chat (first screenshot): it lists both kirocrew and kirocrew-worker, and says "nothing is auto-approved; this agent's existing permissions still apply".
  2. Pressed Add server. The card collapsed to "Applied" (second screenshot). In both kirocrew.json and kirocrew-worker.json, mcpServers.time was present with the x-kirocrew-card-addition stamp, @time was in tools, and no @time grant was in allowedTools.
  3. Pressed Undo. After the rebuild, time was gone from mcpServers and @time from tools in both files.

macOS and Windows were not run; nothing in the diff is platform-specific.

Screenshots / video

The card a default-agent chat raises:

The mount-only card on a default-agent chat

After Add server

The card after Add server, collapsed to Applied with Undo

Related Issues

Closes #25771
Refs #25180, #25157. Builds on #26604 by @vnlebaoduy (credited with a Co-authored-by trailer).

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

Contributed under the project's Apache-2.0 license.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 2, 2026 23:25
@buluoray
buluoray requested a review from cruisercohen November 2, 2026 23:25
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 2, 2026
@buluoray
buluoray force-pushed the feat/mount-only-server-requests-25771 branch from e98df8f to c35b170 Compare November 2, 2026 23:43
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

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

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)

GPT 6.1 flagged blocking issues on 053f122b3a40755563d9c387602f1ed135fea1d1; Opus 5.5 adjudication downgraded every one of them. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 2 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents.

This comment is updated in place on each push.

Review details

BLOCKING -- src/kiro_crew/agent_parts/spec_rebuild.py:746 -- A concurrent rebuild can restore a successfully undone server

_template_additions.reconcile_default_spec(config, _page_names)
Trigger: An MCP-page rebuild snapshots the recorded addition before acquiring the spec-write lock. Undo then removes the record, completes its rebuild, and returns success; the older rebuild subsequently commits its snapshot through write_default_spec.
Outcome: The server and its mount reference return to the default spec and worker mirror despite the empty record. The card remains Undone, and removing the addition again returns not_found; another rebuild is required to unmount it.
Anchor: defect
Fix: Serialize additions reconciliation through the spec commit, deriving mounts and mount-only grants from the current record inside that critical section.
Sites: src/kiro_crew/template_mcp_additions.py:620 reads the record; src/kiro_crew/agent_parts/spec_rebuild.py:796 commits the pre-lock snapshot; src/kiro_crew/dashboard/handlers/template_server_request.py:609 checks Undo before that later commit.

BLOCKING -- src/kiro_crew/dashboard/handlers/template_server_request.py:461 -- Default-spec success does not establish that the worker received the change

return _default_spec_mounts(server) is not present
Trigger: A card applies or undoes an addition while a worker chat is running on a hot-reloading Kiro provider. The default rewrite succeeds, but the worker’s atomic replacement raises a filesystem error; rebuild_agent_config catches that exception, this check examines only the default, and _reach_sessions skips resetting the worker.
Outcome: Apply reports success while the requesting worker still lacks the server. Undo reports success and removes the record while the running worker still mounts it. The spawn-time freshness guard does not repair that already-running session.
Anchor: defect
Fix: Verify and repair the worker mirror before completing the card. If the default committed but the worker did not, retain a retryable partial outcome rather than reporting success or rolling back the committed default.
Sites: src/kiro_crew/dashboard/handlers/template_server_request.py:426 reads only the default; src/kiro_crew/agent_parts/spec_rebuild.py:1051 catches worker-install failures; src/kiro_crew/dashboard/handlers/template_server_request.py:482 skips resets.

[BLOCK-MERGE-DOWNGRADED] 053f122
[GPT-REVIEWED] 053f122

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

F1 — LOW. Every condition checks out in the code. The rebuild reads the record without holding the spec lock (template_mcp_additions.py:620, called from spec_rebuild.py:746), then takes the lock (spec_rebuild.py:778) and writes that earlier snapshot (spec_rebuild.py:796). Meanwhile Undo removes the record and checks the spec on disk (template_server_request.py:600-609). The failure needs an MCP-page rebuild running at the same moment as an Undo. The server that comes back is mount-only with no tool grants (template_mcp_additions.py:621), and the next rebuild (gateway start, any MCP change) removes it, as the design says at template_server_request.py:381-383. The real fix moves the record read and the command resolution inside a cross-process file lock that this code can skip (spec_rebuild.py:779-781), and adds an ordering rule between modules. That costs more than the harm.

F2 — LOW. rebuild_agent_config swallows a failed worker install with only a debug log (spec_rebuild.py:1050-1053). The Apply/Undo success check reads only the default spec (template_server_request.py:426-461), and resets are skipped under hot-reload (template_server_request.py:478-479). The failure needs the default spec write to succeed and the worker write to fail on a filesystem error right after it, while a worker chat is running. Only that running session is affected. New sessions are fixed by the spawn-time freshness guard (named in the finding itself), and the next rebuild brings the worker back in line with the default (worker_agent.py:558, which mirrors the spec on disk). The fix needs worker-mirror checking plus a new retryable partial-outcome state for the card, all for a rare path. That costs more than the harm.

[ADJUDICATION] 053f122b3a40755563d9c387602f1ed135fea1d1 total=2 uphold=0 downgrade=2
DOWNGRADE F1 src/kiro_crew/agent_parts/spec_rebuild.py:746 reason=disproportionate-remedy
DOWNGRADE F2 src/kiro_crew/dashboard/handlers/template_server_request.py:461 reason=disproportionate-remedy
[GPT-ADJUDICATED] 053f122b3a40755563d9c387602f1ed135fea1d1

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

@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 Nov 3, 2026
@buluoray

buluoray commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: Both GPT 6.1 findings on c35b1702e2 were verified in source and fixed in 959a95908c. The verdict was produced but never published because the review job hit the GitHub API rate limit, so the findings are summarised here.

  1. Failed default-agent Undo lost the record (template_server_request.py): the restore after a failed Undo called add_addition() without the disposition, which a kirocrew record requires, so the restore was refused. The restore now passes mount_only=prior.mount_only. Test: test_a_failed_default_undo_puts_the_mount_only_record_back (red with the line removed).
  2. Mount-only withheld a suffixed sibling's approval (mcp_sources.py): the match used the alias family, so a recorded time also caught a separately installed time-2. It now matches the server's own name or its concrete mounted alias. Test: test_a_mount_only_record_leaves_a_suffixed_sibling_s_grant_alone (red with the family match restored).

The other review lanes (UX, Design, First Principles, Opus) also failed on the same rate limit and will run on the new head.

@buluoray
buluoray force-pushed the feat/mount-only-server-requests-25771 branch from c35b170 to 959a959 Compare November 3, 2026 01:16
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

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

First-Principles-Verdict: PASS

Nothing blocks. Every item removes the stated 409 unsupported dead end, and the reversed refusal is named and explained in the description. Three leftovers can be deleted.

Notes

  • Item 8 — zero consumers: template_mcp_additions.mount_only_names is called only from tests (3 hits for mount_only_names across src and test). reconcile_default_spec builds the same set inline instead (frozenset(name for name, add in recorded.items() if add.mount_only)). Subtraction: delete mount_only_names and its test asserts.
  • Item 9 — duplicate of template_mcp_additions.DEFAULT_TEMPLATES / DEFAULT_TEMPLATE: MCP_PAGE_TEMPLATES and MOUNT_ONLY_TEMPLATE in template_server_request.py are aliases with one consumer each (lines 316 and 318). Subtraction: delete both and use _additions.DEFAULT_TEMPLATES / _additions.DEFAULT_TEMPLATE directly.
  • Item 10 — second spelling: _template_support and _parse_mount_only hard-code "kirocrew" and "kirocrew-worker" even though DEFAULT_TEMPLATE was added for this purpose. Subtraction: replace the "kirocrew" literal with DEFAULT_TEMPLATE.

What this change ships

Inventory (10 items) — 7 justified

Intent: let a default-agent or worker chat add an MCP server with one card click, mounted but with no tools approved. ADDITION.

  1. A request_server call from the default agent or the worker now shows an Add server card instead of a 409 refusal — justified
  2. A server added from that card is mounted, and every call to it still asks for approval — justified
  3. One record under kirocrew reaches both the default agent and the worker — justified
  4. Undo now removes the server from kirocrew.json on the next rebuild — justified
  5. An Add or Undo whose rebuild did not land is rolled back — justified
  6. A hand-edited default-agent record without mount_only is ignored — justified
  7. A separate audit (SEL) record is written for mount-only withholds — justified
  8. New mount_only_names helper — zero consumers
  9. New MCP_PAGE_TEMPLATES and MOUNT_ONLY_TEMPLATE handler constants — duplicate of template_mcp_additions.DEFAULT_TEMPLATES/DEFAULT_TEMPLATE
  10. The "kirocrew" literal is still hard-coded beside the new DEFAULT_TEMPLATE — duplicate of DEFAULT_TEMPLATE

[FIRST-PRINCIPLES-REVIEWED] 053f122

Description read

[DESCRIPTION-READ] cb57dab9ddc71e22e47436b442fe61d9cbf1181ccea81ff10d9c07c0954bebe0

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 Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

No design-level blocker: the change reuses the existing card and record, it takes nothing away, and the rebuild stamp can only remove an entry, never grant one.

Notes

  • A server recorded mount-only and later added on the MCP page still has its bare grant withheld (name in mount_only runs before the page path), so the page's full-grant add silently fails to approve. It fails safe and is reversible, but it needs either a precedence rule or a line in mcp.md.

[DESIGN-REVIEWED] 053f122

Description read

[DESCRIPTION-READ] dd54c6dbef581b6648b4c64b440fb3e3c9ac2b3f8cb0d03c02bb343431436335

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 Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 053f122

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

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

@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 Nov 3, 2026
@buluoray
buluoray force-pushed the feat/mount-only-server-requests-25771 branch from 959a959 to 469b286 Compare November 3, 2026 01:38
@buluoray

buluoray commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: Dispositions for the review findings on 959a95908c. The fixes are in 469b286bdb.

Opus 5.5 (blocking, security): a page toggle stub kept an undone server mounted and let the page's grant approve it. Verified: list_servers lists a card-added server as an agent-config row, and a toggle on that row writes a stub with no launch line into a page scope. The old page-name set counted that stub, so Undo kept the entry, and sync_shared_server_refs then reached the stub and wrote the bare grant. Fixed: reconcile_default_spec now only treats a name as page-owned when a page scope launches it (page_launched_names: an entry with a command or url). Test: test_a_page_toggle_stub_does_not_keep_an_undone_addition (red with the old name set).

GPT 6.1 F1 (blocking, fenced): a failed Undo destroyed per-tool grants. Verified: the removal stripped @server/tool refs, and a restore after a failed Undo re-adds only the mount. Fixed in code, not overridden: removal now strips only the bare @server refs. A per-tool ref reaches nothing while no server of that name exists, and a later card for the same name lists it under "Already approved", so keeping it is never a hidden grant. Test: test_a_failed_undo_returns_the_server_with_its_per_tool_grant (red with per-tool stripping restored).

GPT 6.1 F2 (downgraded by adjudication): the card reports Applied when the launcher is missing. Not changed in this PR. _rebuild_required checks that the spec write succeeded, not that every server resolved, and that is the same for conductor cards on main today. An unresolved server is kept deferred by design and mounts on the first rebuild after the launcher is installed. Making the card verify resolution would change that shared contract for every template, which is outside this PR's goal.

@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 Nov 3, 2026
@buluoray
buluoray force-pushed the feat/mount-only-server-requests-25771 branch from 469b286 to 82cd45e Compare November 3, 2026 01:56
@buluoray

buluoray commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: GPT 6.1's finding on 469b286bdb (failed Undo loses per-tool approvals, security-class) is verified and fixed in 82cd45e094, not overridden.

Verified: when the Undo rebuild commits kirocrew.json but holds back a conductor spec, _rebuild_specs reported failure, so the handler restored the record on top of a spec whose dangling @server/tool refs prune_dangling_tool_refs had already removed.

This is the second round on the same class, so the fix removes the trigger instead of patching the restore. For the default agent, _rebuild_required now asks only whether kirocrew.json was written (_rebuild_specs(ignore_held=True)). No conductor spec carries a default-agent addition, so a held conductor spec says nothing about this Undo. The rollback now runs only when kirocrew.json itself was not written, and then nothing was pruned. Conductor templates keep the stricter rule. Tests: test_a_held_conductor_spec_does_not_roll_back_a_default_agent_change (red with the old call) and the extended test_a_rebuild_counts_only_when_every_spec_was_written.

…the worker

A default-agent or worker session asking for an MCP server mid-chat was
refused (409 unsupported, pointing at the MCP page), because the MCP page's
add also approves every tool and a card that said "add this server" would
have granted more than it said.

The request now raises the existing template.mcp_server card. Approving it
records a mount_only addition under kirocrew (the worker mirrors that spec):
the rebuild mounts the server (mcpServers plus the @server ref in tools) and
never writes the bare @server grant, so every call still asks. A per-tool
grant the user wrote is kept, as the card's "Already approved" row says, and
the governance ceiling's stricter arm still wins when it applies.

kirocrew.json is rebuilt on top of itself, so a merged entry is stamped
x-kirocrew-card-addition and reconcile_default_spec removes a stamped entry
whose record is gone (the card's Undo), unless the MCP page now carries that
name. The stamp can only make a rebuild remove an entry, never grant one. A
declined default rebuild now puts the record back, as it does for a conductor.

Closes #25771

Co-authored-by: Lê Bảo Duy <4734934+vnlebaoduy@users.noreply.github.com>
@buluoray
buluoray force-pushed the feat/mount-only-server-requests-25771 branch from 82cd45e to 053f122 Compare November 3, 2026 02:18
@buluoray

buluoray commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: GPT 6.1 produced a verdict on 82cd45e094 but could not publish it (GitHub API rate limit), so its two findings are answered here. Both were verified and are fixed in 053f122b3a, not overridden. Opus 5.5 found nothing blocking on that head.

1. Separate record reads let a kept entry take the full grant (security). Verified: reconcile_default_spec and the grant pass each read the record, so an Undo landing between them left the entry kept but out of the mount-only set, and a page toggle stub then reached it with the bare grant. Fixed: reconcile_default_spec returns the mount-only set from the same read it merged with, and rebuild_agent_config passes that set to sync_shared_server_refs. Test: test_the_grant_pass_uses_the_record_read_the_merge_used (red with the second read restored).

2. A failed Undo loses per-tool grants (third round of this class). The earlier fixes patched one failure source at a time. This one removes the cause: for the default agent the card no longer trusts the rebuild's overall success flag. It reads the outcome from kirocrew.json itself. Add server counts as applied when the spec holds the stamped entry, and Undo counts as done when it no longer does. Any other installer failure, after the default spec is committed, no longer triggers a rollback over a pruned spec. The same check also refuses an Add server whose launcher did not resolve, which answers the earlier downgraded F2 for the default agent. Conductor templates keep their rule. Tests: test_a_default_undo_whose_spec_landed_is_not_rolled_back, test_a_default_apply_whose_server_did_not_land_is_rolled_back and test_the_default_agent_s_outcome_is_read_from_its_spec (the first two red with the old flag check).

@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 Nov 3, 2026

@bolichen97 bolichen97 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.

Approving at 053f122.

Read every source, doc and test hunk (15 files). Checked as an approval-gate change:

  • A default-agent or worker request is recorded once under kirocrew with mount_only: true; the worker reaches it through the mirror. A plain addition on the default agent, any addition on the worker, and a hand-edited default entry without the flag are all refused (_parse_mount_only, _check_covered).
  • sync_shared_server_refs keeps the @server ref in tools and writes no bare @server grant for a mount-only server, so every call still goes through the approval gate. Per-tool grants the user wrote are kept and listed on the card.
  • The x-kirocrew-card-addition stamp can only make the rebuild remove an entry, never grant one, and a page toggle stub does not keep an undone server mounted (page_launched_names).
  • _rebuild_required reads the outcome from the default spec itself, so a rollback runs only when the spec did not change.

Gates at this head: mergeable, 95 checks ok, 0 red, 0 pending, no open change requests. Design, First Principles, Opus and GPT lanes pass; UX skipped (no user-facing surface).

Non-blocking: mounting a stdio server runs its command on the host once the user presses Add server. That was already true for conductor cards, and the card shows the entry, so no change asked.

@bolichen97
bolichen97 merged commit 7c8e1f7 into main Nov 3, 2026
95 checks passed
@bolichen97
bolichen97 deleted the feat/mount-only-server-requests-25771 branch November 3, 2026 04:15
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 3, 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.

request_server: mount-only server requests from the default agent and the worker

2 participants