Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
244 changes: 244 additions & 0 deletions docs/superpowers/plans/2026-07-09-layer-isolation.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/remote-client/src/transcript/store.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { getRendererProviderCapabilities } from '@providers/registry.renderer.capabilities'
import { foldSemanticEvent } from '@renderer/workspace/semantic/foldEvent'
import { foldSemanticEvent } from '@renderer/session-runtime/semantic/foldEvent'
import {
reduceStreamPhase,
type StreamPhaseState,
} from '@renderer/workspace/semantic/streamPhaseMachine'
import { indexEntryIntoMaps } from '@renderer/workspace/entries/utils'
} from '@renderer/session-runtime/semantic/streamPhaseMachine'
import { indexEntryIntoMaps } from '@renderer/session-runtime/entries'
import {
emptySemanticRuntime,
type SemanticLiveTurn,
type SemanticRuntimeState,
} from '@renderer/workspace/workspaceState'
} from '@renderer/session-runtime/state'
import { isAgentProviderKind, type AgentProviderKind } from '@shared/types/providerKind'
import type { Entry, ToolResultBlock, ToolUseBlock } from '@shared/types/transcript'
import type { ProviderConditionSnapshot } from '@shared/types/providerConditions'
Expand Down
2 changes: 1 addition & 1 deletion src/remote-client/src/ui/SessionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from
import { Feed } from '@renderer/features/feed/ui/Feed'
import { SessionFeedProvider } from '@renderer/features/sessionFeed/SessionFeedContext'
import { useLedgerFeedItems } from '@renderer/rendering/view/useLedgerFeedItems'
import type { SessionRuntime } from '@renderer/workspace/workspaceState'
import type { SessionRuntime } from '@renderer/session-runtime/state'
import type { Entry } from '@shared/types/transcript'
import {
conditionStateByKind,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/app-state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import type { Settings } from '@renderer/app-state/settings/types'
import type { DispatchAttachIntent, UiShellState } from '@renderer/app-state/uiShell/types'
import type { SessionId, TabId } from '@renderer/workspace/types'
import type { WorkspaceState } from '@renderer/workspace/types'
import type { SessionRuntime } from '@renderer/session-runtime/state'
import type {
ReaderModeState,
SessionRuntime,
SpotlightState,
TileTabsState,
} from '@renderer/workspace/workspaceState'
} from '@renderer/workspace/types'

export type SettingsSlice = {
settings: Settings
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/app-state/workspace/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import type { StateCreator } from 'zustand'

import type { AppStore, WorkspaceSlice } from '@renderer/app-state/types'
import type { WorkspaceState } from '@renderer/workspace/types'
import type { SessionRuntime } from '@renderer/session-runtime/state'
import type {
ReaderModeState,
SessionRuntime,
SpotlightState,
TileTabsState,
} from '@renderer/workspace/workspaceState'
} from '@renderer/workspace/types'

function applyUpdater<T>(prev: T, next: T | ((prev: T) => T)): T {
return typeof next === 'function'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
TabId,
WorkspaceState,
} from '@renderer/workspace/types'
import type { SessionRuntime } from '@renderer/workspace/workspaceState'
import type { SessionRuntime } from '@renderer/session-runtime/state'

export type AgentStatusKind = AgentProviderKind

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import type {
FeedDebugEntry,
SemanticLiveBlock,
SemanticLiveTurn,
} from '@renderer/workspace/workspaceState'
} from '@renderer/session-runtime/state'
import {
conditionStateByKind,
type ClaudeAskUserQuestionState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
resumableProviderSessionId,
} from '@renderer/workspace/providerSessionIdentity'
import type { SessionId, SessionMeta } from '@renderer/workspace/types'
import type { FeedDebugEntry } from '@renderer/workspace/workspaceState'
import type { FeedDebugEntry } from '@renderer/session-runtime/state'

export const transcriptSyncModule: DevDebugModule = {
id: 'transcript-sync',
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/debug/devModules/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Workspace } from '@renderer/workspace/workspaceStore'
import type { SessionRuntime } from '@renderer/workspace/workspaceState'
import type { SessionRuntime } from '@renderer/session-runtime/state'

export type DevDebugModuleProps = {
workspace: Workspace
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/debug/saveDebugBundle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DEFAULT_PROVIDER, isAgentProviderKind } from '@shared/types/providerKind'
import type { Workspace } from '@renderer/workspace/workspaceStore'
import type { SessionRuntime } from '@renderer/workspace/workspaceState'
import type { SessionRuntime } from '@renderer/session-runtime/state'
import { useAppStore } from '@renderer/app-state/store'
import { sanitizeHtml } from '@renderer/lib/sanitizeHtml'
import { commandTargetSessionId } from '@renderer/workspace/hook/selectors/commandTargetSessionId'
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/debug/ui/DevDebugPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
DevDebugModuleProps,
} from '@renderer/features/debug/devModules/types'
import type { Workspace } from '@renderer/workspace/workspaceStore'
import type { SessionRuntime } from '@renderer/workspace/workspaceState'
import type { SessionRuntime } from '@renderer/session-runtime/state'

