Skip to content

refactor: make core independent of the design-critique app - #28021

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

bolichen97 merged 1 commit into
mainfrom
refactor/decouple-core-from-design-critique

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Kiro Crew's core stops depending on the Design Critique app, so the app can move out of this repository without a core edit.

The chat create paths hard-coded Design Critique's worker slot mode: chat_handlers._CREATABLE_MODES = ("", "design-critique"). The app's tests also lived in core: three test/test_design_critique_*.py files, its row of the shared DENIED_ROOT_PARTS pin, and twelve website/src/test/DesignCritique* files, plus its rows in two cross-app frontend tests. 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 that app breaks the core. If "design-critique" stays in the allowlist, it becomes a dead mode. If it is dropped from the allowlist, the app's throwaway dc-* worker slots get created as plain chats and fill the user's chat sidebar.

Not a goal

  • Moving Design Critique out of the repository. This PR only removes the core's dependency on it.
  • Giving installed (registry) apps a way to declare a worker slot mode. The seam reads shipped built-ins only. The external app will need an App Kit equivalent.
  • Removing the couplings listed under What changed that are data keyed by the app id (store copy, i18n catalogs, assets, tooling tables). Each one leaves with the app.
  • Changing any behaviour. The create paths accept exactly "" and "design-critique", as before.

What changed (motivation → approach → change)

The core now asks a seam for the worker slot modes the built-ins register, instead of naming one.

Coupling Before After
Worker slot mode accepted by POST /api/chat/slots and the POST /api/chat auto-create literal in chat_handlers._CREATABLE_MODES the app's own seams.py calls seams.register_worker_slot_mode("design-critique"); _CREATABLE_MODES = ("", *seams.worker_slot_modes())
App backend tests test/test_design_critique_*.py, and the app's row in test/test_denied_root_parts_shared.py apps/builtins/design_critique/tests/; their two node spawns are rows in test/spawn_audit_app_spawns.py
App frontend tests website/src/test/DesignCritique*, designCritiqueSendReceipt.test.ts, and the app's rows in appApiTypedErrors.test.ts / appComposerUploads.test.ts website/src/apps/design-critique/

The mode is one more seam in the existing apps/seams.py, so the core keeps one loader for what a built-in provides. Unlike the provider seams, every app may hold one, and each built-in registers its own id. chat_handlers reads the seam once, at import, and that first lookup is what loads the built-in seams modules, so only a built-in reaches the create paths. Because that lookup imports the app's package, design_critique/__init__.py serves register_routes from a module __getattr__ (the aws-control shape): the route module is imported by the boot route loop's guarded lookup, so an unreadable route file is still logged and skipped, not fatal. Comments in chat_handlers.py, chat_send.py and chat_slot.py stop naming the app.

test_core_design_critique_decoupling.py fails if any core module or script imports the app (any import spelling) or names it in a non-docstring string. It calls the shared test/core_app_independence.py scans, like the aws-control and Files gates, and flags main's chat_handlers.py:672. designCritiqueBoundary.test.ts fails if anything outside apps/design-critique/ imports the UI, except the registry. Spec: app-kit-platform.md §23a and the §30 seam table.

