Repository navigation
refactor(layers): extract session-runtime/ — ingest gets one grep-able home (#493 PR-1) - #501
Merged
Merged
Conversation
…, with deviations Full four-way read of ingest/decide/render + build wiring; plan documents where the code disagrees with the issue sketch (type-only back-edges, already-clean feed direction, groupSemanticActivity PR-2/PR-3 conflict, ingress UI-entanglement) and frames the stack inside the app-wide modularity goal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e grep-able home (#493 PR-1) Pure moves + import-specifier rewrites + one type-file split. Zero logic changes; behavior-preserving by construction. Moved into src/renderer/src/session-runtime/ (git mv, history preserved): - semantic/{foldEvent,helpers,summarize,streamPhaseMachine} — stages 4-5 - ghosts.ts, mergedEntries.ts — stage 6 (ghost bridge + merge selector) - entries.ts (was workspace/entries/utils.ts) — tool-index ingest primitive - claudeQueueReconstruction.ts, queueInvariants.ts, feedDebug.ts — pure stage-3 policy/bookkeeping the issue didn't name but the sweep proved are ingest-only - taskNotification.ts (was features/feed/lib/) — pure transcript parsing (imports only Entry); claudeQueueReconstruction depends on it, and the ingest layer must not import features/ - state.ts (was workspace/workspaceState.ts) — SessionRuntime + everything the runtime object is made of. Layout-view states (Spotlight/Reader/ TileTabs) split OUT to workspace/types.ts: they are tile-tree view state, not runtime. Deliberately NOT moved: - useIpcSubscriptions.ts + workspace/hook/** — the ingress hook is IO wiring interleaved with pane-UI policy (unread badges, condition mirrors, composer picker); the layer boundary is the reducers it calls, all of which did move (plan D2). - providerSessionIdentity.ts — initially moved, then moved back: it governs SessionMeta (workspace's persisted session model), not SessionRuntime, so its layer home follows its data model. Dependency law now holds and is grep-verifiable: grep -rn "@renderer/(workspace|features|app-state)|from 'react'" \ src/renderer/src/session-runtime/ # -> empty foldEvent's SessionKind import now comes from @shared/types/providerKind (the source of truth) instead of workspace/types' re-export. workspaceStore.ts keeps serving its ~45 useWorkspace importers; only its re-export sources were repointed. Gates: tsc node+web clean, vitest 476/476 (the one failing suite — agent-voice-dictation hotkeyBinding "no test suite" — pre-exists on main), remote-client vite build OK (it deep-imports the moved reducers). Plan: docs/superpowers/plans/2026-07-09-layer-isolation.md Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of 3 for #493 (plan:
docs/superpowers/plans/2026-07-09-layer-isolation.md, committed on this branch — read it first; it documents the full four-way code read this stack is built on, including where the code disagrees with the issue sketch).What
Pure moves (
git mv, history preserved) + repo-wide import-specifier rewrites + one type-file split. Zero logic changes.New folder
src/renderer/src/session-runtime/— the INGEST layer (channels → one clean per-session object):semantic/{foldEvent,helpers,summarize,streamPhaseMachine}.tsworkspace/semantic/ghosts.ts,mergedEntries.tsworkspace/entries.tsworkspace/entries/utils.tsclaudeQueueReconstruction.ts,queueInvariants.ts,feedDebug.tsworkspace/taskNotification.tsfeatures/feed/lib/Entry); ingest depends on it and must not importfeatures/state.tsworkspace/workspaceState.tsSessionRuntime+ everything it's made ofSpotlightState/ReaderModeState/TileTabsStatesplit OUT toworkspace/types.ts— tile-tree view state, not runtime.What deliberately did NOT move (plan D2)
useIpcSubscriptions.ts+workspace/hook/**— the ingress hook is IO wiring interleaved with pane-UI policy (unread badges, condition overlay mirrors, composer picker, bootstrap scroll gating). The layer boundary is the reducers it calls — all of which moved. The issue's acceptance ("session-runtime imports no UI") holds; a future ingress split is scoped in the plan §7 as the top follow-up.providerSessionIdentity.ts— moved, then moved back: it governsSessionMeta(workspace's persisted session model), notSessionRuntime. Layer membership follows the data model a module governs.The law, verified
Gates
tsc -b tsconfig.node.json+tsc --noEmit -p tsconfig.web.json— cleanNODE_ENV=test vitest run— 476/476 (the one failing suite, agent-voice-dictationhotkeyBinding.test.ts"no test suite found", pre-exists on main — verified)vite build --config src/remote-client/vite.config.ts— OK (the phone client deep-imports the moved reducers; electron-vite build does not cover it)Stacked: PR-2 (input contract) and PR-3 (view-seam flip) follow on top.
🤖 Generated with Claude Code