Skip to content

Commit c582e8b

Browse files
committed
chore(gates): register @agent-device/test-kit and approve its fixture-subpath closure weights
1 parent 8692e8f commit c582e8b

8 files changed

Lines changed: 75 additions & 7 deletions

File tree

‎.fallowrc.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,14 @@
314314
"exports": ["*"]
315315
},
316316
{
317-
// Published package surfaces (see each package.json#exports); consumers may be external or reach them through workspace package exports Fallow does not follow.
318-
"file": "{src/sdk/*.ts,src/ai-sdk/index.ts,packages/proxy/src/index.ts}",
317+
// @agent-device/test-kit is the test-helper package: every module is consumed only from the test trees (root, scripts/, packages/, test/), which --production analysis does not see, exactly like the *.fixtures.ts entry above. The package manifest's exports map owns its surface; the same per-file blanket keeps it inside every other Fallow rule.
318+
"file": "packages/test-kit/src/*.ts",
319319
"exports": ["*"]
320320
},
321321
{
322-
// #1642: its three consumers (src/__tests__/cli-device-status.test.ts, src/daemon/device/__tests__/device-claims.test.ts, src/daemon/device/__tests__/device-claim-prune.test.ts) all reach it the only way a Vitest module mock can — `vi.mock(path, async (importOriginal) => (await import('...host-process-mock.ts')).pinOwnProcessStartTime(importOriginal))`. Dependency analysis cannot follow that dynamic import to a consumer, the same limitation the daemon route-handler entry above records.
323-
"file": "src/__tests__/test-utils/host-process-mock.ts",
324-
"exports": ["pinOwnProcessStartTime"]
322+
// Published package surfaces (see each package.json#exports); consumers may be external or reach them through workspace package exports Fallow does not follow.
323+
"file": "{src/sdk/*.ts,src/ai-sdk/index.ts,packages/proxy/src/index.ts}",
324+
"exports": ["*"]
325325
},
326326
{
327327
// Tool config default exports, loaded by the tool rather than imported.
@@ -356,7 +356,7 @@
356356
"exports": ["getSessionCommandKind"]
357357
},
358358
{
359-
// Workspace-package symbols whose only consumers are test-tree files, which --production analysis does not see. Each import is the package specifier, so the façade entry is load-bearing: parseTargetAnnotationV1Payload/TARGET_ANNOTATION_MAX_FIELD_BYTES from src/daemon/__tests__/session-target-evidence.test.ts, MAESTRO_COMPAT_* from src/cli/parser/__tests__/maestro-support-matrix.test.ts, SCRIPT_FLAG_COMMANDS/scriptFlagEntries from src/commands/replay/script-flag-admission.test.ts (the #3197 two-way drift guard between the .ad grammar and the CLI schema), createAppLogLiveHandle from src/__tests__/test-utils/app-log-live-handle.ts (its production sibling createAppLogLiveHandleFromFinish wraps it, and scripts/layering/platform-package-policy.test.ts pins the specifier form).
359+
// Workspace-package symbols whose only consumers are test-tree files, which --production analysis does not see. Each import is the package specifier, so the façade entry is load-bearing: parseTargetAnnotationV1Payload/TARGET_ANNOTATION_MAX_FIELD_BYTES from src/daemon/__tests__/session-target-evidence.test.ts, MAESTRO_COMPAT_* from src/cli/parser/__tests__/maestro-support-matrix.test.ts, SCRIPT_FLAG_COMMANDS/scriptFlagEntries from src/commands/replay/script-flag-admission.test.ts (the #3197 two-way drift guard between the .ad grammar and the CLI schema), createAppLogLiveHandle from packages/test-kit/src/app-log-live-handle.ts (its production sibling createAppLogLiveHandleFromFinish wraps it, and scripts/layering/platform-package-policy.test.ts pins the specifier form).
360360
"file": "packages/{ad-script,maestro,capture-kit}/src/index.ts",
361361
"exports": [
362362
"parseTargetAnnotationV1Payload",

‎examples/sdk/tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
{ "path": "../../packages/replay-test" },
6060
{ "path": "../../packages/selectors" },
6161
{ "path": "../../packages/session-journal" },
62+
{ "path": "../../packages/test-kit" },
6263
{ "path": "../../packages/xml" }
6364
]
6465
}

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@
312312
"@agent-device/replay-test": "workspace:*",
313313
"@agent-device/selectors": "workspace:*",
314314
"@agent-device/session-journal": "workspace:*",
315+
"@agent-device/test-kit": "workspace:*",
315316
"@agent-device/xml": "workspace:*",
316317
"@arethetypeswrong/cli": "^0.18.5",
317318
"@chenglou/freerange": "^0.0.4",

