The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
test: verify Corepack uses the pinned pnpm version
benno0o7c2bc54be268
diff --git a/tests/scripts/codex-hooks.test.js b/tests/scripts/codex-hooks.test.jsindex 37ccfe1c8..628a37da7 100644--- a/tests/scripts/codex-hooks.test.js+++ b/tests/scripts/codex-hooks.test.js@@ -132,7 +132,12 @@ const cacheManifestWithLocalRefs = {let passed = 0;let failed = 0;-function runHermeticPrePush({ failScript = null, includeCorepack = true, includePnpm = false } = {}) {+function runHermeticPrePush({+ failScript = null,+ includeCorepack = true,+ includePnpm = false,+ audit = false,+} = {}) {const tempDir = createTempDir('codex-pre-push-');const binDir = path.join(tempDir, 'bin');const projectDir = path.join(tempDir, 'project');@@ -141,6 +146,7 @@ function runHermeticPrePush({ failScript = null, includeCorepack = true, includefs.mkdirSync(binDir);fs.mkdirSync(projectDir);const functionStub = (name, corepack) => `${name}() {+${corepack ? 'node -e \'const p=require("./package.json"); process.exit(p.packageManager === "[email protected]" ? 0 : 1)\' || return 97' : ':'}printf '%s\\n' "${corepack ? '' : 'pnpm '}$*" >> "${toBashPath(callsPath)}"${corepack ? 'shift' : ':'}shift@@ -165,7 +171,7 @@ ${includePnpm ? functionStub('pnpm', false) : ''}env: {PATH: toBashPath(binDir),BASH_ENV: toBashPath(bashEnv),- ECC_PREPUSH_AUDIT: '0',+ ECC_PREPUSH_AUDIT: audit ? '1' : '0',ECC_SKIP_GIT_HOOKS: '0',ECC_SKIP_PREPUSH: '0',MSYS_NO_PATHCONV: '1',@@ -235,6 +241,39 @@ if (passed++;else failed++;+if (+ test('pre-push runs the production audit through Corepack pnpm', () => {+ const { result, calls } = runHermeticPrePush({ audit: true });+ assert.strictEqual(result.status, 0, `${result.stdout}\n${result.stderr}`);+ assert.deepStrictEqual(calls, [+ 'pnpm run lint',+ 'pnpm run typecheck',+ 'pnpm run test',+ 'pnpm run build',+ 'pnpm audit --prod',+ ]);+ })+)+ passed++;+else failed++;++if (+ test('pre-push fails closed when the production audit fails', () => {+ const { result, calls } = runHermeticPrePush({ audit: true, failScript: '--prod' });+ assert.notStrictEqual(result.status, 0, `${result.stdout}\n${result.stderr}`);+ assert.deepStrictEqual(calls, [+ 'pnpm run lint',+ 'pnpm run typecheck',+ 'pnpm run test',+ 'pnpm run build',+ 'pnpm audit --prod',+ ]);+ assert.match(result.stderr, /pnpm audit failed/);+ })+)+ passed++;+else failed++;+if (test('check-plugin-cache fails when the installed cache is missing manifest-referenced files', () => {const homeDir = createTempDir('codex-plugin-cache-home-');