@tangle-network/agent-bench 0.8.32 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -246,6 +246,7 @@ async function makeSyntheticMirror(root: string): Promise<SyntheticMirror> {
246
246
  const mirror = join(root, 'mirror')
247
247
  await mkdir(mirror, { recursive: true })
248
248
  await runOk('git', ['-C', mirror, 'init', '-q', '-b', 'main'])
249
+ await runOk('git', ['-C', mirror, 'config', 'core.hooksPath', '/dev/null'])
249
250
  await writeFile(join(mirror, 'README.md'), '# synthetic\n')
250
251
  await writeFile(
251
252
  join(mirror, 'package.json'),
@@ -359,7 +360,8 @@ describe('parseVitestSummary', () => {
359
360
  })
360
361
  })
361
362
 
362
- describe('factory command credential isolation', () => {
363
+ // The isolated Docker controller uses the Linux daemon socket, never personal Docker contexts.
364
+ describe.skipIf(process.platform !== 'linux')('factory command credential isolation', () => {
363
365
  it('blocks arbitrary env, auth sockets, npm config, and home credentials from a package lifecycle script', async () => {
364
366
  const ambientHome = join(root, 'ambient-home')
365
367
  const ambientXdg = join(root, 'ambient-xdg')
@@ -506,7 +508,7 @@ describe('loadFactoryInstance', () => {
506
508
  // Judge child pipeline on the synthetic fixture.
507
509
  // ---------------------------------------------------------------------------
508
510
 
509
- describe('judgeFactoryPatch', () => {
511
+ describe.skipIf(process.platform !== 'linux')('judgeFactoryPatch', () => {
510
512
  it('gold (impl-only PR diff) resolves with full score', async () => {
511
513
  const { result } = await judgeFactoryPatch(goodInst, await goldImplPatch(goodInst))
512
514
  expect(result).toMatchObject({ resolved: true, score: 1, passed: 2, total: 2 })
@@ -597,7 +599,7 @@ describe('materializeFactoryWorkspace', () => {
597
599
  // Calibration admission gate — both rejection directions.
598
600
  // ---------------------------------------------------------------------------
599
601
 
600
- describe('calibrateFactoryInstance', () => {
602
+ describe.skipIf(process.platform !== 'linux')('calibrateFactoryInstance', () => {
601
603
  it('admits a well-formed instance (gold passes, base fails)', async () => {
602
604
  const r = await calibrateFactoryInstance(goodInst)
603
605
  expect(r).toMatchObject({
@@ -535,6 +535,7 @@ describe('fanOutLoopsGenerator with the gepa seat', () => {
535
535
  loopsRepo = await mkdtemp(join(tmpdir(), 'gepa-repo-'))
536
536
  outDir = await mkdtemp(join(tmpdir(), 'gepa-out-'))
537
537
  await runOk('git', ['init', '-q', '-b', 'main', loopsRepo])
538
+ await runOk('git', ['-C', loopsRepo, 'config', 'core.hooksPath', '/dev/null'])
538
539
  await git(['config', 'user.email', 't@t.dev'], loopsRepo)
539
540
  await git(['config', 'user.name', 'T'], loopsRepo)
540
541
  await mkdir(join(loopsRepo, 'extensions', 'pi', 'prompts'), { recursive: true })
@@ -995,6 +996,7 @@ describe('integration: real adapter roundtrip', () => {
995
996
  const outDir = await mkdtemp(join(tmpdir(), 'gepa-int-out-'))
996
997
  try {
997
998
  await runOk('git', ['init', '-q', '-b', 'main', loopsRepo])
999
+ await runOk('git', ['-C', loopsRepo, 'config', 'core.hooksPath', '/dev/null'])
998
1000
  await runOk('git', ['-C', loopsRepo, 'config', 'user.email', 't@t.dev'])
999
1001
  await runOk('git', ['-C', loopsRepo, 'config', 'user.name', 'T'])
1000
1002
  await mkdir(join(loopsRepo, 'extensions', 'pi', 'prompts'), { recursive: true })
@@ -182,6 +182,7 @@ describe('loadFullCampaignCells + incumbentSurfaceHash (real fs/git)', () => {
182
182
 
183
183
  it('computes the same incumbent hash for the unchanged tip (baseCommit == candidateCommit, empty patch)', async () => {
184
184
  await runOk('git', ['init', '-q', '-b', 'main', repo])
185
+ await runOk('git', ['-C', repo, 'config', 'core.hooksPath', '/dev/null'])
185
186
  await runOk('git', ['-C', repo, 'config', 'user.email', 't@t.dev'])
186
187
  await runOk('git', ['-C', repo, 'config', 'user.name', 'T'])
187
188
  await writeFile(join(repo, 'a.txt'), 'x\n')
@@ -65,18 +65,16 @@ describe('run process-group timeout', () => {
65
65
  const dir = await mkdtemp(join(tmpdir(), 'swe-proc-tree-'))
66
66
  dirs.push(dir)
67
67
  const pidFile = join(dir, 'grandchild.pid')
68
- const grandchild = `process.on('SIGTERM',()=>{}); setInterval(()=>{},1000)`
68
+ const grandchild = `process.on('SIGTERM',()=>{}); require('node:fs').writeFileSync(process.argv[1],String(process.pid)); setInterval(()=>{},1000)`
69
69
  const parent = [
70
70
  `const {spawn}=require('node:child_process')`,
71
- `const fs=require('node:fs')`,
72
- `const child=spawn(process.execPath,['-e',${JSON.stringify(grandchild)}],{stdio:'ignore'})`,
73
- `fs.writeFileSync(process.argv[1],String(child.pid))`,
71
+ `spawn(process.execPath,['-e',${JSON.stringify(grandchild)},process.argv[1]],{stdio:'ignore'})`,
74
72
  `process.on('SIGTERM',()=>process.exit(0))`,
75
73
  `setInterval(()=>{},1000)`,
76
74
  ].join(';')
77
75
 
78
76
  const result = await run(process.execPath, ['-e', parent, pidFile], {
79
- timeoutMs: 100,
77
+ timeoutMs: 2_000,
80
78
  killGraceMs: 50,
81
79
  })
82
80
  const grandchildPid = Number(await readFile(pidFile, 'utf8'))
@@ -358,6 +358,7 @@ describe('fanOutLoopsGenerator', () => {
358
358
  loopsRepo = await mkdtemp(join(tmpdir(), 'fanout-repo-'))
359
359
  outDir = await mkdtemp(join(tmpdir(), 'fanout-out-'))
360
360
  await runOk('git', ['init', '-q', '-b', 'main', loopsRepo])
361
+ await runOk('git', ['-C', loopsRepo, 'config', 'core.hooksPath', '/dev/null'])
361
362
  await git(['config', 'user.email', 't@t.dev'], loopsRepo)
362
363
  await git(['config', 'user.name', 'T'], loopsRepo)
363
364
  await writeFile(join(loopsRepo, 'src.ts'), 'base\n')
@@ -399,6 +399,8 @@ export async function materializeFactoryWorkspace(
399
399
  await writeFile(join(dest, 'SPEC.md'), inst.spec)
400
400
 
401
401
  await runOk('git', ['-C', dest, 'init', '-q', '-b', 'work'])
402
+ // This synthetic benchmark repository must not execute the host's personal Git hooks.
403
+ await runOk('git', ['-C', dest, 'config', 'core.hooksPath', '/dev/null'])
402
404
  await runOk('git', ['-C', dest, 'config', 'user.email', 'factory-bench@local'])
403
405
  await runOk('git', ['-C', dest, 'config', 'user.name', 'factory-bench'])
404
406
  await runOk('git', ['-C', dest, 'add', '-A'])
@@ -21,6 +21,7 @@ describe('scratch worktrees', () => {
21
21
  const output = await mkdtemp(join(tmpdir(), 'scratch-worktree-out-'))
22
22
  roots.push(repository, output)
23
23
  await runOk('git', ['init', '-q', '-b', 'main', repository])
24
+ await runOk('git', ['-C', repository, 'config', 'core.hooksPath', '/dev/null'])
24
25
  await runOk('git', ['-C', repository, 'config', 'user.email', 'test@example.com'])
25
26
  await runOk('git', ['-C', repository, 'config', 'user.name', 'Test'])
26
27
  await writeFile(join(repository, 'seed.txt'), 'seed\n')
@@ -51,5 +52,5 @@ describe('scratch worktrees', () => {
51
52
  await runOk('git', ['-C', repository, 'worktree', 'list', '--porcelain'])
52
53
  ).stdout
53
54
  expect(listed.match(/^worktree /gmu)).toHaveLength(1)
54
- })
55
+ }, 60_000)
55
56
  })
@@ -93,9 +93,13 @@ describe('SWE worker prompts', () => {
93
93
 
94
94
  describe('SWE temporary directory', () => {
95
95
  it('stays absolute when model temperature is configured through TEMPERATURE', () => {
96
+ const priorTmpdir = process.env.TMPDIR
97
+ const priorTmp = process.env.TMP
96
98
  const priorTemp = process.env.TEMP
97
99
  const priorTemperature = process.env.TEMPERATURE
98
100
  try {
101
+ delete process.env.TMPDIR
102
+ delete process.env.TMP
99
103
  delete process.env.TEMP
100
104
  process.env.TEMPERATURE = '0.8'
101
105
  assert.equal(isAbsolute(absoluteSweTempDir()), true)
@@ -103,6 +107,10 @@ describe('SWE temporary directory', () => {
103
107
  process.env.TEMP = '0.8'
104
108
  assert.throws(() => absoluteSweTempDir(), /must be absolute.*TEMPERATURE/)
105
109
  } finally {
110
+ if (priorTmpdir === undefined) delete process.env.TMPDIR
111
+ else process.env.TMPDIR = priorTmpdir
112
+ if (priorTmp === undefined) delete process.env.TMP
113
+ else process.env.TMP = priorTmp
106
114
  if (priorTemp === undefined) delete process.env.TEMP
107
115
  else process.env.TEMP = priorTemp
108
116
  if (priorTemperature === undefined) delete process.env.TEMPERATURE
@@ -197,7 +205,7 @@ describe('isInsideJail (realpath containment)', () => {
197
205
  symlinkSync('/etc', link)
198
206
  // `resolveInJail` does `realpathSync(join(ws.dir, relPath))` then this containment check.
199
207
  const real = realpathSync(join(dir, 'escape/passwd'))
200
- assert.equal(real, '/etc/passwd')
208
+ assert.equal(real, realpathSync('/etc/passwd'))
201
209
  assert.equal(isInsideJail(jailRoot, real), false)
202
210
  })
203
211