Skip to content

Commit caa3dc2

Browse files
authored
refactor: dissolve caller-side src/replay into command and CLI owners (#2151)
* refactor: dissolve caller-side replay ownership * fix: remove replay test-only export * fix: restore replay loader promise boundary
1 parent bf849ed commit caa3dc2

55 files changed

Lines changed: 233 additions & 233 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/adr/0018-unified-event-journal.md

Lines changed: 1 addition & 1 deletion

docs/adr/0020-composable-recorded-fragments.md

Lines changed: 1 addition & 1 deletion

fallow-baselines/health.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@
604604
"packages/provider-webdriver/src/webdriver-utils.ts:high impact",
605605
"src/utils/keyed-lock.ts:high impact",
606606
"src/daemon/request-progress-protocol.ts:high impact",
607-
"src/replay/test/reporters/format.ts:high impact",
607+
"src/cli/replay-test/reporters/format.ts:high impact",
608608
"src/daemon/handlers/session-test-infrastructure.ts:high impact",
609609
"src/daemon/handlers/session-test-artifacts.ts:high impact",
610610
"packages/platform-android/src/app-parsers.ts:high impact",

packages/ad-script/src/internal/__tests__/script.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ test('formatDivergenceActionLabel categorically drops fill/type text but keeps t
680680
});
681681

682682
// The property test asserting "serializing a parsed script is a fixed point
683-
// for generated scripts" stays at `src/replay/__tests__/ad-script-round-trip.test.ts`:
683+
// for generated scripts" stays at `src/commands/replay/ad-script-round-trip.test.ts`:
684684
// its script generator (`replayScriptArb`) is derived from the root command
685685
// catalog and selector grammar (`src/__tests__/test-utils/property-arbitraries.ts`),
686686
// which this package cannot import without an R11 package→root-src escape

packages/ad-script/src/internal/target-annotation-identity.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
* prefix matching over versioned `.ad` target-binding evidence, plus the
44
* bounded diagnostic diffs built on top of it. Both the writer (over
55
* `SnapshotNode`-derived values, `src/daemon/session-target-evidence.ts`) and
6-
* replay-time verification (`src/daemon/handlers/session-replay-target-classification.ts`,
7-
* `src/commands/interaction/runtime/selector-wait.ts`, and the shared
8-
* replay-zone tree helpers in `src/replay/`) share this verbatim so both
6+
* replay-time verification (`src/daemon/handlers/session-replay-target-classification.ts` and
7+
* `src/commands/interaction/runtime/selector-wait.ts`) share this verbatim so both
98
* sides compute the SAME identity/ancestry match by construction (#1478 P5
109
* review, "genuinely shared recording vocabulary" relocated to its owner).
1110
*

scripts/layering/architecture-ownership.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const LOGICAL_MODULE_POLICIES = [
2222
'src/daemon/',
2323
'src/providers/',
2424
'src/request/',
25-
'src/replay/',
2625
'src/compat/',
2726
'packages/maestro/',
2827
'packages/ad-replay/',

scripts/layering/check.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ import {
104104
import { runtimeExecutionIntegrityViolations } from './runtime-execution-policy.ts';
105105
import { sourceExecutionCompatibilityViolations } from './source-execution-policy.ts';
106106
import { sessionResourceOwnershipViolations } from './session-resource-ownership.ts';
107+
import { replayOwnershipViolations } from './replay-ownership.ts';
107108
import { applicationLifecycleOwnershipViolations } from './application-lifecycle-policy.ts';
108109

109110
const repoRoot = execFileSync('git', ['rev-parse', '--show-toplevel'], {
@@ -551,6 +552,7 @@ export const LAYERING_RULE_IDS = [
551552
'package-boundaries',
552553
'platform-package-policy',
553554
'retired-platforms-zone',
555+
'replay-ownership',
554556
] as const;
555557

556558
export type LayeringRuleId = (typeof LAYERING_RULE_IDS)[number];
@@ -589,6 +591,7 @@ export const LAYERING_RULES: Readonly<Record<LayeringRuleId, LayeringRule>> = {
589591
{ untrackedProductionFiles: listUntrackedProductionTypeScriptFiles(repoRoot) },
590592
),
591593
'retired-platforms-zone': () => checkRetiredPlatformsZone(listTrackedPlatformZoneFiles(repoRoot)),
594+
'replay-ownership': (context) => replayOwnershipViolations(context.sourceFiles),
592595
};
593596

594597
export function main(): number {

scripts/layering/daemon-modularity.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,15 @@ test('replay-test rejects request-global and engine-internal imports', () => {
118118
'packages/replay-test/src/internal/scheduler.ts',
119119
[
120120
"import { emitRequestProgress } from '../../../../src/request/progress.ts';",
121-
"import { readReplayScriptMetadata } from '../../../../src/replay/script.ts';",
121+
"import { readReplayScriptMetadata } from '../../../../src/daemon/handlers/session-replay-runtime.ts';",
122122
"import { parseMaestroProgram } from '../../../../src/compat/maestro/program-ir-parser.ts';",
123123
].join('\n'),
124124
],
125125
['src/request/progress.ts', 'export function emitRequestProgress() {}'],
126-
['src/replay/script.ts', 'export function readReplayScriptMetadata() {}'],
126+
[
127+
'src/daemon/handlers/session-replay-runtime.ts',
128+
'export function readReplayScriptMetadata() {}',
129+
],
127130
['src/compat/maestro/program-ir-parser.ts', 'export function parseMaestroProgram() {}'],
128131
]),
129132
);
@@ -136,7 +139,7 @@ test('replay-test rejects request-global and engine-internal imports', () => {
136139
violations.map(({ message }) => message.replace(/;.*/, '')),
137140
[
138141
'replay-test must not import src/request/progress.ts',
139-
'replay-test must not import src/replay/script.ts',
142+
'replay-test must not import src/daemon/handlers/session-replay-runtime.ts',
140143
'replay-test must not import src/compat/maestro/program-ir-parser.ts',
141144
],
142145
);

scripts/layering/daemon-modularity.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export const TYPE_CYCLE_BASELINE = Object.values(LARGEST_TYPE_CYCLE_ZONE_CEILING
3737
const ENGINE_FILE_PREFIXES = [
3838
'packages/ad-replay/src/',
3939
'packages/maestro/src/',
40-
'src/replay/',
4140
'src/daemon/handlers/session-replay',
4241
'packages/replay-test/src/',
4342
] as const;
@@ -193,8 +192,7 @@ function checkLogicalModuleImports(edges: readonly ResolvedImportEdge[]): Layeri
193192
}
194193

195194
if (!sourceModule) continue;
196-
// A module's own files are never a forbidden target: `replay-test` sits inside the wider
197-
// `src/replay/` engine root it may not import from.
195+
// A module's own files are never a forbidden target.
198196
if (sourceModule.roots.some((root) => matchesDeclaredRoot(edge.target, root))) continue;
199197
if (!sourceModule.forbiddenTargetRoots.some((root) => matchesDeclaredRoot(edge.target, root)))
200198
continue;

scripts/layering/model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ const TARGET_DAG_RANK = new Map([
3737
['contracts', 1],
3838
['maestro', 1],
3939
['recording', 1],
40-
['replay', 1],
4140
['replay-test', 1],
4241
['request', 1],
4342
['screenshot-diff', 1],

0 commit comments

Comments
 (0)