Skip to content

refactor: move the workflow run views out of the workflows app - #36348

Merged
bolichen97 merged 1 commit into
mainfrom
feat/w4-workflows
Nov 13, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/w4-workflows

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let the Workflows app leave the repository without taking the core workflow run views (chat, session sidebar, Customize → Workflows) with it.

The run tree, run graph, source panel, Runs list, run snapshot hook and the event-stream and plan models live under website/src/apps/workflows/, but they are core UI: the chat side panel, the progress bar, the run cards, the session sidebar and the Customize → Workflows tab render them, and they read only the core run registry at /api/workflows/*. 34 core modules import the app directory today, so the app cannot be moved out, adopted or later deleted without breaking those core surfaces.

Why it matters

The built-in app campaign moves every app out of core (stage A: core infrastructure that lives under an app directory moves into core). Until this lands, deleting or externalizing the workflows app would remove the run views from every chat that runs a workflow, for every user, whether or not they ever enabled the hidden app.

Not a goal

  • Retiring, externalizing or pinning the workflows app itself, or changing its /workflows page, its backend or its manifest.
  • Renaming the apps.workflows.* catalog keys the moved views read.
  • Any change to what a user sees.

What changed (motivation → approach → change)

The views are core in everything but location, so they move to website/src/components/workflows/ byte for byte (git sees pure renames), and every core importer, test and capture script points there (an import-line change only in website/src/pages/, website/src/hooks/websocket/turnCompletion.ts, website/src/lib/closeBusyGate.ts, website/src/store/chat/workflows.ts and website/src/utils/sessionKeys.ts). The app keeps only its /workflows page (the Author view over its own backend, plus the core Runs list), which now imports the views from core and no longer re-exports the run-model helpers for tests. Its page tests move beside it, and the one page case in WorkflowsPluralCounts.test.tsx moves into WorkflowsPage.switchLabels.test.tsx. workflowsBoundary.test.ts pins that core reaches the app only through its builtinRegistry.ts row. The workflows spec, the feature map and test/gui_user/features.json name the new paths.

Backwards compatibility

Compatible: only module paths inside the dashboard bundle change; no route, API, setting, catalog key or rendered output changes.

Removes nothing: every moved module keeps its exports, and the one dropped re-export (groupByPhase/latestBudget from WorkflowsPage.tsx) had a single reader, website/src/test/workflowRunModel.test.ts (formerly WorkflowsPage.test.ts), which now imports components/workflows/runModel directly.

Tests

  • website/src/apps/workflows/workflowsBoundary.test.ts: fails on main (34 modules outside the app import it), passes here.
  • Every existing workflows test runs unchanged at its new path; WorkflowsPage.switchLabels.test.tsx carries the page case split out of WorkflowsPluralCounts.test.tsx.

Proof: not provable -- frontend test (prove.py runs Python only). The boundary test was run against an origin/main tree and failed with the 34 core importers listed.

Manual verification

N/A: a path-only move with no rendered delta; tsc -p tsconfig.app.json, eslint, npm run i18n:check, npm run build and every vitest file that imports a changed module (341 files, 4675 tests) pass locally.

Screenshots / video

Why no screenshot: files move between directories with identical contents, so nothing renders differently.

Related Issues

Part of #26967

Open PRs #25466 and #25471 add new views under website/src/apps/workflows/kas/; if core imports them, the boundary test asks for components/workflows/ instead.

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 13, 2026 03:15
@bolichen97
bolichen97 enabled auto-merge (squash) November 13, 2026 03:16
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

No design-level concerns. This is a path-only move of core views out of the app directory. A boundary test pins the move, and no reader outside the patch still names the old paths.

[DESIGN-REVIEWED] 886614f

Description read

[DESCRIPTION-READ] e04e9e676bcc3aec166bf6f3ea868bf2dfe9efc1acdc66170c4811d955ce4290

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing to check. The diff only moves files: the moved views are 100% renames, and every other source change is an import path. No string, control or render changes, so the missing screenshots leave no evidence gap.

[UX-REVIEWED] 886614f

Description read

[DESCRIPTION-READ] f5952689ceb58ae37fd928aae7f427137407dc38152c50c2edd2483170cd8eab

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 886614fcf81f54bf135364eb93665491a9de25d4 — 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

This change only moves files and changes import paths, which the frozen Goal requires; it changes no default, surface or rendered output.

Inventory (6 items) — 6 justified

Intent: let the Workflows app leave the repository without taking the chat, sidebar and Customize → Workflows run views with it. This is a FIX: it removes a dependency of core on an app directory, under #26967.

  1. The run tree, run graph, source panel, Runs list, run-snapshot hook and the event and plan models move byte for byte into core components/workflows/ — justified
  2. The core chat, sidebar, Customize tab, store, utils and capture scripts import them from the new path — justified
  3. The app page no longer re-exports groupByPhase, latestBudget or the run types; their one test reader now imports runModel directly — justified
  4. The app's page tests move beside the app, and the Author/Runs switch-label case is split out of WorkflowsPluralCounts — justified
  5. workflowsBoundary.test.ts pins that core imports the app only through the builtinRegistry.ts row. It is the 14th copy of the per-app *Boundary.test.ts pattern (14 files define SPEC_RE = ) — justified
  6. The workflows spec, the feature map and features.json name the new paths — justified

[FIRST-PRINCIPLES-REVIEWED] 886614f

Description read

[DESCRIPTION-READ] f5600257b297485db044609763c43b30eef9d674e49120f7ff01fcb7e4c0ca69

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 886614f

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

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

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 886614fcf81f54bf135364eb93665491a9de25d4 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 886614f

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

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/acp-client.md, docs/system-specs/modules/cli.md, docs/system-specs/modules/history.md, website/src/store/chat/lifecycle.ts, website/src/utils/previewFlags.ts since this head went green (27e9359 -> d4b588b); CI re-running.

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

Copy link
Copy Markdown
Contributor Author

Backend Lint & Type Check (3.12) is red on main, not on this diff: mypy reports src/kiro_crew/cli_commands_memory.py:335: Incompatible types in assignment (from #36114 + #36212), a file this PR does not touch; Coverage Gate fails closed behind it. Tracked in #36458, fixed by #36457. This PR waits for that fix and rebases onto it; no override for this red.

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

Copy link
Copy Markdown
Contributor Author

Rebased onto main to pick up #36457: the only red on 13ba715 was Backend Lint & Type Check (3.12) failing mypy at src/kiro_crew/cli_commands_memory.py:335 (a main red outside this diff), which also failed Coverage Gate closed. The diff is unchanged (fd6ce14); tsc -p tsconfig.app.json and the 28 workflows vitest files (331 tests) pass locally on the rebased tree.

@KiroCrewCaptain

KiroCrewCaptain commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates a 6% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

This is a path-only refactor. All 11 workflow run-view modules move from src/apps/workflows/ to src/components/workflows/ as 100% renames. Both directories are at the same depth, so their ../../ imports still resolve, and their ./ imports only point at sibling files that moved with them. Every core importer, vi.mock target, capture script, the RadioChipGroup file list, features.json and the docs were updated, and a repo-wide search finds no leftover reference to the old module paths. The one dropped re-export (groupByPhase/latestBudget) had a single test reader, and it now imports runModel directly. The new workflowsBoundary.test.ts follows the existing 14-file per-app boundary pattern; the only core importer left is the builtinRegistry lazy row, which the test allows. The UI-location registry and committed UI index don't name the moved files. Frontend lint/typecheck, ratchets/i18n and bundle-size checks passed; the frontend test shards were still pending at review time. No behaviour, state or trust boundary changes.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 886614fcf8 · 295 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@bolichen97

Copy link
Copy Markdown
Contributor Author

The one red left on fd6ce14 is Coverage Gate (CI run 43489135360): 75.7% src/kiro_crew/agent_ipc_client.py (87/115) under the 80% per-file floor. This PR touches no backend file; it is the main red #36804 fixes (open, auto-merge armed). This PR waits for #36804 and rebases onto it. The rate-limited lanes from the same round (GPT 6.1 Review, PR Policy, Dependency License Gate, CodeQL: API rate limit exceeded for installation) were rerun once and passed.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main to pick up #36804 (the agent_ipc_client.py per-file coverage red behind Coverage Gate on fd6ce14). The diff is unchanged (6c7c8e3); tsc -p tsconfig.app.json and the 28 workflows vitest files (331 tests) pass locally on the rebased tree.

@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 13, 2026
The run tree, run graph, source panel, Runs list, run snapshot hook and
the event-stream and plan models lived under website/src/apps/workflows/
although the chat, the session sidebar and Customize > Workflows render
them and they read only the core run registry at /api/workflows/*. Core
imported the app from 34 modules, so the app could not leave the
repository without taking core UI with it.

They move to website/src/components/workflows/ unchanged. The app keeps
its /workflows page, which now imports them from core, and its page
tests move beside it. A boundary test pins that core reaches the app
only through its builtinRegistry.ts row.

Part of #26967
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 13, 2026
@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Nov 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/pages/ChatSidebar.tsx, website/src/pages/CrewBoardPage.tsx since this head went green (af8d570 -> ac4062d); CI re-running.

@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: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

PR Readiness passed on 886614f (readiness: passed); auto-merge is armed and the PR waits on a maintainer approval. green_age.py reports main moved 19 commits (ac4062d -> 7b455df) in files this PR also touches. The only same-file overlap is docs/feature-map/README.md, and those edits are in other rows (Context breakdown, Repeated failures note), not the Workflows row this PR edits. Proof against that base, without a push: git merge-tree --write-tree origin/main HEAD is clean (tree 50662067a53), and in that tree tsc -p tsconfig.app.json passes and the 28 workflows vitest files (331 tests) pass. The green-age re-sync budget (2/3) is kept for a real conflict.

@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 886614f. The 11 view and model files move from apps/workflows/ to components/workflows/ as 100% renames, at the same directory depth, so every relative import inside them still resolves. Every other source edit is an import line. No old apps/workflows/ path is left anywhere in the repo, and that includes vi.mock paths, capture, playwright and config files. The only re-export this PR drops had one reader, which now imports runModel directly. The Author/Runs switch-label case moved over with no assertion dropped.

Done well: workflowsBoundary.test.ts asserts the exact set of importers allowed outside the app. It also self-tests every import spelling it relies on, so a later change to the regex cannot quietly stop it from matching. At the merge base, 34 core files outside the app imported it. At head, none do.

Optional:

  • website/src/apps/workflows/WorkflowsPage.tsx:315-317: the comment still says the helpers are "re-exported above" for the WorkflowsPage.test unit tests. This PR removes that re-export, so the comment is now wrong.
  • website/src/components/workflows/runModel.ts:7-8 and three test file headers still name WorkflowsPage.test.ts. That file is now workflowRunModel.test.ts.
  • When #25471 reaches main, its core imports of apps/workflows/kas/ will fail the new boundary test. The PR body already mentions this.

@bolichen97
bolichen97 merged commit 1171b62 into main Nov 13, 2026
99 of 101 checks passed
@bolichen97
bolichen97 deleted the feat/w4-workflows branch November 13, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants