Skip to content

Commit 8a215d8

Browse files
committed
refactor(contracts): reuse replay structural denotation
1 parent c568ad5 commit 8a215d8

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

‎packages/ad-replay/src/internal/step-loop.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {
1919
* `resolveReplayStepResponse` / `buildReplayActionFailure`. Everything that
2020
* touches a real device, a snapshot, `SessionStore`, or the P4b repair
2121
* coordinator is daemon authority and stays behind the narrow
22-
* `AdReplayStepRuntime` capabilities (`./runtime-port-types.ts`) — this
22+
* `AdReplayStepRuntime` capabilities (`@agent-device/contracts/ad-replay-execution`) — this
2323
* module only decides which action to run next, when to skip one, and when
2424
* to stop.
2525
*
@@ -28,7 +28,7 @@ import type {
2828
* vocabulary and the verify-then-dispatch orchestrator — both extracted out,
2929
* following `packages/maestro`'s own three-way split
3030
* (`runtime-port-types.ts` for the vocabulary, its engine files for the
31-
* orchestration logic). `./runtime-port-types.ts` now owns every
31+
* orchestration logic). `@agent-device/contracts/ad-replay-execution` now owns every
3232
* `AdReplayStepRuntime`-adjacent type; `./verify-dispatch.ts` owns
3333
* `verifyAndDispatchStep` and its two dispatch helpers. This file is left
3434
* with exactly the loop (`runAdReplay`) and the terminal-close/executable-

‎packages/contracts/src/ad-replay-execution.ts‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import type { Platform, PublicPlatform } from '@agent-device/kernel/device';
44
import type { SnapshotNode } from '@agent-device/kernel/snapshot';
55
import type { TargetAnnotationV1 } from '@agent-device/contracts/replay';
66
import type { ReplayDivergenceTargetBindingKind } from '@agent-device/contracts/divergence';
7-
import type { LocalIdentity, TargetAncestryEntry } from './target-annotation.ts';
7+
import type {
8+
LocalIdentity,
9+
NodeStructuralDenotation,
10+
TargetAncestryEntry,
11+
} from './target-annotation.ts';
812
import type { ReplayVarSources, ReplayScriptMetadata } from './replay-script-data.ts';
913

1014
/**
@@ -364,18 +368,8 @@ export type AdReplayRunOutcome =
364368
readonly failure: AdReplayStepFailure;
365369
}>;
366370

367-
/**
368-
* The verified/observed member's structural position within its capture
369-
* (document order + sibling) — moved here (from `./step-loop.ts`, which
370-
* still uses it for `AdReplayVerifiedTargetGuard`) so both this module's
371-
* typed evidence shapes and the step loop can reference ONE definition
372-
* without a cycle: this module has no dependency on `./step-loop.ts`, but
373-
* `./step-loop.ts` already depends on this one.
374-
*/
375-
export type AdReplayTargetStructuralDenotation = Readonly<{
376-
documentOrder: number;
377-
sibling: number;
378-
}>;
371+
/** The verified member's shared structural position, read-only across the execution boundary. */
372+
export type AdReplayTargetStructuralDenotation = Readonly<NodeStructuralDenotation>;
379373

380374
/**
381375
* The guard-mismatch refusal's typed evidence, already narrowed by the

0 commit comments

Comments
 (0)