Skip to content

Commit 41fa23b

Browse files
committed
chore(gates): retarget source-reading test probes to layer paths
Ownership probes and eager-closure walks that read daemon modules by path follow them into their layer folders: new URL and path.resolve(import.meta.dirname) specifiers, the route-owner path reconstruction, the replay ownership scan's scan roots and synthetic probe locations, and the provider-manifest probe one level deeper with its file.
1 parent 687b53d commit 41fa23b

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎.fallowrc.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@
311311
},
312312
{
313313
// Daemon-shaped test support outside the *.fixtures.ts naming: the layer-folder move put
314-
// these two files into the audit diff, and their per-symbol consumers are all test-tree
315-
// files that --production analysis does not see — the same property the fixtures and
316-
// test-kit entries below assert per-file.
317-
"file": "{packages/daemon/src/__tests__/support/handlers/session-test-harness.ts,src/__tests__/test-utils/replay-script-source.ts}",
314+
// this file into the audit diff, and its per-symbol consumers are all test-tree files
315+
// that --production analysis does not see — the same property the fixtures and test-kit
316+
// entries below assert per-file.
317+
"file": "packages/daemon/src/__tests__/support/handlers/session-test-harness.ts",
318318
"exports": ["*"]
319319
},
320320
{

‎packages/daemon/src/sessions/handlers/__tests__/lease.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ test('a daemon started without BrowserStack credentials refuses a shell that has
531531
function testMuPluginEnv(): Record<string, string> {
532532
const manifest = path.resolve(
533533
import.meta.dirname,
534-
'../../../../../packages/provider-testmu/package.json',
534+
'../../../../../../packages/provider-testmu/package.json',
535535
);
536536
const { home, env } = pluginHome();
537537
selectPluginManifest(home, JSON.parse(fs.readFileSync(manifest, 'utf8')));

‎src/__tests__/daemon-composition/replay-coordinator-ownership.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type ImportSite = {
5050
declarationTypeOnly: boolean;
5151
};
5252

53-
const PRODUCTION_ROOTS = ['src', 'packages/replay-port/src'] as const;
53+
const PRODUCTION_ROOTS = ['src', 'packages/daemon/src', 'packages/replay-port/src'] as const;
5454

5555
function listProductionSourceFiles(): string[] {
5656
const out: string[] = [];
@@ -367,7 +367,7 @@ test('createReplayCoordinator has exactly one production call site', () => {
367367
});
368368

369369
test('coordinator ownership scanning catches re-exports and unresolved dynamic imports', () => {
370-
const probe = 'packages/daemon/src/replay/internal/probe.ts';
370+
const probe = 'packages/daemon/src/sessions/replay/internal/probe.ts';
371371
const source = `
372372
export { createReplayCoordinator } from '../../session-replay-coordinator.ts';
373373
export * from '../../session-replay-coordinator.ts';
@@ -395,7 +395,7 @@ test('coordinator ownership scanning catches aliases, namespaces, and dynamic im
395395
void import('../../session-replay-coordinator.ts');
396396
`;
397397
assert.deepEqual(
398-
coordinatorConstructionSites('packages/daemon/src/replay/internal/probe.ts', source).map(
398+
coordinatorConstructionSites('packages/daemon/src/sessions/replay/internal/probe.ts', source).map(
399399
({ kind }) => kind,
400400
),
401401
['call', 'call', 'dynamic-import'],
@@ -464,11 +464,11 @@ test('the divergence-report chain rejects unresolved dynamic imports', () => {
464464

465465
test('SessionStore ownership scanning catches dynamic imports and re-exports', () => {
466466
const sites = collectImportSites(
467-
'packages/daemon/src/replay/internal/probe.ts',
467+
'packages/daemon/src/sessions/replay/internal/probe.ts',
468468
[
469-
"void import('../../session-store.ts');",
470-
"export { SessionStore } from '../../session-store.ts';",
471-
"export * from '../../session-store.ts';",
469+
"void import('../../../core/session-store.ts');",
470+
"export { SessionStore } from '../../../core/session-store.ts';",
471+
"export * from '../../../core/session-store.ts';",
472472
].join('\n'),
473473
);
474474
assert.equal(sites.filter((site) => importsAnyBinding(site, SESSION_STORE_MODULE)).length, 3);

0 commit comments

Comments
 (0)