From fa3d9fcc75c874ac17cbbaa1258b6a384506cf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 28 Sep 2026 14:24:00 +0200 Subject: [PATCH 1/2] refactor(move): relocate daemon replay repair and suite tests --- .../session-replay-repair-acceptance.test.ts | 20 ++++++------- .../session-replay-repair-empty-tail.test.ts | 20 ++++++------- .../session-replay-repair-loop.test.ts | 29 +++++++++---------- ...ion-replay-repair-record-exclusion.test.ts | 28 +++++++++--------- ...-repair-transaction-close-ordering.test.ts | 16 +++++----- ...on-replay-repair-transaction-force.test.ts | 28 +++++++++--------- ...sion-replay-repair-transaction.fixtures.ts | 14 ++++----- .../session-replay-repair-transaction.test.ts | 20 ++++++------- .../session-replay-repair.fixtures.ts | 10 +++---- .../session-test-command-trust.test.ts | 14 ++++----- .../session-test-fail-fast.test.ts | 6 ++-- .../replay-suite}/session-test-runner.test.ts | 8 ++--- .../session-test-source-discovery.test.ts | 6 ++-- ...on-test-suite-command-cancellation.test.ts | 2 +- ...ion-test-suite-command-flag-policy.test.ts | 12 ++++---- ...on-test-suite-command-nested-flags.test.ts | 2 +- ...est-suite-command-remote-artifacts.test.ts | 6 ++-- .../session-test-suite-command-video.test.ts | 22 +++++++------- .../session-test-suite-infrastructure.test.ts | 8 ++--- .../session-test-suite.fixtures.ts | 6 ++-- .../replay-suite}/session-test-suite.test.ts | 12 ++++---- 21 files changed, 143 insertions(+), 146 deletions(-) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair-acceptance.test.ts (91%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair-empty-tail.test.ts (97%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair-loop.test.ts (96%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair-record-exclusion.test.ts (94%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair-transaction-close-ordering.test.ts (95%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair-transaction-force.test.ts (94%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair-transaction.fixtures.ts (85%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair-transaction.test.ts (96%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-repair}/session-replay-repair.fixtures.ts (91%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-command-trust.test.ts (83%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-fail-fast.test.ts (83%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-runner.test.ts (98%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-source-discovery.test.ts (92%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-suite-command-cancellation.test.ts (96%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-suite-command-flag-policy.test.ts (94%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-suite-command-nested-flags.test.ts (96%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-suite-command-remote-artifacts.test.ts (96%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-suite-command-video.test.ts (93%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-suite-infrastructure.test.ts (91%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-suite.fixtures.ts (69%) rename src/daemon/{replay/internal/__tests__ => __tests__/replay-suite}/session-test-suite.test.ts (98%) diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair-acceptance.test.ts b/src/daemon/__tests__/replay-repair/session-replay-repair-acceptance.test.ts similarity index 91% rename from src/daemon/replay/internal/__tests__/session-replay-repair-acceptance.test.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair-acceptance.test.ts index 75a170fd84..a4b1f4d1b4 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair-acceptance.test.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair-acceptance.test.ts @@ -6,35 +6,35 @@ * the original recorded, so the fresh replay needs no hand-fixing. */ import { test, expect, vi, beforeEach } from 'vitest'; -import { markRepairTransactionComplete } from '../../../session-replay-transaction.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import { markRepairTransactionComplete } from '../../session-replay-transaction.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = await importOriginal(); return { ...actual, resolveTargetDevice: vi.fn() }; }); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), })); import fs from 'node:fs'; import path from 'node:path'; -import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts'; -import { SessionStore } from '../../../session-store.ts'; -import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts'; -import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts'; -import type { DaemonRequest } from '../../../daemon-request.ts'; +import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts'; +import { SessionStore } from '../../session-store.ts'; +import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts'; +import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts'; +import type { DaemonRequest } from '../../daemon-request.ts'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; import { baseReplayRequest as baseReq, writeReplayFile, -} from '../../__tests__/session-replay-runtime.fixtures.ts'; +} from '../../replay/__tests__/session-replay-runtime.fixtures.ts'; import { freshEvidence, makeRecordingReplayInvoke } from './session-replay-repair.fixtures.ts'; import { captureSnapshotThroughLegacyDispatchFixture, legacyDispatchCapture, -} from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; +} from '../legacy-snapshot-capture-fixture.ts'; const mockDispatchCommand = legacyDispatchCapture; const mockCaptureSnapshotWithInteractor = vi.mocked(captureSnapshotWithInteractor); diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair-empty-tail.test.ts b/src/daemon/__tests__/replay-repair/session-replay-repair-empty-tail.test.ts similarity index 97% rename from src/daemon/replay/internal/__tests__/session-replay-repair-empty-tail.test.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair-empty-tail.test.ts index 10779ab3d0..f7933e7a8a 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair-empty-tail.test.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair-empty-tail.test.ts @@ -23,33 +23,33 @@ * `caution`/`manual` divergence is no longer a dead end. */ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = await importOriginal(); return { ...actual, resolveTargetDevice: vi.fn() }; }); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), })); import fs from 'node:fs'; import path from 'node:path'; -import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts'; -import { SessionStore } from '../../../session-store.ts'; -import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts'; +import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts'; +import { SessionStore } from '../../session-store.ts'; +import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts'; import { captureSnapshotThroughLegacyDispatchFixture, legacyDispatchCapture, -} from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; -import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts'; -import { repairSessionBoundary } from '../../../session-replay-transaction.ts'; -import type { SessionState } from '../../../session-state.ts'; +} from '../legacy-snapshot-capture-fixture.ts'; +import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts'; +import { repairSessionBoundary } from '../../session-replay-transaction.ts'; +import type { SessionState } from '../../session-state.ts'; import { baseReplayRequest as baseReq, writeReplayFile, -} from '../../__tests__/session-replay-runtime.fixtures.ts'; +} from '../../replay/__tests__/session-replay-runtime.fixtures.ts'; import { freshEvidence, makeRecordingReplayInvoke } from './session-replay-repair.fixtures.ts'; import { bottomTabsRealCaptureFixture, diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair-loop.test.ts b/src/daemon/__tests__/replay-repair/session-replay-repair-loop.test.ts similarity index 96% rename from src/daemon/replay/internal/__tests__/session-replay-repair-loop.test.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair-loop.test.ts index 82db4b55bb..49ea447aa9 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair-loop.test.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair-loop.test.ts @@ -1,4 +1,4 @@ -import { isSessionRecording } from '../../../session-script-publication-capability.ts'; +import { isSessionRecording } from '../../session-script-publication-capability.ts'; /** * ADR 0012 decision 6: `replay --save-script` arming (R1), the repair-run * boundary watermark (R6, sticky across `--from` legs, no amputation when @@ -11,41 +11,38 @@ import { isSessionRecording } from '../../../session-script-publication-capabili * `session.actions` accumulates for real instead of staying empty. */ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = await importOriginal(); return { ...actual, resolveTargetDevice: vi.fn() }; }); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), })); import path from 'node:path'; -import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts'; -import { SessionStore } from '../../../session-store.ts'; -import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts'; +import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts'; +import { SessionStore } from '../../session-store.ts'; +import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts'; import { makeIosSession, repairPublication, -} from '../../../../__tests__/test-utils/session-factories.ts'; -import { repairSessionBoundary } from '../../../session-replay-transaction.ts'; -import { - NO_SCRIPT_PUBLICATION, - scriptTargetPath, -} from '../../../session-script-publication-state.ts'; -import type { DaemonRequest } from '../../../daemon-request.ts'; -import type { SessionState } from '../../../session-state.ts'; +} from '../../../__tests__/test-utils/session-factories.ts'; +import { repairSessionBoundary } from '../../session-replay-transaction.ts'; +import { NO_SCRIPT_PUBLICATION, scriptTargetPath } from '../../session-script-publication-state.ts'; +import type { DaemonRequest } from '../../daemon-request.ts'; +import type { SessionState } from '../../session-state.ts'; import { baseReplayRequest as baseReq, writeReplayFile, -} from '../../__tests__/session-replay-runtime.fixtures.ts'; +} from '../../replay/__tests__/session-replay-runtime.fixtures.ts'; import { freshEvidence, makeRecordingReplayInvoke } from './session-replay-repair.fixtures.ts'; import { captureSnapshotThroughLegacyDispatchFixture, legacyDispatchCapture, -} from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; +} from '../legacy-snapshot-capture-fixture.ts'; /** Repair-transaction status, or `undefined` outside a repair publication. */ function sessionRepairStatus(session: SessionState | undefined) { diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair-record-exclusion.test.ts b/src/daemon/__tests__/replay-repair/session-replay-repair-record-exclusion.test.ts similarity index 94% rename from src/daemon/replay/internal/__tests__/session-replay-repair-record-exclusion.test.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair-record-exclusion.test.ts index fa887da044..56660ed134 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair-record-exclusion.test.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair-record-exclusion.test.ts @@ -18,7 +18,7 @@ * completely unchanged. */ import { test, expect, vi, beforeEach } from 'vitest'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; vi.mock('@agent-device/platform-apple/runner/operations', () => ({ resolveRunnerAppBundleId: vi.fn(), @@ -32,9 +32,9 @@ vi.mock('@agent-device/host-kit/command', async (importOriginal) => { const actual = await importOriginal(); return { ...actual, runCmd: vi.fn() }; }); -vi.mock('../../../../platform-runtime-runtime-hints.ts', async (importOriginal) => { +vi.mock('../../../platform-runtime-runtime-hints.ts', async (importOriginal) => { const actual = - await importOriginal(); + await importOriginal(); return { ...actual, clearRuntimeHintValues: vi.fn(async () => {}) }; }); vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { @@ -42,35 +42,35 @@ vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal await importOriginal(); return { ...actual, resolveTargetDevice: vi.fn() }; }); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), })); import fs from 'node:fs'; import path from 'node:path'; -import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts'; -import { handleSessionCloseCommands as handleProductionCloseCommand } from '../../../session-lifecycle/index.ts'; -import { SessionStore } from '../../../session-store.ts'; -import { LeaseRegistry } from '../../../lease-registry.ts'; -import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts'; +import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts'; +import { handleSessionCloseCommands as handleProductionCloseCommand } from '../../session-lifecycle/index.ts'; +import { SessionStore } from '../../session-store.ts'; +import { LeaseRegistry } from '../../lease-registry.ts'; +import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts'; import { makeIosSession, authoringPublication, -} from '../../../../__tests__/test-utils/session-factories.ts'; +} from '../../../__tests__/test-utils/session-factories.ts'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; import { baseReplayRequest as baseReq, writeReplayFile, -} from '../../__tests__/session-replay-runtime.fixtures.ts'; +} from '../../replay/__tests__/session-replay-runtime.fixtures.ts'; import { freshEvidence, makeRecordingReplayInvoke } from './session-replay-repair.fixtures.ts'; import { bindLifecycleRuntime, inspectLifecycleRuntimeFacts, -} from '../../../__tests__/application-lifecycle-runtime-harness.ts'; -import { platformResourceCleanup } from '../../../../platform-runtime-resource-cleanup.ts'; +} from '../application-lifecycle-runtime-harness.ts'; +import { platformResourceCleanup } from '../../../platform-runtime-resource-cleanup.ts'; import { captureSnapshotThroughLegacyDispatchFixture, legacyDispatchCapture, -} from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; +} from '../legacy-snapshot-capture-fixture.ts'; const mockDispatchCommand = legacyDispatchCapture; const mockCaptureSnapshotWithInteractor = vi.mocked(captureSnapshotWithInteractor); diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair-transaction-close-ordering.test.ts b/src/daemon/__tests__/replay-repair/session-replay-repair-transaction-close-ordering.test.ts similarity index 95% rename from src/daemon/replay/internal/__tests__/session-replay-repair-transaction-close-ordering.test.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair-transaction-close-ordering.test.ts index b927f3640e..3fdede4587 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair-transaction-close-ordering.test.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair-transaction-close-ordering.test.ts @@ -25,30 +25,30 @@ vi.mock('@agent-device/host-kit/command', async (importOriginal) => { const actual = await importOriginal(); return { ...actual, runCmd: vi.fn() }; }); -vi.mock('../../../../platform-runtime-runtime-hints.ts', async (importOriginal) => { +vi.mock('../../../platform-runtime-runtime-hints.ts', async (importOriginal) => { const actual = - await importOriginal(); + await importOriginal(); return { ...actual, clearRuntimeHintValues: vi.fn(async () => {}) }; }); vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = (await importOriginal()) as Record; return { ...actual, resolveTargetDevice: vi.fn() }; }); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), })); import fs from 'node:fs'; import path from 'node:path'; -import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts'; +import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts'; import { legacyDispatchCapture, resetLegacySnapshotCapture, -} from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; -import { dispatchApplicationLifecycleEffect } from '../../../__tests__/application-lifecycle-runtime-fixture.ts'; +} from '../legacy-snapshot-capture-fixture.ts'; +import { dispatchApplicationLifecycleEffect } from '../application-lifecycle-runtime-fixture.ts'; import { AppError } from '@agent-device/kernel/errors'; -import { HEAL_COMPLETE_SENTINEL } from '../../../session-script-writer.ts'; +import { HEAL_COMPLETE_SENTINEL } from '../../session-script-writer.ts'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; -import type { SessionState } from '../../../session-state.ts'; +import type { SessionState } from '../../session-state.ts'; import { freshEvidence } from './session-replay-repair.fixtures.ts'; import { handleCloseCommand, diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair-transaction-force.test.ts b/src/daemon/__tests__/replay-repair/session-replay-repair-transaction-force.test.ts similarity index 94% rename from src/daemon/replay/internal/__tests__/session-replay-repair-transaction-force.test.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair-transaction-force.test.ts index b8ae51d889..d129314d3d 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair-transaction-force.test.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair-transaction-force.test.ts @@ -23,45 +23,45 @@ vi.mock('@agent-device/host-kit/command', async (importOriginal) => { const actual = await importOriginal(); return { ...actual, runCmd: vi.fn() }; }); -vi.mock('../../../../platform-runtime-runtime-hints.ts', async (importOriginal) => { +vi.mock('../../../platform-runtime-runtime-hints.ts', async (importOriginal) => { const actual = - await importOriginal(); + await importOriginal(); return { ...actual, clearRuntimeHintValues: vi.fn(async () => {}) }; }); vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = (await importOriginal()) as Record; return { ...actual, resolveTargetDevice: vi.fn() }; }); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), })); import fs from 'node:fs'; import path from 'node:path'; -import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts'; -import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts'; +import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts'; +import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts'; import { legacyDispatchCapture, resetLegacySnapshotCapture, -} from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; -import { dispatchApplicationLifecycleEffect } from '../../../__tests__/application-lifecycle-runtime-fixture.ts'; -import { repairPublication } from '../../../../__tests__/test-utils/session-factories.ts'; -import { HEAL_COMPLETE_SENTINEL } from '../../../session-script-writer.ts'; +} from '../legacy-snapshot-capture-fixture.ts'; +import { dispatchApplicationLifecycleEffect } from '../application-lifecycle-runtime-fixture.ts'; +import { repairPublication } from '../../../__tests__/test-utils/session-factories.ts'; +import { HEAL_COMPLETE_SENTINEL } from '../../session-script-writer.ts'; import { repairSessionBoundary, markRepairTransactionComplete, -} from '../../../session-replay-transaction.ts'; +} from '../../session-replay-transaction.ts'; import { NO_SCRIPT_PUBLICATION, scriptTargetPath, scriptTargetForce, -} from '../../../session-script-publication-state.ts'; +} from '../../session-script-publication-state.ts'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; -import type { DaemonRequest } from '../../../daemon-request.ts'; -import type { SessionState } from '../../../session-state.ts'; +import type { DaemonRequest } from '../../daemon-request.ts'; +import type { SessionState } from '../../session-state.ts'; import { baseReplayRequest as baseReq, writeReplayFile, -} from '../../__tests__/session-replay-runtime.fixtures.ts'; +} from '../../replay/__tests__/session-replay-runtime.fixtures.ts'; import { freshEvidence, makeRecordingReplayInvoke } from './session-replay-repair.fixtures.ts'; import { handleCloseCommand, diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair-transaction.fixtures.ts b/src/daemon/__tests__/replay-repair/session-replay-repair-transaction.fixtures.ts similarity index 85% rename from src/daemon/replay/internal/__tests__/session-replay-repair-transaction.fixtures.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair-transaction.fixtures.ts index de3cb576aa..eecc71704a 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair-transaction.fixtures.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair-transaction.fixtures.ts @@ -1,18 +1,18 @@ import path from 'node:path'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; -import { SessionStore } from '../../../session-store.ts'; -import { LeaseRegistry } from '../../../lease-registry.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; +import { SessionStore } from '../../session-store.ts'; +import { LeaseRegistry } from '../../lease-registry.ts'; import { makeIosSession, makeRepairCompleteSession, repairPublication, -} from '../../../../__tests__/test-utils/session-factories.ts'; -import { handleSessionCloseCommands as handleProductionCloseCommand } from '../../../session-lifecycle/index.ts'; +} from '../../../__tests__/test-utils/session-factories.ts'; +import { handleSessionCloseCommands as handleProductionCloseCommand } from '../../session-lifecycle/index.ts'; import { bindLifecycleRuntime, inspectLifecycleRuntimeFacts, -} from '../../../__tests__/application-lifecycle-runtime-harness.ts'; -import { platformResourceCleanup } from '../../../../platform-runtime-resource-cleanup.ts'; +} from '../application-lifecycle-runtime-harness.ts'; +import { platformResourceCleanup } from '../../../platform-runtime-resource-cleanup.ts'; import { freshEvidence } from './session-replay-repair.fixtures.ts'; /** diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair-transaction.test.ts b/src/daemon/__tests__/replay-repair/session-replay-repair-transaction.test.ts similarity index 96% rename from src/daemon/replay/internal/__tests__/session-replay-repair-transaction.test.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair-transaction.test.ts index d4c9f66f0a..78c8bbc7cb 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair-transaction.test.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair-transaction.test.ts @@ -40,34 +40,34 @@ vi.mock('@agent-device/host-kit/command', async (importOriginal) => { const actual = await importOriginal(); return { ...actual, runCmd: vi.fn() }; }); -vi.mock('../../../../platform-runtime-runtime-hints.ts', async (importOriginal) => { +vi.mock('../../../platform-runtime-runtime-hints.ts', async (importOriginal) => { const actual = - await importOriginal(); + await importOriginal(); return { ...actual, clearRuntimeHintValues: vi.fn(async () => {}) }; }); vi.mock('@agent-device/device-selection/dispatch-resolve', async (importOriginal) => { const actual = (await importOriginal()) as Record; return { ...actual, resolveTargetDevice: vi.fn() }; }); -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(), })); import fs from 'node:fs'; import path from 'node:path'; -import { runReplayForTest } from '../../__tests__/replay-command-fixture.ts'; -import { captureSnapshotWithInteractor } from '../../../snapshot-interactor-capture.ts'; +import { runReplayForTest } from '../../replay/__tests__/replay-command-fixture.ts'; +import { captureSnapshotWithInteractor } from '../../snapshot-interactor-capture.ts'; import { legacyDispatchCapture, resetLegacySnapshotCapture, -} from '../../../__tests__/legacy-snapshot-capture-fixture.ts'; -import { dispatchApplicationLifecycleEffect } from '../../../__tests__/application-lifecycle-runtime-fixture.ts'; -import { HEAL_COMPLETE_SENTINEL } from '../../../session-script-writer.ts'; -import { repairSessionSourcePath } from '../../../session-replay-transaction.ts'; +} from '../legacy-snapshot-capture-fixture.ts'; +import { dispatchApplicationLifecycleEffect } from '../application-lifecycle-runtime-fixture.ts'; +import { HEAL_COMPLETE_SENTINEL } from '../../session-script-writer.ts'; +import { repairSessionSourcePath } from '../../session-replay-transaction.ts'; import { parseReplayScriptDetailed } from '@agent-device/ad-script'; import { baseReplayRequest as baseReq, writeReplayFile, -} from '../../__tests__/session-replay-runtime.fixtures.ts'; +} from '../../replay/__tests__/session-replay-runtime.fixtures.ts'; import { freshEvidence, makeRecordingReplayInvoke } from './session-replay-repair.fixtures.ts'; import { handleCloseCommand, diff --git a/src/daemon/replay/internal/__tests__/session-replay-repair.fixtures.ts b/src/daemon/__tests__/replay-repair/session-replay-repair.fixtures.ts similarity index 91% rename from src/daemon/replay/internal/__tests__/session-replay-repair.fixtures.ts rename to src/daemon/__tests__/replay-repair/session-replay-repair.fixtures.ts index 8f6281daf1..bfdc799b69 100644 --- a/src/daemon/replay/internal/__tests__/session-replay-repair.fixtures.ts +++ b/src/daemon/__tests__/replay-repair/session-replay-repair.fixtures.ts @@ -1,4 +1,4 @@ -import { isSessionRecording } from '../../../session-script-publication-capability.ts'; +import { isSessionRecording } from '../../session-script-publication-capability.ts'; /** * Shared fixtures for the ADR 0012 decision 6 repair-loop tests. The mock * `invoke` in these tests must ACTUALLY record via `sessionStore.recordAction` @@ -7,10 +7,10 @@ import { isSessionRecording } from '../../../session-script-publication-capabili * session.actions." This factory keeps the per-test mock declarative (a config * object, no inline branching) so each test body stays linear. */ -import type { DaemonInvokeFn, DaemonRequest, DaemonResponse } from '../../../daemon-request.ts'; -import { SessionStore } from '../../../session-store.ts'; -import { isInteractiveObservation } from '../../../session-action-recorder.ts'; -import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts'; +import type { DaemonInvokeFn, DaemonRequest, DaemonResponse } from '../../daemon-request.ts'; +import { SessionStore } from '../../session-store.ts'; +import { isInteractiveObservation } from '../../session-action-recorder.ts'; +import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts'; import type { TargetAnnotationV1 } from '@agent-device/contracts/replay'; export function freshEvidence(id: string, label: string): TargetAnnotationV1 { diff --git a/src/daemon/replay/internal/__tests__/session-test-command-trust.test.ts b/src/daemon/__tests__/replay-suite/session-test-command-trust.test.ts similarity index 83% rename from src/daemon/replay/internal/__tests__/session-test-command-trust.test.ts rename to src/daemon/__tests__/replay-suite/session-test-command-trust.test.ts index 2436218123..42cf6b5420 100644 --- a/src/daemon/replay/internal/__tests__/session-test-command-trust.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-command-trust.test.ts @@ -5,20 +5,20 @@ import fs from 'node:fs'; import path from 'node:path'; import { beforeEach, expect, test, vi } from 'vitest'; -import { SessionStore } from '../../../session-store.ts'; +import { SessionStore } from '../../session-store.ts'; import { createReplaySession, replayDaemonDependencies, -} from '../../../handlers/session-replay-command.ts'; -import { runReplayTestCommand } from '../../index.ts'; +} from '../../handlers/session-replay-command.ts'; +import { runReplayTestCommand } from '../../replay/index.ts'; import type { ReplayCommand, ReplayTestCommand } from '@agent-device/replay-port/command-types'; -import { replayScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; -import type { DaemonInvokeFn, DaemonRequest } from '../../../daemon-request.ts'; +import { replayScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; +import type { DaemonInvokeFn, DaemonRequest } from '../../daemon-request.ts'; const capturedCommands: ReplayCommand[] = []; -vi.mock('../native-command.ts', () => ({ +vi.mock('../../replay/internal/native-command.ts', () => ({ runReplayCommand: async (command: ReplayCommand) => { capturedCommands.push(command); return { ok: true as const, data: { replayed: 1 } }; diff --git a/src/daemon/replay/internal/__tests__/session-test-fail-fast.test.ts b/src/daemon/__tests__/replay-suite/session-test-fail-fast.test.ts similarity index 83% rename from src/daemon/replay/internal/__tests__/session-test-fail-fast.test.ts rename to src/daemon/__tests__/replay-suite/session-test-fail-fast.test.ts index 7d17a031ff..126b0c979a 100644 --- a/src/daemon/replay/internal/__tests__/session-test-fail-fast.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-fail-fast.test.ts @@ -2,10 +2,10 @@ import fs from 'node:fs'; import path from 'node:path'; import { expect, test } from 'vitest'; -import { makeSessionStore } from '../../../../__tests__/test-utils/store-factory.ts'; -import { handleSessionCommands } from '../../../handlers/__tests__/session-command-harness.ts'; +import { makeSessionStore } from '../../../__tests__/test-utils/store-factory.ts'; +import { handleSessionCommands } from '../../handlers/__tests__/session-command-harness.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; test('test --fail-fast continues after passing scripts', async () => { const root = mkdtempForTestSync('agent-device-test-fail-fast-pass-'); diff --git a/src/daemon/replay/internal/__tests__/session-test-runner.test.ts b/src/daemon/__tests__/replay-suite/session-test-runner.test.ts similarity index 98% rename from src/daemon/replay/internal/__tests__/session-test-runner.test.ts rename to src/daemon/__tests__/replay-suite/session-test-runner.test.ts index 44af3870f7..6275640088 100644 --- a/src/daemon/replay/internal/__tests__/session-test-runner.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-runner.test.ts @@ -8,11 +8,11 @@ import { makeSession, noopInvoke, assertInvalidArgsMessage, -} from '../../../handlers/__tests__/session-test-harness.ts'; -import type { DaemonRequest } from '../../../daemon-request.ts'; -import { handleSessionCommands } from '../../../handlers/__tests__/session-command-harness.ts'; +} from '../../handlers/__tests__/session-test-harness.ts'; +import type { DaemonRequest } from '../../daemon-request.ts'; +import { handleSessionCommands } from '../../handlers/__tests__/session-command-harness.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; // Opening a Simulator schedules a best-effort runner prewarm that outlives the request; a real one // would spawn xcodebuild after this file finished and land in whichever file the worker runs next. diff --git a/src/daemon/replay/internal/__tests__/session-test-source-discovery.test.ts b/src/daemon/__tests__/replay-suite/session-test-source-discovery.test.ts similarity index 92% rename from src/daemon/replay/internal/__tests__/session-test-source-discovery.test.ts rename to src/daemon/__tests__/replay-suite/session-test-source-discovery.test.ts index d35b80afda..aa70cd3279 100644 --- a/src/daemon/replay/internal/__tests__/session-test-source-discovery.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-source-discovery.test.ts @@ -2,12 +2,12 @@ import { test } from 'vitest'; import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -import { buildReplayTestSourceDiscovery } from '../session-test-source-discovery.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import { buildReplayTestSourceDiscovery } from '../../replay/internal/session-test-source-discovery.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; import { maestroScriptSourceBundleFor, replayScriptSourceBundleFor, -} from '../../../../__tests__/test-utils/replay-script-source.ts'; +} from '../../../__tests__/test-utils/replay-script-source.ts'; // #1478 P3b: the daemon adapter's inspection capability. #1802 moved expansion and file reading // to the caller, so what is left here is exactly format routing plus per-engine manifest diff --git a/src/daemon/replay/internal/__tests__/session-test-suite-command-cancellation.test.ts b/src/daemon/__tests__/replay-suite/session-test-suite-command-cancellation.test.ts similarity index 96% rename from src/daemon/replay/internal/__tests__/session-test-suite-command-cancellation.test.ts rename to src/daemon/__tests__/replay-suite/session-test-suite-command-cancellation.test.ts index 5e9fd1b1af..5661957437 100644 --- a/src/daemon/replay/internal/__tests__/session-test-suite-command-cancellation.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-suite-command-cancellation.test.ts @@ -6,7 +6,7 @@ import { markRequestCanceled, registerRequestAbort, } from '@agent-device/host-kit/request'; -import { bindReplayTestAttemptCancellation } from '../test-command.ts'; +import { bindReplayTestAttemptCancellation } from '../../replay/internal/test-command.ts'; // The daemon half of the replay-test cancellation seam (#1478 P3b). The scheduler only says // "cancel" and "release"; everything here — registry entries, the parent-abort relay, and diff --git a/src/daemon/replay/internal/__tests__/session-test-suite-command-flag-policy.test.ts b/src/daemon/__tests__/replay-suite/session-test-suite-command-flag-policy.test.ts similarity index 94% rename from src/daemon/replay/internal/__tests__/session-test-suite-command-flag-policy.test.ts rename to src/daemon/__tests__/replay-suite/session-test-suite-command-flag-policy.test.ts index f40e020471..f31b81d0ae 100644 --- a/src/daemon/replay/internal/__tests__/session-test-suite-command-flag-policy.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-suite-command-flag-policy.test.ts @@ -8,21 +8,21 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { test, vi } from 'vitest'; -import { SessionStore } from '../../../session-store.ts'; +import { SessionStore } from '../../session-store.ts'; import { createReplaySession, replayDaemonDependencies, -} from '../../../handlers/session-replay-command.ts'; -import { runReplayTestCommand } from '../../index.ts'; +} from '../../handlers/session-replay-command.ts'; +import { runReplayTestCommand } from '../../replay/index.ts'; import { replayInvokeOverDispatch, splitReplayCommandRequest, } from '@agent-device/replay-port/replay-dispatch-envelope'; import type { ReplayTestCommand } from '@agent-device/replay-port/command-types'; import { REPLAY_ONLY_TEST_FLAG_REJECTIONS } from '@agent-device/replay-port/session-replay-test-policy'; -import { replayCommandFamily } from '../../../../commands/replay/index.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; -import type { DaemonInvokeFn, DaemonRequest } from '../../../daemon-request.ts'; +import { replayCommandFamily } from '../../../commands/replay/index.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; +import type { DaemonInvokeFn, DaemonRequest } from '../../daemon-request.ts'; // --- ADR 0012 decision 4 / migration step 5: `--from` is replay-only --- diff --git a/src/daemon/replay/internal/__tests__/session-test-suite-command-nested-flags.test.ts b/src/daemon/__tests__/replay-suite/session-test-suite-command-nested-flags.test.ts similarity index 96% rename from src/daemon/replay/internal/__tests__/session-test-suite-command-nested-flags.test.ts rename to src/daemon/__tests__/replay-suite/session-test-suite-command-nested-flags.test.ts index 7ba8243395..f040bbfbe1 100644 --- a/src/daemon/replay/internal/__tests__/session-test-suite-command-nested-flags.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-suite-command-nested-flags.test.ts @@ -5,7 +5,7 @@ */ import assert from 'node:assert/strict'; import { test } from 'vitest'; -import { buildNestedReplayFlags } from '../test-command.ts'; +import { buildNestedReplayFlags } from '../../replay/internal/test-command.ts'; test('buildNestedReplayFlags returns parent flags untouched when neither override is set', () => { const parent = { platform: 'android' as const, timeoutMs: 5000 }; diff --git a/src/daemon/replay/internal/__tests__/session-test-suite-command-remote-artifacts.test.ts b/src/daemon/__tests__/replay-suite/session-test-suite-command-remote-artifacts.test.ts similarity index 96% rename from src/daemon/replay/internal/__tests__/session-test-suite-command-remote-artifacts.test.ts rename to src/daemon/__tests__/replay-suite/session-test-suite-command-remote-artifacts.test.ts index 1f0c5a7975..3b576c4a3b 100644 --- a/src/daemon/replay/internal/__tests__/session-test-suite-command-remote-artifacts.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-suite-command-remote-artifacts.test.ts @@ -17,9 +17,9 @@ import fs from 'node:fs'; import path from 'node:path'; import { test } from 'vitest'; import type { ReplaySuiteResult } from '@agent-device/contracts/replay'; -import type { DaemonRequest } from '../../../daemon-request.ts'; -import { attachRemoteReplayTestArtifacts } from '../test-command.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import type { DaemonRequest } from '../../daemon-request.ts'; +import { attachRemoteReplayTestArtifacts } from '../../replay/internal/test-command.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; const SUITE_INVOCATION_ID = 'cd5f9c01feec8d70'; diff --git a/src/daemon/replay/internal/__tests__/session-test-suite-command-video.test.ts b/src/daemon/__tests__/replay-suite/session-test-suite-command-video.test.ts similarity index 93% rename from src/daemon/replay/internal/__tests__/session-test-suite-command-video.test.ts rename to src/daemon/__tests__/replay-suite/session-test-suite-command-video.test.ts index 874cf755bc..b331e9d632 100644 --- a/src/daemon/replay/internal/__tests__/session-test-suite-command-video.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-suite-command-video.test.ts @@ -3,36 +3,36 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; import { beforeEach, test, vi } from 'vitest'; -import { SessionStore } from '../../../session-store.ts'; -import type { DaemonRequest, DaemonResponse } from '../../../daemon-request.ts'; -import { makeIosSession } from '../../../../__tests__/test-utils/session-factories.ts'; -import { runReplayTestCommand } from '../../index.ts'; +import { SessionStore } from '../../session-store.ts'; +import type { DaemonRequest, DaemonResponse } from '../../daemon-request.ts'; +import { makeIosSession } from '../../../__tests__/test-utils/session-factories.ts'; +import { runReplayTestCommand } from '../../replay/index.ts'; import { replayInvokeOverDispatch, splitReplayCommandRequest, } from '@agent-device/replay-port/replay-dispatch-envelope'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; -import { replayScriptSourceBundleFor } from '../../../../__tests__/test-utils/replay-script-source.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; +import { replayScriptSourceBundleFor } from '../../../__tests__/test-utils/replay-script-source.ts'; import { unavailableBindDevice, unavailableBindExactDevice, -} from '../../../__tests__/test-device-runtime-gateway.ts'; +} from '../test-device-runtime-gateway.ts'; import { createScreenRecordingAdmissionLedger } from '@agent-device/capture-kit/screen-recording-admission-ledger'; -import type { RecordRuntimeHandlerParams } from '../../../handlers/record-runtime.ts'; +import type { RecordRuntimeHandlerParams } from '../../handlers/record-runtime.ts'; import { createDurableResourceEnvelope } from '@agent-device/capture-kit'; import { localRuntimeOwner } from '@agent-device/contracts/platform-runtime'; import type { ScreenRecordingLiveHandle } from '@agent-device/contracts/screen-recording-runtime'; -import { createReplayTestVideoOwner } from '../../../handlers/session-replay-video-owner.ts'; +import { createReplayTestVideoOwner } from '../../handlers/session-replay-video-owner.ts'; import { createReplaySession, replayDaemonDependencies, -} from '../../../handlers/session-replay-command.ts'; +} from '../../handlers/session-replay-command.ts'; const recordRuntimeMocks = vi.hoisted(() => ({ handleRecordCommand: vi.fn(), })); -vi.mock('../../../handlers/record-runtime.ts', () => ({ +vi.mock('../../handlers/record-runtime.ts', () => ({ handleRecordCommand: recordRuntimeMocks.handleRecordCommand, })); diff --git a/src/daemon/replay/internal/__tests__/session-test-suite-infrastructure.test.ts b/src/daemon/__tests__/replay-suite/session-test-suite-infrastructure.test.ts similarity index 91% rename from src/daemon/replay/internal/__tests__/session-test-suite-infrastructure.test.ts rename to src/daemon/__tests__/replay-suite/session-test-suite-infrastructure.test.ts index 690e4bcfa1..361085a8d3 100644 --- a/src/daemon/replay/internal/__tests__/session-test-suite-infrastructure.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-suite-infrastructure.test.ts @@ -3,12 +3,12 @@ import fs from 'node:fs'; import path from 'node:path'; -import type { DaemonResponse } from '../../../daemon-request.ts'; -import { handleSessionCommands } from '../../../handlers/__tests__/session-command-harness.ts'; +import type { DaemonResponse } from '../../daemon-request.ts'; +import { handleSessionCommands } from '../../handlers/__tests__/session-command-harness.ts'; import { expectOkData, makeSessionStore } from './session-test-suite.fixtures.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(async () => { throw new Error('no device runner available in this test'); }), diff --git a/src/daemon/replay/internal/__tests__/session-test-suite.fixtures.ts b/src/daemon/__tests__/replay-suite/session-test-suite.fixtures.ts similarity index 69% rename from src/daemon/replay/internal/__tests__/session-test-suite.fixtures.ts rename to src/daemon/__tests__/replay-suite/session-test-suite.fixtures.ts index d360e0699d..43da2b3364 100644 --- a/src/daemon/replay/internal/__tests__/session-test-suite.fixtures.ts +++ b/src/daemon/__tests__/replay-suite/session-test-suite.fixtures.ts @@ -1,8 +1,8 @@ import { expect } from 'vitest'; import path from 'node:path'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; -import { SessionStore } from '../../../session-store.ts'; -import type { DaemonResponse, DaemonResponseData } from '../../../daemon-request.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; +import { SessionStore } from '../../session-store.ts'; +import type { DaemonResponse, DaemonResponseData } from '../../daemon-request.ts'; export function makeSessionStore(): SessionStore { const root = mkdtempForTestSync('agent-device-session-test-suite-'); diff --git a/src/daemon/replay/internal/__tests__/session-test-suite.test.ts b/src/daemon/__tests__/replay-suite/session-test-suite.test.ts similarity index 98% rename from src/daemon/replay/internal/__tests__/session-test-suite.test.ts rename to src/daemon/__tests__/replay-suite/session-test-suite.test.ts index 46eea119c4..13438a94ef 100644 --- a/src/daemon/replay/internal/__tests__/session-test-suite.test.ts +++ b/src/daemon/__tests__/replay-suite/session-test-suite.test.ts @@ -7,7 +7,7 @@ import { test, expect, vi } from 'vitest'; // device runner, so without a mock those calls fall through to the real // (slow/hanging) runner dispatch path. Reject fast so failure-path tests keep // exercising `divergence.screen: unavailable` deterministically. -vi.mock('../../../snapshot-interactor-capture.ts', () => ({ +vi.mock('../../snapshot-interactor-capture.ts', () => ({ captureSnapshotWithInteractor: vi.fn(async () => { throw new Error('no device runner available in this test'); }), @@ -19,8 +19,8 @@ import path from 'node:path'; import { handleSessionCommands, mockInspectDeviceRuntimeFacts, -} from '../../../handlers/__tests__/session-command-harness.ts'; -import type { DaemonRequest } from '../../../daemon-request.ts'; +} from '../../handlers/__tests__/session-command-harness.ts'; +import type { DaemonRequest } from '../../daemon-request.ts'; import { expectOkData, makeSessionStore } from './session-test-suite.fixtures.ts'; import { withRequestProgressSink, @@ -30,13 +30,13 @@ import { registerRequestAbort, } from '@agent-device/host-kit/request'; -import { withTestDeviceInventoryProvider as withDeviceInventoryProvider } from '../../../../__tests__/test-utils/device-inventory-gateways.ts'; +import { withTestDeviceInventoryProvider as withDeviceInventoryProvider } from '../../../__tests__/test-utils/device-inventory-gateways.ts'; import type { DeviceInfo } from '@agent-device/kernel/device'; import { makeAndroidSession, makeMacOsSession, -} from '../../../../__tests__/test-utils/session-factories.ts'; -import { mkdtempForTestSync } from '../../../../__tests__/test-utils/tmp-dir.ts'; +} from '../../../__tests__/test-utils/session-factories.ts'; +import { mkdtempForTestSync } from '../../../__tests__/test-utils/tmp-dir.ts'; const ANDROID_ONE: DeviceInfo = { platform: 'android', From 319f190be5f71e5ae449d25a385c5c6295a23543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 28 Sep 2026 14:24:58 +0200 Subject: [PATCH 2/2] chore(gates): follow renamed replay suite test baseline --- fallow-baselines/health.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fallow-baselines/health.json b/fallow-baselines/health.json index 4869c16c7c..be35214a66 100644 --- a/fallow-baselines/health.json +++ b/fallow-baselines/health.json @@ -199,7 +199,7 @@ "count": 1 } }, - "src/daemon/replay/internal/__tests__/session-test-runner.test.ts": { + "src/daemon/__tests__/replay-suite/session-test-runner.test.ts": { "crap_high": { "count": 1 },