mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
refactor: move atomic publication to its filesystem owner
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
1 src/main/codex-accounts/codex-login-auth-snapshot.ts
|
||||
5 src/main/codex-accounts/codex-managed-home-lifecycle.ts
|
||||
6 src/main/codex-accounts/codex-managed-home-path.ts
|
||||
17 src/main/codex-accounts/fs-utils.ts
|
||||
17 src/main/filesystem/atomic-file-publication.ts
|
||||
1 src/main/codex-accounts/guest-codex-account-homes.ts
|
||||
6 src/main/codex-accounts/host-codex-managed-home-ownership.ts
|
||||
2 src/main/codex-accounts/legacy-shared-auth-migration.ts
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
1 src/main/browser/network/egress/browser-route-egress-electron-launch.ts
|
||||
1 src/main/browser/routing/partitions/browser-route-partition-binding-store.ts
|
||||
1 src/main/claude-accounts/runtime-auth-service.ts
|
||||
3 src/main/codex-accounts/fs-utils.ts
|
||||
3 src/main/filesystem/atomic-file-publication.ts
|
||||
2 src/main/codex-accounts/legacy-wsl-runtime-auth-drain-recovery-script-harness.ts
|
||||
2 src/main/codex-accounts/legacy-wsl-runtime-auth-drain-script-harness.ts
|
||||
1 src/main/codex-accounts/runtime-home-service-home-routing.ts
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { mkdirSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { readAgentStateJsonFileSync } from '../../codex/configuration/agent-state-file-reader'
|
||||
import { writeFileAtomically } from '../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../filesystem/atomic-file-publication'
|
||||
import { getOrcaUserDataPath } from '../../codex/configuration/homes/codex-home-paths'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
import { existsSync, mkdirSync, readFileSync, realpathSync } from 'node:fs'
|
||||
import { dirname, join, resolve } from 'node:path'
|
||||
import { writeFileAtomically } from '../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../filesystem/atomic-file-publication'
|
||||
import { upsertOrcaCreatedProjectTrustLevel } from '../../codex/trust/toml/config-toml-trust'
|
||||
import { runExclusivelyForCodexTrustConfig } from '../../codex/trust/toml/codex-trust-config-mutation-queue'
|
||||
import { recordOrcaCreatedAntigravityTrust } from './antigravity-workspace-trust-ownership'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { writeFileAtomically } from '../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../filesystem/atomic-file-publication'
|
||||
import { createAgentTrustOwnershipLedger } from './agent-trust-ownership-ledger'
|
||||
|
||||
// Why resolve, not realpath: removal runs after the worktree directory is gone.
|
||||
|
||||
@@ -49,9 +49,7 @@ vi.mock('../sessions/profiles/browser-session-registry', () => ({
|
||||
clearPendingCookieImport: clearPendingCookieImportMock
|
||||
}
|
||||
}))
|
||||
vi.mock('../../codex-accounts/fs-utils', () => ({
|
||||
copyFileWithWindowsRetry: copyFileWithWindowsRetryMock
|
||||
}))
|
||||
|
||||
vi.mock('../../../shared/windows-retry-file-operations', () => ({
|
||||
copyFileWithWindowsRetry: copyFileWithWindowsRetryMock
|
||||
}))
|
||||
|
||||
+1
-2
@@ -182,8 +182,7 @@ export function installModuleMocks(
|
||||
...(await importOriginal<Record<string, unknown>>()),
|
||||
renameFileWithWindowsRetry: renameFileWithWindowsRetryMock
|
||||
}))
|
||||
vi.doMock('../../../codex-accounts/fs-utils', () => ({
|
||||
renameFileWithWindowsRetry: renameFileWithWindowsRetryMock,
|
||||
vi.doMock('../../../filesystem/atomic-file-publication', () => ({
|
||||
writeFileAtomically: vi.fn((pathValue: string, data: string) => {
|
||||
const key = fsKey(pathValue)
|
||||
fsState.files.set(key, data)
|
||||
|
||||
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs'
|
||||
import { basename, dirname, isAbsolute, resolve } from 'node:path'
|
||||
import { resolveAbsoluteDirOverride } from '../../shared/absolute-dir-override'
|
||||
import type { GlobalSettings } from '../../shared/global-settings-types'
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { isDirectory } from './claude-profile-homes'
|
||||
|
||||
const MAX_OBSERVED_CONFIG_DIRS = 32
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as fs from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as FsUtils from '../codex-accounts/fs-utils'
|
||||
import type * as FsUtils from '../filesystem/atomic-file-publication'
|
||||
vi.mock('electron', () => ({ app: { getPath: () => '/unused-test-path' } }))
|
||||
vi.mock('node:fs', async (original) => {
|
||||
const actual = await original<typeof fs>()
|
||||
@@ -13,11 +13,11 @@ vi.mock('node:fs', async (original) => {
|
||||
symlinkSync: vi.fn(actual.symlinkSync)
|
||||
}
|
||||
})
|
||||
vi.mock('../codex-accounts/fs-utils', async (original) => {
|
||||
vi.mock('../filesystem/atomic-file-publication', async (original) => {
|
||||
const actual = await original<typeof FsUtils>()
|
||||
return { ...actual, writeFileAtomically: vi.fn(actual.writeFileAtomically) }
|
||||
})
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { shareClaudeProfileHistory } from './claude-profile-history'
|
||||
|
||||
// Junctions and hardlinks need no Windows privilege; POSIX uses symlinks for junctions.
|
||||
|
||||
@@ -8,7 +8,8 @@ import {
|
||||
unlinkSync
|
||||
} from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { renameFileWithWindowsRetry } from '../codex-accounts/fs-utils'
|
||||
import '../filesystem/atomic-file-publication'
|
||||
import { renameFileWithWindowsRetry } from '../../shared/windows-retry-file-operations'
|
||||
import { resolveClaudeDefaultHome } from './claude-profile-paths'
|
||||
import {
|
||||
ClaudeProfileSurfaceError,
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '../../shared/claude-profile-routing'
|
||||
import { isDefinitiveAbsence } from '../../shared/definitive-filesystem-absence'
|
||||
import type { ExecutionHostId } from '../../shared/execution-host'
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { ClaudeProfileSurfaceError } from './claude-profile-report'
|
||||
|
||||
/** Caller-relative `executionHostId` routes calls but must not be persisted. */
|
||||
|
||||
@@ -17,7 +17,8 @@ import {
|
||||
} from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { isDefinitiveAbsence } from '../../shared/definitive-filesystem-absence'
|
||||
import { renameFileWithWindowsRetry, writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { renameFileWithWindowsRetry } from '../../shared/windows-retry-file-operations'
|
||||
import {
|
||||
ClaudeProfileSurfaceError,
|
||||
warnClaudeProfile,
|
||||
|
||||
@@ -2,13 +2,13 @@ import * as fs from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as FsUtils from '../codex-accounts/fs-utils'
|
||||
import type * as FsUtils from '../filesystem/atomic-file-publication'
|
||||
vi.mock('electron', () => ({ app: { getPath: () => '/unused-test-path' } }))
|
||||
vi.mock('node:fs', async (original) => {
|
||||
const actual = await original<typeof fs>()
|
||||
return { ...actual, symlinkSync: vi.fn(actual.symlinkSync) }
|
||||
})
|
||||
vi.mock('../codex-accounts/fs-utils', async (original) => {
|
||||
vi.mock('../filesystem/atomic-file-publication', async (original) => {
|
||||
const actual = await original<typeof FsUtils>()
|
||||
return { ...actual, writeFileAtomically: vi.fn(actual.writeFileAtomically) }
|
||||
})
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
resolveClaudeGlobalConfigFile,
|
||||
updateClaudeGlobalConfig
|
||||
} from '../claude/claude-folder-trust-file'
|
||||
import { publishFileWithoutOverwrite } from '../codex-accounts/fs-utils'
|
||||
import { publishFileWithoutOverwrite } from '../filesystem/atomic-file-publication'
|
||||
import { CLAUDE_PROFILE_HISTORY_DIRS, mergeClaudeProfileDirectory } from './claude-profile-history'
|
||||
import { readClaudeProfileObject, resolveClaudeDefaultHome } from './claude-profile-paths'
|
||||
import { lstatIfPresent } from './claude-profile-prompt-history'
|
||||
|
||||
@@ -16,7 +16,7 @@ import { claudeProfileMissing } from './claude-profile-launch-errors'
|
||||
import type { GlobalSettings } from '../../shared/global-settings-types'
|
||||
import type { ClaudeManagedAccount } from '../../shared/managed-account-types'
|
||||
import { probeRecentClaudeCliVersion } from '../claude/claude-hook-event-versions'
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { resolveClaudeCommand } from '../codex-cli/command'
|
||||
import {
|
||||
describeClaudeProfile,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
import { statSync } from 'node:fs'
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { readClaudeProfileObject } from './claude-profile-paths'
|
||||
import { lstatIfPresent } from './claude-profile-prompt-history'
|
||||
import {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from 'node:fs'
|
||||
import { dirname } from 'node:path'
|
||||
import { isDefinitiveAbsence } from '../../shared/definitive-filesystem-absence'
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import type { ClaudeProfileSurfaceOutcome } from './claude-profile-report'
|
||||
|
||||
export function linkClaudeProfileDirectory(
|
||||
|
||||
@@ -12,7 +12,8 @@ import {
|
||||
import { dirname, join, posix, resolve, win32 } from 'node:path'
|
||||
import { homedir } from 'node:os'
|
||||
import { lock } from 'proper-lockfile'
|
||||
import { renameFileWithWindowsRetry } from '../codex-accounts/fs-utils'
|
||||
import '../filesystem/atomic-file-publication'
|
||||
import { renameFileWithWindowsRetry } from '../../shared/windows-retry-file-operations'
|
||||
import { runKeyedSerializedOperation } from '../cli/keyed-promise-queue'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { mkdir, readFile } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { getKeyedSerializedQueueTail, runKeyedSerializedOperation } from './keyed-promise-queue'
|
||||
import { normalizeWslDistroKey } from './wsl-cli-registration-operation'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { quotePosixShell } from '../../shared/shell/launch/shell-argument-quotin
|
||||
import { parseWslUncPath, toWindowsWslPath } from '../../shared/wsl-paths'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import type { CodexAccountAddTarget, ManagedCodexHomeLocation } from './codex-account-service-types'
|
||||
import { writeFileAtomically } from './fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { ManagedCodexHomeTemporarilyUnavailableError } from './host-codex-managed-home-ownership'
|
||||
import type { CodexManagedHomePath } from './codex-managed-home-path'
|
||||
|
||||
|
||||
@@ -12,12 +12,14 @@ import {
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import type { CodexManagedAccount } from '../../shared/managed-account-types'
|
||||
import type * as CodexAccountFs from './fs-utils'
|
||||
import type * as CodexAccountFs from '../filesystem/atomic-file-publication'
|
||||
|
||||
const writeFailure = vi.hoisted(() => ({ failNextAuthWrite: false }))
|
||||
|
||||
vi.mock('./fs-utils', async () => {
|
||||
const actual = await vi.importActual<typeof CodexAccountFs>('./fs-utils')
|
||||
vi.mock('../filesystem/atomic-file-publication', async () => {
|
||||
const actual = await vi.importActual<typeof CodexAccountFs>(
|
||||
'../filesystem/atomic-file-publication'
|
||||
)
|
||||
return {
|
||||
...actual,
|
||||
writeFileAtomically: (targetPath: string, contents: string, options?: { mode?: number }) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { lstatSync, readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import type { CodexManagedAccount } from '../../shared/managed-account-types'
|
||||
import { writeFileAtomically } from './fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { assertOwnedHostCodexManagedHomePath } from './host-codex-managed-home-ownership'
|
||||
import { codexAuthMatchesManagedAccount, compareCodexAuthFreshness } from './codex-auth-identity'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'nod
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { syncLegacySharedCodexConfigForRetainedPanes } from './legacy-shared-config-compatibility'
|
||||
import type * as FsUtils from './fs-utils'
|
||||
import type * as FsUtils from '../filesystem/atomic-file-publication'
|
||||
|
||||
const generationRace = vi.hoisted(() => ({
|
||||
path: null as string | null,
|
||||
@@ -19,7 +19,7 @@ vi.mock(
|
||||
})
|
||||
)
|
||||
|
||||
vi.mock('./fs-utils', async (importOriginal) => {
|
||||
vi.mock('../filesystem/atomic-file-publication', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof FsUtils>()
|
||||
return {
|
||||
...actual,
|
||||
|
||||
@@ -2,7 +2,10 @@ import { existsSync, chmodSync, readFileSync, rmSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { isDefinitiveAbsence } from '../../shared/definitive-filesystem-absence'
|
||||
import { getSystemCodexHomePath } from '../codex/configuration/homes/codex-home-paths'
|
||||
import { writeFileAtomically, writeFileAtomicallyIfUnchanged } from './fs-utils'
|
||||
import {
|
||||
writeFileAtomically,
|
||||
writeFileAtomicallyIfUnchanged
|
||||
} from '../filesystem/atomic-file-publication'
|
||||
import type {
|
||||
CodexRuntimeLogoutMarker,
|
||||
CodexRuntimeLogoutMarkerStatus,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { existsSync, readFileSync, rmSync } from 'node:fs'
|
||||
import { writeFileAtomically } from './fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import type {
|
||||
CodexSharedRuntimeAuthPendingProvenance,
|
||||
CodexSharedRuntimeAuthProvenance,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
removeFileAtomicallyIfUnchanged,
|
||||
writeFileAtomically,
|
||||
writeFileAtomicallyIfUnchanged
|
||||
} from './fs-utils'
|
||||
} from '../filesystem/atomic-file-publication'
|
||||
import { CodexRuntimeHomeLaunch } from './runtime-home-service-launch'
|
||||
import type { CodexSystemDefaultSnapshot } from './runtime-home-service-types'
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
statSync
|
||||
} from 'node:fs'
|
||||
import { dirname, extname, join, parse, relative } from 'node:path'
|
||||
import { writeFileAtomically } from './fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { migrateLegacySharedAuthToPerAccountHome } from './legacy-shared-auth-migration'
|
||||
import { normalizeCodexRuntimeSelection } from './runtime-selection'
|
||||
import { getSystemCodexHomePath } from '../codex/configuration/homes/codex-home-paths'
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
normalizeCodexRuntimeSelection,
|
||||
type CodexAccountSelectionTarget
|
||||
} from './runtime-selection'
|
||||
import { recoverInterruptedGuardedFileOperation } from './fs-utils'
|
||||
import { recoverInterruptedGuardedFileOperation } from '../filesystem/atomic-file-publication'
|
||||
import type { CodexSharedRuntimeAuthProvenanceStatus } from './runtime-home-service-types'
|
||||
import { codexAuthIsMonotonicallyFresher } from './runtime-home-service-auth-sync-identity'
|
||||
import { CodexRuntimeHomeWsl } from './runtime-home-service-wsl'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { writeFileAtomically } from '../../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../../filesystem/atomic-file-publication'
|
||||
import { observe } from '../codex-path-observation'
|
||||
|
||||
const RULES_DIR_NAME = 'rules'
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
recoverInterruptedGuardedFileOperation,
|
||||
writeFileAtomically,
|
||||
writeFileAtomicallyIfUnchanged
|
||||
} from '../../../codex-accounts/fs-utils'
|
||||
} from '../../../filesystem/atomic-file-publication'
|
||||
import { getOrcaManagedCodexHomePath, getSystemCodexHomePath } from '../homes/codex-home-paths'
|
||||
import {
|
||||
rebaseBundledMarketplaceSources,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync
|
||||
import { homedir, tmpdir } from 'node:os'
|
||||
import type * as Os from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import type * as CodexFsUtils from '../../../codex-accounts/fs-utils'
|
||||
import type * as CodexFsUtils from '../../../filesystem/atomic-file-publication'
|
||||
|
||||
const { homedirMock, registrationTestState } = vi.hoisted(() => ({
|
||||
homedirMock: vi.fn<() => string>(),
|
||||
@@ -18,7 +18,7 @@ vi.mock('node:os', async (importOriginal) => {
|
||||
}
|
||||
})
|
||||
|
||||
vi.mock('../../../codex-accounts/fs-utils', async (importOriginal) => {
|
||||
vi.mock('../../../filesystem/atomic-file-publication', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof CodexFsUtils>()
|
||||
return {
|
||||
...actual,
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
import { homedir, tmpdir } from 'node:os'
|
||||
import type * as Os from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import type * as CodexFsUtils from '../../../codex-accounts/fs-utils'
|
||||
import type * as CodexFsUtils from '../../../filesystem/atomic-file-publication'
|
||||
|
||||
// Bypass platform-specific socket paths so asserted config bytes stay host-independent.
|
||||
vi.mock('../shared-server/codex-daemon-socket-path-guard', async (importOriginal) => ({
|
||||
@@ -35,7 +35,7 @@ vi.mock('node:os', async (importOriginal) => {
|
||||
}
|
||||
})
|
||||
|
||||
vi.mock('../../../codex-accounts/fs-utils', async (importOriginal) => {
|
||||
vi.mock('../../../filesystem/atomic-file-publication', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof CodexFsUtils>()
|
||||
return {
|
||||
...actual,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { mkdirSync, writeFileSync } from 'node:fs'
|
||||
import { dirname, join, resolve } from 'node:path'
|
||||
import { observeAgentStateFile } from '../codex-path-observation'
|
||||
import { resolvePromotionWriteTarget } from './config-settings-promotion-write-target'
|
||||
import { writeFileAtomically } from '../../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../../filesystem/atomic-file-publication'
|
||||
import { parseWslUncPath } from '../../../../shared/wsl-paths'
|
||||
import { getOrcaManagedCodexHomePath, getSystemCodexHomePath } from '../homes/codex-home-paths'
|
||||
import { upsertPromotedSettingsInContent } from './codex-config-settings-upsert'
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
writeFileSync
|
||||
} from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
import '../../../codex-accounts/fs-utils'
|
||||
import '../../../filesystem/atomic-file-publication'
|
||||
import { renameFileWithWindowsRetry } from '../../../../shared/windows-retry-file-operations'
|
||||
import { writeRollingFileBackup } from '../../../filesystem/rolling-file-backup'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { mkdirSync, readFileSync, rmSync } from 'node:fs'
|
||||
import { dirname } from 'node:path'
|
||||
import { normalizeRuntimePathForComparison } from '../../../../shared/cross-platform-path'
|
||||
import { writeFileAtomically } from '../../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../../filesystem/atomic-file-publication'
|
||||
import {
|
||||
expandCodexSessionBackfillDatesThroughToday,
|
||||
getCodexSessionBackfillDate,
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
isPathInsideOrEqual,
|
||||
normalizeRuntimePathForComparison
|
||||
} from '../../../../shared/cross-platform-path'
|
||||
import { writeFileAtomically } from '../../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../../filesystem/atomic-file-publication'
|
||||
import { streamCodexSessionLedgerRecords } from '../rollouts/codex-session-ledger-stream'
|
||||
|
||||
// Bump after semantics changes to retry outcomes recorded under older versions.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { existsSync, mkdirSync, readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { writeFileAtomically } from '../../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../../filesystem/atomic-file-publication'
|
||||
import type { HooksConfig } from '../../../agent-hooks/installation/configuration/hook-config-schema'
|
||||
import { resolveHooksJsonWritePath } from '../../../agent-hooks/installation/configuration/hook-config-write-path'
|
||||
import {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { join } from 'node:path'
|
||||
import type * as CodexCommand from '../../../codex-cli/command'
|
||||
import type * as TrustDerivation from './codex-hook-trust-derivation'
|
||||
import { fingerprintCodex } from './codex-hook-trust-derivation'
|
||||
import { writeFileAtomically } from '../../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../../filesystem/atomic-file-publication'
|
||||
import type { CodexHookAnswer, CodexHookHashes } from './codex-hook-trust-derivation'
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
|
||||
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { isDeepStrictEqual } from 'node:util'
|
||||
import { normalizeRuntimePathForComparison as codexBinaryKey } from '../../../../shared/cross-platform-path'
|
||||
import { writeFileAtomically } from '../../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../../filesystem/atomic-file-publication'
|
||||
import { isPlainObject } from '../../../agent-hooks/installation/configuration/hooks-json-read'
|
||||
import { getOrcaUserDataPath } from '../../configuration/homes/codex-home-paths'
|
||||
import type { CodexHookAnswer, CodexHookHashes } from './codex-hook-trust-derivation'
|
||||
|
||||
+4
-1
@@ -3,7 +3,10 @@ import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'no
|
||||
import type * as NodeFs from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { removeFileAtomicallyIfUnchanged, writeFileAtomicallyIfUnchanged } from './fs-utils'
|
||||
import {
|
||||
removeFileAtomicallyIfUnchanged,
|
||||
writeFileAtomicallyIfUnchanged
|
||||
} from './atomic-file-publication'
|
||||
|
||||
const fsMock = vi.hoisted(() => ({ linkSync: vi.fn(), renameSync: vi.fn() }))
|
||||
|
||||
+2
-8
@@ -2,15 +2,9 @@ import { randomUUID } from 'node:crypto'
|
||||
import { existsSync, linkSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import { dirname } from 'node:path'
|
||||
import { grantDirAcl } from '../windows/windows-directory-acl'
|
||||
import { isPermissionError } from '../filesystem/permission-errors'
|
||||
import { isPermissionError } from './permission-errors'
|
||||
import { nodeFileContentsEqualSync } from '../../shared/file-content/node-file-content-equality'
|
||||
import {
|
||||
copyFileWithWindowsRetry,
|
||||
renameFileWithWindowsRetry,
|
||||
renameFileWithWindowsRetryAsync
|
||||
} from '../../shared/windows-retry-file-operations'
|
||||
|
||||
export { copyFileWithWindowsRetry, renameFileWithWindowsRetry, renameFileWithWindowsRetryAsync }
|
||||
import { renameFileWithWindowsRetry } from '../../shared/windows-retry-file-operations'
|
||||
|
||||
export function writeFileAtomically(
|
||||
targetPath: string,
|
||||
@@ -3,7 +3,7 @@
|
||||
import { closeSync, fsyncSync, openSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import { open, readdir, rm, stat } from 'node:fs/promises'
|
||||
import { basename, dirname, join } from 'node:path'
|
||||
import { publishFileWithoutOverwrite } from '../codex-accounts/fs-utils'
|
||||
import { publishFileWithoutOverwrite } from './atomic-file-publication'
|
||||
import {
|
||||
renameFileWithWindowsRetry,
|
||||
renameFileWithWindowsRetryAsync
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import type { BrowserWindow } from 'electron'
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path'
|
||||
import { MacosTccPromptWatch } from './macos-tcc-prompt-watch'
|
||||
import { reclaimOrphanedTccLogStreams } from './macos-tcc-log-stream-orphans'
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '../../shared/orcad-artifacts'
|
||||
import { nodeFileContentsEqual } from '../../shared/file-content/node-file-content-equality'
|
||||
import { buildUnixCliLauncher } from '../cli/cli-dev-launcher'
|
||||
import { writeFileAtomically } from '../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../filesystem/atomic-file-publication'
|
||||
import { resolveOrcadInstallRoot, resolveUserDataPath } from './orcad-app-paths'
|
||||
|
||||
// The native Windows launcher selects server mode when this sibling config exists.
|
||||
|
||||
@@ -17,7 +17,8 @@ import {
|
||||
bestEffortFsyncDirectorySync,
|
||||
fsyncFileSync
|
||||
} from '../../../shared/secure-storage/secure-file'
|
||||
import { renameFileWithWindowsRetry } from '../../codex-accounts/fs-utils'
|
||||
import '../../filesystem/atomic-file-publication'
|
||||
import { renameFileWithWindowsRetry } from '../../../shared/windows-retry-file-operations'
|
||||
import {
|
||||
START_TIME_TOLERANCE_MS,
|
||||
startTimesWithinTolerance
|
||||
|
||||
@@ -2,7 +2,7 @@ import { mkdirSync, readFileSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { runProcessSync } from '@orca/process-host'
|
||||
import type { ProcessResult } from '@orca/process-host/process-spec'
|
||||
import { writeFileAtomically } from '../../codex-accounts/fs-utils'
|
||||
import { writeFileAtomically } from '../../filesystem/atomic-file-publication'
|
||||
|
||||
// Opt out of the accent picker once so terminal keys repeat (#14746); later user choices win.
|
||||
// The separate defaults process may affect only the next launch. Reverting this also requires deleting the key.
|
||||
|
||||
Reference in New Issue
Block a user