Repository navigation
refactor: make core independent of the file-explorer app - #28032
Conversation
|
Driver notes for #26967 (the campaign's driver decides and reports; nothing here asks for a ruling). Decisions
Local gate on this host. Two backend reds and 13 frontend files also fail on a clean
|
d0efe15 to
4d27180
Compare
|
CI triage for d0efe15 (14 red checks). The new head is 4d27180, rebased on main 90773d1.
|
4d27180 to
b3474d6
Compare
|
Rebased again, because main's #27995 changed
|
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the core-to-app links are inverted into core-owned helpers and a declarative seam, and gates stop new imports. Notes
[DESIGN-REVIEWED] dfa45e8 Description read[DESCRIPTION-READ] bd629a5a3e16c6d1840175a4e344ea779efc54fb0a065d7f06621a9355ce5bf0 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The "Open in Files" row keeps the same label, the same rules for when it appears and the same link; the rest of the diff moves code and tests, so no screenshot is needed. [UX-REVIEWED] dfa45e8 Description read[DESCRIPTION-READ] e4a636b5f27bf10831827f9ebb996d4657a8f012dca836f4cf35f5235c35495c 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: every item enforces the AGENTS.md rule that core never imports or names a specific app. One note: the new path-opener seam has exactly one user. Notes
What this change shipsInventory (8 items) — 7 justifiedIntent: let the Files app leave the repo whole, without core changing (ADDITION/refactor, no behaviour change).
[FIRST-PRINCIPLES-REVIEWED] dfa45e8 Description read[DESCRIPTION-READ] 03b76fe824ada3ee26b0c416ab637b0b90dc8b20c3d85727323186e1ee46b2c6 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
The Files app is to leave this repository whole, so nothing outside its own directories may import it or name it. - The dashboard's "Open in Files" row now asks a generic seam: a builtinRegistry entry declares `opensPathParam`, and apps/pathOpener.ts picks the first enabled, natively routed page that declares one. The Files row declares `path`, so the row, its gates and its link are unchanged. - useDebouncedValue and parentDir, which core components borrowed from the app, move into core (hooks/, utils/); the app imports them. - DefaultAppsLoader.bundled_app_names() returns [] instead of naming two builtins by package name. The names never matched an installed app directory (those are hyphenated), so orphan detection is unchanged. - The app's tests, and the parity pin of its BINARY_EXTS against the core file-read endpoint, move into the app's own directories. - test/test_core_file_explorer_decoupling.py and fileExplorerBoundary.test.ts keep core from importing or naming the app again. The backend gate and the aws-control one call one shared, app-agnostic scanner, test/core_app_independence.py, so the next app to leave adds a gate, not another copy of the scanner. Part of #26967
b3474d6 to
dfa45e8
Compare
|
self-added: yes
|
|
The red |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on behalf of the watch holder (bolichen). Lanes pass on dfa45e8, no conflict, no open change request.
Problem / Motivation
Goal: Kiro Crew core stops importing or naming the Files (
file-explorer) app, so that app can move out of this repository whole without core changing.Core reaches into the Files app in four places today. The file viewer's ⋯ menu imports the app's deep-link module to build "Open in Files". Two core components borrow the app's
parentDiranduseDebouncedValuehelpers.DefaultAppsLoader.bundled_app_names()namesfile_explorerby package name. A core test imports the app's server to pin its binary-extension list. While those links exist, the app cannot leave as #26967 plans.Why it matters
Every built-in app is moving to its own repository (#26967). Without this change, removing the Files app would break the chat side panel's file viewer and the Files rail at build time, and nothing would stop a new core import of the app from creeping back in.
Not a goal
kc:file-explorer:state:v2(users' open tabs), the App Store copy inappManifest.ts, theapps.fileExplorer.*catalog keys, the registry row, and the core tests that use the app as their shipped-builtin fixture. Each goes when the app leaves.entryPointto a file entry point; that changes how the backend is launched and trusted.What changed (motivation → approach → change)
Core now asks for what it needs instead of importing the app.
BuiltinAppEntrymay declareopensPathParam, the query parameter its page reads a path from. The newwebsite/src/apps/pathOpener.tspicks the first such entry whose app is enabled and routed natively, and builds the link. The Files row declarespath, so the row, its gates and its URL are unchanged;MarkdownPanel.test.tsx's "Open in Files" cases pass untouched.useDebouncedValuebecomeshooks/useDebouncedValue.tsandparentDirbecomesutils/parentDir.ts; the app imports them from there.bundled_app_names()returns[](platform/defaults.py, with theAppsLoaderdocstring inplatform/interfaces_structural.py). The two package names it returned never matched an installed app directory, which is hyphenated, so orphan detection reads the same set.test_file_explorer_app.pyand the app's frontend tests move into the app's directories, as do the app's cases from three cross-app frontend tests, its_is_withinprefix case, and its parity pin ofBINARY_EXTSagainstdashboard/handlers/files.py;test_server.pydefines its ownrequires_symlinksmarker instead of importing core'stest/conftest.py. Twofiles.pycomments stop naming the app's path.cssClassParity.test.tsnow skips*.test.ts(x)files wherever they live, as it already skippedsrc/test/: a moved test'squerySelector('.mc-fe-tab-folder')read as a stylesheet rule.test/test_core_file_explorer_decoupling.pyfails on any core module or script that imports the app or names it in a string.fileExplorerBoundary.test.tsfails on any dashboard module exceptbuiltinRegistry.tsthat imports from the app directory.test/core_app_independence.pytakes an app's package, its names and the reasoned string rows a gate allows. The Files gate andtest_core_aws_control_decoupling.pyboth call it, so the next app to leave adds a short gate, not another scanner.Specs updated:
app-kit-platform.md,platform-context.md,website/docs/extension-seams.md,website/docs/frontend-conventions.md.Backwards compatibility
Compatible: the Files app still ships in this tree and its registry row declares the path parameter, so the menu offers the same row with the same link;
bundled_app_names()dropped only names no installed app can carry.Reader: src/kiro_crew/apps/manager_builtins.py:_edition_bundled_app_names -- app -- feeds
get_orphaned_builtins, whosediscover_builtin_apps()already yieldsfile-explorerandauto-research; test_cpp_wiring_enterprise_wave2.pyReader: website/src/components/MarkdownPanelHeader.tsx:OverflowMenu -- chat -- reads
pathOpenerTarget; MarkdownPanel.test.tsx "OverflowMenu — Open in Files"Reader: website/src/components/FilePathMenu.tsx:FilePathMenu -- chat -- imports
parentDirfromutils/parentDir; parentDir.test.tsReader: website/src/pages/chat/FileBrowserRail.tsx:FileBrowserRail -- chat -- imports
useDebouncedValuefromhooks/useDebouncedValue; useDebouncedValue.test.tsTests
test/test_core_file_explorer_decoupling.py: the no-import gate, the no-name-string gate, and probes that every import form and both spellings are caught, run through the sharedtest/core_app_independence.py.test/test_core_aws_control_decoupling.py: the same tests and pinned list as onmain, run through the shared scanner.website/src/apps/file-explorer/fileExplorerBoundary.test.ts: onlybuiltinRegistry.tsimports into the app directory, and the row's path opener builds the link the page reads.website/src/test/pathOpener.test.ts: the opener rule on synthetic registry rows (none declared, order, disabled / orphaned / AppHost-routed skipped, a parameter needing encoding skipped).parentDir.test.ts,useDebouncedValue.test.ts: the cases moved out of the app's tests.test_core_parity.py,test_windows_extended_prefix.py,api.typedErrors.test.ts,PathBar.imeGuard.test.tsx,windowsPaths.test.ts.Determinism: the two backend gates (30 tests) passed 3 repeats at
-n0, once in reverse file order, and once at-n 2 --dist loadgroup; they read only the source tree. The 146 backend tests in the Files gate and the app'stests/passed 20 repeats at-n0, each in a different shuffled order (seeds 1-20), and 10 runs at-n 4; the frontend files undersrc/apps/file-explorer/and the three new core test files passed 10 shuffled repeats (--sequence.shuffle, seeds 1-10). None of them sleeps or reads a clock.Manual verification
N/A — unit coverage sufficient: the change moves code and inverts one import, and the unchanged menu tests pin the row's gates, label, order and link.
Screenshots / video
Why no screenshot: the file viewer's ⋯ menu renders the same rows with the same labels and order; only where its "Open in" target is looked up changed.
Related Issues
Part of #26967
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)