Skip to content

feat(app-kit): serve dev-fleet's pod tools through agentTools - #33159

Merged
bolichen97 merged 1 commit into
mainfrom
fix/adoption-devfleet-tools
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/adoption-devfleet-tools

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Dev Fleet's five agent pod tools are declared and served by the app itself through the manifest agentTools seam, under the same names, arguments and replies, so no core table names dev-fleet and adoption stops refusing it.

mcp_tools/apps.py declared, ran and mapped (TOOL_APPS) pod_up, pod_restart, pod_down, pod_status and pod_ls in the kirocrew-core MCP server. Ruling 2 of #26967 (comment 6713005850) refuses app code in that server, and adoption's E10 (builtin_adoption_checks.core_named_apps) refuses every dev-fleet pin while a core table keys a capability on the app: scripts/adoption_pin.py compute answers pinned_feature_unsupported.

The seam as it stood could not carry these tools unchanged: a tool name had to start with dev_fleet_, every call waited at most 30s (a pod boot is bounded at 180s in the gateway), the answer was JSON redacted as a whole (the pod's open: http://127.0.0.1:<port>/?token=... line is redacted as an exfiltration URL), and a process-backed app's call went to its backend, which is sandboxed and so can neither reach the systemd user bus nor mint a pod token.

Why it matters

Campaign #26967 moves every built-in out of core with zero behaviour change for current users. Until no core table names dev-fleet, its users can never be adopted onto KiroCrewCaptain/kirocrew-app-dev-fleet, and a rename to dev_fleet_* would break the shipped pod-e2e, kirocrew-worktree-dev and web-verify skills and every profile or policy that names a pod tool.

Not a goal

  • Adding a dev-fleet adoption pin, or listing an adopted record's declared tools (app_agent_tools reads first-party built-in records only; that is a separate change in this campaign).
  • Declaring the four routes the app repository's bundle calls outside permissions.api (make-live, restart-gateway, pod-token, GET /api/apps): widening the declared permissions is an open owner question (E9).
  • Moving the name-keyed governance rows that still name these tools (the channel agent's dispatch deny, the remote session's local-only fence, the title rows): they stay in core and keep applying because the names are unchanged.
  • Removing Dev Fleet's existing /api/apps/dev-fleet/pod/* gateway routes or their strict-internal rows.

What changed (motivation → approach → change)

Goal → move the tools onto the manifest seam, unchanged for an agent → extend the seam generically where it could not carry them, then move them.

Seam (apps/manifest_agent_tools.py, mcp_tools/app_tools.py, dashboard/handlers/app_agent_tools.py, apps/route_registry.py; no app named):

  • agentTools.namespace: a block may state the prefix its tool names use (a lowercase identifier, at most 32 chars); the default stays the app's name. A core tool still keeps its name, and a name two apps declare is neither's.
  • per-tool timeoutSeconds (1-600, default 30, the wait every core post already had): how long kirocrew-core waits for the forwarded call.
  • per-tool result: "text": the app answers with the model-facing text it formatted, and the core redacts it and relays it as text. An answer {"text": [<pieces>], "credential": <str>} keeps one credential verbatim (one printable token, 16-4,096 chars) and the core redacts each piece around it: that is how pod_up hands over the pod's own token, which the core tool never redacted either. Any other answer of such a tool (a gateway refusal, a timeout, any other body) is an Error: line, so the tool-call audit records it as failed. json stays the default (an exact {"text": <string>} answer is that text).
  • dispatch: POST /api/app-tools/call serves a tool from the app's own gateway route when the app registered a POST route at exactly the declared route (RouteRegistry.serves), else from its backend as before.
  • the apps/manifest.py facade binds the new manifest_agent_tools constants.
  • APP_SDK_LEVEL 3 → 4 (apps/app_sdk_level.py and website/src/app-sdk/sdkLevel.ts), because a level-2/3 host refuses a block carrying the new keys.

Dev Fleet wheel copy:

  • app.json declares the five tools under namespace pod with the core descriptions and schemas byte for byte, plus the bounds the core validator enforced as maxLength (worktree 200, memory/cpu 16), the core waits (210s start/restart, 120s stop, 45s read), result: "text" and a 60,000-char cap; and backend.hooks.routes: agent_tools:register_routes.
  • agent_tools.py registers POST /api/apps/dev-fleet/agent-tools, re-asserts the pod routes' caller gate (local origin + internal_auth) and the host-exec grant, runs the same agent_pod_api verb, reads its answer the way the core gateway client read a route's, and renders the text the core tool rendered (moved verbatim from mcp_tools/apps.py); a pod start's answer names the pod token as its credential.
  • agent_pod_api.py: each handler's body is split into a pod_*_response function both the route and the tool call; the routes are unchanged.

Core removals: the pod descriptors, handlers, helpers and TOOL_APPS rows in mcp_tools/apps.py; the POD_* schemas in validation_parts and the validation facade (the declaration is validated by the seam's field-engine schema now).

security_posture.py lists agent_tools.py with the other Dev Fleet non-egress redactors.

Specs: app-kit-platform.md §7 and §30.1 (keys, dispatch order, text results and the named credential, level 4, Dev Fleet on the seam), dev-fleet.md (model-facing half), docs/architecture/mcp.md.

App repo: KiroCrewCaptain/kirocrew-app-dev-fleet@3c0bfa6

That commit carries the same declaration, the agent_pod_api split, the route in its gateway_hooks.py and this branch's _answer, so a pod start names its token as the answer's credential there too (no pin exists yet: Not a goal).

Backwards compatibility

Compatible: the tools keep their names, descriptions, arguments, validation bounds, waits and reply text; the existing seam keys keep their meaning and defaults, and a block without the new keys validates and dispatches as before (an app with no gateway route at its tool route still goes to its backend).

Two edge readings differ, both in states where the call is refused anyway: a call that the core seam itself refuses (app disabled, gateway unreachable, a timeout) reads Error: pod_up failed [<code>]: <message> instead of the core tool's Error: pod up '<worktree>' failed: ... (both start Error:, so the audit outcome is the same), and a corrupt installed.json hides the tools (the seam's first-party check fails closed) where the core listing showed them and the route refused. The descriptor's inputSchema now states the maxLength bounds the core validator already enforced.

Reader: src/kiro_crew/mcp_tools/apps.py:TOOL_APPS -- release -- adoption's core_named_apps() is the reader that must stop seeing dev-fleet; test_adoption_no_longer_refuses_dev_fleet_on_a_core_tool_table
Reader: src/kiro_crew/mcp_tools/apps.py:schemas/HANDLERS (pod_) -- chat|subagent|cron -- the names are now listed and answered by the app_tools domain from the shipped manifest; test_the_pod_tools_keep_their_names_in_the_core_listing
Reader: src/kiro_crew/validation_parts/server_registries.py:MCP_CORE_SCHEMAS (pod_
) -- chat|subagent|cron -- mcp_core.validate_args falls through to app_tools.tool_schema; test_pod_tools_keep_the_core_validation_bounds
Reader: src/kiro_crew/validation.py:POD
SCHEMA -- release -- no reader outside tests in src/ or scripts/; facade inventory and test_validation_parts_facade updated
Reader: src/kiro_crew/channel.py + src/kiro_crew/session_environment.py (pod
by name) -- chat -- unchanged rows, still applied by mcp_core._call_tool_inner to every kirocrew-core call; test_channel_blocked_tools, test_remote_session_local_only_tools
Reader: builtin skills pod-e2e, kirocrew-worktree-dev, web-verify (call pod_up/pod_status) -- chat|subagent -- names unchanged

Tests

  • test/test_app_agent_tools.py: the new keys parse and every out-of-range value is refused; a stated namespace replaces the app name and a core name still wins; the core waits the declared timeoutSeconds; a text tool's text is redacted; a named credential is the one string kept verbatim, each piece around it redacted on its own; a transport failure, a refusal, a malformed credential answer or any other body of a text tool is an Error: line; any answer of a json tool is redacted JSON; a backend app with its own gateway route at the tool route is served there, any other route leaves it on its proxy; RouteRegistry.serves matches only an exact registered route.
  • test/test_dev_fleet_pod_agent_api.py: the declaration (names, bounds, waits, text result) against the shipped app.json; every reply, refusal and limit case the core tool tests pinned, now against agent_tools.py; a pod start names its token as the answer's credential, and through the core's real redaction a pod_up reply around a minted link token, and each other pod reply, reads byte for byte what the core tool returned; the tool route's caller gate, grant refusal wording and unknown-tool refusal; the hook registers exactly the declared route; the shipped block is read as first party and its names reach build_tool_names and app_tools.HANDLERS; core_named_apps() no longer names dev-fleet; a pod_ls call through the real /api/app-tools/call handler and a real RouteRegistry loaded from the shipped hook reaches the gateway route, never the backend proxy.
  • test/test_pod_stop_timeout.py: the pod_down wait it holds above Dev Fleet's pod down bound is read from the shipped declaration.
  • test/test_mcp_apps_tool_gate.py, test/test_validation_parts_facade.py: the apps domain without the pod tools; its one remaining app's listing is checked against the call gate with no installed.json, switched off and switched on.

Determinism: test_app_agent_tools.py and test_dev_fleet_pod_agent_api.py pass 5 repeats (-n 4) and a shuffled serial order (seed 33159); test_mcp_apps_tool_gate.py passes 20 repeats at -n0, 10 at -n 4 beside two sibling files, and a shuffled order (seed 33159); the changed test_pod_stop_timeout.py test passes 20 repeats at -n0, 10 at -n 4 beside two sibling files, and its file shuffled (seed 33159); test/test_flake_pattern_ratchet.py is green.

Proof: not provable -- other: a move plus a seam extension, not a defect fix; reverting the production hunks deletes agent_tools.py and fails the moved tests at import

Manual verification

N/A — the call is pinned through the real gateway handler, the real route registry and the shipped hook module; the pod verbs themselves are unchanged and keep their own tests. The app repository's full suite (1,398 tests) passes against this branch and against its pinned Kiro Crew commit.

Related Issues

Part of #26967

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

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 8, 2026 12:29
@bolichen97
bolichen97 enabled auto-merge (squash) November 8, 2026 12:29
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing to check. The PR adds or changes no control, label or state that a user sees. The only frontend line bumps the APP_SDK_LEVEL constant, and the pod tools' text for the agent keeps the same names and replies.

[UX-REVIEWED] 73665f1

Description read

[DESCRIPTION-READ] d866ea7922dee152cd3d47e3a95130336da78eb203785acecf451bc0e1f83e98

That sha256 names everything this verdict read: the PR description, plus the 3 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 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 73665f1abb078da71351b07724cc54b00859bf6c — 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: each new seam key is the smallest generic fix for a gap AGENTS.md calls an App Kit seam gap, and each has exactly one real consumer, Dev Fleet.

Notes

  • Item 4 — one consumer, generalized: result: "text" adds a second spelling of the existing exact {"text": <string>} JSON answer (_answer_text). Only the credential splice and the Error: line for other bodies are new. Subtraction: drop the RESULT_MODES enum and accept {"text": [...], "credential": ...} in the default mode.

What this change ships

Inventory (8 items) — 7 justified

Intent: move Dev Fleet's pod tools out of core with no change an agent would notice, so the app can be adopted. ADDITION (a seam extension) plus a move.

  1. The five pod tools are now served by the Dev Fleet app, with the same names, arguments and replies — justified
  2. Apps can state an agentTools.namespace so tools keep names they already had — justified
  3. Each tool can set its own wait, timeoutSeconds (1–600, default 30) — justified
  4. Tools can answer in text mode, with one named credential kept verbatim — one consumer, generalized
  5. A tool call goes to the app's gateway route when the app registered one there, ahead of its backend — justified
  6. APP_SDK_LEVEL goes from 3 to 4 — justified
  7. Pod schemas, handlers and TOOL_APPS rows are removed from core — justified
  8. Errors on calls refused before reaching the app read differently, and a corrupt installed.json hides the tools — justified

[FIRST-PRINCIPLES-REVIEWED] 73665f1

Description read

[DESCRIPTION-READ] eaee7519c28a972db5edbc0afa5f22588bb5a953b471aaf36acaf1a8d707f2a3

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the seam extensions (namespace, timeout, text result, gateway-route dispatch) are generic, name no app, and keep every tool name an agent, a profile or a policy already uses.

Notes

  • Dispatch now prefers the gateway route whenever the app registered one at the tool's route (if backed and not in_gateway). That moves app tool code into the unsandboxed gateway as soon as the route exists, with no opt-in in the manifest. An explicit dispatch: "gateway" key would state the trust choice in the manifest itself instead of leaving it implied by which routes happen to be registered.
  • The description was cut off inside ## Backwards compatibility, so the reader list was judged only up to the cut.

[DESIGN-REVIEWED] 73665f1

Description read

[DESCRIPTION-READ] 8b8e1264302376f8bdcb589c8923d688edb1b50962227ca94fc3bae4f996386d

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 73665f1

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

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

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 73665f1

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 73665f1abb078da71351b07724cc54b00859bf6c 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 8, 2026
@bolichen97
bolichen97 force-pushed the fix/adoption-devfleet-tools branch from 92ab4b1 to 66b5d8c Compare November 8, 2026 13:10
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: result "text" answer handling in app_tools._text_answer

  • span=d019e89db609 a timed-out or unreachable pod call no longer reads Error:, so the audit records it as completed

fixed in 66b5d8c: a result: "text" tool's answer that is not its text is now an Error: line. A refusal or transport failure ({"error", "code"?}) reads Error: <tool> failed [<code>]: <redacted message>; any other body reads Error: <tool> returned no result: <redacted body>.
The class swept is every failure shape a text tool can get back: the gateway's own refusals, the app route's 400/404, _transport_failure (timeout, refused connection), and a malformed answer. All four now go through the same branch, so call_tool_with_logging._audit records each one as failed.
test_any_other_answer_of_a_text_tool_is_an_error_line pins each shape, the transport failure among them. A json tool's answer is unchanged here: it is main's existing contract for the other apps on the seam.
The same push narrows the text path too. The core now redacts every text answer, and the one string it keeps verbatim is a credential the answer names (the pod token). test_the_core_relays_a_pod_up_reply_byte_for_byte proves the old tool's reply is byte-identical through the real redactor.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture.py

  • @bolichen97 posted a complete reasoning template for 73665f1.

@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 8, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 66b5d8c
  • What rule changed: one row added to security_posture.NON_EGRESS_REDACTION_MODULES: apps/builtins/dev_fleet/agent_tools.py, the module this PR adds. No other rule, sink or allowlist entry changes.
  • Before -> after (what was allowed/blocked, now): before, test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed because the new module calls a redactor and was unclassified. After, it is classified with the other Dev Fleet modules (gateway_routes.py, gateway_service.py, ...) as an app-side, non-egress redactor. The egress for its text stays mcp_tools/app_tools.py, already a classified module, which redacts every answer again before it reaches the model.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the redaction posture panel would not count this module as an egress sink. Nothing is unredacted by the row itself; the model-facing text is still redacted at app_tools._text_answer, and only the pod token the answer names is kept verbatim (as the old core pod_up kept it).
  • Evidence checked (which sandbox result proves it): not a sandbox change. test/test_security_posture.py (all of it) passes on this head locally, and Static Ratchet Gate is green on this head in CI.
  • No regression:
    • Tools still work (which tools/commands were run, result): test/test_dev_fleet_pod_agent_api.py drives the five pod tools through the real /api/app-tools/call handler and a real route registry; test_the_core_relays_a_pod_up_reply_byte_for_byte runs the real redactor over a minted link token and gets the old tool's reply byte for byte.
    • Backward compatible (old config / old data / old callers still work, how checked): an allowlist row only; no config, data or caller reads it except the posture test and panel.
    • Existing tests (which suites passed on this head): test_security_posture.py, test_security_posture_facade.py, test_app_agent_tools.py, test_dev_fleet_pod_agent_api.py, test_mcp_apps_tool_gate.py, test_flake_pattern_ratchet.py locally; Static Ratchet Gate in CI.
  • How to undo: delete the row (and the module, which is the only caller).

@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 8, 2026
@bolichen97
bolichen97 force-pushed the fix/adoption-devfleet-tools branch from 66b5d8c to 14e61d4 Compare November 8, 2026 13:56
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 14e61d4
  • What rule changed: one row added to security_posture.NON_EGRESS_REDACTION_MODULES: apps/builtins/dev_fleet/agent_tools.py, the module this PR adds. No other rule, sink or allowlist entry changes.
  • Before -> after (what was allowed/blocked, now): before, test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed because the new module calls a redactor and was unclassified. After, it is classified with the other Dev Fleet modules (gateway_routes.py, gateway_service.py, ...) as an app-side, non-egress redactor. The egress for its text stays mcp_tools/app_tools.py, already a classified module, which redacts every answer again before it reaches the model.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the redaction posture panel would not count this module as an egress sink. Nothing is unredacted by the row itself; the model-facing text is still redacted at app_tools._text_answer, and only the pod token the answer names is kept verbatim (as the old core pod_up kept it).
  • Evidence checked (which sandbox result proves it): not a sandbox change. test/test_security_posture.py (all of it) passes on this head locally, and Static Ratchet Gate was green in CI on the previous head (66b5d8c), which carried the same row.
  • No regression:
    • Tools still work (which tools/commands were run, result): test/test_dev_fleet_pod_agent_api.py drives the five pod tools through the real /api/app-tools/call handler and a real route registry; test_the_core_relays_a_pod_up_reply_byte_for_byte runs the real redactor over a minted link token and gets the old tool's reply byte for byte.
    • Backward compatible (old config / old data / old callers still work, how checked): an allowlist row only; no config, data or caller reads it except the posture test and panel.
    • Existing tests (which suites passed on this head): test_security_posture.py, test_security_posture_facade.py, test_app_agent_tools.py, test_dev_fleet_pod_agent_api.py, test_mcp_apps_tool_gate.py, test_flake_pattern_ratchet.py locally (9,014 tests across every test file that imports a touched module, after the rebase onto main).
  • How to undo: delete the row (and the module, which is the only caller).

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

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/app-kit-platform.md and 73 other files since this head went green (d1a9a81 -> b4a5645); CI re-running.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 9a8cd30
  • What rule changed: one row added to security_posture.NON_EGRESS_REDACTION_MODULES: apps/builtins/dev_fleet/agent_tools.py, the module this PR adds. No other rule, sink or allowlist entry changes.
  • Before -> after (what was allowed/blocked, now): before, test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed because the new module calls a redactor and was unclassified. After, it is classified with the other Dev Fleet modules (gateway_routes.py, gateway_service.py, ...) as an app-side, non-egress redactor. The egress for its text stays mcp_tools/app_tools.py, already a classified module, which redacts every answer again before it reaches the model.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the redaction posture panel would not count this module as an egress sink. Nothing is unredacted by the row itself; the model-facing text is still redacted at app_tools._text_answer, and only the pod token the answer names is kept verbatim (as the old core pod_up kept it).
  • Evidence checked (which sandbox result proves it): not a sandbox change. test/test_security_posture.py (all of it) passes on this head locally, and Static Ratchet Gate was green in CI on 14e61d4, which carried the same row (this head is that commit rebased onto main).
  • No regression:
    • Tools still work (which tools/commands were run, result): test/test_dev_fleet_pod_agent_api.py drives the five pod tools through the real /api/app-tools/call handler and a real route registry; test_the_core_relays_a_pod_up_reply_byte_for_byte runs the real redactor over a minted link token and gets the old tool's reply byte for byte.
    • Backward compatible (old config / old data / old callers still work, how checked): an allowlist row only; no config, data or caller reads it except the posture test and panel.
    • Existing tests (which suites passed on this head): test_security_posture.py, test_security_posture_facade.py, test_app_agent_tools.py, test_dev_fleet_pod_agent_api.py, test_mcp_apps_tool_gate.py, test_flake_pattern_ratchet.py locally (9,083 tests across every test file that imports a touched module, after the rebase onto main).
  • How to undo: delete the row (and the module, which is the only caller).

@bolichen97
bolichen97 force-pushed the fix/adoption-devfleet-tools branch from 14e61d4 to 9a8cd30 Compare November 8, 2026 14:45
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 8, 2026
@bolichen97
bolichen97 force-pushed the fix/adoption-devfleet-tools branch from 26a0618 to 41f5f9b Compare November 8, 2026 19:04
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased again onto main at d68f4b8db4, 26a0618ab4 -> 41f5f9b0cf, because #33141 (adopted former built-ins keep their agent tools) made the PR conflict. This range-diff is conflict-only too: the one conflict was the §30.1 Writers: line in app-kit-platform.md, resolved by keeping both sides' writers (apps/route_registry.py, the dev-fleet manifest and agent_tools.py, and apps/builtin_adoption_gate.py). Nothing changed in the code.

Local checks on the rebased tree:

  • Gates: flake8, mypy, the black / comment-history / brand / file-line-cap gates, docs-lint.sh.
  • Tests: 92 related files, now including test_app_agent_tools_adopted.py: 3685 passed.

App repo: marker unchanged. Auto-merge (squash) is still armed.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 41f5f9b
  • What rule changed: one row added to security_posture.NON_EGRESS_REDACTION_MODULES: apps/builtins/dev_fleet/agent_tools.py, the module this PR adds. No other rule, sink or allowlist entry changes. The rebase onto main did not touch this file's hunk.
  • Before -> after (what was allowed/blocked, now): before, test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed because the new module calls a redactor and was unclassified. After, it is classified with the other Dev Fleet modules (gateway_routes.py, gateway_service.py, ...) as an app-side, non-egress redactor. The egress for its text stays mcp_tools/app_tools.py, already a classified module, which redacts every answer again before it reaches the model.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the redaction posture panel would not count this module as an egress sink. The row itself unredacts nothing: the model-facing text is still redacted at app_tools._text_answer, and only the pod token the answer names is kept verbatim (as the old core pod_up kept it).
  • Evidence checked (which sandbox result proves it): not a sandbox change. test/test_security_posture.py and test/test_security_posture_facade.py pass locally on this diff. Static Ratchet Gate was green in CI on 9a8cd30, which carried the same row. This head is that commit rebased onto main (twice), conflicts resolved in other files only.
  • No regression:
    • Tools still work (which tools/commands were run, result): test/test_dev_fleet_pod_agent_api.py drives the five pod tools through the real /api/app-tools/call handler and a real route registry. test_the_core_relays_a_pod_up_reply_byte_for_byte runs the real redactor over a minted link token and gets the old tool's reply byte for byte. Issue Radar's tool tests (test_issue_radar_crew_mcp_tools.py, test_issue_radar_investigation_tool.py) pass through the same merged app_tools handler.
    • Backward compatible (old config / old data / old callers still work, how checked): an allowlist row only. Nothing reads it except the posture test and panel.
    • Existing tests (which suites passed on this head): locally, 92 related files (3,685 tests, posture, dev-fleet, app_tools, issue-radar, apps gate, adopted-tool and facade tests included) on 7db1ca6806, the same diff one disjoint main merge earlier; mypy and flake8 clean.
  • How to undo: delete the row (and the module, which is the only caller).

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 8, 2026
@bolichen97
bolichen97 force-pushed the fix/adoption-devfleet-tools branch from 41f5f9b to 0febda4 Compare November 8, 2026 19:30
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 0a53e02b65, 41f5f9b0cf -> 0febda4b84. #33272 and #33254 changed the core pod_down / pod_up rows in mcp_tools/apps.py, and this PR removes those rows. The conflict was resolved by keeping the removal and carrying both changes over to the wheel copy's declaration, so the tools still match main's core tools exactly:

main change where it lives now
#33272: pod_down's client wait 60s -> 120s, set above Dev Fleet's 90s pod down bound app.json pod_down.timeoutSeconds: 120. test_pod_stop_timeout.py::test_each_wait_above_the_stop_is_longer now reads the wait from the shipped declaration, since mcp_apps._POD_DOWN_TIMEOUT_S is gone. The waits pin in test_dev_fleet_pod_agent_api.py and the "120s to stop" lines in dev-fleet.md / app-kit-platform.md §30.1 are updated to match.
#33254: pod_up's description sends a pod worktree to <repo>/.worktrees/<name>, never $KIROCREW_SCRATCH the same sentence in app.json's pod_up description. All five descriptions and input schemas were compared with main's last core descriptors: they are identical, apart from the maxLength bounds this PR adds.

No other change. Local checks:

  • Gates: flake8, mypy, the black / comment-history / brand gates, docs-lint.sh.
  • Tests: 97 related files, 3862 passed. The files include test_pod_stop_timeout.py, test_pod_teardown.py and test_dev_fleet_scratch_worktree.py.
  • Determinism: the changed timeout test passed 20 runs at -n0, 10 at -n 4 and a shuffled run (seed 33159).

Maintainer note: the marker KiroCrewCaptain/kirocrew-app-dev-fleet@3c0bfa6c5611ab95d348e6b10cb89f57a607e571 is unchanged, as asked, but that app-repo commit still declares pod_down at 60s and the older pod_up description. Before a dev-fleet pin lands, the app repo needs both changes. Otherwise #33141's equal-to-wheel-copy check will leave those two tools off an adopted host's list.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 0febda4
  • What rule changed: one row added to security_posture.NON_EGRESS_REDACTION_MODULES: apps/builtins/dev_fleet/agent_tools.py, the module this PR adds. No other rule, sink or allowlist entry changes. The rebase onto main did not touch this file's hunk.
  • Before -> after (what was allowed/blocked, now): before, test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed because the new module calls a redactor and was unclassified. After, it is classified with the other Dev Fleet modules (gateway_routes.py, gateway_service.py, ...) as an app-side, non-egress redactor. The egress for its text stays mcp_tools/app_tools.py, already a classified module, which redacts every answer again before it reaches the model.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the redaction posture panel would not count this module as an egress sink. The row itself unredacts nothing: the model-facing text is still redacted at app_tools._text_answer, and only the pod token the answer names is kept verbatim (as the old core pod_up kept it).
  • Evidence checked (which sandbox result proves it): not a sandbox change. test/test_security_posture.py and test/test_security_posture_facade.py pass locally on this diff. Static Ratchet Gate was green in CI on 9a8cd30, which carried the same row. This head is that commit rebased onto main (three times), conflicts resolved in other files only.
  • No regression:
    • Tools still work (which tools/commands were run, result): test/test_dev_fleet_pod_agent_api.py drives the five pod tools through the real /api/app-tools/call handler and a real route registry. test_the_core_relays_a_pod_up_reply_byte_for_byte runs the real redactor over a minted link token and gets the old tool's reply byte for byte. Issue Radar's tool tests (test_issue_radar_crew_mcp_tools.py, test_issue_radar_investigation_tool.py) pass through the same merged app_tools handler.
    • Backward compatible (old config / old data / old callers still work, how checked): an allowlist row only. Nothing reads it except the posture test and panel.
    • Existing tests (which suites passed on this head): locally, 97 related files (3,862 tests, posture, dev-fleet, pod stop-timeout, app_tools, issue-radar, apps gate, adopted-tool and facade tests included) on de912b3503, the same diff one disjoint main merge earlier; mypy and flake8 clean.
  • How to undo: delete the row (and the module, which is the only caller).

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 8, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

CI red on 0febda4b84 is a main red, not this PR's. Backend Tests (3.12, 6), Backend Tests (Windows) (6) and Coverage Gate all fail on test/test_dashboard_server_composition_contract.py::test_the_lazy_imports_stay_inside_the_functions_that_need_them (assert 140 == 139).

Per the red-main rule, this PR gets no push and no override for that red. It will be rebased once #33377 merges. Every other lane on this head is green, including all five AI review lanes.

@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 8, 2026
Ruling 2 of #26967 keeps app code out of the kirocrew-core MCP server,
and E10 refused any dev-fleet adoption pin because mcp_tools/apps.py
still declared, ran and mapped pod_up, pod_restart, pod_down,
pod_status and pod_ls in core.

The wheel copy now declares the five tools in its app.json agentTools
block and serves them from one gateway route its backend.hooks.routes
registers, running the same agent_pod_api verbs and rendering the same
text. The seam gains what that needs without naming the app: a block
namespace so tools keep the names agents, skills and policies know, a
per-tool timeoutSeconds (a pod boot is bounded at 180s), result "text"
so the pod token the tool exists to deliver is relayed as the app
wrote it, and dispatch to an app's own gateway route before its
sandboxed backend. APP_SDK_LEVEL becomes 4. The core rows go, so
core_named_apps() no longer names dev-fleet; the name-keyed channel
deny, remote local-only fence and title rows stay and still apply.

Part of #26967
@bolichen97
bolichen97 force-pushed the fix/adoption-devfleet-tools branch from 0febda4 to 73665f1 Compare November 8, 2026 20:46
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 73665f1
  • What rule changed: one row added to security_posture.NON_EGRESS_REDACTION_MODULES: apps/builtins/dev_fleet/agent_tools.py, the module this PR adds. No other rule, sink or allowlist entry changes. The rebase onto main did not touch this file's hunk.
  • Before -> after (what was allowed/blocked, now): before, test_every_redactor_call_site_is_a_registered_sink_or_allowlisted failed because the new module calls a redactor and was unclassified. After, it is classified with the other Dev Fleet modules (gateway_routes.py, gateway_service.py, ...) as an app-side, non-egress redactor. The egress for its text stays mcp_tools/app_tools.py, already a classified module, which redacts every answer again before it reaches the model.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the redaction posture panel would not count this module as an egress sink. The row itself unredacts nothing: the model-facing text is still redacted at app_tools._text_answer, and only the pod token the answer names is kept verbatim (as the old core pod_up kept it).
  • Evidence checked (which sandbox result proves it): not a sandbox change. test/test_security_posture.py and test/test_security_posture_facade.py pass locally on this diff. Static Ratchet Gate was green in CI on 9a8cd30, which carried the same row. This head is that commit rebased onto main (four times), conflicts resolved in other files only.
  • No regression:
    • Tools still work (which tools/commands were run, result): test/test_dev_fleet_pod_agent_api.py drives the five pod tools through the real /api/app-tools/call handler and a real route registry. test_the_core_relays_a_pod_up_reply_byte_for_byte runs the real redactor over a minted link token and gets the old tool's reply byte for byte. Issue Radar's tool tests (test_issue_radar_crew_mcp_tools.py, test_issue_radar_investigation_tool.py) pass through the same merged app_tools handler.
    • Backward compatible (old config / old data / old callers still work, how checked): an allowlist row only. Nothing reads it except the posture test and panel.
    • Existing tests (which suites passed on this head): locally, 97 related files plus the server composition contract (3,907 tests: posture, dev-fleet, pod stop-timeout, app_tools, issue-radar, apps gate, adopted-tool and facade tests included) on this head; mypy and flake8 clean.
  • How to undo: delete the row (and the module, which is the only caller).

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 0bdd18df60 (#33377, the lazy-import re-pin), 0febda4b84 -> 73665f1abb. This is a conflict-free, main-only range-diff: the PR diff did not change. Locally, 3907 related tests passed, test_dashboard_server_composition_contract.py included. CI is re-running. Auto-merge (squash) is still armed.

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

Copy link
Copy Markdown
Contributor Author

green_age.py reports STALE for 73665f1abb: main gained three commits since its CI ran (0bdd18df -> 87247b9c). #33064, #15107 and #33383 overlap this PR only by import or by directory (acp/client_native_children.py, test_codex_native_subagent_cards.py, the acp-client / providers specs). No file is touched on both sides.

Pushing a re-sync would throw away this green and rerun the whole matrix, so I proved the rebased tree locally and did not push. Results on 87247b9c + this commit (cherry-picked with no conflict):

  • mypy is clean.
  • 98 related test files, including test_codex_native_subagent_cards.py and the server composition contract: 3956 passed, 0 failed.

The head stays 73665f1abb. PR Readiness is passed and auto-merge (squash) is armed. Only a reviewer approval is still needed: the conflict-resolution pushes dismissed the earlier one.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This review checked head 73665f1. The five pod tool descriptors and input schemas in app.json match the removed core rows exactly; the only addition is the maxLength bounds, which equal the old validator limits. The waits (210/210/120/45/45) match main's timeouts. The name-keyed fences (channel dispatch block, local-only tools) still apply before dispatch. No reader of the removed POD_* names is left. Done well: test_the_core_relays_a_pod_up_reply_byte_for_byte runs a real minted link token through the real core redactor, and the end-to-end test loads the shipped hook into a real RouteRegistry with the proxy set to fail. Together they pin both the reply parity and the new dispatch order.

Security: the new path is no weaker than main. /api/app-tools/call checks internal auth, then the declaration, then exact argument re-validation, then that the app is enabled, then strictSession. The app route is wrapped in the same local-origin plus internal-auth gate, and it checks the host-exec grant again before any pod verb runs. Unknown tools get 404 and a missing grant gets 403. The text result path is stricter than main: every piece is redacted except the one named credential, which is bounded to 16 to 4096 printable characters in 2 to 8 pieces.

  • Optional: #32983 also moves APP_SDK_LEVEL from 3 to 4, for a different seam. Whichever PR lands second should move to level 5 in app_sdk_level.py, sdkLevel.ts and the spec's level paragraph.
  • Optional: with no Dev Fleet install record, a pod tool call now returns "no installed app declares the tool" where it used to return the route's steps for turning the app on. Consider naming this in Backwards compatibility and pinning it with a pod_ls test.
  • Optional: no test fails if the refusal scrub or the code filter in agent_tools._client_view is removed. One parametrized case with a credential-shaped message and a malformed code would pin both.

@bolichen97
bolichen97 merged commit 88ed811 into main Nov 8, 2026
100 checks passed
@bolichen97
bolichen97 deleted the fix/adoption-devfleet-tools branch November 8, 2026 21:58
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 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.

2 participants