refactor(persistence): import concrete owners and remove forwarding entry (#37081)

This commit is contained in:
Neil
2026-11-01 09:48:22 -08:00
committed by GitHub
parent 5ac1231508
commit 5e40d652b2
335 changed files with 365 additions and 355 deletions
@@ -1,6 +1,6 @@
import { afterEach, beforeEach, vi, type Mock } from 'vitest'
import type * as WorktreeLogic from '../ipc/worktree-logic'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { Repo } from '../../shared/repo-types'
import { resolveWorktreeAddBaseRef } from '../../shared/worktree/base-ref'
@@ -41,7 +41,7 @@ describe('active-view persistence boundary', () => {
it('persists a view switch without changing the global durable snapshot', async () => {
vi.useFakeTimers()
vi.resetModules()
const { Store } = await import('./persistence')
const { Store } = await import('./persistence/loading-store/store')
const dataFile = join(testState.dir, 'orca-data.json')
const store = createSqliteTestStore(Store, { dataFile })
store.flush()
+1 -1
View File
@@ -1,5 +1,5 @@
import type { CodexRuntimeHomeService } from './codex-accounts/runtime-home-service'
import type { Store } from './persistence'
import type { Store } from './persistence/loading-store/store'
const AUTH_PRESERVATION_TIMEOUT_MS = 2_000
@@ -6,7 +6,7 @@ import { rememberBranchRenameFailureOutput } from './branch-rename-failure-outpu
import { renameWorktreeFolderOnFirstWork } from './first-work-folder-rename'
import { moveWorktree } from '../git/worktree'
import { isWslMoveFolderWorkspaceBlocked } from '../persistence/moving-wsl-projects/wsl-move-background-backoff'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { RuntimeStore } from '../runtime/runtime-store-contract'
import type { OrcaRuntimeService } from '../runtime/orca-runtime'
import { resolveWorktreeMetaOwner } from '../persistence/host-qualified-worktree-meta'
@@ -7,7 +7,7 @@ import type { SshTarget } from '../../shared/ssh-types'
import type { Automation } from '../../shared/automations-types'
import { AUTOMATION_ORPHAN_ISSUES } from '../../shared/automation-list-scope'
import { removeTreeSync } from '../../shared/windows-transient-lock-removal'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { resolveAutomationRunTarget } from './run-target-resolution'
import { AutomationService } from './service'
import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness'
@@ -7,7 +7,7 @@ import type {
AutomationPrecheckResult
} from '../../shared/automations-types'
import { getRepoExecutionHostId } from '../../shared/execution-host'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { AutomationRunWriter } from './automation-run-writer'
import type { HeadlessAutomationDispatcher } from './headless-dispatch'
import type { HeadlessAutomationDispatchContext } from './headless-dispatch-runner'
@@ -109,7 +109,8 @@ async function createStore() {
}
vi.resetModules()
installFakeAppEnvironment({ getPath: () => testState.dir })
const { Store, initDataPath } = await import('../persistence')
const { Store } = await import('../persistence/loading-store/store')
const { initDataPath } = await import('../persistence/loading-store/user-data-path')
initDataPath()
return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') })
}
@@ -1,7 +1,7 @@
import { describe, expect, it, vi } from 'vitest'
import { createAutomationRunWriter } from './automation-run-writer'
import { buildProfileStateCutoverFixture } from '../persistence/profile-state-cutover-fixture'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
const SSH_SELECTOR = { kind: 'ssh', targetId: 'ssh-1' } as const
@@ -1,4 +1,4 @@
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { PublishAutomationsChanged } from '../../shared/runtime-client-events'
import type { AutomationDispatchResult, AutomationRun } from '../../shared/automations-types'
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os'
import type { Repo } from '../../shared/repo-types'
import type { Automation } from '../../shared/automations-types'
import { removeTreeSync } from '../../shared/windows-transient-lock-removal'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
closeTestStores,
createStore,
@@ -122,7 +122,8 @@ async function createStore() {
}
vi.resetModules()
installFakeAppEnvironment({ getPath: () => testState.dir })
const { Store, initDataPath } = await import('../persistence')
const { Store } = await import('../persistence/loading-store/store')
const { initDataPath } = await import('../persistence/loading-store/user-data-path')
initDataPath()
return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') })
}
@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from 'vitest'
import { AutomationService } from './service'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
createWorkerMaintenanceFixture,
maintenanceBarrier
@@ -122,7 +122,8 @@ async function createStore(
}
vi.resetModules()
installFakeAppEnvironment({ getPath: () => testState.dir })
const { Store, initDataPath } = await import('../persistence')
const { Store } = await import('../persistence/loading-store/store')
const { initDataPath } = await import('../persistence/loading-store/user-data-path')
initDataPath()
return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') })
}
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os'
import type { Repo } from '../../shared/repo-types'
import type { Automation } from '../../shared/automations-types'
import { removeTreeSync } from '../../shared/windows-transient-lock-removal'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness'
import type * as UncGate from '../wsl/wsl-unc-access-gate'
import { AutomationService } from './service'
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os'
import type { Repo } from '../../shared/repo-types'
import type { Automation } from '../../shared/automations-types'
import { removeTreeSync } from '../../shared/windows-transient-lock-removal'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness'
import { wslMoveCutoverFixture as cutover } from '../persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture'
import { seedWslMoveCutover } from '../persistence/__fixtures__/wsl-mover/wsl-move-journal-seeding'
+1 -1
View File
@@ -1,6 +1,6 @@
// Skip coalescing requires a fixed, byte-identical sentence for each refusal reason.
import type { WebContents } from 'electron'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type {
Automation,
AutomationDispatchRequest,
@@ -1,6 +1,6 @@
import type { AutomationDispatchResult, AutomationRun } from '../../shared/automations-types'
import { automationRunRecency } from '../../shared/automation-session-reuse'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { runOwnHandle } from './headless-automation-agent-launch'
import {
AGENT_HOOKS_REVIEW_BLOCKED_ERROR,
@@ -1,6 +1,6 @@
import { getAppEnvironment } from '../../shared/app-environment'
import type { Automation } from '../../shared/automations-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { listOrcadMigrationCutoverChainForTarget } from '../ssh/orcad-migration-cutover-journal'
export const ORCAD_FENCED_AUTOMATION = "This automation now runs on its SSH host's Orca server."
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { Automation } from '../../shared/automations-types'
import type { WorkspaceRunContext } from '../../shared/task-source-context'
import type { ProjectHostSetup } from '../../shared/project-types'
@@ -1,6 +1,6 @@
import { findAutomationRepo } from '../../shared/automation-repo-target'
import { findProjectHostSetup } from '../../shared/project-host-setup-target'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { Automation } from '../../shared/automations-types'
import { getAutomationLegacyRepoId } from '../../shared/automation-run-identity'
import {
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Automation, AutomationRun, AutomationRunUsage } from '../../shared/automations-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { AutomationRunWriter } from './automation-run-writer'
import type { ClaudeUsageStore } from '../claude-usage/store'
import type { CodexUsageStore } from '../codex-usage/store'
@@ -3,7 +3,7 @@ import type * as AgentLauncher from './automation-chat-agent-launch'
import type { HeadlessAutomationDispatcher } from './headless-dispatch'
import type { AutomationRunTerminalObserver } from './run-completion-watcher'
import type { OrcaRuntimeService } from '../runtime/orca-runtime'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { buildProfileStateCutoverFixture } from '../persistence/profile-state-cutover-fixture'
import { automationRunOperationId } from './automation-run-operation'
@@ -5,7 +5,7 @@ import { launchAutomationChatAgent } from './automation-chat-agent-launch'
import { tuiAgentDisplayName } from '../../shared/tui-agent-display-names'
import type { ClaudeUsageStore } from '../claude-usage/store'
import type { CodexUsageStore } from '../codex-usage/store'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { OrcaRuntimeService } from '../runtime/orca-runtime'
import { AutomationService } from './service'
import { createHeadlessRunTerminalRetention } from './headless-run-terminal-retention'
@@ -44,7 +44,8 @@ async function createStore() {
}
vi.resetModules()
installFakeAppEnvironment({ getPath: () => testState.dir })
const { Store, initDataPath } = await import('../persistence')
const { Store } = await import('../persistence/loading-store/store')
const { initDataPath } = await import('../persistence/loading-store/user-data-path')
initDataPath()
return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') })
}
+1 -1
View File
@@ -5,7 +5,7 @@ import {
type AutomationRendererChannel
} from './automation-dispatch-request'
export type { AutomationRendererChannel } from './automation-dispatch-request'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
isFinalAutomationRunStatus,
type Automation,
+1 -1
View File
@@ -5,7 +5,7 @@ import { installServeSupervisorDisconnectQuit } from './serve-update-handoff'
const { quit } = vi.hoisted(() => ({ quit: vi.fn() }))
vi.mock('./startup/process-quit-request', () => ({ quitProcess: quit }))
vi.mock('./persistence', () => ({
vi.mock('./persistence/loading-store/user-data-path', () => ({
getCanonicalUserDataPath: () => {
throw new Error('No profile access for sidecar owner')
}
@@ -152,9 +152,6 @@ export function installModuleMocks(
userAgent: CLEAN_USER_AGENT
})
}))
vi.doMock('../../persistence', () => ({
getCanonicalUserDataPath: () => USER_DATA
}))
vi.doMock('../../persistence/loading-store/user-data-path', () => ({
getCanonicalUserDataPath: () => USER_DATA
}))
@@ -1,5 +1,5 @@
import { webContents } from 'electron'
import type { Store } from '../../persistence'
import type { Store } from '../../persistence/loading-store/store'
import type { BrowserWorkspace } from '../../../shared/browser-workspace-types'
import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types'
import { browserManager } from '../browser-manager'
@@ -2,7 +2,7 @@ import { join } from 'node:path'
import { getAppEnvironment } from '../../shared/app-environment'
import { toWindowsWslPath } from '../../shared/wsl-paths'
import { resolveLocalAccountRuntimeTarget } from '../../shared/local-account-runtime'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { isWslDistroRunning } from '../wsl-background-distro-gate'
import { getDefaultWslDistro, getWslHome } from '../wsl'
import { ClaudeProfileRouter } from './claude-profile-router'
+1 -1
View File
@@ -12,7 +12,7 @@ import type {
ClaudeUsageSummary
} from '../../shared/claude-usage-types'
import type { AutomationRunUsage } from '../../shared/automations-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { ClaudeUsagePersistedState } from './types'
import {
scanClaudeUsageFilesViaWorker,
@@ -10,7 +10,7 @@ import type {
CodexManagedAccount,
CodexRateLimitAccountsState
} from '../../shared/managed-account-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { RateLimitService } from '../rate-limits/service'
import type { CodexRuntimeHomeService } from './runtime-home-service'
import type { ResolvedCodexIdentity } from './codex-account-identity'
@@ -4,7 +4,7 @@ import type {
CodexSystemDefaultIdentity
} from '../../shared/managed-account-types'
import { parseWslUncPath } from '../../shared/wsl-paths'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { RateLimitService } from '../rate-limits/service'
import type { CodexRuntimeHomeService } from './runtime-home-service'
import type { CodexConfigMirror } from './codex-config-mirror'
@@ -7,7 +7,7 @@ import {
syncSystemConfigIntoManagedCodexHome
} from '../codex/codex-config-mirror'
import { readCodexTopLevelModelProvider } from '../codex/codex-model-provider-config'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { toWindowsWslPath } from '../wsl'
import { wasWslDistroLastSeenRunningSettled } from '../wsl-background-distro-gate'
import { WSL_UNC_RUNNING_LEASE_MS } from '../wsl/wsl-unc-access-gate'
@@ -13,7 +13,7 @@ import type {
RateLimitState,
RateLimitRuntimeTarget
} from '../../shared/rate-limit-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { RateLimitService } from '../rate-limits/service'
import type { CodexRuntimeHomeService } from './runtime-home-service'
import { getSelectedCodexAccountIdForTarget } from './runtime-selection'
@@ -8,7 +8,7 @@ import type {
CodexRateLimitResetOutcome,
RateLimitRuntimeTarget
} from '../../shared/rate-limit-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { profileStateWriterFailureOutcome } from '../persistence/profile-state/profile-state-writer-errors'
export type CodexResetCreditAttempt = {
@@ -7,7 +7,7 @@ import {
type CodexResetCreditExpectedScope
} from '../../shared/codex-reset-credit-scope'
import type { RateLimitState, RateLimitRuntimeTarget } from '../../shared/rate-limit-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { RateLimitService } from '../rate-limits/service'
import type { CodexResetCreditRejectedBeforeProviderReason } from './codex-account-service-types'
import type { CodexManagedHomePath } from './codex-managed-home-path'
@@ -1,5 +1,5 @@
import type { CodexManagedAccount } from '../../shared/managed-account-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { CodexCredentialAbsenceGrace } from './codex-credential-absence-grace'
import type {
CodexMirroredHomeStatus,
@@ -1,4 +1,4 @@
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { CodexRuntimeHomeAuthSync } from './runtime-home-service-auth-sync'
export type {
+1 -1
View File
@@ -10,7 +10,7 @@ import type {
import type { CodexRateLimitResetResult } from '../../shared/rate-limit-types'
import type { CodexResetCreditExpectedScope } from '../../shared/codex-reset-credit-scope'
import type { CodexRuntimeHomeService } from './runtime-home-service'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { RateLimitService } from '../rate-limits/service'
import { admitSelfInitiatedTreeKill } from '../own-chromium-tree-kill-guard'
import type { CodexAccountSelectionTarget } from './runtime-selection'
+1 -1
View File
@@ -12,7 +12,7 @@ import type {
CodexUsageSummary
} from '../../shared/codex-usage-types'
import type { AutomationRunUsage } from '../../shared/automations-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { CodexUsagePersistedState } from './types'
import type { AutomationUsageLookupInput } from './codex-automation-run-attribution'
import { CODEX_USAGE_SCHEMA_VERSION, codexUsageProvider } from './codex-usage-provider'
+1 -1
View File
@@ -1,5 +1,5 @@
import { app } from 'electron'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { listEphemeralVmRuntimes } from '../../shared/ephemeral-vm-runtime-store'
import { suspendEphemeralVmRuntime } from './runtime-service'
import { disconnectRuntimeOwnedSshTarget } from './runtime-ssh'
+1 -1
View File
@@ -9,7 +9,7 @@ import {
LOCAL_EXECUTION_HOST_ID,
parseExecutionHostId
} from '../shared/execution-host'
import type { Store } from './persistence'
import type { Store } from './persistence/loading-store/store'
import { isFolderRepo } from '../shared/repo-kind'
import { normalizeRuntimePathForComparison } from '../shared/cross-platform-path'
import { getGitRepoRootAsync, isGitRepoAsync } from './git/repo'
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { GlobalSettings } from '../../shared/global-settings-types'
import { afterEach, describe, expect, it, vi } from 'vitest'
+1 -1
View File
@@ -1,7 +1,7 @@
import { readFile, stat } from 'node:fs/promises'
import { platform } from 'node:os'
import type { GhosttyImportPreview, GlobalSettings } from '../../shared/global-settings-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { findGhosttyConfigPaths } from './discovery'
import { parseGhosttyConfig } from './parser'
import { mapGhosttyToOrca } from './mapper'
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { GlobalSettings } from '../../shared/global-settings-types'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { PRRefreshOutcome } from '../../shared/github/pull-request-refresh-types'
import type { Repo } from '../../shared/repo-types'
import type { GitHubRepoContext, LocalGitExecOptions } from './github-repository-identity'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { __resetHostedReviewBranchCacheForTests } from '../source-control/hosted-review-branch-cache'
const mocks = vi.hoisted(() => ({
+1 -1
View File
@@ -13,7 +13,7 @@ import { setWindowMaterialSuppressed } from '../window/window-material-suppressi
import { isTrustedUIRenderer } from './ui'
import { prepareWindowsAdministratorRestart } from '../windows/windows-administrator-restart'
import { quitProcess } from '../startup/process-quit-request'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { getDevInstanceIdentity } from '../startup/dev-instance-identity'
import { isPwshAvailableAsync } from '../pwsh'
import { isWslAvailableAsync, listWslDistrosAsync } from '../wsl'
@@ -5,7 +5,7 @@ import { AUTOMATION_OWNER_CONFLICT_CODES } from '../../shared/automation-owner-c
import type { AutomationOwnerRef } from '../../shared/automation-owner-ref'
import type { SshTarget } from '../../shared/ssh-types'
import type { AutomationService } from '../automations/service'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type * as Fs from 'node:fs'
import { SSH_HOST_NOT_SERVED_MESSAGE } from '../providers/ssh-host-not-served-error'
import { ExternalAutomationManagerCache } from '../automations/external-automation-manager-cache'
+1 -1
View File
@@ -1,7 +1,7 @@
import { parseExecutionHostId } from '../../shared/execution-host'
import { hostWorktreeTarget } from '../../shared/worktree/host-qualified-identity'
import { ipcMain } from 'electron'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { AutomationService } from '../automations/service'
import type {
AutomationDispatchResult,
@@ -49,7 +49,9 @@ vi.mock('../cli/wsl-cli-registration-operation', () => ({
runSerializedWslCliRegistrationOperation: vi.fn()
}))
vi.mock('../persistence', () => ({ getCanonicalUserDataPath: vi.fn() }))
vi.mock('../persistence/loading-store/user-data-path', () => ({
getCanonicalUserDataPath: vi.fn()
}))
vi.mock('../startup/hydrate-shell-path', () => ({
hydrateShellPath: mocks.hydrateShellPath,
+3 -1
View File
@@ -29,7 +29,9 @@ vi.mock('../cli/wsl-cli-registration-registry', () => ({
recordWslCliRegistrationRemoved: recordRemovedMock,
forgetWslCliRegistration: forgetMock
}))
vi.mock('../persistence', () => ({ getCanonicalUserDataPath: () => '/canonical-user-data' }))
vi.mock('../persistence/loading-store/user-data-path', () => ({
getCanonicalUserDataPath: () => '/canonical-user-data'
}))
vi.mock('../startup/hydrate-shell-path', () => ({
hydrateShellPath: vi.fn(async () => ({ ok: false })),
mergePathSegments: vi.fn()
+1 -1
View File
@@ -16,7 +16,7 @@ import {
WslCliUnreachableError
} from '../cli/wsl-cli-status'
import { runSerializedWslCliRegistrationOperation } from '../cli/wsl-cli-registration-operation'
import { getCanonicalUserDataPath } from '../persistence'
import { getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path'
import { hydrateShellPath, mergePathSegments } from '../startup/hydrate-shell-path'
import { getDefaultWslDistro } from '../wsl'
import { blockedWslDistroForExec, runAsWslExecUserAct } from '../wsl/wsl-background-exec-gate'
@@ -3,7 +3,7 @@ import { resolve } from 'node:path'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type * as RepoWorktrees from '../repo-worktrees'
import { listRepoWorktreeGraph } from '../repo-worktrees'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { Repo } from '../../shared/repo-types'
import {
__resetCreatedWorktreeRootsForTests,
+1 -1
View File
@@ -1,5 +1,5 @@
import { app, ipcMain } from 'electron'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { KeybindingService } from '../keybindings/keybinding-service'
import type { DashboardSnapshot } from '../../shared/dashboard-snapshot'
import {
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { loadHooks } from '../hooks'
import type { EphemeralVmRecipeDoctorResult } from '../../shared/ephemeral-vm-recipes'
import { listEphemeralVmRuntimes } from '../../shared/ephemeral-vm-runtime-store'
@@ -1,6 +1,6 @@
import type { ChildProcess } from 'node:child_process'
import type { FileHandle } from 'node:fs/promises'
import type { Store } from '../../persistence'
import type { Store } from '../../persistence/loading-store/store'
import type { CommitMessageAgentEnvironmentResolvers } from '../../text-generation/commit-message-agent-environment'
import type { SenderScopedRequestCancellations } from '../sender-scoped-request-cancellation'
import { cleanupLocalTransferPath } from './filesystem-download-promotion'
@@ -1,6 +1,6 @@
import { resolve } from 'node:path'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { Store } from '../../persistence'
import type { Store } from '../../persistence/loading-store/store'
import type { Repo } from '../../../shared/repo-types'
const mocks = vi.hoisted(() => ({ graph: vi.fn(), gitOptions: vi.fn() }))
@@ -1,5 +1,5 @@
import type { Repo } from '../../../shared/repo-types'
import type { Store } from '../../persistence'
import type { Store } from '../../persistence/loading-store/store'
import {
getLocalProjectWorktreeGitOptions,
type LocalProjectWorktreeGitOptions
@@ -1,4 +1,4 @@
import type { Store } from '../../persistence'
import type { Store } from '../../persistence/loading-store/store'
import type { LocalProjectWorktreeGitOptions } from '../../project-runtime-git-options'
import { resolveRegisteredWorktreePath } from '../registered-worktree-roots-cache'
import { getLocalGitOptionsForRegisteredWorktree } from '../local-worktree-runtime-options'
+1 -1
View File
@@ -4,7 +4,7 @@ import path from 'node:path'
import { getAppEnvironment } from '../../shared/app-environment'
import type { GlobalSettings } from '../../shared/global-settings-types'
import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { resolveFloatingWorkspacePath } from '../persistence/restoring-sessions/floating-workspace-normalization'
type FloatingTerminalSettings = Pick<GlobalSettings, 'floatingTerminalTrustedCwds'>
@@ -2,7 +2,7 @@ import { join } from 'node:path'
import type { BrowserWindow } from 'electron'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type { Repo } from '../../shared/repo-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
const fake = vi.hoisted(() => ({
stat: vi.fn(),
+1 -1
View File
@@ -2,7 +2,7 @@ import { stat } from 'node:fs/promises'
import { join } from 'node:path'
import type { BrowserWindow } from 'electron'
import type { Repo } from '../../shared/repo-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host'
import { isFolderRepo } from '../../shared/repo-kind'
import { findExtraFolderWorkspaceIds } from '../folder-workspace-meta-presence'
@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
const mocks = vi.hoisted(() => ({
gitExec: vi.fn(),
@@ -1,4 +1,4 @@
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { resolveGitStatusUpstreamRef } from '../git/status-upstream-ref'
import { gitExecFileAsync } from '../git/runner'
import { abortSignalWithTimeout } from '../lib/abort-signal-with-timeout'
+1 -1
View File
@@ -8,7 +8,7 @@ import {
validateGhAccountBinding
} from '../github/gh-account-binding-inventory'
import { getRateLimit } from '../github/rate-limit'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { getCohortAtEmit } from '../telemetry/cohort-classifier'
import { track } from '../telemetry/client'
import { assertRegisteredGitHubRepo, getGitHubLocalGitOptionArgs } from './github-repo-routing'
@@ -3,7 +3,7 @@ import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types'
import type { GitHubIssueUpdate } from '../../shared/issue-mutation-types'
import type { TaskSourceContext } from '../../shared/task-source-context'
import { addIssueComment, listAssignableUsers, listLabels, updateIssue } from '../github/client'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
assertRegisteredGitHubRepo,
getGitHubLocalGitOptionArgs,
+1 -1
View File
@@ -11,7 +11,7 @@ import {
updatePRState,
updatePRTitle
} from '../github/client'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
assertRegisteredGitHubRepo,
getGitHubLocalGitOptionArgs,
+1 -1
View File
@@ -11,7 +11,7 @@ import {
resolveReviewThread,
setPRCommentReaction
} from '../github/client'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
assertRegisteredGitHubRepo,
getGitHubLocalGitOptionArgs,
+1 -1
View File
@@ -16,7 +16,7 @@ import {
setPRRefreshOutcomeObserver,
setPRRefreshRegistrationCheck
} from '../github/pr-refresh-coordinator'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { StatsCollector } from '../stats/collector'
import {
applyRegisteredRepoToPRRefreshCandidate,
+1 -1
View File
@@ -2,7 +2,7 @@ import { ipcMain } from 'electron'
import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types'
import type { TaskSourceContext } from '../../shared/task-source-context'
import { addPRReviewComment, addPRReviewCommentReply, setPRFileViewed } from '../github/client'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
assertRegisteredGitHubRepo,
getGitHubLocalGitOptionArgs,
@@ -1,7 +1,7 @@
import { describe, expect, it, vi } from 'vitest'
import type { GitHubPRRefreshCandidate } from '../../shared/github/pull-request-refresh-types'
import type { Repo } from '../../shared/repo-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
vi.mock('../project-runtime-git-options', () => ({
getLocalProjectGhExecOptions: () => ({})
+1 -1
View File
@@ -10,7 +10,7 @@ import {
notePRRefreshValidationDenial,
type PRRefreshValidationDenialReason
} from '../github/pr-refresh-validation-backoff'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
getLocalProjectGhExecOptions,
type LocalProjectGhExecOptions
+1 -1
View File
@@ -12,7 +12,7 @@ import {
listWorkItems
} from '../github/client'
import { getPRFileContents, getWorkItemDetails } from '../github/work-item-details'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { dispatchWorkItem, type WorkItemArgs } from './github-work-item-args'
import {
assertRegisteredGitHubRepo,
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { StatsCollector } from '../stats/collector'
import { registerGitHubAccountHandlers } from './github-account-handlers'
import { registerGitHubIssueMutationHandlers } from './github-issue-mutation-handlers'
+1 -1
View File
@@ -1,6 +1,6 @@
import { ipcMain } from 'electron'
import { toGitLabJobLogExcerptResult } from '../../shared/gitlab-job-log-excerpt'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { getJobTrace, retryJob } from '../gitlab/client'
import type { ProjectRef } from '../gitlab/gl-utils'
import type { GitLabRepoSelectorArgs } from './gitlab-repo-access'
+1 -1
View File
@@ -1,7 +1,7 @@
import { ipcMain } from 'electron'
import type { GitLabIssueUpdate, GitLabWorkItem } from '../../shared/gitlab-types'
import type { TaskSourceContext } from '../../shared/task-source-context'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
normalizeGitLabIssueAssignee,
normalizeGitLabIssueListState,
@@ -1,7 +1,7 @@
import { ipcMain } from 'electron'
import type { GitLabMRInlineCommentInput, GitLabMRUpdate } from '../../shared/gitlab-types'
import type { TaskSourceContext } from '../../shared/task-source-context'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
addMRComment,
addMRInlineComment,
@@ -1,6 +1,6 @@
import { ipcMain } from 'electron'
import type { TaskSourceContext } from '../../shared/task-source-context'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
normalizeGitLabMRListState,
normalizeGitLabPositiveInteger,
+1 -1
View File
@@ -2,7 +2,7 @@ import { resolve } from 'node:path'
import type { Repo } from '../../shared/repo-types'
import { getRepoExecutionHostId } from '../../shared/execution-host'
import type { TaskSourceContext } from '../../shared/task-source-context'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { LocalGitExecOptions } from '../gitlab/gitlab-project-ref-resolution'
import { getLocalProjectWorktreeGitOptions } from '../project-runtime-git-options'
import type { HostedReviewExecutionOptions } from '../source-control/hosted-review-git-options'
+1 -1
View File
@@ -1,6 +1,6 @@
import { ipcMain } from 'electron'
import type { TaskSourceContext } from '../../shared/task-source-context'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
normalizeGitLabMRListState,
normalizeGitLabPositiveInteger,
+1 -1
View File
@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { Repo } from '../../shared/repo-types'
import { toSshExecutionHostId } from '../../shared/execution-host'
+1 -1
View File
@@ -1,5 +1,5 @@
import { ipcMain } from 'electron'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
diagnoseAuth,
getAuthenticatedViewer,
+1 -1
View File
@@ -7,7 +7,7 @@ import type {
HostedReviewForBranchArgs
} from '../../shared/hosted-review'
import type { Repo } from '../../shared/repo-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { StatsCollector } from '../stats/collector'
import {
createHostedReview,
@@ -1,7 +1,7 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import type * as NodeFs from 'node:fs'
import type * as NodePath from 'node:path'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
// Use Windows paths on every host to prove UNC credential-leak rejection happens before filesystem access.
vi.mock('node:path', async () => {
@@ -3,7 +3,7 @@ import { homedir, tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { installFakeAppEnvironment } from '../../../config/scripts/vitest-host-ports-setup'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type * as RepoWorktrees from '../repo-worktrees'
import { resolveAuthorizedPath } from './filesystem/filesystem-auth'
import {
+1 -1
View File
@@ -19,7 +19,7 @@ import {
getActiveLocalLogTailWatcherCount,
registerLocalLogTailHandlers
} from './local-log-tail'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: path resolution is mocked, so the store is never read.
const NO_STORE = {} as Store
+1 -1
View File
@@ -31,7 +31,7 @@ import {
getActiveLocalLogTailWatcherCount,
registerLocalLogTailHandlers
} from './local-log-tail'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: path resolution is mocked, so the store is never read.
const NO_STORE = {} as Store
+1 -1
View File
@@ -7,7 +7,7 @@ import type {
LocalLogTailWatchArgs
} from '../../shared/local-log-tail-types'
import { readLocalLogTailRange } from '../ai-vault/local-log-tail-reader'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { resolveUserNamedRegularFile } from './local-file-access-resolution'
import { abortWhenRendererGone } from './renderer-lifetime-abort'
+1 -1
View File
@@ -6,7 +6,7 @@ import {
type LocalhostWorktreeLabelResult,
type LocalhostWorktreeLabelRoute
} from '../../shared/localhost-worktree-labels'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { localhostWorktreeLabelProxy } from '../localhost-worktree-label-proxy'
import {
getStoreWorkspacePortProbes,
+1 -1
View File
@@ -1,6 +1,6 @@
import { BrowserWindow, ipcMain } from 'electron'
import type { MemorySnapshot } from '../../shared/process-stats-types'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { collectMemorySnapshot } from '../memory/collector'
import {
+1 -1
View File
@@ -3,7 +3,7 @@ import { mkdir, mkdtemp, realpath, rm, symlink, writeFile } from 'node:fs/promis
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type * as RepoWorktrees from '../repo-worktrees'
import { invalidateAuthorizedRootsCache } from './registered-worktree-roots-cache'
+1 -1
View File
@@ -33,7 +33,7 @@ vi.mock('node:fs/promises', async (importOriginal) => {
})
import { registerNotebookHandlers } from './notebook'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type * as FileAccessResolution from './local-file-access-resolution'
function fakeKernel() {
+1 -1
View File
@@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto'
import { realpath } from 'node:fs/promises'
import { dirname } from 'node:path'
import { ipcMain, type WebContents } from 'electron'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import {
resolveDesktopAuthorizedPath,
resolveUserNamedRegularFile
+1 -1
View File
@@ -1,7 +1,7 @@
import { ipcMain } from 'electron'
import { readFile, stat } from 'node:fs/promises'
import { extname, normalize } from 'node:path'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { NotificationSoundDataResult } from '../../shared/notification-settings-types'
import {
getSelectedNotificationSoundPath,
+1 -1
View File
@@ -1,6 +1,6 @@
import { BrowserWindow, Notification, ipcMain, powerMonitor } from 'electron'
import { readDesktopAwayState } from '../notifications/desktop-away-state'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type {
NotificationDeliveryProbeResult,
NotificationDismissResult,
+2 -1
View File
@@ -1,5 +1,6 @@
import { ipcMain } from 'electron'
import { sanitizeOnboardingUpdate, type Store } from '../persistence'
import { sanitizeOnboardingUpdate } from '../persistence/applying-settings/onboarding-normalization'
import type { Store } from '../persistence/loading-store/store'
import type { OnboardingState } from '../../shared/onboarding-state-types'
import type { ChatUiLaunchTipVariant } from '../../shared/native-chat/chat-ui-launch-tip-audience'
import { isChatUiLaunchTipDeferredForConsent } from '../telemetry/chat-ui-launch-tip-cohort'
+1 -1
View File
@@ -1,5 +1,5 @@
import { ipcMain, type WebContents } from 'electron'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { relaunchApp, type AppRelaunchReason } from '../app-relaunch'
import { quitProcess } from '../startup/process-quit-request'
import type {
+1 -1
View File
@@ -1,7 +1,7 @@
import { ipcMain, type IpcMainInvokeEvent } from 'electron'
import { z } from 'zod'
import type { PluginFrameEntry } from '../../shared/plugins/frames/plugin-frame-bridge'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { PluginService } from '../plugins/plugin-service'
import { bindPluginPanelOwnerLifecycle } from '../plugins/panels/plugin-panel-owner-lifecycle'
import { preparePluginFrameGuest } from '../plugins/panels/plugin-frame-guest-sessions'
@@ -6,7 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { z } from 'zod'
import { pluginManifestSchema } from '../../shared/plugins/manifest/plugin-manifest'
import { panelSessionTokenSchema } from '../../shared/plugins/frames/plugin-frame-bridge'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import { PluginContentVerifier } from '../plugins/plugin-content-integrity'
import type { ValidDiscoveredPlugin } from '../plugins/plugin-discovery'
import { PluginPanelController } from '../plugins/panels/plugin-panel-controller'
+1 -1
View File
@@ -1,6 +1,6 @@
import { ipcMain } from 'electron'
import { z } from 'zod'
import type { Store } from '../persistence'
import type { Store } from '../persistence/loading-store/store'
import type { PluginHostCallOutcome } from '../../shared/plugins/frames/plugin-protocol'
import { getUserPluginsDir, getPluginsDataDir } from '../plugins/plugin-discovery'
import {

Some files were not shown because too many files have changed in this diff Show More