Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/contracts/src/replay-divergence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export type ReplayDivergenceOverflow = {
/**
* ADR 0012 decision 6, R3: the daemon-computed repair routing hint. Always
* defined (never absent/null) — the mapping in
* `src/daemon/replay/internal/session-replay-repair-hint.ts` is total, defaulting
* `packages/replay-port/src/daemon-port/repair-hint.ts` is total, defaulting
* to `manual` whenever no safer routing can be proven. A small fixed token,
* so it is carried at every response level (including `--level digest`) and
* every projection (text, JSON, client `AppError`, MCP `structuredContent`).
Expand Down
16 changes: 15 additions & 1 deletion packages/replay-port/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,23 @@
"description": "Daemon-side replay port: the adapter over the ad-replay, ad-script and replay-test engines.",
"dependencies": {
"@agent-device/ad-script": "workspace:*",
"@agent-device/contracts": "workspace:*"
"@agent-device/contracts": "workspace:*",
"@agent-device/kernel": "workspace:*",
"@agent-device/selectors": "workspace:*"
},
"exports": {
"./target-token": {
"types": "./src/daemon-port/target-token.ts",
"default": "./src/daemon-port/target-token.ts"
},
"./repair-hint": {
"types": "./src/daemon-port/repair-hint.ts",
"default": "./src/daemon-port/repair-hint.ts"
},
"./script-source": {
"types": "./src/daemon-port/script-source.ts",
"default": "./src/daemon-port/script-source.ts"
},
"./session-replay-vars": {
"types": "./src/session-replay-vars.ts",
"default": "./src/session-replay-vars.ts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { test } from 'vitest';
import assert from 'node:assert/strict';
import type { RawSnapshotNode, SnapshotNode } from '@agent-device/kernel/snapshot';
import type { TargetAnnotationV1 } from '@agent-device/contracts/replay';
import {
computeReplayRepairHint,
type ReplayRepairHintCapture,
} from '../session-replay-repair-hint.ts';
import { computeReplayRepairHint, type ReplayRepairHintCapture } from '../repair-hint.ts';

/**
* ADR 0012 decision 6, R3: `computeReplayRepairHint` must be a TOTAL mapping
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from 'vitest';
import { AppError } from '@agent-device/kernel/errors';
import { readReplayScriptSourceFile } from '../replay-script-source.ts';
import { readReplayScriptSourceFile } from '../script-source.ts';

test('reading a file the bundle does not carry names the file and the entry', () => {
const bundle = { entry: '/flows/login.yaml', files: { '/flows/login.yaml': '---\n- back\n' } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { SessionAction } from '@agent-device/contracts/session';
import { test } from 'vitest';
import assert from 'node:assert/strict';
import { extractReplayTargetToken, readRefLabel } from '../session-replay-target-token.ts';
import { extractReplayTargetToken, readRefLabel } from '../target-token.ts';

// ---------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* ADR 0012 decision 6, R3: the daemon-side `repairHint` computation.
* ADR 0012 decision 6, R3: the replay port's `repairHint` computation.

@cubic-dev-ai cubic-dev-ai Bot Sep 28, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: After this rename, packages/contracts/src/replay-divergence.ts:184 still points to the old module path src/daemon/replay/internal/session-replay-repair-hint.ts, which no longer exists anywhere in the tree. Update that doc reference to packages/replay-port/src/daemon-port/repair-hint.ts (or drop the path) to keep the ADR cross-reference accurate.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/replay-port/src/daemon-port/repair-hint.ts, line 2:

<comment>After this rename, `packages/contracts/src/replay-divergence.ts:184` still points to the old module path `src/daemon/replay/internal/session-replay-repair-hint.ts`, which no longer exists anywhere in the tree. Update that doc reference to `packages/replay-port/src/daemon-port/repair-hint.ts` (or drop the path) to keep the ADR cross-reference accurate.</comment>

<file context>
@@ -1,5 +1,5 @@
 /**
- * ADR 0012 decision 6, R3: the daemon-side `repairHint` computation.
+ * ADR 0012 decision 6, R3: the replay port's `repairHint` computation.
  *
  * Computed daemon-side at divergence time, never by the agent, from (i) the
</file context>
Fix with cubic

*
* Computed daemon-side at divergence time, never by the agent, from (i) the
* recorded `target-v1` evidence for the diverged action (decision 3's
Expand All @@ -13,8 +13,7 @@
* evidence, or a sparse/unavailable capture — so `repairHint` is always
* defined.
*
* Lives in the daemon zone because the container-presence test
* below is a genuine structural containment check over `parentIndex` — the
* The container-presence test below is a genuine structural containment check over `parentIndex` — the
* same tree-walking machinery decision 3's own identity-set filter uses
* (`buildAncestryChain`/`computeScrollRegionKey`, `@agent-device/selectors/target-evidence`)
* — not a flat identity-string search.
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import net from 'node:net';
import path from 'node:path';
import { afterEach, expect, test } from 'vitest';
import { LeaseRegistry } from '../lease-registry.ts';
import { REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE } from '../replay-script-source.ts';
import { REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE } from '@agent-device/replay-port/script-source';
import { createRequestHandler } from './test-device-runtime-gateway.ts';
import { SessionStore } from '../session-store.ts';
import { createDaemonHttpServer } from '../server/http-server.ts';
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay-device-selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { inspectMaestroFlow } from '@agent-device/maestro';
import { parseReplayInput, resolveReplayFormat } from '@agent-device/ad-script';
import type { ResolveTargetDeviceOptions } from '@agent-device/device-selection/dispatch-resolve';
import type { CommandFlags } from '@agent-device/contracts/command';
import { readReplayScriptSourceFile } from './replay-script-source.ts';
import { readReplayScriptSourceFile } from '@agent-device/replay-port/script-source';
import type { DaemonRequest } from './daemon-request.ts';
import {
appTargetResolutionOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
maestroScriptSourceBundleFor,
replayScriptSourceBundleFor,
} from '../../../../__tests__/test-utils/replay-script-source.ts';
import { REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE } from '../../../replay-script-source.ts';
import { REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE } from '@agent-device/replay-port/script-source';
import {
captureSnapshotThroughLegacyDispatchFixture,
legacyDispatchCapture,
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/native-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { prepareReplayPlan, routeMaestroReplay } from './session-replay-runtime-
import {
readReplayScriptSourceFile,
REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE,
} from '../../replay-script-source.ts';
} from '@agent-device/replay-port/script-source';
import { prepareReplaySession } from './session-replay-runtime-session.ts';
import type {
ReplayCommand,
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/session-replay-divergence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { formatDivergenceActionLabel, isTouchTargetCommand } from '@agent-device
import {
computeReplayRepairHint,
type ReplayRepairHintCapture,
} from './session-replay-repair-hint.ts';
} from '@agent-device/replay-port/repair-hint';
import type {
ReplayResumeStamper,
ReplaySessionObservation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
type DivergenceFieldSanitizer,
} from './session-replay-divergence.ts';
import { boundReplayDivergenceForSession } from './session-replay-divergence-publication.ts';
import { computeReplayRepairHint } from './session-replay-repair-hint.ts';
import { computeReplayRepairHint } from '@agent-device/replay-port/repair-hint';
import {
buildReplayDivergenceFailureResponseFromDescriptor,
hoistReplayFailureCauseDiagnosticMeta,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { buildMaestroReplayTargetDeviceResolutionOptions } from './replay-script
import {
readReplayScriptSourceFile,
REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE,
} from '../../replay-script-source.ts';
} from '@agent-device/replay-port/script-source';
import type { ReplayScriptSourceBundle } from '@agent-device/contracts/replay';
import type { ReplayCommand, ReplayDispatchRequest, ReplaySessionStore } from './command-types.ts';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ import type {
import {
computeReplayRepairHint,
type ReplayRepairHintCapture,
} from './session-replay-repair-hint.ts';
} from '@agent-device/replay-port/repair-hint';
import { buildReplayDivergenceFailureResponse } from './session-replay-runtime-failure-response.ts';
import { buildAndPersistReplayDivergenceResume } from './session-replay-resume.ts';
import { classifyReplayTarget } from './session-replay-target-classification.ts';
import { extractReplayTargetToken, readRefLabel } from './session-replay-target-token.ts';
import { extractReplayTargetToken, readRefLabel } from '@agent-device/replay-port/target-token';

// ---------------------------------------------------------------------------
// #1555 review R3 ("target verification must happen INSIDE the engine"): the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { inspectMaestroFlow } from '@agent-device/maestro';
import type { ReplayScriptSourceBundle } from '@agent-device/contracts/replay';
import { readReplayScriptMetadata, resolveReplayFormat } from '@agent-device/ad-script';
import { readReplayScriptSourceFile } from '../../replay-script-source.ts';
import { readReplayScriptSourceFile } from '@agent-device/replay-port/script-source';
import type {
ReplayTestDiscoverSources,
ReplayTestManifest,
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/replay/internal/test-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
ReplaySuiteResult,
ReplayScriptSourceBundle,
} from '@agent-device/contracts/replay';
import { REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE } from '../../replay-script-source.ts';
import { REPLAY_SCRIPT_SOURCE_REQUIRED_MESSAGE } from '@agent-device/replay-port/script-source';
import type { ReplayScriptMetadata } from '@agent-device/ad-script';
import { expandSessionPath } from '@agent-device/host-kit/session-paths';
import type { ReplayCommand, ReplayTestCommand } from './command-types.ts';
Expand Down
Loading