Skip to content

Commit 1d5ddb5

Browse files
authored
refactor(snapshot): move snapshot policy utilities (#2135) (#2181)
* refactor(snapshot): move snapshot policy utilities (#2135) * fix(snapshot): preserve CLI eager closure
1 parent 7e784be commit 1d5ddb5

24 files changed

Lines changed: 143 additions & 147 deletions

‎fallow-baselines/health.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@
486486
"count": 1
487487
}
488488
},
489-
"src/utils/scroll-edge-state.ts": {
489+
"src/snapshot/scroll-edge-state.ts": {
490490
"crap_moderate": {
491491
"count": 1
492492
}

‎src/commands/interaction/runtime/gestures.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
type ScrollEdge,
2727
type ScrollEdgeState,
2828
type ScrollEdgeTarget,
29-
} from '../../../utils/scroll-edge-state.ts';
29+
} from '../../../snapshot/scroll-edge-state.ts';
3030
import { successText } from '@agent-device/kernel/success-text';
3131
import { requireIntInRange } from '../../../utils/validation.ts';
3232
import { toBackendContext } from '../../runtime-common.ts';

‎src/commands/interaction/runtime/interactions.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ test('runtime fill with verify reports evidence and detects a changed post-actio
534534
assert.equal(result.kind, 'selector');
535535
assert.ok(result.evidence);
536536
// Digest is over (type, label, identifier) only, so a value-only change does
537-
// not flip the digest — this is intentional (see ax-digest.ts docs).
537+
// not flip the digest — this is intentional (see snapshot-evidence.ts docs).
538538
assert.equal(result.evidence?.changedFromBefore, false);
539539
assert.equal(result.evidence?.nodeCount, 1);
540540
});

‎src/commands/interaction/runtime/post-action-observation.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { SnapshotNode } from '@agent-device/kernel/snapshot';
22
import type { AgentDeviceRuntime, CommandContext } from '../../../runtime-contract.ts';
3-
import { summarizeAxEvidence } from '../../../utils/ax-digest.ts';
3+
import { summarizeAxEvidence } from '../../../snapshot/snapshot-evidence.ts';
44
import type {
55
InteractionEvidence,
66
ResolvedInteractionTarget,

‎src/commands/interaction/runtime/settle.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { isSparseSnapshotQualityVerdict } from '@agent-device/capture-kit/snapsh
88
import { buildSnapshotDiff } from '../../../snapshot/snapshot-diff.ts';
99
import { displayLabel, formatRole } from '../../../snapshot/snapshot-lines.ts';
1010
import { collectSettleChromeRefs, withoutSettleChrome } from '../../../core/snapshot-chrome.ts';
11-
import { summarizeAxEvidence } from '../../../utils/ax-digest.ts';
11+
import { summarizeAxEvidence } from '../../../snapshot/snapshot-evidence.ts';
1212
import type {
1313
InteractionEvidence,
1414
ResolvedInteractionTarget,

‎src/daemon/handlers/interaction-ios-tap-outcome.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
isSparseSnapshotQualityVerdict,
77
preferredSnapshotBackendForVerdict,
88
} from '@agent-device/capture-kit/snapshot-quality-verdict';
9-
import { summarizeAxEvidence } from '../../utils/ax-digest.ts';
9+
import { summarizeAxEvidence } from '../../snapshot/snapshot-evidence.ts';
1010
import { getRequestSignal } from '@agent-device/host-kit/request';
1111
import { isLocalIosRunnerSession } from '../direct-ios-selector.ts';
1212
import { emitDiagnostic } from '@agent-device/host-kit/diagnostics';

‎src/daemon/scroll-runtime.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
runScrollEdgePasses,
2222
type ScrollEdge,
2323
type ScrollEdgeState,
24-
} from '../utils/scroll-edge-state.ts';
24+
} from '../snapshot/scroll-edge-state.ts';
2525
import { withSuccessText } from '@agent-device/kernel/success-text';
2626
import type { DaemonCommandContext } from './context.ts';
2727
import { errorResponse } from './handlers/response.ts';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import { computeAxDigest } from '../ax-digest.ts';
2+
import { computeAxDigest } from '../snapshot-evidence.ts';
33

44
test('digest is stable across repeated calls for the same nodes', () => {
55
const nodes = [

src/utils/scroll-edge-state-broad-selection.test.ts renamed to src/snapshot/__tests__/scroll-edge-state-broad-selection.test.ts

File renamed without changes.

src/utils/scroll-edge-state-container-existence.test.ts renamed to src/snapshot/__tests__/scroll-edge-state-container-existence.test.ts

File renamed without changes.

0 commit comments

Comments
 (0)