Skip to content

Commit 8610f00

Browse files
thymikeeclaude
andcommitted
chore(gates): keep exec out of the runner toolchain identity
Lint the identity reader and the runner fingerprint so neither can import node:child_process, host-kit's command helpers, or any runner host export but commandDeveloperDir. A planted runCmd import and a planted node:child_process import each fail the rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 8b112e4 commit 8610f00

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎oxlint.config.ts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const NODE_OS_PATH = {
3333
name: 'node:os',
3434
};
3535

36+
const TOOLCHAIN_IDENTITY_EXEC_MESSAGE =
37+
'Read the toolchain identity from Xcode files (xcode-bundle-identity.ts); an exec here can stall the runner cache decision.';
38+
3639
const CHILD_PROCESS_BAN_ROOTS = ['src', 'packages/host-kit/src'];
3740
const PROVIDER_BAN_ROOTS = ['src/commands', 'src/cli/commands'];
3841

@@ -244,6 +247,30 @@ export default defineConfig({
244247
'no-restricted-imports': ['error', { paths: [CHILD_PROCESS_PATH] }],
245248
},
246249
},
250+
{
251+
// The runner cache key reads the selected Xcode's files and execs nothing: a hosted macOS
252+
// runner can stall an `xcrun` exec longer than any budget (Perf Nightly run 40441065511).
253+
files: [
254+
'packages/platform-apple/src/runner/xcode-bundle-identity.ts',
255+
'packages/platform-apple/src/runner/runner-toolchain-identity.ts',
256+
],
257+
rules: {
258+
'no-restricted-imports': [
259+
'error',
260+
{
261+
paths: [
262+
{ ...CHILD_PROCESS_PATH, message: TOOLCHAIN_IDENTITY_EXEC_MESSAGE },
263+
{ name: '@agent-device/host-kit/command', message: TOOLCHAIN_IDENTITY_EXEC_MESSAGE },
264+
{
265+
name: './host.ts',
266+
allowImportNames: ['commandDeveloperDir'],
267+
message: TOOLCHAIN_IDENTITY_EXEC_MESSAGE,
268+
},
269+
],
270+
},
271+
],
272+
},
273+
},
247274
{
248275
// The host-kit process helpers are the sanctioned node:child_process importer.
249276
files: ['packages/host-kit/src/internal/exec.ts'],

0 commit comments

Comments
 (0)