Couplings that remain, each leaving with the app:

  • apps/builtins/__init__.py BUILTIN_NAMES and website/src/apps/builtinRegistry.ts's /design-critique row: the built-in still ships.
  • website/src/components/appstore/appManifest.ts store-copy keys and the apps.designCritique.* i18n keys in the 15 locale catalogs: these wait for the manifest l10n block (feat(app-kit): add level-1 seams for apps leaving the core #27517).
  • website/public/app-assets/design-critique/: served at the URLs app.json names.
  • Tooling tables keyed by path or id: .github/black-baseline.txt, .github/docs-lint-baseline.txt, website/eslint.i18n.config.js, the i18n baselines, capture-app-store-gallery.mjs, check-kiro-light-cards.mjs, i18n-surfaces.mjs, test/test_git_tree_removal_windows.py, test/link_screen_sites.py, test/test_ci_surface_tests.py, test/spawn_audit_app_spawns.py, test/gui_user/features.json.
  • Prose only: comments in security/paths.py, token_auth_app_scope.py and api/apiError.ts; src/kiro_crew/docs/apps.md; security-deep-dive.md.
  • Core tests that use design-critique only as a fixture label, with no dependency on the app.
  • The seam is filled only while the app is a built-in.

Backwards compatibility

Compatible: _CREATABLE_MODES is ("", "design-critique") before and after (test_worker_slot_mode.py pins it). Persisted dc-* slots restore through _restored_mode, which this PR does not touch. The routes, URLs and page are unchanged.

Removes nothing: every moved test still runs from its new directory, and no route, key, mode or record is removed.

Tests

  • test/test_app_seams.py TestWorkerSlotModes: modes come back in registration order, registering twice is a no-op, no registration means no mode, a non-string is refused, and _CREATABLE_MODES equals ("", *worker_slot_modes()).
  • test/test_core_design_critique_decoupling.py: no core module or script imports or names the app. Each import spelling, a hard-coded allowlist entry, a split string and an f-string are proven to be caught; a docstring, a comment and an unrelated built-in are not.
  • apps/builtins/design_critique/tests/test_worker_slot_mode.py and test_denied_root_parts_owner.py: the app's mode reaches the create allowlist, and its guard still holds the shared DENIED_ROOT_PARTS object.
  • apps/builtins/design_critique/tests/test_unreadable_routes_skipped.py: reading register_routes off the package is what imports the route module, and a PermissionError there leaves system.register running, logged, with no Design Critique route. Both tests fail against a package that imports the route module inside register_routes.
  • test/test_dashboard_chat_api_chat.py TestApiChatModeForwarding registers a fixture worker mode on the facade, so it does not depend on which built-ins register one.
  • website/src/apps/design-critique/designCritiqueBoundary.test.ts, api.typedErrors.test.ts (named like the Files and Design Tweak copies), uploads.test.ts: the UI boundary, and the app's rows of the two cross-app tests, its 429 relabel case included. The core appApiTypedErrors.test.ts now pins only Mochi, so its 429 case runs against getWatchlist().

Proof: not provable -- other: refactor with no behaviour change; the guard's positive control is that it flags origin/main's chat_handlers.py:672

Local, rebased on deb619a442: the app's own tests, test_core_design_critique_decoupling.py, test_app_seams.py, test_dashboard_builtin_app_unreadable.py, test_dashboard_chat_api_chat.py, test_denied_root_parts_shared.py and test_spawn_audit.py: 261 passed at -n 4. The gate reds when chat_handlers.py gets back a "design-critique" literal or an import of the app. The vitest files under apps/design-critique/, plus appApiTypedErrors.test.ts, appComposerUploads.test.ts and SubagentProgressBar.i18n.test.tsx: 223 passed. mypy, flake8, isort, the black, subprocess-encoding, comment-history, brand, line-cap and docs-lint gates and the flake-pattern ratchet are green. semgrep is not installed on this host, so the SAST lane is the semgrep run.

Determinism: test_unreadable_routes_skipped.py passes 20 times at -n0, and with test_dashboard_builtin_app_unreadable.py interleaved in one order and its reverse. test_app_seams.py and test_worker_slot_mode.py pass 5 times at -n0, each in a different shuffled order (seeds 1 to 5). test_core_design_critique_decoupling.py passes 5 times at -n0 in shuffled orders (seeds 0 to 4), and 3 times over at -n 4.

Manual verification

N/A — a refactor with no behaviour change. _CREATABLE_MODES was read in a fresh interpreter (('', 'design-critique')), and importing chat_handlers loads only the two built-ins' seams modules and packages, not the app's route module.

Screenshots / video

Why no screenshot: only test files move under website/, 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 2, 2026 09:49
@bolichen97
bolichen97 enabled auto-merge (squash) November 2, 2026 09:49
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing to check. This refactor adds or changes no user-visible control or string. Every website/ change is a test file being moved or edited, so the missing screenshots and the blind read that never ran leave no evidence gap.

[UX-REVIEWED] b36e4cd

Description read

[DESCRIPTION-READ] 73c819beb65ad5cfd7ed6dc4ffb02a8e9d1b9187855891e9a3e1e68e2fb88c98

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 b36e4cd8c76ee3bf144a0a97aac1c72e266ad9be — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level blocker: the allowlist reads the same before and after, the seam fits the existing apps/seams.py loader, and nothing outside the patch reads what moved.

Notes

  • _CREATABLE_MODES = ("", *_app_seams.worker_slot_modes()) runs _load_builtin_seams() whenever chat_handlers is imported. Importing chat_handlers now also imports every built-in's seams package, including auto_research/__init__.py's from .handlers import register_routes, which pulls in its whole campaign backend. A later seams module that imports back into dashboard would hit a cycle there. The failed import would be logged, skipped and latched, so that app's providers would be gone for the process. Consider giving auto_research the same lazy __getattr__ that aws_control and now design_critique use.
  • The seam only reads built-ins. Once Design Critique leaves, its dc-* slots fall back to the chat sidebar unless App Kit can declare a worker slot mode. The PR scopes that out under "Not a goal", so the move-out PR should be ordered after that App Kit support exists.

[DESIGN-REVIEWED] b36e4cd

Description read

[DESCRIPTION-READ] d104934181a0d19515020f679331c1527e68df3bc7d93c97eb59bea8f55560dd

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 b36e4cd8c76ee3bf144a0a97aac1c72e266ad9be — 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 replaces a hard-coded literal with no change in behaviour. Its only registrant is the app that is about to leave.

Notes

  • Item 1 — one consumer, generalized: _worker_slot_modes: dict[str, str] maps app_id -> app_id and has exactly one registrant (design_critique/seams.py:18, grep register_worker_slot_mode( = 1 caller). The description also says "The seam reads shipped built-ins only", so once the Goal's move happens the seam is permanently empty. Subtraction: shrink the dict to a tuple or set of ids. The value repeats the key.

What this change ships

Inventory (6 items) — 5 justified

Intent: let Design Critique leave the repository without a core edit. This is an ADDITION, a decoupling refactor.

  1. The chat create allowlist now gets its app modes from a new apps/seams registry instead of a literal: one consumer, generalized
  2. Importing chat_handlers now loads the built-in seams modules at import time: justified
  3. The Design Critique package serves register_routes lazily, the same pattern aws-control uses: justified
  4. The app's backend tests moved into apps/builtins/design_critique/tests/: justified
  5. The app's frontend tests moved under website/src/apps/design-critique/, and its rows were split out of the cross-app tests: justified
  6. A new gate fails if core imports or names the app, built on the shared core_app_independence.py: justified

[FIRST-PRINCIPLES-REVIEWED] b36e4cd

Description read

[DESCRIPTION-READ] dad8af20126998d37b42761d5fd2b5c772bf5118de1bbbd17af074412c915316

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

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] b36e4cd

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

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

@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 b36e4cd8c76ee3bf144a0a97aac1c72e266ad9be and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b36e4cd

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b36e4cd8c76ee3bf144a0a97aac1c72e266ad9be 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 2, 2026
@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-design-critique branch from 7f91b24 to 66fdfd0 Compare November 2, 2026 11:18
@bolichen97

bolichen97 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: apps/builtin_slot_modes.py, a second per-built-in discovery loader
resolution: removed

  • span=ea8c568daddb Second per-built-in discovery loader — duplicate of src/kiro_crew/apps/seams.py

fixed in 66fdfd0: apps/builtin_slot_modes.py and design_critique/slot_modes.py are deleted. The mode is one more seam in apps/seams.py: register_worker_slot_mode(app_id) / worker_slot_modes(), empty by default, filled by the existing _load_builtin_seams loop, so there is one loader.
Design Critique registers from its own seams.py; chat_handlers._CREATABLE_MODES = ("", *seams.worker_slot_modes()) is still ("", "design-critique") (fresh-interpreter read, and test_worker_slot_mode.py).
Kept from the removed loader: the mode is always the app's own id, and seams.CORE_SLOT_MODES ("", member, crew, orchestrator) is refused. Tests moved to test_app_seams.py::TestWorkerSlotModes; spec app-kit-platform.md §23a and the §30 seam table.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 2, 2026
KiroCrewCaptain
KiroCrewCaptain previously approved these changes Nov 2, 2026

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

Approved on behalf of the watch holder (bolichen). Lanes pass on 66fdfd0, no conflict, no open change request.

@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-design-critique branch from 66fdfd0 to 3c20138 Compare November 2, 2026 16:14
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/test/appApiTypedErrors.test.ts (conflict) and docs/system-specs/modules/app-kit-platform.md since this head went green (90773d1 -> 5ec4c08); CI re-running.

  • appApiTypedErrors.test.ts: refactor: make core independent of the file-explorer app #28032 moved the Files row out and this PR moved the Design Critique row out; the shared test keeps design-tweak and mochi only.
  • The Design Critique gate is renamed test/test_core_design_critique_decoupling.py and now calls the shared test/core_app_independence.py scans (refactor: make core independent of the file-explorer app #28032) instead of carrying its own scanner. It reds on a re-added "design-critique" literal or an app import in chat_handlers.py.
  • app-kit-platform.md §23a names the renamed gate and the shared scanner; the "Every backend app gate runs the same scanner" paragraph lists Design Critique beside aws-control and Files. Section numbers are unchanged (§23a, §30).

The Captain's approval on 66fdfd0 was dismissed by this push; the new head 3c20138 needs a fresh approval.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision 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-design-critique branch from 3c20138 to 6753d52 Compare November 2, 2026 17:18
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main 1dd2be3 (head 3c20138 -> 6753d52), no code change.

The 7 failing checks on 3c20138 were one main break, not this diff:

  • Backend Tests (3.12, 3) / (Windows) (3): 4 tests in test/test_mate_conductor_agent.py.
  • Backend Tests (3.12, 4) / (Windows) (4): all 8 test/test_agent_refactor_spec_bytes.py::test_every_written_spec_matches_the_pre_split_bytes[*] scenarios.
  • Coverage Gate: fails closed on the backend-test failure above.
  • Sensitive Change Review: cancelled by a newer queued run of the same lane, not a verdict.

Cause: #27933 and #27940 landed together and left the conductor tests and spec-bytes goldens stale on main; #28301 (now on main) fixed them. This PR touches neither file. Locally the 12 node ids fail on 3c20138 and pass on the rebased head; the related set (270 tests) is green, and black / isort / flake8 / mypy / comment-history / brand / line-cap gates pass. CI is re-running.

@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 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-design-critique branch from 6753d52 to 2955fe2 Compare November 3, 2026 07:12
@bolichen97

bolichen97 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Conflict re-sync onto 83995359b5 (head 6753d52a4b -> 2955fe2009); no behaviour change, CI re-running.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention 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-design-critique branch from 2955fe2 to 015e5bd Compare November 3, 2026 08:42
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: design_critique/init.py importing its route module inside register_routes
resolution: removed

  • span=d213c2cb2f78 Deferred routes import runs outside the boot loop's OSError guard

fixed in 015e5bd: design_critique/__init__.py serves register_routes from a module __getattr__ over _LAZY_OWNERS (the aws-control shape), so the route module is imported by getattr(_mod, "register_routes") inside system.py's except OSError, not by the unguarded _register(app) call.
The package __init__ still imports nothing of the app, so the seams loader stays light while chat_handlers is being imported.
Class swept: every apps/builtins/*/__init__.py defining register_routes; only design_critique deferred its import into the call body (dev_fleet imports its two route modules at module top, aws_control already uses __getattr__).
Pinned by design_critique/tests/test_unreadable_routes_skipped.py: a PermissionError on the route module surfaces at the lookup and system.register logs and skips the app. Both tests fail against the old __init__.

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: design_critique/init.py importing its route module inside register_routes
resolution: removed

  • span=667926ed0b12 Deferred backend import escapes the optional-app failure guard

fixed in 015e5bd: design_critique/__init__.py serves register_routes from a module __getattr__ over _LAZY_OWNERS (the aws-control shape), so the route module is imported by getattr(_mod, "register_routes") inside system.py's except OSError, not by the unguarded _register(app) call.
The package __init__ still imports nothing of the app, so the seams loader stays light while chat_handlers is being imported.
Class swept: every apps/builtins/*/__init__.py defining register_routes; only design_critique deferred its import into the call body (dev_fleet imports its two route modules at module top, aws_control already uses __getattr__).
Pinned by design_critique/tests/test_unreadable_routes_skipped.py: a PermissionError on the route module surfaces at the lookup and system.register logs and skips the app. Both tests fail against the old __init__.

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: seams.CORE_SLOT_MODES refusal in register_worker_slot_mode
resolution: removed

  • Notes, item 2: the core-mode refusal has no case it currently prevents

fixed in 015e5bd: seams.CORE_SLOT_MODES and its ValueError branch are deleted; the isinstance check stays. The one registrant passes "design-critique", so no shipped caller reached the branch.
Its two tests (test_a_mode_the_core_owns_is_refused, test_the_core_modes_include_the_member_thread_mode) go with it, and app-kit-platform.md §23a and the register_worker_slot_mode docstring now state only what the code does: each built-in passes its own id (Design note 1's "one app cannot claim another's" was not enforced and is dropped).

@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 and removed readiness: action required A blocking check or review needs attention labels Nov 3, 2026
The chat create paths hard-coded Design Critique's worker slot mode in
chat_handlers._CREATABLE_MODES, so the app could not leave the
repository without a core edit. The mode is now one more seam in
apps/seams.py, empty by default: a built-in's seams.py calls
register_worker_slot_mode(app_id), so the mode is always the app's own
id and never a core mode, and chat_handlers reads worker_slot_modes()
at import. The accepted set is unchanged: "" and "design-critique".

The app's tests that lived in core move into its own directories: the
three test/test_design_critique_* files, its row of the shared
DENIED_ROOT_PARTS pin and of the app API typed-error and composer-upload
tests, and the twelve website/src/test/DesignCritique* files. New guards
keep core from importing or naming the app again
(test_core_design_critique_decoupling.py, on the shared
test/core_app_independence.py scans) and keep its UI reachable only
through the builtin registry (designCritiqueBoundary.test.ts).

Part of #26967
@bolichen97
bolichen97 force-pushed the refactor/decouple-core-from-design-critique branch from 015e5bd to b36e4cd Compare November 3, 2026 09:20
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/app-kit-platform.md, src/kiro_crew/apps/seams.py since this head went green (deb619a -> e54cda5); CI re-running.

Conflicts came from #28338 (auto-research's stopped_loop_tombstone seam). Both sides kept: apps/seams.py carries the stopped_loop_tombstone() accessor next to register_worker_slot_mode / worker_slot_modes, its module docstring names both needs, and the seam table in app-kit-platform.md lists both rows. No code change beyond the merge. Related tests pass locally (app seams, both decoupling gates, the design-critique app tests, the tombstone seam, chat create paths: 282 passed), and docs-lint, flake8, mypy, black and comment-history are clean. The --rounds retrospective found nothing new: every mechanism an earlier round added has already been removed, and this round adds none.

@github-actions github-actions Bot added 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

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

What it does for users: nothing visible changes. Design Critique's throwaway dc-* worker slots are still created under their own mode, so they stay off the chat sidebar. The difference is that the core no longer spells the app's name, so the app can later leave the repository without a core edit. This follows the same pattern as #28355 (Design Tweak) and #27435.

Evidence

  • Behaviour equivalence, checked by import. chat_handlers._CREATABLE_MODES is ('', 'design-critique') on this head, which matches the literal on main (chat_handlers.py:703). I read it after importing chat_handlers, kiro_crew.dashboard, dashboard.server, dashboard.routes.system, dashboard.state, kiro_crew.cli, the auto-research package and the design-critique package first. Every order gave the same tuple, logged no seam-load warning, and left the stopped_loop_tombstone and crew_runtime providers registered.
  • One loader. worker_slot_modes() (apps/seams.py, added near line 192) goes through the existing _load_builtin_seams() and its _load_lock. It does not add a third discovery path. The second per-built-in loader from an earlier round (apps/builtin_slot_modes.py) is gone.
  • Removed symbols have no readers. Nothing in src/ or test/ imports register_routes from design_critique.backend.routes through the package eagerly. test_backend_routes.py:21 reads it off the package, which now goes through __getattr__. The boot loop reads it with getattr inside the OSError guard (dashboard/routes/system.py:251-276). The routes._DENIED_ROOT_PARTS identity pin moved to design_critique/tests/test_denied_root_parts_owner.py:17.
  • Moved tests are moved, not rewritten. Git rename similarity is 100% for the owner-gate test and 97% / 88% for the SSRF and resolver-rule tests. In those two files only the path-to-scripts lines and a docstring paragraph changed. The frontend moves are 92-99% similar. The rows removed from the two cross-app frontend tests reappear in apps/design-critique/api.typedErrors.test.ts and uploads.test.ts, including the 429 relabel case.
  • Unreadable-file behaviour. I simulated an unreadable auto-research route module and imported chat_handlers, on this head and on its base. Both log and skip the auto-research seams module and keep the rest. The only difference is timing: here it happens at chat_handlers import, and on base it happened at the first seam lookup.
  • Local tests: 261 passed (design_critique/tests, test_core_design_critique_decoupling.py, test_app_seams.py, test_dashboard_builtin_app_unreadable.py, test_dashboard_chat_api_chat.py, test_denied_root_parts_shared.py, test_spawn_audit.py, at -n 4). Vitest: 19 files, 223 tests passed (apps/design-critique/, appApiTypedErrors.test.ts, appComposerUploads.test.ts, and the progress-bar i18n test).
  • Mutations, run one at a time and restored after each:
    • I replaced seams.register_worker_slot_mode(APP_ID) with pass. That reddened test_worker_slot_mode.py::test_the_app_registers_its_own_name_as_its_worker_mode and ::test_the_chat_create_paths_accept_it.
    • I restored the eager from .backend.routes import register_routes in the package __init__. That reddened test_unreadable_routes_skipped.py::test_the_route_module_is_read_by_the_lookup_not_the_call and ::test_an_unreadable_route_module_does_not_abort_route_setup.
    • I put the ("", "design-critique") literal back in chat_handlers.py. That reddened test_core_design_critique_decoupling.py::test_no_core_string_names_the_app. test_app_seams.py::test_the_chat_create_paths_read_the_seam stayed green under that mutation, as expected, because the two tuples are equal. The decoupling gate is the only check that pins the literal's absence.
  • CI on this head: 81 success, 11 skipped, 0 failing check runs. PR Readiness and both CodeBuild statuses are success. The Opus, GPT, Design and First Principles lanes all pass on this head, with no HOLD. git merge-tree --write-tree against current main exits 0.

Source-only: Windows behaviour (I relied on the green Windows lanes and did not run it). I did not run the full repository suite locally.

Follow-ups (non-blocking)

  • The PR body's manual-verification line says importing chat_handlers loads "only the two built-ins' seams modules and packages, not the app's route module". After the rebase onto #28338 there are three seams modules. The auto-research package __init__ imports its handlers route module eagerly, so chat_handlers import now pulls in auto-research's route module and its campaign.* modules. Outcomes match base (shown above), so this is a wording update. The spec's §23a "Light package" bullet could also say whether auto-research should adopt the same lazy register_routes shape when it leaves.
  • register_worker_slot_mode does not refuse a core mode or a mode already used by chat_folders._VALID_MODES. Today only built-ins reach it, so this is not reachable from an installed app. The App Kit equivalent for external apps will need that rule.

@bolichen97
bolichen97 merged commit 05e5be8 into main Nov 3, 2026
96 checks passed
@bolichen97
bolichen97 deleted the refactor/decouple-core-from-design-critique branch November 3, 2026 16:34
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants