Skip to content

Commit 196452d

Browse files
thymikeeclaude
andcommitted
chore(gates): cover the daemon process's root entry and composition root in the client-only gate
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ff30a0c commit 196452d

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎scripts/layering/client-only-subpaths.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ test('the caller-side replay source subpaths are denied to daemon production cod
4545
file,
4646
);
4747
}
48-
for (const file of ['src/daemon/replay-runtime.ts', 'packages/daemon/src/replay-runtime.ts']) {
48+
for (const file of [
49+
'src/daemon/replay-runtime.ts',
50+
'packages/daemon/src/replay-runtime.ts',
51+
'src/daemon.ts',
52+
'src/daemon-composition.ts',
53+
]) {
4954
const violations = check(file).filter((v) => /caller-side replay sources/.test(v.message));
5055
assert.equal(violations.length, 1, file);
5156
}

‎scripts/layering/package-boundaries.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,16 @@ export const CLIENT_ONLY_SUBPATHS: ReadonlySet<string> = new Set([
204204
]);
205205

206206
const DAEMON_SOURCE_FILE = /^(?:src\/daemon|packages\/daemon\/src)\//;
207+
// The daemon process also runs its root entry and composition root, outside the daemon tree.
208+
const DAEMON_PROCESS_ROOT_FILES: ReadonlySet<string> = new Set([
209+
'src/daemon.ts',
210+
'src/daemon-composition.ts',
211+
]);
207212

208213
function importsClientOnlyFromDaemon(file: string, specifier: string): boolean {
209214
return (
210215
CLIENT_ONLY_SUBPATHS.has(specifier) &&
211-
DAEMON_SOURCE_FILE.test(file) &&
216+
(DAEMON_SOURCE_FILE.test(file) || DAEMON_PROCESS_ROOT_FILES.has(file)) &&
212217
!isTestConsumerFile(file)
213218
);
214219
}

0 commit comments

Comments
 (0)