Skip to content

Commit 43a8978

Browse files
committed
chore(gates): settle self-review findings on the package base
Dead oxlint override for a file deleted before this stack, the vacuous device-lane fixture pin (now asserts the fixture exists, at its path in this tree), the R81 helpers that never needed to leave their module, and the closure-probe hops that follow the interaction routes and replay probes into their layer folders. (cherry picked from commit baebba2; the ime-capture fixture pin tracks its 11b home under packages/platform-android/src/fixtures/) (cherry picked from commit 5e88063) # Conflicts: # oxlint.config.ts
1 parent 2605451 commit 43a8978

8 files changed

Lines changed: 38 additions & 24 deletions

File tree

‎scripts/check-affected/device-lanes.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// a tooling change beside it still fails open to the full set.
44

55
import assert from 'node:assert/strict';
6+
import fs from 'node:fs';
67
import { test } from 'node:test';
78
import { deviceLaneLeaf, deviceLanesFor, isDeviceLaneSurface, isUnitTest } from './device-lanes.ts';
89
import { selectChecks, type CheckId } from './model.ts';
@@ -137,7 +138,11 @@ test('unit tests under src/ and packages/*/src own no lane', () => {
137138
assert.deepEqual(lanes(file), [], file);
138139
}
139140
// Non-TypeScript under __tests__ is a fixture the selector cannot place, not a unit test.
140-
assert.ok(!isUnitTest('packages/platform-android/src/android-ime-capture.raw.json'));
141+
// The existence pin keeps this from going vacuous when the fixture moves again: a path that
142+
// no longer exists satisfies !isUnitTest for the wrong reason.
143+
const imeFixture = 'packages/platform-android/src/fixtures/android-ime-capture.raw.json';
144+
assert.ok(fs.existsSync(imeFixture), imeFixture);
145+
assert.ok(!isUnitTest(imeFixture));
141146
// Package tests outside src/ have no owner and keep failing open.
142147
assert.ok(!isUnitTest('packages/maestro/test/conformance/verify.test.ts'));
143148
assert.equal(

‎scripts/depgraph/affected.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ test('commandsReaching follows the dynamic import a route uses to load its handl
8989
// These are in-memory arbitrary paths for graph traversal, not repository ownership metadata.
9090
const edges = edgesOf({
9191
'packages/daemon/src/sessions/handlers/session.ts':
92-
"import { helper } from '../../../../src/utils/helper.ts';\nexport const h = helper;",
92+
"import { helper } from '../../../../../src/utils/helper.ts';\nexport const h = helper;",
9393
'packages/daemon/src/execution/interaction/index.ts': 'export const f = 1;',
9494
'src/utils/helper.ts': 'export const helper = 1;',
9595
'packages/daemon/src/chain.ts': [
96-
"export const routes = { session: () => import('./handlers/session.ts'),",
97-
" find: () => import('./interaction/index.ts') };",
96+
"export const routes = { session: () => import('./sessions/handlers/session.ts'),",
97+
" find: () => import('./execution/interaction/index.ts') };",
9898
].join('\n'),
9999
});
100100
const chains = [

‎scripts/depgraph/model.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ function authorityFixture(): Map<string, string> {
3939
"import type { ProgressShape } from '@agent-device/contracts/progress';",
4040
].join('\n'),
4141
'packages/daemon/src/capability-consumer.ts': [
42-
"import { createRequestRuntimeBindings } from './request-runtime-binding.ts';",
43-
"import { isSessionRecording } from './session-script-publication-capability.ts';",
42+
"import { createRequestRuntimeBindings } from './core/request-runtime-binding.ts';",
43+
"import { isSessionRecording } from './core/session-script-publication-capability.ts';",
4444
].join('\n'),
4545
'packages/daemon/src/state-consumer.ts': [
46-
"import type { SessionState } from './session-state.ts';",
47-
"import { SessionStore } from './session-store.ts';",
46+
"import type { SessionState } from './core/session-state.ts';",
47+
"import { SessionStore } from './core/session-store.ts';",
4848
].join('\n'),
4949
'packages/daemon/src/type-consumer.ts':
50-
"import type { SessionStore } from './session-store.ts';\n",
50+
"import type { SessionStore } from './core/session-store.ts';\n",
5151
'packages/capture-kit/src/snapshot/policy-consumer.ts': [
5252
"import type { SessionState } from '../../../../packages/daemon/src/core/session-state.ts';",
5353
"import type { SessionRef } from '../../../../packages/daemon/src/core/session-state.ts';",
5454
"import './ordinary-target.ts';",
5555
].join('\n'),
5656
'packages/daemon/src/ordinary-consumer.ts': [
5757
"import { SessionState } from './session-state-store.ts';",
58-
"import { createRequestRuntimeBindingsExtra } from './request-runtime-binding.ts';",
58+
"import { createRequestRuntimeBindingsExtra } from './core/request-runtime-binding.ts';",
5959
].join('\n'),
6060
'packages/daemon/src/core/session-state.ts':
6161
'export type SessionState = { name: string };\nexport type SessionRef = unknown;\n',

‎scripts/integration-progress-model.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const EMPTY_STATEMENT_COVERAGE = { covered: 0, pct: 0, total: 0 };
1111
export function buildIntegrationProgressModel({ root = process.cwd() } = {}) {
1212
const coverageSummary = path.join(root, 'coverage/coverage-summary.json');
1313
const handlerTestDirs = [
14-
path.join(root, 'packages/daemon/src/core/handlers/__tests__'),
1514
path.join(root, 'packages/daemon/src/sessions/handlers/__tests__'),
1615
path.join(root, 'packages/daemon/src/execution/handlers/__tests__'),
1716
];

‎scripts/layering/architecture-ownership.ts‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,29 @@ export const LOGICAL_MODULE_POLICIES = [
143143
{
144144
name: 'daemon-session-lifecycle',
145145
roots: ['packages/daemon/src/sessions/session-lifecycle/'],
146-
forbiddenTargetRoots: ['packages/daemon/src/sessions/handlers/', 'packages/daemon/src/execution/handlers/'],
146+
forbiddenTargetRoots: [
147+
'packages/daemon/src/sessions/handlers/',
148+
'packages/daemon/src/execution/handlers/',
149+
],
147150
facade: DAEMON_SESSION_LIFECYCLE_FACADE,
148151
},
149152
{
150153
name: 'daemon-interaction',
151154
roots: ['packages/daemon/src/execution/interaction/'],
152155
forbiddenTargetRoots: [],
153-
internalForbiddenTargetRoots: ['packages/daemon/src/sessions/handlers/', 'packages/daemon/src/execution/handlers/'],
156+
internalForbiddenTargetRoots: [
157+
'packages/daemon/src/sessions/handlers/',
158+
'packages/daemon/src/execution/handlers/',
159+
],
154160
facade: DAEMON_INTERACTION_FACADE,
155161
},
156162
{
157163
name: 'daemon-session-observability',
158164
roots: ['packages/daemon/src/sessions/session-observability/'],
159-
forbiddenTargetRoots: ['packages/daemon/src/sessions/handlers/', 'packages/daemon/src/execution/handlers/'],
165+
forbiddenTargetRoots: [
166+
'packages/daemon/src/sessions/handlers/',
167+
'packages/daemon/src/execution/handlers/',
168+
],
160169
facade: DAEMON_SESSION_OBSERVABILITY_FACADE,
161170
},
162171
] as const satisfies readonly LogicalModulePolicy[];

‎scripts/layering/session-authority-overlay.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ export function measureSessionAuthorityOverlay(
6363
) {
6464
shape.add(edge.file);
6565
}
66-
if (
67-
SESSION_STORE_AUTHORITY_TARGETS.has(edge.target) &&
68-
edge.symbols.includes('SessionStore')
69-
) {
66+
if (SESSION_STORE_AUTHORITY_TARGETS.has(edge.target) && edge.symbols.includes('SessionStore')) {
7067
authority.add(edge.file);
7168
}
7269
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,10 @@ 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/sessions/replay/internal/probe.ts', source).map(
399-
({ kind }) => kind,
400-
),
398+
coordinatorConstructionSites(
399+
'packages/daemon/src/sessions/replay/internal/probe.ts',
400+
source,
401+
).map(({ kind }) => kind),
401402
['call', 'call', 'dynamic-import'],
402403
);
403404
});

‎src/__tests__/daemon-composition/request-handler-chain.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,18 @@ test('route owner files match the production module loaders', () => {
9898
);
9999

100100
assert.equal(definitions.length + 1, Object.keys(ownerFiles).length);
101+
// The loaders are relative to the chain module, which lives in a layer folder; resolve them
102+
// the same way the runtime does instead of assuming the package root.
103+
const CHAIN_DIR = 'packages/daemon/src/sessions/';
101104
for (const [, route, modulePath] of definitions) {
102105
assert.ok(route && modulePath);
103106
assert.equal(
104107
ownerFiles[route as keyof typeof ownerFiles],
105-
`packages/daemon/src/${modulePath.slice(2)}`,
108+
path.posix.normalize(`${CHAIN_DIR}${modulePath}`),
106109
);
107110
}
108111
assert.ok(genericModulePath && genericRouteMatches);
109-
assert.equal(ownerFiles.generic, `packages/daemon/src/${genericModulePath.slice(2)}`);
112+
assert.equal(ownerFiles.generic, path.posix.normalize(`${CHAIN_DIR}${genericModulePath}`));
110113

111114
assert.ok(
112115
!/ownerFile/.test(source),
@@ -153,7 +156,7 @@ test('interaction facade keeps route implementations out of its eager import clo
153156
for (const routeModule of ['find.ts', 'interaction.ts']) {
154157
const routePath = path.resolve(
155158
import.meta.dirname,
156-
`../../../packages/daemon/src/interaction/internal/${routeModule}`,
159+
`../../../packages/daemon/src/execution/interaction/internal/${routeModule}`,
157160
);
158161
assert.equal(
159162
fs.existsSync(routePath),

0 commit comments

Comments
 (0)