const STORAGE_KEY = 'agent-code:dev-debug:enabled-modules'

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/debug/ui/FeedDebugPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'

import type { FeedDebugEntry, FeedDebugLayer, SessionRuntime } from '@renderer/workspace/workspaceState'
import type { FeedDebugEntry, FeedDebugLayer, SessionRuntime } from '@renderer/session-runtime/state'

type Props = {
sessionId: string
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/debug/ui/ProxyDebugPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from 'react'
import { useAppStore } from '@renderer/app-state/hooks'
import { emptySemanticRuntime } from '@renderer/workspace/workspaceState'
import { emptySemanticRuntime } from '@renderer/session-runtime/state'

// ProxyDebugPanel — live inspector for the semantic stream and any
// provider transport attribution that survives into the shared runtime.
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/WorkIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import { memo, useEffect, useState } from 'react'

import { MarkerRow } from '@renderer/features/feed/ui/MarkerRow'
import type { StreamPhase } from '@renderer/workspace/workspaceState'
import type { StreamPhase } from '@renderer/session-runtime/state'

type Props = {
phase: StreamPhase
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/features/feed/context.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TaskNotification } from '@renderer/features/feed/lib/taskNotification'
import type { TaskNotification } from '@renderer/session-runtime/taskNotification'
import { createContext } from 'react'

import type {
Expand All @@ -7,7 +7,7 @@ import type {
} from '@shared/types/transcript'

import type { AgentProvider } from '@renderer/features/feed/types'
import type { SubAgentState } from '@renderer/workspace/workspaceState'
import type { SubAgentState } from '@renderer/session-runtime/state'
import type { ClaudeAskUserQuestionState } from '@shared/types/providerConditions'

// ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type ToolResultBlock,
type ToolUseBlock,
} from '@shared/types/transcript'
import type { SemanticLiveTurn } from '@renderer/workspace/workspaceState'
import type { SemanticLiveTurn } from '@renderer/session-runtime/state'
import { asRecord } from '@shared/lib/asRecord'

function isToolUseBlock(block: ContentBlock): block is ToolUseBlock {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/model/renderModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type Entry } from '@shared/types/transcript'
import type {
SemanticLiveTurn,
StreamPhase,
} from '@renderer/workspace/workspaceState'
} from '@renderer/session-runtime/state'
import type {
AgentProvider,
DebugVisibleRow,
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/src/features/feed/ui/Feed.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
taskNotificationFromEntry,
type TaskNotification,
} from '@renderer/features/feed/lib/taskNotification'
} from '@renderer/session-runtime/taskNotification'
import { TaskNotificationsContext } from '@renderer/features/feed/context'
import { getRendererProviderCapabilities } from '@providers/registry.renderer.capabilities'
import {
Expand All @@ -20,7 +20,7 @@ import {
import type {
SemanticLiveTurn,
StreamPhase,
} from '@renderer/workspace/workspaceState'
} from '@renderer/session-runtime/state'
import { WorkIndicator } from '@renderer/features/feed/WorkIndicator'
import { toolHintFromTurn } from '@renderer/features/feed/workIndicatorHints'
import {
Expand Down Expand Up @@ -52,14 +52,14 @@ import {
} from '@renderer/features/feed/ui/semantic'
import { MarkerRow } from '@renderer/features/feed/ui/MarkerRow'
import { StreamingProse } from '@renderer/features/feed/ui/markdown'
import { semanticTurnScrollSignal } from '@renderer/workspace/semantic/helpers'
import { semanticTurnScrollSignal } from '@renderer/session-runtime/semantic/helpers'
import {
EAGER_TAIL,
EntryRow,
LazyEntry,
} from '@renderer/features/feed/ui/rows'
import type { ToolResultBlock, ToolUseBlock } from '@shared/types/transcript'
import type { SubAgentState } from '@renderer/workspace/workspaceState'
import type { SubAgentState } from '@renderer/session-runtime/state'
import type { ClaudeAskUserQuestionState } from '@shared/types/providerConditions'
import * as perf from '@renderer/performance/client'

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/ui/rows/EntryRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { CompactBoundaryRow } from '@renderer/features/feed/ui/rows/CompactBoundaryRow'
import { CompactSummaryRow } from '@renderer/features/feed/ui/rows/CompactSummaryRow'
import { ConversationRow } from '@renderer/features/feed/ui/rows/ConversationRow'
import { taskNotificationFromEntry } from '@renderer/features/feed/lib/taskNotification'
import { taskNotificationFromEntry } from '@renderer/session-runtime/taskNotification'
import { TaskNotificationRow } from '@renderer/features/feed/ui/rows/TaskNotificationRow'
import { SystemRow } from '@renderer/features/feed/ui/rows/SystemRow'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MarkerRow } from '@renderer/features/feed/ui/MarkerRow'
import type { SubAgentState } from '@renderer/workspace/workspaceState'
import type { SubAgentState } from '@renderer/session-runtime/state'

// The drill-in view for one subagent: its tool-call timeline + a live
// current-activity line. Deliberately compact — this is "what is it doing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MarkerRow } from '@renderer/features/feed/ui/MarkerRow'
import {
taskNotificationStatusKind,
type TaskNotification,
} from '@renderer/features/feed/lib/taskNotification'
} from '@renderer/session-runtime/taskNotification'
import { TextProse } from '@renderer/features/feed/ui/markdown'

