Skip to content

Commit 805c818

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 0a3739a commit 805c818

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎oxlint.config.ts‎

Lines changed: 24 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 the selected Xcode files; 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,27 @@ 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: ['packages/platform-apple/src/runner/runner-toolchain-identity.ts'],
254+
rules: {
255+
'no-restricted-imports': [
256+
'error',
257+
{
258+
paths: [
259+
{ ...CHILD_PROCESS_PATH, message: TOOLCHAIN_IDENTITY_EXEC_MESSAGE },
260+
{ name: '@agent-device/host-kit/command', message: TOOLCHAIN_IDENTITY_EXEC_MESSAGE },
261+
{
262+
name: './host.ts',
263+
allowImportNames: ['commandDeveloperDir'],
264+
message: TOOLCHAIN_IDENTITY_EXEC_MESSAGE,
265+
},
266+
],
267+
},
268+
],
269+
},
270+
},
247271
{
248272
// The host-kit process helpers are the sanctioned node:child_process importer.
249273
files: ['packages/host-kit/src/internal/exec.ts'],

0 commit comments

Comments
 (0)