Skip to content

Commit 5352eef

Browse files
committed
chore(gates): pin the maestro replay backend plugin surface and closure approval
1 parent dc13590 commit 5352eef

5 files changed

Lines changed: 34 additions & 29 deletions

File tree

‎packages/maestro/package.json‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"description": "Private Maestro compatibility engine for agent-device.",
88
"dependencies": {
9+
"@agent-device/ad-script": "workspace:*",
910
"@agent-device/capture-kit": "workspace:*",
1011
"@agent-device/contracts": "workspace:*",
1112
"@agent-device/host-kit": "workspace:*",
@@ -18,9 +19,13 @@
1819
"types": "./src/index.ts",
1920
"default": "./src/index.ts"
2021
},
21-
"./daemon-runtime-port": {
22-
"types": "./src/daemon-port/daemon-runtime-port.ts",
23-
"default": "./src/daemon-port/daemon-runtime-port.ts"
22+
"./replay-backend": {
23+
"types": "./src/replay-backend/replay-maestro-backend.ts",
24+
"default": "./src/replay-backend/replay-maestro-backend.ts"
25+
},
26+
"./replay-backend-declaration": {
27+
"types": "./src/replay-backend/replay-maestro-declaration.ts",
28+
"default": "./src/replay-backend/replay-maestro-declaration.ts"
2429
},
2530
"./run-script-http": {
2631
"types": "./src/daemon-port/run-script-http.ts",

‎packages/maestro/src/index.test.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ describe('@agent-device/maestro facade', () => {
1919
expect(exports).not.toContain('rankMaestroFailureCandidates');
2020
});
2121

22-
test('keeps the daemon-side port off the engine entry and declares pure modules', () => {
22+
test('keeps the plugin and helper off the engine entry and declares pure modules', () => {
2323
const manifest = JSON.parse(
2424
fs.readFileSync(path.join(import.meta.dirname, '../package.json'), 'utf8'),
2525
) as { exports: Record<string, unknown>; sideEffects?: boolean };
26-
// The daemon-side runtime port (#2544) and its runScript HTTP helper are subpaths, not part
27-
// of the engine entry. This pins the surface; scripts/__tests__/eager-closure-budgets.test.ts
28-
// is what keeps `.` from starting to evaluate host-kit, capture-kit, or provision-kit.
26+
// The runScript HTTP helper is a subpath, not part of the engine entry, and the replay
27+
// backend plugin (#3377) is the only other way in: its engine-free declaration lets help list
28+
// the backend without evaluating the engine. This pins the surface;
29+
// scripts/__tests__/eager-closure-budgets.test.ts is what keeps `.` from starting to evaluate
30+
// host-kit, capture-kit, or provision-kit.
2931
expect(Object.keys(manifest.exports)).toEqual([
3032
'.',
31-
'./daemon-runtime-port',
33+
'./replay-backend',
34+
'./replay-backend-declaration',
3235
'./run-script-http',
3336
]);
3437
expect(manifest.sideEffects).toBe(false);

‎packages/replay-port/package.json‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
"types": "./src/daemon-port/replay-backend-registry.ts",
4141
"default": "./src/daemon-port/replay-backend-registry.ts"
4242
},
43+
"./replay-backend-declarations": {
44+
"types": "./src/daemon-port/replay-backend-declarations.ts",
45+
"default": "./src/daemon-port/replay-backend-declarations.ts"
46+
},
4347
"./replay-script-selection": {
4448
"types": "./src/daemon-port/replay-script-selection.ts",
4549
"default": "./src/daemon-port/replay-script-selection.ts"
@@ -72,22 +76,6 @@
7276
"types": "./src/daemon-port/session-replay-heal.ts",
7377
"default": "./src/daemon-port/session-replay-heal.ts"
7478
},
75-
"./session-replay-maestro-failure": {
76-
"types": "./src/daemon-port/session-replay-maestro-failure.ts",
77-
"default": "./src/daemon-port/session-replay-maestro-failure.ts"
78-
},
79-
"./session-replay-maestro-observer": {
80-
"types": "./src/daemon-port/session-replay-maestro-observer.ts",
81-
"default": "./src/daemon-port/session-replay-maestro-observer.ts"
82-
},
83-
"./session-replay-maestro-request": {
84-
"types": "./src/daemon-port/session-replay-maestro-request.ts",
85-
"default": "./src/daemon-port/session-replay-maestro-request.ts"
86-
},
87-
"./session-replay-maestro-runtime": {
88-
"types": "./src/daemon-port/session-replay-maestro-runtime.ts",
89-
"default": "./src/daemon-port/session-replay-maestro-runtime.ts"
90-
},
9179
"./session-replay-report-action": {
9280
"types": "./src/daemon-port/session-replay-report-action.ts",
9381
"default": "./src/daemon-port/session-replay-report-action.ts"

‎scripts/__tests__/eager-closure-budgets.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,14 @@ export const NEW_ENTRY_CEILINGS: Readonly<Record<EntryCategory, number>> = Objec
132132
*/
133133
export const APPROVED_OVER_CEILING: Readonly<
134134
Record<string, { issue: string; reason: string; owner: string }>
135-
> = Object.freeze({});
135+
> = Object.freeze({
136+
'packages/maestro/src/replay-backend/replay-maestro-backend.ts': {
137+
issue: '#3377',
138+
reason:
139+
'The Maestro replay backend plugin IS the engine behind `replay --maestro`; the registry reaches it only through a function-scoped import(), and no startup hub evaluates it (cli-startup-import-closure pins that).',
140+
owner: 'thymikee',
141+
},
142+
});
136143

137144
/** The category is a function of the path, never a hand-written column. */
138145
export function entryCategoryOf(entryFile: string): EntryCategory {

‎scripts/layering/package-boundaries.test.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,15 +666,17 @@ test('the real tree parses, declares, and passes R11', () => {
666666
]);
667667
const maestroPackage = packages.find((pkg) => pkg.name === '@agent-device/maestro');
668668
assert.ok(maestroPackage, 'maestro package must exist');
669-
// Locks the export surface: `.` (the engine) plus the two daemon-side port entries #2544
670-
// moved out of `src/daemon/adapters/maestro`. The eager-closure budget gate
671-
// (scripts/__tests__/eager-closure-budgets.test.ts) is what keeps the port off `.`.
669+
// Locks the export surface: `.` (the engine), the replay backend plugin (#3377) with its
670+
// engine-free declaration, and the runScript HTTP helper. The eager-closure budget gate
671+
// (scripts/__tests__/eager-closure-budgets.test.ts) is what keeps the plugin off `.`.
672672
assert.deepEqual([...maestroPackage.exportTargets.keys()].sort(), [
673673
'@agent-device/maestro',
674-
'@agent-device/maestro/daemon-runtime-port',
674+
'@agent-device/maestro/replay-backend',
675+
'@agent-device/maestro/replay-backend-declaration',
675676
'@agent-device/maestro/run-script-http',
676677
]);
677678
assert.deepEqual([...maestroPackage.workspaceDependencies].sort(), [
679+
'@agent-device/ad-script',
678680
'@agent-device/capture-kit',
679681
'@agent-device/contracts',
680682
'@agent-device/host-kit',

0 commit comments

Comments
 (0)