Skip to content

Commit 687b53d

Browse files
committed
chore(gates): retarget fallow config, URL-based ownership probe, and audit scope
The route-handler and interaction-facade fallow entries follow their files into the sessions/execution layers. The atomic-publish ownership probe reads its judged sources through new URL(...) relative to the test, so its specifiers follow the move by hand. Two test-support files the move brought into the audit diff join the per-file test-support exemption: every consumer is test-tree code --production analysis cannot see.
1 parent e2ce98c commit 687b53d

15 files changed

Lines changed: 100 additions & 54 deletions

‎.device-evidence/CHECKLIST.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ appended warning:
101101
The false-attribution class is covered by unit tests rather than a device run, because the device
102102
cannot show a cache hit on command: `packages/daemon/src/core/__tests__/capture-disclosure-target-activation.test.ts`
103103
pins that a cache-reused tree discloses nothing, and
104-
`packages/daemon/src/interaction/internal/__tests__/interaction-target-activation-disclosure.test.ts` pins that
104+
`packages/daemon/src/execution/interaction/internal/__tests__/find-target-activation-disclosure.test.ts` pins that
105105
a press which consumed no capture is not disclosed against an older tree.
106106

107107
## Why the live activation lane is manual

‎.fallowrc.json‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,20 @@
217217
},
218218
{
219219
// Daemon route handlers are reached only through the dynamic `import()` table in request-handler-chain.ts, which --production analysis cannot follow to a consumer.
220-
"file": "packages/daemon/src/handlers/{human-control,lease,session,snapshot,react-native,record-trace}.ts",
220+
"file": "packages/daemon/src/sessions/handlers/{human-control,lease,session,snapshot,record-trace}.ts",
221221
"exports": [
222222
"handleHumanControlCommand",
223223
"handleLeaseCommands",
224224
"handleSessionCommands",
225225
"handleSnapshotCommands",
226-
"handleReactNativeCommands",
227226
"handleRecordTraceCommands"
228227
]
229228
},
229+
{
230+
// The react-native route handler lives in the execution layer with its mechanics; same dynamic-loader exemption as the sessions-side route handlers above.
231+
"file": "packages/daemon/src/execution/handlers/react-native.ts",
232+
"exports": ["handleReactNativeCommands"]
233+
},
230234
{
231235
// The interaction facade exposes #2178's named route inputs and deferred handlers, plus the existing ref mutation response consumed by help conformance. Fallow's production graph cannot follow the request-handler-chain dynamic imports, so this exact list is the facade contract.
232236
"file": "packages/daemon/src/execution/interaction/index.ts",
@@ -239,7 +243,7 @@
239243
},
240244
{
241245
// The #2178 route implementations are reached only through the interaction facade's deferred delegates; Fallow's production graph cannot follow those dynamic imports. Keep this exemption limited to the two route entrypoints.
242-
"file": "packages/daemon/src/interaction/internal/{find,interaction}.ts",
246+
"file": "packages/daemon/src/execution/interaction/internal/{find,interaction}.ts",
243247
"exports": ["handleFindCommands", "handleInteractionCommands"]
244248
},
245249
{
@@ -305,6 +309,14 @@
305309
"collectViewportRects"
306310
]
307311
},
312+
{
313+
// 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}",
318+
"exports": ["*"]
319+
},
308320
{
309321
// Test fixtures: every *.fixtures.ts builds doubles for co-located *.test.ts files (several import `vi` directly) and none is imported by production source, so --production analysis sees no consumer for any of them. Scoped to unused-exports rather than ignorePatterns so fixtures stay inside every other Fallow rule (health, dead-code, cycles); `*` rather than today's three symbols because the property being asserted is per-file, not per-symbol.
310322
"file": "**/*.fixtures.ts",

‎packages/daemon/src/server/__tests__/atomic-publish-ownership.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { test } from 'vitest';
44

55
const SIMPLE_PUBLISHERS = [
66
// device-claims.ts delegates every write to device-claim-store.ts's writeDeviceClaim.
7-
new URL('../device/device-claim-store.ts', import.meta.url),
7+
new URL('../../resources/device/device-claim-store.ts', import.meta.url),
88
new URL(
9-
'../../../../packages/daemon-contracts/src/daemon-registration-owner.ts',
9+
'../../../../../packages/daemon-contracts/src/daemon-registration-owner.ts',
1010
import.meta.url,
1111
),
1212
new URL('../provider-lease-expiry.ts', import.meta.url),
13-
new URL('../session-script-writer.ts', import.meta.url),
14-
new URL('../../../../packages/platform-apple/src/runner/runner-lease.ts', import.meta.url),
15-
new URL('../../../../src/remote/remote-connection-state.ts', import.meta.url),
13+
new URL('../../core/session-script-writer.ts', import.meta.url),
14+
new URL('../../../../../packages/platform-apple/src/runner/runner-lease.ts', import.meta.url),
15+
new URL('../../../../../src/remote/remote-connection-state.ts', import.meta.url),
1616
] as const;
1717

1818
const PROCESS_LOCK_SOURCE = new URL(
19-
'../../../../packages/host-kit/src/internal/process-lock.ts',
19+
'../../../../../packages/host-kit/src/internal/process-lock.ts',
2020
import.meta.url,
2121
);
2222

@@ -47,7 +47,7 @@ test('the process lock reclaims in place instead of renaming the lock path', ()
4747

4848
test('durable publishers share the host-kit durable publication owner', () => {
4949
const sourcePaths = [
50-
new URL('../../../../packages/capture-kit/src/durable-capture/store.ts', import.meta.url),
50+
new URL('../../../../../packages/capture-kit/src/durable-capture/store.ts', import.meta.url),
5151
];
5252
for (const sourcePath of sourcePaths) {
5353
const source = fs.readFileSync(sourcePath, 'utf8');

‎scripts/integration-progress-model.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@ const EMPTY_STATEMENT_COVERAGE = { covered: 0, pct: 0, total: 0 };
1010

1111
export function buildIntegrationProgressModel({ root = process.cwd() } = {}) {
1212
const coverageSummary = path.join(root, 'coverage/coverage-summary.json');
13-
const handlerTestDir = path.join(root, 'packages/daemon/src/handlers/__tests__');
13+
const handlerTestDirs = [
14+
path.join(root, 'packages/daemon/src/core/handlers/__tests__'),
15+
path.join(root, 'packages/daemon/src/sessions/handlers/__tests__'),
16+
path.join(root, 'packages/daemon/src/execution/handlers/__tests__'),
17+
];
1418
const providerScenarioDir = path.join(root, 'test/integration/provider-scenarios');
1519
const commandContractFiles = walkFiles(path.join(root, 'src/commands'), (file) =>
1620
isCommandContractSource(file),
1721
);
1822
const clientCommandMethods = readClientCommandMethods(commandContractFiles);
1923

20-
const handlerTests = walkFiles(handlerTestDir, (file) => file.endsWith('.test.ts'));
24+
const handlerTests = handlerTestDirs.flatMap((dir) =>
25+
walkFiles(dir, (file) => file.endsWith('.test.ts')),
26+
);
2127
const providerScenarioTests = walkFiles(providerScenarioDir, (file) => file.endsWith('.test.ts'));
2228
const providerScenarioSources = walkFiles(providerScenarioDir, (file) => file.endsWith('.ts'));
2329
const providerScenarioSupportSources = providerScenarioSources.filter(

‎scripts/layering/architecture-ownership.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,21 @@ export const LOGICAL_MODULE_POLICIES = [
140140
},
141141
{
142142
name: 'daemon-session-lifecycle',
143-
roots: ['packages/daemon/src/session-lifecycle/'],
144-
forbiddenTargetRoots: ['packages/daemon/src/handlers/'],
143+
roots: ['packages/daemon/src/sessions/session-lifecycle/'],
144+
forbiddenTargetRoots: ['packages/daemon/src/sessions/handlers/', 'packages/daemon/src/execution/handlers/'],
145145
facade: DAEMON_SESSION_LIFECYCLE_FACADE,
146146
},
147147
{
148148
name: 'daemon-interaction',
149-
roots: ['packages/daemon/src/interaction/'],
149+
roots: ['packages/daemon/src/execution/interaction/'],
150150
forbiddenTargetRoots: [],
151-
internalForbiddenTargetRoots: ['packages/daemon/src/handlers/'],
151+
internalForbiddenTargetRoots: ['packages/daemon/src/sessions/handlers/', 'packages/daemon/src/execution/handlers/'],
152152
facade: DAEMON_INTERACTION_FACADE,
153153
},
154154
{
155155
name: 'daemon-session-observability',
156-
roots: ['packages/daemon/src/session-observability/'],
157-
forbiddenTargetRoots: ['packages/daemon/src/handlers/'],
156+
roots: ['packages/daemon/src/sessions/session-observability/'],
157+
forbiddenTargetRoots: ['packages/daemon/src/sessions/handlers/', 'packages/daemon/src/execution/handlers/'],
158158
facade: DAEMON_SESSION_OBSERVABILITY_FACADE,
159159
},
160160
] as const satisfies readonly LogicalModulePolicy[];

‎scripts/layering/daemon-client-entry.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ test('a planted runtime import of daemon internals by the client is red', () =>
6060
assert.match(violations[0]!.message, /value-imports daemon internals/);
6161
assert.match(
6262
violations[0]!.message,
63-
/daemon-client-metadata\.ts -> packages\/daemon\/src\/config\.ts/,
63+
/daemon-client-metadata\.ts -> packages\/daemon\/src\/core\/config\.ts/,
6464
);
6565
});
6666

@@ -102,7 +102,7 @@ test('an unrecorded type import of daemon internals is red', () => {
102102
assert.match(violations[0]!.message, /unclassified daemon-client import of daemon internals/);
103103
assert.match(
104104
violations[0]!.message,
105-
/daemon-launch-spec\.ts -> packages\/daemon\/src\/daemon-request\.ts/,
105+
/daemon-launch-spec\.ts -> packages\/daemon\/src\/core\/daemon-request\.ts/,
106106
);
107107
});
108108

‎scripts/layering/daemon-platform-runtime-inventory.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('R76 rejects the direct-iOS selector edge the retired inventory classified'
2525
const sources = {
2626
[RETIRED_TARGET]: RETIRED_STUB,
2727
[RETIRED_IMPORTER]:
28-
"import { queryAppleRuntimeSelector } from '../../../src/platform-runtime-apple-resources.ts';\n" +
28+
"import { queryAppleRuntimeSelector } from '../../../../src/platform-runtime-apple-resources.ts';\n" +
2929
'void queryAppleRuntimeSelector;\n',
3030
};
3131
const found = edgeViolations(sources, RETIRED_IMPORTER);
@@ -34,7 +34,7 @@ test('R76 rejects the direct-iOS selector edge the retired inventory classified'
3434
assert.match(found[0]!.message, /daemon coupling to root platform mechanics is banned/);
3535
assert.match(
3636
found[0]!.message,
37-
/packages\/daemon\/src\/direct-ios-selector\.ts -> src\/platform-runtime-apple-resources\.ts/,
37+
/packages\/daemon\/src\/core\/direct-ios-selector\.ts -> src\/platform-runtime-apple-resources\.ts/,
3838
);
3939
});
4040

@@ -78,8 +78,8 @@ test('R76 reports an import and re-export of one pair as a single violation', ()
7878
const sources = {
7979
[RETIRED_TARGET]: RETIRED_STUB,
8080
[RETIRED_IMPORTER]:
81-
"import { queryAppleRuntimeSelector } from '../../../src/platform-runtime-apple-resources.ts';\n" +
82-
"export { queryAppleRuntimeSelector } from '../../../src/platform-runtime-apple-resources.ts';\n" +
81+
"import { queryAppleRuntimeSelector } from '../../../../src/platform-runtime-apple-resources.ts';\n" +
82+
"export { queryAppleRuntimeSelector } from '../../../../src/platform-runtime-apple-resources.ts';\n" +
8383
'void queryAppleRuntimeSelector;\n',
8484
};
8585
assert.equal(edgeViolations(sources, RETIRED_IMPORTER).length, 1);
@@ -89,7 +89,7 @@ test('R76 rejects a destructured dynamic import of the root platform-runtime fam
8989
const sources = {
9090
[RETIRED_TARGET]: RETIRED_STUB,
9191
[RETIRED_IMPORTER]:
92-
"const { queryAppleRuntimeSelector } = await import('../../../src/platform-runtime-apple-resources.ts');\n" +
92+
"const { queryAppleRuntimeSelector } = await import('../../../../src/platform-runtime-apple-resources.ts');\n" +
9393
'void queryAppleRuntimeSelector;\n',
9494
};
9595
assert.equal(edgeViolations(sources, RETIRED_IMPORTER).length, 1);
@@ -99,15 +99,15 @@ test('R76 rejects a dynamic namespace import of a root platform-runtime module',
9999
const sources = {
100100
[RETIRED_TARGET]: RETIRED_STUB,
101101
[RETIRED_IMPORTER]:
102-
"const appleResources = await import('../../../src/platform-runtime-apple-resources.ts');\n" +
102+
"const appleResources = await import('../../../../src/platform-runtime-apple-resources.ts');\n" +
103103
'void appleResources;\n',
104104
};
105105
const found = edgeViolations(sources, RETIRED_IMPORTER);
106106
assert.equal(found.length, 1);
107107
assert.equal(found[0]!.rule, DAEMON_PLATFORM_RUNTIME_RULE);
108108
assert.match(
109109
found[0]!.message,
110-
/packages\/daemon\/src\/direct-ios-selector\.ts -> src\/platform-runtime-apple-resources\.ts/,
110+
/packages\/daemon\/src\/core\/direct-ios-selector\.ts -> src\/platform-runtime-apple-resources\.ts/,
111111
);
112112
});
113113

‎scripts/layering/model.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ const RECORDED_IMPORT_TYPE_CASES = [
184184
[
185185
'packages/daemon/src/execution/interaction/index.ts',
186186
'packages/daemon/src/core/gesture-runtime.ts',
187-
'../gesture-runtime.ts',
187+
'../../core/gesture-runtime.ts',
188188
'BoundGestureExecutor',
189189
],
190190
[
191191
'packages/daemon/src/execution/interaction/index.ts',
192192
'packages/daemon/src/core/touch-runtime.ts',
193-
'../touch-runtime.ts',
193+
'../../core/touch-runtime.ts',
194194
'BoundTouchExecutor',
195195
],
196196
[

‎scripts/layering/platform-package-policy.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ test('only the canonical composition root may import the private provider compos
266266

267267
sources.set(
268268
'packages/daemon/src/server/request-router.ts',
269-
"import { providerScope } from '../../../src/platform-runtime/request-providers.ts';",
269+
"import { providerScope } from '../../../../src/platform-runtime/request-providers.ts';",
270270
);
271271
assert.match(
272272
messages(sources).join('\n'),

‎scripts/layering/ratchet-reference.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ test('measureRatchets reports all ratchets from one tree', () => {
6262
});
6363
const withAuthority = tree({
6464
'packages/daemon/src/handlers/fixture.ts':
65-
"import type { SessionState } from '../session-state.ts';\n" +
66-
"import { SessionStore } from '../session-store.ts';",
65+
"import type { SessionState } from '../core/session-state.ts';\n" +
66+
"import { SessionStore } from '../core/session-store.ts';",
6767
'packages/daemon/src/core/session-store.ts': 'export class SessionStore {}',
6868
});
6969
assert.deepEqual(

0 commit comments

Comments
 (0)