/* ---------- Standalone task-notification row ---------- */
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/ui/rows/TaskSubagentRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { memo, useContext, useState } from 'react'
import type { ToolUseBlock } from '@shared/types/transcript'
import {
taskNotificationStatusKind,
} from '@renderer/features/feed/lib/taskNotification'
} from '@renderer/session-runtime/taskNotification'
import { TaskNotificationsContext } from '@renderer/features/feed/context'
import { TextProse } from '@renderer/features/feed/ui/markdown'
import { MarkerRow } from '@renderer/features/feed/ui/MarkerRow'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext, useRef, useState } from 'react'
import type { KeyboardEvent } from 'react'

import type { SemanticLiveTurn } from '@renderer/workspace/workspaceState'
import type { SemanticLiveTurn } from '@renderer/session-runtime/state'

import {
AskUserQuestionConditionContext,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/ui/semantic/BlockRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { CodeBlock } from '@renderer/lib/code/CodeBlock'
import {
parseSemanticTodos,
type SemanticLiveTurn,
} from '@renderer/workspace/workspaceState'
} from '@renderer/session-runtime/state'

import { splitStreamingCodeFence } from '@renderer/features/feed/lib/helpers'
import { extractStreamingWriteInput } from '@renderer/features/feed/lib/streamingWriteInput'
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/ui/semantic/TodoList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { memo } from 'react'

import type { SemanticTodoItem } from '@renderer/workspace/workspaceState'
import type { SemanticTodoItem } from '@renderer/session-runtime/state'

// Inline todo-list rendering for the semantic-streaming TodoWrite
// tool row. Shows the list with status glyphs (☑ done, ◐ in-progress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
semanticRenderUnitPaintsDom,
semanticTurnHasRenderableContent,
} from '@renderer/features/feed/ui/semantic/renderUnits'
import type { SemanticLiveTurn } from '@renderer/workspace/workspaceState'
import type { SemanticLiveTurn } from '@renderer/session-runtime/state'

// Build a turn containing a single collapsible Read tool block whose live
// status is controlled by `status`. A running Read collapses into a
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/ui/semantic/renderUnits.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Entry, ToolResultBlock, ToolUseBlock } from '@shared/types/transcript'
import { asRecord, parseJsonRecord } from '@shared/lib/asRecord'
import type { SemanticLiveTurn } from '@renderer/workspace/workspaceState'
import type { SemanticLiveTurn } from '@renderer/session-runtime/state'

import { classifySemanticToolActivity } from '@renderer/features/feed/lib/helpers'

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/ui/semantic/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SemanticLiveTurn } from '@renderer/workspace/workspaceState'
import type { SemanticLiveTurn } from '@renderer/session-runtime/state'

// Derived render-unit shape used by buildSemanticRenderUnits.
//
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/feed/workIndicatorHints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// visual tests trivial and keeps the component memo-friendly (it only
// re-renders when the hint string changes, not on every block delta).

import type { SemanticLiveBlock, SemanticLiveTurn } from '@renderer/workspace/workspaceState'
import type { SemanticLiveBlock, SemanticLiveTurn } from '@renderer/session-runtime/state'

