Skip to content

refactor: make core independent of the dev-fleet and pptx-maker apps - #27435

Merged
bolichen97 merged 1 commit into
mainfrom
refactor/decouple-core-from-dev-fleet
Nov 3, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
refactor/decouple-core-from-dev-fleet

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Kiro Crew's core stops depending on the Dev Fleet and PPTX Maker apps, so either app can move out of this repository without a core edit.

The core imported Dev Fleet and PPTX Maker code and spelled their names in its own tables: the BUILD rlimit set, the deferred bound-port spawn, the forwarded KIROCREW_DEVFLEET_* variables, the app-owned dev_fleet config section, five strict-internal pod routes, two relay-refused token mints, PPTX Maker's agent-template placeholders, and the file panel's soffice discovery. The Dev Fleet UI sat in the core SPA's pages/ and test/ folders. None of that could leave with the app.

Why it matters

Under #26967 every built-in moves to its own repository. While the core names an app, removing the app breaks the core: an import fails, or a table keeps a route nobody serves. Slide previews in the file panel also only worked through PPTX Maker's code, so they would stop working the day that app leaves.

Not a goal

  • Moving Dev Fleet or PPTX Maker out of the repository. This PR only removes the core's dependency on them.
  • Giving installed (registry) apps a way to ask for these host grants. The seam reads shipped built-ins only.
  • Removing the couplings listed under What changed that still name an app. Each one leaves with its app.
  • Changing any behaviour. Every grant applies exactly as before.

What changed (motivation → approach → change)

The core now asks each built-in what it needs, instead of naming it.

Coupling Before After
BUILD rlimit, bound port and deferred spawn, forwarded env, dev_fleet config section, strict-internal pod routes, relay-refused token mints literals in apps/backend.py, backend_runtime/startup.py, config/validation.py, server_internal_paths.py, kiro_relay/limits.py Dev Fleet's own host_grants.py, read by the new apps/builtin_host_grants.py
PPTX Maker agent placeholders computed in bridges_agents._placeholder_values the app's own agent_placeholders.py, called by the same function
soffice lookup and install hint PPTX Maker's engine / preview_tools, imported by the file panel the core's soffice_discovery.py, the only copy; the file panel and PPTX Maker both import it
Dev Fleet UI website/src/pages/, website/src/test/ website/src/apps/dev-fleet/, reached only from builtinRegistry.ts

The seam is plain data with guard rails. It reads only packages in BUILTIN_NAMES. A row may grant only its own app. Every path it claims must sit under that app's own /api/apps/<app>/ or /apps/<app>/ namespace. A forwarded variable must be a KIROCREW_* name. A bad row raises at load, so a grant can never quietly stop applying. With no built-in shipping a grant, every answer is empty. On boot it costs one file check per built-in plus one data-module import, once per process. That cost does not grow with user data.

test_core_dev_fleet_pptx_maker_decoupling.py fails if any core module or script imports either app, in any import spelling, using the shared scan in test/core_app_independence.py. devFleetBoundary.test.ts fails if anything outside apps/dev-fleet/ imports the UI, except the registry. The two i18n gate scripts compare a moved file with its old path, so a pure move adds no i18n debt, and website/src/i18n/untranslated-baseline.json carries the page's row under its new path.

Couplings that remain, each leaving with its app:

  • mcp_tools/apps.py maps the core pod_* MCP tools to dev-fleet and calls /api/apps/dev-fleet/pod.
  • security_posture.py lists Dev Fleet and PPTX Maker files in its redaction and posture rows.
  • Comments in keystone files (sandbox_leaves.py, sandbox_tiers.py, env.py, frontend.py, pod/) name the apps. They are prose only.
  • builtin_skills/pptx-maker/SKILL.md still ships in the core skill tree.
  • The host grants apply only while the app is a built-in. Once Dev Fleet ships from the registry, its pod routes and token mints need an App Kit equivalent.

