The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
test: keep stale lock race fixture portable
haelyraafdf403ae9e3
diff --git a/tests/docs/story-lifecycle-ledger.test.js b/tests/docs/story-lifecycle-ledger.test.jsindex 4f97eabd7..f96bafb88 100644--- a/tests/docs/story-lifecycle-ledger.test.js+++ b/tests/docs/story-lifecycle-ledger.test.js@@ -320,7 +320,7 @@ const tests = [const preload = path.join(root, 'race.js');fs.writeFileSync(preload, `const fs = require('fs'); const orig = fs.openSync; let raced = false;fs.openSync = function (p, ...a) { const r = orig.call(fs, p, ...a);- if (!raced && String(p).endsWith('.lock') && a[0] === fs.constants.O_NOFOLLOW) { raced = true; fs.unlinkSync(p);+ if (!raced && String(p).endsWith('.lock') && a[0] === (fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW || 0))) { raced = true; fs.unlinkSync(p);fs.writeFileSync(p, JSON.stringify({ pid: ${process.pid}, host: require('os').hostname(), at: 'live' }), { flag: 'wx' }); }return r; };`);const r = spawnSync(process.execPath, ['-r', preload, LEDGER, 'allocate', '--epic', 'auth-flow', '--root', root, '--wait-ms', '200'], { encoding: 'utf8' });