/** Pull a short, single-line hint for the pending tool call. When the
* tool's parsed input is available (finalised JSON from
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/features/session-preview/previewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
isConversationEntry,
} from '@shared/types/transcript'
import { getRendererProviderCapabilities } from '@providers/registry.renderer.capabilities'
import { indexEntryIntoMaps } from '@renderer/workspace/entries/utils'
import { indexEntryIntoMaps } from '@renderer/session-runtime/entries'

// previewModel — turn a raw JSONL transcript tail into the exact inputs
// the real feed row components consume.
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/rendering/adapter/collectLedgerInput.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { GhostEntry } from 'agent-transcript-parser/ghost'
import type { AgentProviderKind } from '@shared/types/providerKind'
import type { SemanticLiveTurn } from '@renderer/workspace/workspaceState'
import type { SemanticLiveTurn } from '@renderer/session-runtime/state'
import type { GhostPredicateContext } from '@renderer/rendering/model/ghostPredicate'
import type { GhostLedgerCandidate, LedgerInput } from '@renderer/rendering/model/ledger'
import type { OwnershipDecision, RenderCandidate } from '@renderer/rendering/model/types'
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/src/rendering/replay/reconstructSlices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { asRecord } from '@shared/lib/asRecord'
import {
emptySemanticRuntime,
type SemanticRuntimeState,
} from '@renderer/workspace/workspaceState'
import { foldSemanticEvent } from '@renderer/workspace/semantic/foldEvent'
} from '@renderer/session-runtime/state'
import { foldSemanticEvent } from '@renderer/session-runtime/semantic/foldEvent'
import {
reduceStreamPhase,
type StreamPhaseState,
} from '@renderer/workspace/semantic/streamPhaseMachine'
} from '@renderer/session-runtime/semantic/streamPhaseMachine'
import {
ghostsFromSemanticTurn,
reconcileUpstream,
} from '@renderer/workspace/ghosts'
} from '@renderer/session-runtime/ghosts'
import { getRendererProviderCapabilities } from '@providers/registry.renderer.capabilities'
import type { RuntimeLedgerSlices } from '@renderer/rendering/adapter/collectLedgerInput'

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/rendering/replay/recordedSession.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AgentProviderKind } from '@shared/types/providerKind'
import { isAgentProviderKind } from '@shared/types/providerKind'
import type { FeedRenderItem } from '@renderer/features/feed/model/renderModel'
import type { SessionRuntime } from '@renderer/workspace/workspaceState'
import type { SessionRuntime } from '@renderer/session-runtime/state'
import {
createLedgerInputAdapter,
type RuntimeLedgerSlices,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/rendering/view/ledgerFeedItems.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
emptyRuntime,
type SemanticLiveTurn,
type SessionRuntime,
} from '@renderer/workspace/workspaceState'
} from '@renderer/session-runtime/state'
import {
createLedgerInputAdapter,
type RuntimeLedgerSlices,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/rendering/view/ledgerFeedItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
SemanticLiveTurn,
SessionRuntime,
StreamPhase,
} from '@renderer/workspace/workspaceState'
} from '@renderer/session-runtime/state'
import type { AgentProviderKind } from '@shared/types/providerKind'
import type { RenderLedger, RenderRow } from '@renderer/rendering/model/types'
import { groupSemanticActivity } from '@renderer/features/feed/ui/semantic/renderUnits'
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/rendering/view/useLedgerFeedItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMemo, useRef } from 'react'

import type { AgentProviderKind } from '@shared/types/providerKind'
import type { FeedRenderItem } from '@renderer/features/feed/model/renderModel'
import type { SessionRuntime } from '@renderer/workspace/workspaceState'
import type { SessionRuntime } from '@renderer/session-runtime/state'
import {
createLedgerInputAdapter,
type RuntimeLedgerSlices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'
import { applyClaudeQueueDequeue } from '@renderer/workspace/claudeQueueReconstruction'
import type { QueuedMessage } from '@renderer/workspace/workspaceState'
import { applyClaudeQueueDequeue } from '@renderer/session-runtime/claudeQueueReconstruction'
import type { QueuedMessage } from '@renderer/session-runtime/state'

// Regression coverage for the 2026-07-07 soak bundles
// debug-bundles/manual/2026-07-07T13-17-20-472-5b19529f ("completed agents
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseTaskNotification } from '@renderer/features/feed/lib/taskNotification'
import type { QueuedMessage } from '@renderer/workspace/workspaceState'
import { parseTaskNotification } from '@renderer/session-runtime/taskNotification'
import type { QueuedMessage } from '@renderer/session-runtime/state'

// Reconstruction of Claude's PROVIDER-OWNED message queue from the
// `queue-operation` transcript records our renderer replays live in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'

import { indexEntryIntoMaps } from '@renderer/workspace/entries/utils'
import { indexEntryIntoMaps } from '@renderer/session-runtime/entries'
import type {
Entry,
ToolResultBlock,
Expand Down
Loading