Docs: app-kit-platform.md gains §34 on the seam (after main's §33, built-in adoption). dev-fleet.md gains a Host grants table. config.md, dashboard-token-auth.md, learn-cron-dashboard.md, pptx-maker.md and docs/feature-map/README.md name the new owners. kirocrew-worktree-dev/SKILL.md and pipeline-conductor/SKILL.md note that the pod-e2e harness ships with Dev Fleet.

Backwards compatibility

Compatible: the strict-internal set, the relay credential set and the app-owned config keys are identical to main's, every grant applies to the same app, and the moved UI is served from the same /dev-fleet route.

Reader: src/kiro_crew/dashboard/server_runtime/app_platform.py:_start_bound_port_app_backends -- release -- calls start_deferred_app_backends, which spawns bound_port_apps() in place of DEV_FLEET_APP_NAME; test_bound_port_backends_start_only_after_the_export_and_the_rest_before_setup
Reader: src/kiro_crew/apps/backend.py:_start_app_backend_body -- app -- reads build_rlimit_apps() / bound_port_apps() / the env grants in place of _BUILD_CAPABLE_APPS and the KIROCREW_DEVFLEET_* literals; test_app_backend_spawn_env.py
Reader: src/kiro_crew/dashboard/server_internal_paths.py:_STRICT_INTERNAL_API_PATHS -- chat -- the five pod paths arrive through the grant; test_the_core_tables_carry_the_grants
Reader: src/kiro_crew/dashboard/kiro_relay/limits.py:_LOCAL_CREDENTIAL_EXACT -- crew page -- the two pod-token paths arrive through the grant; test_the_core_tables_carry_the_grants
Reader: src/kiro_crew/dashboard/handlers/office_slides.py:soffice_path -- chat -- soffice_discovery.find_soffice; test_file_office_slides.py, test_soffice_discovery.py
Reader: src/kiro_crew/apps/builtins/pptx_maker/backend/routes.py:_deps_status -- app -- reads soffice_discovery.soffice_install_hint in place of preview_tools.soffice_hint; test_pptx_maker_soffice_hint.py
Reader: src/kiro_crew/apps/builtins/pptx_maker/backend/engine.py:optional_dep_path -- app -- reads soffice_discovery.windows_install_path / which_within in place of the app's own copies; test_preview_tool_discovery.py
Reader: website/src/apps/builtinRegistry.ts:'/dev-fleet' -- app -- imports ./dev-fleet/DevFleetPage; devFleetBoundary.test.ts
Reader: website/capture/devfleet-discovery.tsx:DevFleetPage -- release -- it and devfleet-provision-reattach.tsx / devfleet-prune-untracked.tsx import the moved page; tsc -p tsconfig.app.json

Tests

  • test/test_builtin_host_grants.py: the seam is empty with no grants; Dev Fleet's grants reach every core table; reading grants does not import the route modules; every malformed or overreaching row raises; deferred bound-port backends are re-checked and spawned in order.
  • test/test_core_dev_fleet_pptx_maker_decoupling.py: no core module or script imports either app, and each import spelling is proven to be caught by the shared scan.
  • test/test_core_pptx_maker_decoupling.py (main's PPTX Maker gate): its PENDING_IMPORTS and PENDING_NAME_REFERENCES rows, which tolerated the two imports and the one "pptx-maker" literal this PR removes, are deleted, so that gate is now strict.
  • test/test_soffice_discovery.py: PATH first, then the Windows roots; a hit outside the asked root is refused; the per-OS install hint for every distribution. These cases come from PPTX Maker's tests, which now pin only how the app ranks and forwards the core's answer.
  • website/src/apps/dev-fleet/devFleetBoundary.test.ts and website/src/test/i18nGateRenameSources.test.ts: the UI boundary, checked with path.relative so it holds on either path separator, and the rename-aware i18n base.
  • The Dev Fleet client's proxy-challenge case moves from edgeChallengeAtDirectErrorSites.test.ts into apps/dev-fleet/devFleetApi.test.ts.
  • Existing spawn-env, composition-contract, startup, office-slides and sandbox tests now follow the new owners.

Local: the related backend tests (PPTX Maker, soffice, office slides, host grants, spawn env, composition, startup, sandbox; about 1,370) and the Dev Fleet and i18n vitest files pass; tsc -p tsconfig.app.json, mypy, flake8, isort, the black, comment-history, brand, line-cap, harness-parity and docs-lint gates, and the flake-pattern ratchet are green.

Determinism: the three new backend test files pass 20 times at -n0, 10 times at -n 4 beside the spawn-env and office-slides tests, and once in a shuffled order (seed 27435); the two new vitest files pass 20 times and in a shuffled order (--sequence.shuffle, seed 27435).

Manual verification

N/A — a refactor with no behaviour change. The equality of the strict-internal and relay sets with main's was checked by loading both modules side by side.

Screenshots / video

Why no screenshot: the Dev Fleet UI files move directories with only import paths changed, so nothing renders differently.

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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 1, 2026 22:09
@bolichen97
bolichen97 enabled auto-merge (squash) November 1, 2026 22:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 1, 2026
@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-dev-fleet branch from 2fb180e to 8da6429 Compare November 2, 2026 00:44
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing to check. This is a pure refactor. The Dev Fleet UI files moved without changes apart from import paths, and the user-facing soffice install hint text is the same as before, so no user-visible control was added or changed.

[UX-REVIEWED] 42a910c

Description read

[DESCRIPTION-READ] e765e91ae53049eae2608a8c44e85405c7e838bb92a6d5467c6a3f4538a651bb

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Behaviour stays the same, and the readers outside the patch (_placeholder_values, preview_tools, the moved page) still resolve. Nothing blocks.

Notes

  • When Dev Fleet moves to the registry, its relay_credential_paths grant disappears with it, and nothing goes red. The strict-internal pod routes fail closed (the tools return 403). The refusal for /apps/dev-fleet/api/pod/token fails open instead: relayed callers could reach the token mint through the app proxy. The App Kit equivalent the description defers should exist before that move, so add a pin now that fails when a granted path loses its grant.

[DESIGN-REVIEWED] 42a910c

Description read

[DESCRIPTION-READ] 61bbd51c81923c7beb8945c58e699f4f9cebe7c3a0bf21d8c0f046d513f43875

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 42a910c5858c0248eeb35e465724b048cd5379a0 — 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. The seam is required by the AGENTS.md "core never hard-codes an app id" rule, but it is a general form with one consumer, and that consumer is due to leave.

Notes

  • Item 1 — one consumer, generalized: grep builtins/*/host_grants.py finds 1 file (dev_fleet). The 7-field HostGrants registry and the deferred-app tuple serve that one app. It "reads shipped built-ins only", and under Move every built-in app out to KiroCrewApps and forbid built-in apps #26967 the built-in set is being emptied. So the day Dev Fleet leaves, the seam has zero consumers, and per the description its routes "need an App Kit equivalent" anyway. Subtraction: shrink HostGrants to the fields Dev Fleet sets, and keep _DEFERRED_BOUND_PORT_APPS the single-app form it was.
  • Item 2 — one consumer, generalized: grep builtins/*/agent_placeholders.py finds 1 file (pptx_maker), yet _placeholder_values discovers it by naming convention across all of BUILTIN_NAMES. Subtraction: none smaller that also satisfies the no-app-id rule. It goes when PPTX Maker leaves.

What this change ships

Inventory (7 items) — 5 justified

Intent: let the Dev Fleet and PPTX Maker apps leave the repo without breaking the core. This is an ADDITION (a refactor seam).

  1. The core reads Dev Fleet's rlimit, bound port, env, config key, strict paths and relay paths from the app's own data file — one consumer, generalized
  2. PPTX Maker's agent placeholders are computed by the app's own module, which the core finds by naming convention — one consumer, generalized
  3. Slide previews in the file panel find soffice through a core module, not through PPTX Maker — justified
  4. The Dev Fleet UI files move to website/src/apps/dev-fleet/, still served at the same /dev-fleet route — justified
  5. The i18n and unit-literal gates measure a renamed file against its old path — justified
  6. The PPTX Maker decoupling gate's tolerated rows are deleted, so that gate is now strict — justified
  7. New import-boundary tests for both apps, on the backend and the frontend — justified

[FIRST-PRINCIPLES-REVIEWED] 42a910c

Description read

[DESCRIPTION-READ] 5b1dbfd2aa731145c1c6848ce468450fbbe43df566aac5b1f82ebd02734af81d

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

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 42a910c5858c0248eeb35e465724b048cd5379a0 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 42a910c

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

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 42a910c5858c0248eeb35e465724b048cd5379a0 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 42a910c

Verdict parsed from the review's SHA-scoped output markers for commit 42a910c5858c0248eeb35e465724b048cd5379a0.

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 2, 2026
@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-dev-fleet branch from 8da6429 to 7c69171 Compare November 2, 2026 01:44
@bolichen97

bolichen97 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: one soffice lookup + install-hint table, in core, imported by the app
resolution: removed the app's copy

  • Second spelling of soffice discovery span=776f970c5910

fixed in 7c69171: src/kiro_crew/soffice_discovery.py is now the only copy of the Windows install roots, which_within, and the per-OS install-hint table. PPTX Maker's engine.py and preview_tools.py lost their copies and import the core helpers (windows_install_path, which_within, soffice_install_hint); routes._deps_status forwards the core hint.
The direction is app -> core, which the campaign allows; core still imports no app (test_core_app_independence.py). The hint text was identical in both copies, so no app-specific parameter was needed.
Tests follow the one copy: the full hint table and the which_within guard tests live in test/test_soffice_discovery.py; PPTX Maker's tests keep only how the app ranks and forwards the core's answer. pptx-maker.md and app-kit-platform.md name the single owner.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 2, 2026
@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-dev-fleet branch from 7c69171 to 773b277 Compare November 2, 2026 02:58
@bolichen97

bolichen97 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: devFleetBoundary.test.ts directory containment check

  • Boundary scan fails on native Windows span=c43e13a60eef

fixed in 773b277: both containment checks (the import target and the walked file) go through one insideTheApp(p), which uses path.relative(APP_DIR, p) and accepts '' or a result that neither starts with .. nor is absolute. relative() resolves both sides itself, so the separator __dirname carries and the one resolve()/join() return can no longer disagree; no string prefix with '/' is left.
Class swept: the other added frontend path code (renameSources in the i18n gate scripts) splits git's name-status output, whose paths are always forward-slash, so it is outside the class.
Verified: the test passes, and a temporary stray @/apps/dev-fleet/devFleetApi import from src/ turns it red with that file listed, so the narrowed check still catches a real crossing. tsc and eslint clean.
Repair model: fallback: Opus-family general model (GPT models are not available on this host); served model unverified.

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: builtin_host_grants.py loader with self-only, namespace and KIROCREW_ env validators

  • Host-grants seam is a general loader for one producer (PASS note, Item 1)

Rebutted: the seam's width is set by the seven core tables that had to stop naming Dev Fleet (rlimit, bound port, env names, env prefixes, config key, strict-internal paths, relay credential paths), not by the producer count; a "plain tuple" per table would still need those seven fields, so the shrink removes no code a reader must hold.
The validators are guards, not polish: two of the fields feed the strict-internal tier (loopback + X-Internal-Secret) and the relay credential refusal, and one forwards env into every app backend past minimal_env(). The self-only and /api/apps/<app>/ namespace checks keep one built-in from widening another's or a core route; the KIROCREW_ check keeps the seam from forwarding an arbitrary host credential. Deleting them removes a fence on a security table, which this refactor's "no behaviour change" goal does not license.
The lapse is real and is the frozen Not-a-goal: once Dev Fleet ships from the registry its pod routes and token mints need an App Kit equivalent; the body says so under "Couplings that remain". Until then the seam is what lets the app leave without a core edit.

@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-dev-fleet branch from 773b277 to 1f7c162 Compare November 2, 2026 03:48
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: config_top_keys host grant feeding validation._APP_OWNED_TOP_KEYS

  • config_top_keys duplicates manifest config_keys span=66250642ad4b

Rebutted: the two are not the same job at gateway boot. The gateway skips the CLI prime, so a manifest config_keys key is unknown until register_builtin_apps runs refresh_app_config_keys on the executor (app-kit-platform.md: "A config load that runs before that executor refresh can still log one unrecognized-key warning"; pinned by test_gateway_load_before_refresh_warns_once_then_loads_cleanly).
Main's literal {"dev_fleet"} is that spec's "core compatibility fallback" and keeps every gateway boot silent. Moving dev_fleet to app.json would bring back one unrecognized top-level keys: dev_fleet warning per gateway launch for every Dev Fleet operator, which breaks the campaign's "no impact on existing users" rule (#26967).
The grant is read at import with no I/O, so it keeps main's behaviour exactly while core names no app. It goes away with the app: the PR that moves Dev Fleet to the registry declares config_keys in its manifest and owns the boot-window gap. This PR's goal does not need that gap closed.
Item 1 / Item 3 notes: every remaining HostGrants field has a Dev Fleet value; agent_placeholders is what lets PPTX Maker leave. Kept as-is.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 2, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 2, 2026
@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-dev-fleet branch from 86f7f01 to 8c98c31 Compare November 2, 2026 22:03
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto main to clear a merge conflict: head 86f7f01 -> 8c98c31, base 1dd2be3 -> 169fa89.

The only conflict was the import block of website/src/apps/dev-fleet/DevFleetPage.tsx. Main added the restart-exhausted banner (gatewayApi and restartExhaustedNotice) to the old pages/ copy; both imports are kept, with paths updated for the file's new location. Main's banner tests moved with the rest of the Dev Fleet tests and pass.

Local checks on the new head: scoped backend tests (901 passed), isort, flake8, mypy, tsc, Dev Fleet and i18n vitest (1265 passed), semgrep on the diff (0 findings). Local GPT and Opus reviews: no findings.

AI-assisted, posted on behalf of bolichen97

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 2, 2026
buluoray
buluoray previously approved these changes Nov 2, 2026

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

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Verdict: APPROVE on 8c98c31.

What it does. The core stops naming Dev Fleet and PPTX Maker. Dev Fleet's host needs (BUILD rlimit, deferred bound-port spawn, forwarded KIROCREW_DEVFLEET_* variables, the dev_fleet config section, the five strict-internal pod routes, the two relay-refused pod credential mints) move into the app's own host_grants.py, read through the new apps/builtin_host_grants.py. PPTX Maker's agent placeholders move into its own agent_placeholders.py. soffice discovery moves into a core soffice_discovery.py that both the file panel and PPTX Maker import. The Dev Fleet UI moves from pages/ and test/ into website/src/apps/dev-fleet/.

Behaviour preservation, checked against source and by import.

  • I imported _STRICT_INTERNAL_API_PATHS, kiro_relay.limits._LOCAL_CREDENTIAL_EXACT and validation._APP_OWNED_TOP_KEYS on the base (169fa89) and on this head. The sets are identical: 67, 11 and 1 entries respectively.
  • apps/backend.py: KIROCREW_DEVFLEET_REPO is still forwarded only when non-empty. KIROCREW_DEVFLEET_BIN_* is still forwarded by prefix to every backend, as on main. KIROCREW_BOUND_PORT still goes only to Dev Fleet, and the BUILD rlimit still applies only to Dev Fleet.
  • backend_runtime/startup.py: the old single-app deferral becomes a loop over bound_port_apps(). For each app it keeps the same enabled-state re-check (is not True) and the same fail-closed activation re-vet. With one grant, the result is the same as before.
  • pod_* MCP tools: mcp_tools/apps.py and dev_fleet/agent_pod_api.py are unchanged. The refusal while the app is off still comes from _require_enabled (403 app_not_enabled), and the tools are still hidden by the TOOL_APPS rows. The package __init__ now imports its route modules inside register_routes. The gateway's hasattr(package, "register_routes") convention still finds it. No caller reaches dev_fleet.gateway_routes or dev_fleet.agent_pod_api as a package attribute, so the lazy import breaks nothing.
  • UI move: I compared each moved file with its old path, ignoring import lines. Every file is unchanged apart from one relative resolve(DIR, '..', '..'), one dynamic registry import path and one comment word. devFleetApi.test.ts gains the access-proxy case that edgeChallengeAtDirectErrorSites.test.ts drops. The /dev-fleet route still lazy-loads the same component.
  • Removed symbols (DEV_FLEET_APP_NAME, _BUILD_CAPABLE_APPS, _DEV_FLEET_DEFERRED, engine._which_within, engine._soffice_system_install_path, preview_tools.soffice_hint, _linux_soffice_hint, the old pages/DevFleet* and test/devFleetApi paths): every reader on current origin/main is a file this PR edits. A grep of the merged tree finds none left. Main has not touched any of the affected core, Dev Fleet or PPTX Maker files since this PR's base. git merge-tree --write-tree origin/main exits 0.

Tests and mutations.

  • I ran the PR's Python test files plus test_dev_fleet_pod_agent_api.py locally: 825 passed, 2 skipped, 5 failed. All 5 failures are in test_file_office_slides.py, with ModuleNotFoundError: pypdfium2 on this host. The same 5 fail the same way on the base commit, so they come from the environment and not from this diff.
  • Mutation 1: dropping | _builtin_strict_internal_paths() from server_internal_paths.py reddens test_builtin_host_grants.py::test_the_core_tables_carry_the_grants and test_dev_fleet_pod_agent_api.py::test_every_route_is_named_in_the_strict_internal_table.
  • Mutation 2: making _owns_path return True reddens three test_a_malformed_or_overreaching_row_raises[... own namespace] cases.
  • The tree was restored and clean after each mutation.

Source-only, not exercised.

  • The file panel's soffice_path() no longer falls through to PPTX Maker's managed preview-tools directory. On main that fallback could never find soffice, because the managed directory only ever receives a pdftoppm launcher (preview_tools._launcher_paths). PATH and the fixed Windows roots are probed as before, so I see no user-visible change. The Windows lookup path was read, not run.
  • _placeholder_values now also catches an exception raised by placeholder_values() itself, not only the import, and refuses a malformed result. Both fail closed to {} (no agent registered), the same outcome main had for an unknown app.
  • I did not run the frontend tests locally (devFleetBoundary.test.ts, the i18n rename gate). CI covers them.

CI on this head. 59 check names have passed, 11 are skipped and 20 are still queued, including Backend Tests, Frontend Tests, the E2E lanes and Bundle Size Gate. The one red is Publish readiness signal, which failed on API rate limit exceeded for installation. That is infrastructure, not this diff, and PR Readiness is pending a re-check. Security Scope Review passed. The UX, Design, First Principles, GPT 6.1 and Opus 5.5 lanes all report PASS or no blocking findings on this head. No inline threads are open. The only earlier review is a dismissed approval on an older head.

Size. +1487/-672, of which about 600 lines are new tests and the soffice module is mostly moved code. The seam itself is 171 lines with validation that fails at load. For a change that lets two apps leave without a core edit, I think the size is justified.

Follow-ups, not blocking.

  • #28355 (Design Tweak) adds a second, parallel loader (builtin_agent_tools.py) with the same shape, and it also edits server_internal_paths.py, app-kit-platform.md and test_dashboard_server_composition_contract.py. Whichever lands second will need a rebase at the import block and in the docs. One shared on-disk discovery helper for both seams would be worth a later pass.
  • The couplings listed in the PR body as remaining (the pod_* mapping in mcp_tools/apps.py, the security_posture.py rows, the shipped pptx-maker skill) still name the apps. They need an App Kit equivalent before Dev Fleet ships from the registry.
  • §33 says the strict paths are "folded into server._STRICT_INTERNAL_API_PATHS". The fold happens in server_internal_paths.py, which server re-exports. It is accurate as written, but naming the owning module would help readers.

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

buluoray commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]: @bolichen97 #28355 merged first, so this PR now conflicts with main in the files both touch (server_internal_paths.py, app-kit-platform.md, the composition contract test). Please rebase and keep both loaders and both _DATA_MODULE_SOURCES rows. The rebase will clear my approval; I will re-review the new head.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 8c98c31.

Three things hold this PR:

  1. Merge conflict. GitHub reports the head as CONFLICTING. refactor: make core independent of the design-tweak app #28355 landed first and overlaps in server_internal_paths.py, app-kit-platform.md and the composition contract test. A rebase is needed, and the new head needs a fresh review.
  2. CI is not finished. Several jobs on this head are still queued (Frontend Tests, E2E Gateway Boot, E2E stub ACP), and PR Readiness is pending.
  3. Reserved for a human reviewer. The change moves security registries behind a new loader. The strict-internal tier (server_internal_paths.py#L244), the relay's credential-mint refusals (limits.py#L111) and the env vars forwarded to every app backend (backend.py#L745) are now built from built-in apps' host_grants modules. The resulting sets match main today, but the PR adds a new way to change who is admitted to those tiers. That decision belongs to a maintainer, even though the code looks sound.

I found no concrete defect in the security-relevant files I read. _parse limits each row to its own app's namespace and to KIROCREW_* names, and it raises on a malformed row (builtin_host_grants.py#L90). I did not review the UI moves or the pptx/soffice extraction line by line.

To clear: rebase onto main, let CI finish green on the new head, and get a human maintainer's review of the host-grant seam.

— crew-pr-reviewer (r142)

@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-dev-fleet branch from 8c98c31 to 8d8d522 Compare November 3, 2026 00:28
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto main again because GitHub reported a merge conflict: head 8c98c31 -> 8d8d522, base 169fa89 -> 84ea89d.

The conflict came from the design-tweak decoupling that landed on main. Both changes add a reader to src/kiro_crew/dashboard/server_internal_paths.py: main's agent-tool reader feeds the mixed path set, and this PR's host-grant reader feeds the strict set. Both imports are kept, and _DATA_MODULE_SOURCES in test/test_dashboard_server_composition_contract.py now lists both names. The two sets share no path; the existing disjointness test checks that.

Local checks on the new head: scoped backend tests including main's design-tweak seam tests (1037 passed), isort, flake8, mypy, tsc, Dev Fleet, design-tweak and i18n vitest (1505 passed), semgrep on the diff (0 findings). Local GPT and Opus reviews: no findings.

This push dismissed the earlier approval, so the PR needs a fresh one.

AI-assisted, posted on behalf of bolichen97

@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 3, 2026
@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-dev-fleet branch from 8d8d522 to ce06cc7 Compare November 3, 2026 01:19
@bolichen97

bolichen97 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto main again because GitHub reported a merge conflict: head ce06cc7 -> 42a910c, base 234829d -> fc60e8b (earlier: 8d8d522 -> ce06cc7 on base 84ea89d -> 234829d).

  • The only conflict was docs/system-specs/modules/app-kit-platform.md: main's feat(apps): adopt former built-ins onto their pinned repository #27556 added its own §33 (Former built-in adoption) in the same place. Both sections are kept; this PR's seam section is renumbered §34 and its text is unchanged. Nothing linked to the old number.
  • Main's refactor: make core independent of the pptx-maker app #28337 added test/test_core_pptx_maker_decoupling.py, which tolerated this PR's two pptx-maker imports (bridges_agents.py, office_slides.py) and the one "pptx-maker" literal as PENDING_IMPORTS / PENDING_NAME_REFERENCES. This PR removes those couplings, so both sets, their filter and the filter's own test are deleted. That gate is now strict.
  • The PR body's What changed (§34) and Tests sections are updated to match. The goal sections are unchanged.

Earlier round (ce06cc7): the conflict came from the Dev Fleet change on main that localizes the UPDATED column age and the prune toast. fmtRelative was kept in the page's i18n/format import, with the path updated, and DevFleetPage.updatedColumnLocale.test.tsx moved into website/src/apps/dev-fleet/ with its assertions unchanged.

Local checks on 42a910c: related backend tests (882 passed, including both pptx-maker gates, host grants, soffice, office slides, spawn env, composition, startup and Dev Fleet / PPTX Maker app tests), the built-in adoption tests (213 passed), flake-pattern ratchet (64 passed), mypy (4000 files, clean), flake8, isort, black, subprocess-encoding, comment-history, brand, line-cap and docs-lint gates, Dev Fleet / PPTX Maker / i18n vitest (318 passed), and both i18n scripts.

This push dismisses the existing approval, so the PR needs a fresh one.

AI-assisted, posted on behalf of bolichen97

@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 3, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: config_top_keys host grant feeding validation._APP_OWNED_TOP_KEYS

  • config_top_keys duplicates manifest config_keys span=7ac54139b23c

Rebutted: same class as span=66250642ad4b and span=8cdbeac50695, rebutted earlier on this PR. The rebases since then changed no code here (git range-diff shows the patch unchanged).
The two declarations are not the same job at gateway boot. The gateway skips the CLI prime, so a manifest config_keys key is unknown until register_builtin_apps runs refresh_app_config_keys (pinned by test_gateway_load_before_refresh_warns_once_then_loads_cleanly).
Moving dev_fleet to app.json brings back one unrecognized-key warning per gateway launch for every Dev Fleet operator, against maintainer requirement 1 (no impact on existing users) on #26967. The grant goes away with the app. Kept as-is.

AI-assisted, posted on behalf of bolichen97

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles ce06cc7 false-positive: The finding repeats a class already rebutted three times on this PR. Manifest config_keys are only known after refresh_app_config_keys runs at gateway boot, so moving dev_fleet there brings back an unknown-key warning on every launch; config_top_keys is the boot-time grant. Rebuttal: #27435 (comment)

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a false-positive release (class false-positive) for the first-principles AI finding on ce06cc7002c90c79f44097c1123e9ac9e441b838.

The finding repeats a class already rebutted three times on this PR. Manifest config_keys are only known after refresh_app_config_keys runs at gateway boot, so moving dev_fleet there brings back an unknown-key warning on every launch; config_top_keys is the boot-time grant. Rebuttal: #27435 (comment)

This decision applies only to this commit. A new push requires a new judgment.

chenmingwei23
chenmingwei23 previously approved these changes Nov 3, 2026

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

Approved for bulk merge: readiness passed, no conflicts, checks green.

Dev Fleet and PPTX Maker are to leave this repository intact, so the
core must stop importing them and naming them in its tables.

What a built-in asks of the host (the BUILD rlimit, the bound port and
its deferred spawn, forwarded KIROCREW_* variables, an app-owned
config section, strict-internal routes, relay-refused credential mints)
is now data in the app's own host_grants.py, read by the core through
apps/builtin_host_grants.py. Only BUILTIN_NAMES packages are read, a
row may grant only its own app and only paths under its own namespace,
and a malformed row raises at load.

PPTX Maker's agent placeholders move into the app's
agent_placeholders.py. LibreOffice discovery and its install hint live
once, in the core's soffice_discovery.py: the file panel's slide
previews and PPTX Maker both import it. The Dev Fleet UI moves
under website/src/apps/dev-fleet/.
test_core_dev_fleet_pptx_maker_decoupling.py, on the shared
core_app_independence scan, fails on any core module or script that
imports either app.

Part of #26967

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

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Verdict: APPROVE on 42a910c.

This is a re-review after the rebases. My earlier approval was on 8c98c31 and the push dismissed it.

What it does for users. Nothing changes for users. Dev Fleet and PPTX Maker behave as before, and the core no longer names either app. Dev Fleet's host needs (BUILD rlimit, deferred bound-port spawn, forwarded KIROCREW_DEVFLEET_* variables, the dev_fleet config section, the five strict-internal pod routes, the two relay-refused credential mints) are declared in the app's own host_grants.py and read through apps/builtin_host_grants.py. PPTX Maker's agent placeholders live in the app. soffice discovery is one core module that the file panel and PPTX Maker share. The Dev Fleet UI lives under website/src/apps/dev-fleet/.

What changed since 8c98c31, beyond picking up main. I ran git range-diff from 169fa89..8c98c31 to fc60e8b..42a910c. Everything outside the hunks below is identical.

  • server_internal_paths.py (conflict with #28355). Both loaders survive: the design-tweak internal_paths as _builtin_agent_tool_paths import and this PR's strict_internal_paths as _builtin_strict_internal_paths import sit side by side. The fold sites are | _builtin_strict_internal_paths() into the strict set (line 245) and main's | _builtin_agent_tool_paths() into the mixed set (line 419). The module docstring is merged to describe both.
  • test_dashboard_server_composition_contract.py (conflict with #28355). _DATA_MODULE_SOURCES now lists both names for server_internal_paths, and the comment is plural. This PR's earlier change to the bindings assertion is gone from the patch because #28355 already landed the same line on main.
  • app-kit-platform.md. #27556 took §33 for Former built-in adoption, so this PR's section is renumbered §34 with its text unchanged. No file refers to either number.
  • test_core_pptx_maker_decoupling.py (from #28337). That gate tolerated this PR's two pptx-maker imports and one literal as PENDING_IMPORTS / PENDING_NAME_REFERENCES, and its docstring said to delete them once this change landed. The PR deletes both sets, their filter and the filter's test, so the gate is now strict.
  • DevFleetPage.tsx keeps main's new fmtRelative import with the moved path. Main's new DevFleetPage.updatedColumnLocale.test.tsx moves into website/src/apps/dev-fleet/, and only its import lines change.

Behaviour preservation, checked by import. I imported server_internal_paths (every set it exports), kiro_relay.limits._LOCAL_CREDENTIAL_EXACT and validation._APP_OWNED_TOP_KEYS on current main (759a49c) and on this head. Every set is identical: strict 67, mixed 31, CSRF-safe methods 3, pre-audit deny statuses 2, relay local credential paths 11, app-owned config keys 1. The server's strict set is the same object as the data module's. Because the mixed set matches main, the design-tweak fold still takes effect. Because the strict set matches main, this PR's fold reproduces the routes main still lists by hand. A grep of the head finds no reader left for any removed symbol.

Tests and mutations.

  • I ran this PR's Python test files plus the Dev Fleet pod API, built-in agent tools, design-tweak and auto-research decoupling and dashboard composition guard/owner/reach tests: 974 passed, 2 skipped, 5 failed. The 5 failures are in test_file_office_slides.py (pypdfium2 is missing on this host). The same 5 fail the same way on main, so they come from the environment.
  • The Dev Fleet folder plus the i18n rename-sources and edge-challenge vitest files: 12 files, 212 tests passed.
  • Main has moved to 642d833 since the rebase. git merge-tree --write-tree exits 0. On that merged tree, I ran the preview-tools tests (#28972 edited them since), soffice, both decoupling gates, host grants and the composition contract: 127 passed, 2 skipped.
  • Mutation 1: dropping | _builtin_strict_internal_paths() reddens test_builtin_host_grants.py::test_the_core_tables_carry_the_grants and test_dev_fleet_pod_agent_api.py::test_every_route_is_named_in_the_strict_internal_table.
  • Mutation 2: deleting the _builtin_agent_tool_paths row from _DATA_MODULE_SOURCES reddens test_a_data_module_holds_only_the_values_the_facade_rebinds[kiro_crew.dashboard.server_internal_paths].
  • Mutation 3: deleting the _builtin_strict_internal_paths row reddens the same test. Each row is pinned on its own.
  • Mutation 4: re-adding a pptx_maker.backend import to bridges_agents.py reddens test_no_core_module_or_script_imports_the_app in both test_core_pptx_maker_decoupling.py and test_core_dev_fleet_pptx_maker_decoupling.py. This confirms the gate is strict now that the pending rows are gone.
  • I ran each mutation alone and the tree was clean after each.

Source-only, unchanged from the last round. I checked the following by reading source, not by running it. The file panel's soffice_path() no longer falls back to PPTX Maker's managed directory. That directory only ever receives a pdftoppm launcher, so I see no user-visible change. I read the Windows lookup but did not run it. _placeholder_values fails closed to {} on both an import error and a malformed result.

CI on this head. Grouped by check name: 83 success and 11 skipped, with nothing red or pending. PR Readiness and both CodeBuild statuses are success. The UX, Design, First Principles, GPT 6.1 and Opus 5.5 lanes all report PASS or no blocking findings on 42a910c. The First Principles concern about config_top_keys has a recorded override on ce06cc7, and the lane passes on this head. No inline threads are open. The three earlier reviews were all dismissed by rebases.

On the HOLD at 8c98c31. That HOLD named three blockers. The merge conflict is resolved and checked above, and CI is green. The third blocker was a maintainer review of the host-grant seam, and this review is that review. The seam only reads packages listed in BUILTIN_NAMES. It refuses any path outside the app's own namespace and any name that is not KIROCREW_*, and it raises on a malformed row. With today's grants, every resulting set equals main.

Follow-ups, not blocking.

  • The two loaders now sit side by side but discover packages differently. builtin_agent_tools scans every directory under builtins/. builtin_host_grants reads only BUILTIN_NAMES, which is the stricter trust rule. A later pass should give both one discovery helper and pick the BUILTIN_NAMES rule for both.
  • The remaining couplings in the PR body (the pod_* mapping in mcp_tools/apps.py, the security_posture.py rows, the shipped pptx-maker skill) still need an App Kit equivalent before Dev Fleet ships from the registry. The same applies once Dev Fleet gets an adoption pin: an adopted copy would not be read by this seam.
  • §34 still says the strict paths are "folded into server._STRICT_INTERNAL_API_PATHS". The fold happens in server_internal_paths.py, and naming that module would help readers.

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.

5 participants