‎pnpm-lock.yaml‎

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,40 @@ 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+
// The three test-kit helpers whose narrow fixture subpath sits behind a heavy package façade
137+
// (the capture-kit barrel, the command-registry catalog, and the contracts runtime-facet
138+
// family). Every module they evaluate is workspace-package vocabulary — no concrete platform
139+
// implementation, which the deny-platform assertion below separately proves. The ceiling
140+
// guards production entry weight; a test-only helper's closure is never loaded by a CLI run,
141+
// a daemon start, or the published bundle.
142+
'packages/test-kit/src/app-log-live-handle.ts': {
143+
issue: '#1490',
144+
reason:
145+
'Test-only live-handle constructor; its one value edge is the capture-kit façade that owns ' +
146+
'the real implementation, so its closure is capture-kit + contracts + kernel vocabulary. ' +
147+
'The subpath is one function, and splitting the capture-kit façade for it would move ' +
148+
'production code for a test import.',
149+
owner: 'test-kit',
150+
},
151+
'packages/test-kit/src/property-arbitraries.ts': {
152+
issue: '#1490',
153+
reason:
154+
"Test-only fast-check arbitraries; the weight is the command-registry catalog's eager " +
155+
'registry-metadata surface, which the property files must read to stay drift-free against ' +
156+
'the registry (the #1413 shared-hazard design). No platform implementation; never bundled.',
157+
owner: 'test-kit',
158+
},
159+
'packages/test-kit/src/runtime-operation-facts.ts': {
160+
issue: '#1490',
161+
reason:
162+
'Test-only unavailable-runtime fact builders typed against the twelve runtime-facet ' +
163+
'contracts subpaths plus kernel device vocabulary; the contracts family is exactly the ' +
164+
'vocabulary-facade layer the budgets treat as cheap per edge, and no single facet can be ' +
165+
'dropped without breaking a runtime-seam fixture consumer.',
166+
owner: 'test-kit',
167+
},
168+
});
136169

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

‎scripts/layering/model.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export const UNRANKED_ZONES: ReadonlySet<string> = new Set([
112112
'host-kit',
113113
'capture-kit',
114114
'provision-kit',
115+
'test-kit',
115116
...PLATFORMS.map((family) => `platform-${family}`),
116117
'provider-webdriver',
117118
'provider-limrun',

‎tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
{ "path": "packages/replay-test" },
5555
{ "path": "packages/selectors" },
5656
{ "path": "packages/session-journal" },
57+
{ "path": "packages/test-kit" },
5758
{ "path": "packages/xml" }
5859
]
5960
}

‎vitest.config.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ export default defineConfig({
278278
'src/**/*.test.ts',
279279
'src/**/__tests__/**',
280280
'**/*.fixtures.ts',
281+
// Test helpers are test material, not product surface: they sat under `__tests__/` roots
282+
// before @agent-device/test-kit existed and must stay out of the coverage denominator.
283+
'packages/test-kit/**',
281284
'src/**/*-types.ts',
282285
'src/**/types.ts',
283286
'src/sdk/**',

0 commit comments

Comments
 (0)