@tangle-network/agent-bench 0.3.7 → 0.3.8
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.
- package/CHANGELOG.md +4 -0
- package/HARNESS.md +43 -0
- package/dist/adapters.js +23 -23
- package/dist/benchmarks/_harness.d.ts +1 -1
- package/dist/benchmarks/_harness.js +1 -1
- package/dist/benchmarks/aec-bench.js +2 -2
- package/dist/benchmarks/agentbench.js +2 -2
- package/dist/benchmarks/appworld.js +2 -2
- package/dist/benchmarks/bfcl.js +2 -2
- package/dist/benchmarks/commit0.js +2 -2
- package/dist/benchmarks/crag.js +2 -2
- package/dist/benchmarks/dabstep.js +2 -2
- package/dist/benchmarks/enterpriseops-gym.js +2 -2
- package/dist/benchmarks/finresearchbench.js +2 -2
- package/dist/benchmarks/nomiracl.js +2 -2
- package/dist/benchmarks/open-rag-bench.js +2 -2
- package/dist/benchmarks/programbench.js +2 -2
- package/dist/benchmarks/ragbench.js +2 -2
- package/dist/benchmarks/swe-bench.js +2 -2
- package/dist/benchmarks/t2-ragbench.js +2 -2
- package/dist/benchmarks/tau-bench-shared.js +2 -2
- package/dist/benchmarks/tau2-bench.js +3 -3
- package/dist/benchmarks/tau3-banking.js +3 -3
- package/dist/benchmarks/terminal-bench.js +2 -2
- package/dist/benchmarks/toollm.js +2 -2
- package/dist/benchmarks/webarena-verified.js +2 -2
- package/dist/{chunk-CKUVRZ2T.js → chunk-3U5TXJZS.js} +2 -2
- package/dist/{chunk-YCGY7UIZ.js → chunk-7GRVHU22.js} +2 -2
- package/dist/{chunk-Z7ML6L77.js → chunk-HWST3SED.js} +2 -2
- package/dist/{chunk-SYDW647C.js → chunk-IA2FBTWC.js} +2 -2
- package/dist/{chunk-R67DFVLO.js → chunk-IFVINJ4B.js} +2 -2
- package/dist/{chunk-R36V2VP7.js → chunk-IZ5M6OAC.js} +2 -2
- package/dist/{chunk-ODT47UAY.js → chunk-K3BQGZCT.js} +2 -2
- package/dist/{chunk-IFAV6KEM.js → chunk-KP5KD6EN.js} +2 -2
- package/dist/{chunk-ZEWMTR5M.js → chunk-MQMRLGOG.js} +2 -2
- package/dist/{chunk-TSWPNOYM.js → chunk-NQG5XDSB.js} +2 -2
- package/dist/{chunk-7WSD27QQ.js → chunk-PB64GYIG.js} +2 -2
- package/dist/{chunk-HBSWHQNJ.js → chunk-RCYQEFNX.js} +3 -3
- package/dist/{chunk-J3KDJNX2.js → chunk-RH5F53JT.js} +2 -2
- package/dist/{chunk-UAIOHCUK.js → chunk-SFLA7OH3.js} +3 -3
- package/dist/{chunk-Y6O2OCUO.js → chunk-SHM6MRRF.js} +2 -2
- package/dist/{chunk-KDIKRJGB.js → chunk-SHYIRB7I.js} +2 -2
- package/dist/{chunk-HHXFIHXC.js → chunk-SVR2LKYI.js} +2 -2
- package/dist/{chunk-PWQVGAJB.js → chunk-V7AEBY6U.js} +21 -21
- package/dist/{chunk-LRRD7NAG.js → chunk-WSKWVEQB.js} +18 -2
- package/dist/chunk-WSKWVEQB.js.map +1 -0
- package/dist/{chunk-2PVVP7GN.js → chunk-XKEFIFIC.js} +2 -2
- package/dist/{chunk-JRWWGMK7.js → chunk-XYA4XSNU.js} +2 -2
- package/dist/{chunk-X5YKXC6V.js → chunk-YSMEKBTD.js} +2 -2
- package/dist/{chunk-2XU6OGEN.js → chunk-Z4TZ76N7.js} +2 -2
- package/dist/index.js +23 -23
- package/package.json +4 -4
- package/scripts/verify-packed-consumer.mjs +1 -1
- package/src/benchmarks/_harness.ts +20 -2
- package/src/benchmarks/humaneval.test.mts +2 -2
- package/src/quant-arena/README.md +144 -0
- package/src/quant-arena/backtest.test.mts +135 -0
- package/src/quant-arena/backtest.ts +218 -0
- package/src/quant-arena/data.test.mts +44 -0
- package/src/quant-arena/data.ts +141 -0
- package/src/quant-arena/driver.test.mts +253 -0
- package/src/quant-arena/driver.ts +219 -0
- package/src/quant-arena/fixtures/data/PROVENANCE.md +26 -0
- package/src/quant-arena/fixtures/data/holdout/IDX.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S01.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S02.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S03.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S04.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S05.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S06.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S07.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S08.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S09.csv +523 -0
- package/src/quant-arena/fixtures/data/holdout/S10.csv +523 -0
- package/src/quant-arena/fixtures/data/insample/IDX.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S01.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S02.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S03.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S04.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S05.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S06.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S07.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S08.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S09.csv +2087 -0
- package/src/quant-arena/fixtures/data/insample/S10.csv +2087 -0
- package/src/quant-arena/fixtures/demo-campaign/cost-ledger.jsonl +16 -0
- package/src/quant-arena/fixtures/demo-campaign/notebook.jsonl +5 -0
- package/src/quant-arena/fixtures/demo-campaign/rollout-manifest.json +171 -0
- package/src/quant-arena/fixtures/demo-campaign/strategies/cand-001-default-author/strategy.ts +119 -0
- package/src/quant-arena/fixtures/demo-campaign/strategies/cand-002-default-author/strategy.ts +119 -0
- package/src/quant-arena/fixtures/demo-campaign/strategies/cand-003-quant-researcher/strategy.ts +105 -0
- package/src/quant-arena/fixtures/demo-campaign/strategies/cand-004-quant-researcher/strategy.ts +102 -0
- package/src/quant-arena/fixtures/demo-campaign-v2/cost-ledger.jsonl +4 -0
- package/src/quant-arena/fixtures/demo-campaign-v2/notebook.jsonl +2 -0
- package/src/quant-arena/fixtures/demo-campaign-v2/rollout-manifest.json +84 -0
- package/src/quant-arena/fixtures/demo-campaign-v2/strategies/cand-001-quant-researcher/strategy.ts +117 -0
- package/src/quant-arena/holdout-certify.mts +206 -0
- package/src/quant-arena/holdout-certify.test.mts +82 -0
- package/src/quant-arena/leak-audit.test.mts +79 -0
- package/src/quant-arena/leak-audit.ts +95 -0
- package/src/quant-arena/make-fixtures.mts +161 -0
- package/src/quant-arena/multiplicity.test.mts +68 -0
- package/src/quant-arena/multiplicity.ts +87 -0
- package/src/quant-arena/nautilus-certify.ts +31 -0
- package/src/quant-arena/oms.ts +90 -0
- package/src/quant-arena/profiles/quant-researcher.profile.json +7 -0
- package/src/quant-arena/python/pyproject.toml +8 -0
- package/src/quant-arena/python/uv.lock +1297 -0
- package/src/quant-arena/python/vbt-worker.py +192 -0
- package/src/quant-arena/quant-loop.mts +813 -0
- package/src/quant-arena/quant-loop.test.mts +75 -0
- package/src/quant-arena/strategies/buy-hold-index/strategy.ts +11 -0
- package/src/quant-arena/strategies/equal-weight/strategy.ts +20 -0
- package/src/quant-arena/strategies/sma-crossover/strategy.ts +42 -0
- package/src/quant-arena/types.ts +133 -0
- package/src/quant-arena/vbt-client.ts +321 -0
- package/src/quant-arena/vbt-parity.test.mts +183 -0
- package/src/quant-arena/windows.test.mts +45 -0
- package/src/quant-arena/windows.ts +54 -0
- package/src/rollout-ledger/backfill-swe-arena.mts +606 -0
- package/src/rollout-ledger/backfill-swe-arena.test.mts +338 -0
- package/src/rollout-ledger/settle-capture.mts +442 -0
- package/src/rollout-ledger/settle-capture.test.mts +270 -0
- package/src/swe-arena/activation.mts +228 -0
- package/src/swe-arena/activation.test.mts +303 -0
- package/src/swe-arena/arms.ts +30 -14
- package/src/swe-arena/briefing.mts +217 -0
- package/src/swe-arena/briefing.test.mts +178 -0
- package/src/swe-arena/calibrate.ts +102 -1
- package/src/swe-arena/cell-evidence.mts +41 -9
- package/src/swe-arena/factory-command-container.ts +284 -0
- package/src/swe-arena/factory-judge-child.mts +228 -0
- package/src/swe-arena/factory.test.mts +643 -0
- package/src/swe-arena/fixtures/factory/agent-eval-309/calibration.md +51 -0
- package/src/swe-arena/fixtures/factory/agent-eval-309/manifest.json +29 -0
- package/src/swe-arena/fixtures/factory/agent-eval-309/spec.md +64 -0
- package/src/swe-arena/fixtures/factory/agent-runtime-232/calibration.md +48 -0
- package/src/swe-arena/fixtures/factory/agent-runtime-232/manifest.json +29 -0
- package/src/swe-arena/fixtures/factory/agent-runtime-232/spec.md +48 -0
- package/src/swe-arena/fixtures/factory/loops-28/calibration.md +47 -0
- package/src/swe-arena/fixtures/factory/loops-28/manifest.json +30 -0
- package/src/swe-arena/fixtures/factory/loops-28/spec.md +50 -0
- package/src/swe-arena/fixtures/run-report/README.md +43 -0
- package/src/swe-arena/fixtures/run-report/factory-agent-eval-309-FSUP0.json +173 -0
- package/src/swe-arena/fixtures/run-report/factory-agent-eval-309-FSUP0.md +100 -0
- package/src/swe-arena/fixtures/run-report/gen3-rollup.json +551 -0
- package/src/swe-arena/fixtures/run-report/gen3-rollup.md +64 -0
- package/src/swe-arena/fixtures.ts +135 -2
- package/src/swe-arena/gepa-seat.mts +583 -0
- package/src/swe-arena/gepa-seat.test.mts +635 -0
- package/src/swe-arena/ledger-orphans.mts +77 -0
- package/src/swe-arena/ledger-orphans.test.mts +147 -0
- package/src/swe-arena/lineage-record.mts +164 -0
- package/src/swe-arena/lineage-record.test.mts +115 -0
- package/src/swe-arena/outer-loop.mts +677 -27
- package/src/swe-arena/premeasured-from-cells.mts +281 -0
- package/src/swe-arena/premeasured-from-cells.test.mts +180 -0
- package/src/swe-arena/proposer-fanout.mts +295 -14
- package/src/swe-arena/proposer-fanout.test.mts +247 -0
- package/src/swe-arena/proposer-provenance.mts +177 -0
- package/src/swe-arena/proposer-provenance.test.mts +106 -0
- package/src/swe-arena/run-experiment.mts +367 -1
- package/src/swe-arena/run-report.mts +75 -0
- package/src/swe-arena/run-supervisor.test.mts +5 -3
- package/src/swe-arena/score-split.mts +140 -0
- package/src/swe-arena/score-split.test.mts +123 -0
- package/src/swe-arena/types.ts +52 -0
- package/src/swe-structural.mts +245 -837
- package/dist/chunk-LRRD7NAG.js.map +0 -1
- /package/dist/{chunk-CKUVRZ2T.js.map → chunk-3U5TXJZS.js.map} +0 -0
- /package/dist/{chunk-YCGY7UIZ.js.map → chunk-7GRVHU22.js.map} +0 -0
- /package/dist/{chunk-Z7ML6L77.js.map → chunk-HWST3SED.js.map} +0 -0
- /package/dist/{chunk-SYDW647C.js.map → chunk-IA2FBTWC.js.map} +0 -0
- /package/dist/{chunk-R67DFVLO.js.map → chunk-IFVINJ4B.js.map} +0 -0
- /package/dist/{chunk-R36V2VP7.js.map → chunk-IZ5M6OAC.js.map} +0 -0
- /package/dist/{chunk-ODT47UAY.js.map → chunk-K3BQGZCT.js.map} +0 -0
- /package/dist/{chunk-IFAV6KEM.js.map → chunk-KP5KD6EN.js.map} +0 -0
- /package/dist/{chunk-ZEWMTR5M.js.map → chunk-MQMRLGOG.js.map} +0 -0
- /package/dist/{chunk-TSWPNOYM.js.map → chunk-NQG5XDSB.js.map} +0 -0
- /package/dist/{chunk-7WSD27QQ.js.map → chunk-PB64GYIG.js.map} +0 -0
- /package/dist/{chunk-HBSWHQNJ.js.map → chunk-RCYQEFNX.js.map} +0 -0
- /package/dist/{chunk-J3KDJNX2.js.map → chunk-RH5F53JT.js.map} +0 -0
- /package/dist/{chunk-UAIOHCUK.js.map → chunk-SFLA7OH3.js.map} +0 -0
- /package/dist/{chunk-Y6O2OCUO.js.map → chunk-SHM6MRRF.js.map} +0 -0
- /package/dist/{chunk-KDIKRJGB.js.map → chunk-SHYIRB7I.js.map} +0 -0
- /package/dist/{chunk-HHXFIHXC.js.map → chunk-SVR2LKYI.js.map} +0 -0
- /package/dist/{chunk-PWQVGAJB.js.map → chunk-V7AEBY6U.js.map} +0 -0
- /package/dist/{chunk-2PVVP7GN.js.map → chunk-XKEFIFIC.js.map} +0 -0
- /package/dist/{chunk-JRWWGMK7.js.map → chunk-XYA4XSNU.js.map} +0 -0
- /package/dist/{chunk-X5YKXC6V.js.map → chunk-YSMEKBTD.js.map} +0 -0
- /package/dist/{chunk-2XU6OGEN.js.map → chunk-Z4TZ76N7.js.map} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gen-5 public/private score split: determinism (seeded by runId), persisted
|
|
3
|
+
* resume stability, and the never-surfaced invariant's checkable pieces.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
|
|
7
|
+
import { tmpdir } from 'node:os'
|
|
8
|
+
import { join } from 'node:path'
|
|
9
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
10
|
+
import {
|
|
11
|
+
leaksPrivateInstance,
|
|
12
|
+
loadOrCreateScoreSplit,
|
|
13
|
+
publicOnly,
|
|
14
|
+
SCORE_SPLIT_FILENAME,
|
|
15
|
+
splitInstances,
|
|
16
|
+
subScores,
|
|
17
|
+
} from './score-split.mts'
|
|
18
|
+
|
|
19
|
+
const SIX = [
|
|
20
|
+
'astropy__astropy-13033',
|
|
21
|
+
'django__django-11532',
|
|
22
|
+
'matplotlib__matplotlib-20826',
|
|
23
|
+
'pydata__xarray-4687',
|
|
24
|
+
'pytest-dev__pytest-6197',
|
|
25
|
+
'sphinx-doc__sphinx-9658',
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
describe('splitInstances', () => {
|
|
29
|
+
it('is deterministic: same (runId, instances, publicCount) → identical split', () => {
|
|
30
|
+
const a = splitInstances('r4-abc123', SIX, 4)
|
|
31
|
+
const b = splitInstances('r4-abc123', SIX, 4)
|
|
32
|
+
expect(a).toEqual(b)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('is instance-ORDER-insensitive (ranking is content-derived)', () => {
|
|
36
|
+
const a = splitInstances('r4-abc123', SIX, 4)
|
|
37
|
+
const b = splitInstances('r4-abc123', [...SIX].reverse(), 4)
|
|
38
|
+
expect(a).toEqual(b)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('respects publicCount and partitions exactly (4 public / 2 private of 6)', () => {
|
|
42
|
+
const split = splitInstances('r4-abc123', SIX, 4)
|
|
43
|
+
expect(split.publicInstances).toHaveLength(4)
|
|
44
|
+
expect(split.privateInstances).toHaveLength(2)
|
|
45
|
+
expect([...split.publicInstances, ...split.privateInstances].sort()).toEqual([...SIX].sort())
|
|
46
|
+
expect(split.publicInstances.filter((i) => split.privateInstances.includes(i))).toEqual([])
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('is SEEDED by runId: different runIds produce different splits', () => {
|
|
50
|
+
const splits = new Set(
|
|
51
|
+
Array.from({ length: 10 }, (_, i) => splitInstances(`r4-run${i}`, SIX, 4).privateInstances.join('|')),
|
|
52
|
+
)
|
|
53
|
+
expect(splits.size).toBeGreaterThan(1)
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('rejects publicCount outside (0, n) and duplicate instance ids', () => {
|
|
57
|
+
expect(() => splitInstances('r', SIX, 0)).toThrow(/publicCount/)
|
|
58
|
+
expect(() => splitInstances('r', SIX, 6)).toThrow(/publicCount/)
|
|
59
|
+
expect(() => splitInstances('r', SIX, 2.5)).toThrow(/publicCount/)
|
|
60
|
+
expect(() => splitInstances('r', ['a', 'a', 'b'], 1)).toThrow(/duplicate/)
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
describe('loadOrCreateScoreSplit (resume stability)', () => {
|
|
65
|
+
let outDir: string
|
|
66
|
+
beforeEach(async () => {
|
|
67
|
+
outDir = await mkdtemp(join(tmpdir(), 'split-'))
|
|
68
|
+
})
|
|
69
|
+
afterEach(async () => {
|
|
70
|
+
await rm(outDir, { recursive: true, force: true })
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it('persists on first computation and RELOADS verbatim under a NEW runId (a resume cannot rotate private into view)', async () => {
|
|
74
|
+
const first = await loadOrCreateScoreSplit({ outDir, runId: 'r4-first', instances: SIX, publicCount: 4 })
|
|
75
|
+
expect(JSON.parse(await readFile(join(outDir, SCORE_SPLIT_FILENAME), 'utf8'))).toEqual(first)
|
|
76
|
+
const resumed = await loadOrCreateScoreSplit({ outDir, runId: 'r4-DIFFERENT', instances: SIX, publicCount: 4 })
|
|
77
|
+
expect(resumed).toEqual(first)
|
|
78
|
+
expect(resumed.seededBy).toBe('r4-first')
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
it('fails loud when the persisted split covers different instances or a different publicCount', async () => {
|
|
82
|
+
await loadOrCreateScoreSplit({ outDir, runId: 'r4-first', instances: SIX, publicCount: 4 })
|
|
83
|
+
await expect(
|
|
84
|
+
loadOrCreateScoreSplit({ outDir, runId: 'r4-x', instances: [...SIX.slice(0, 5), 'other__iid-1'], publicCount: 4 }),
|
|
85
|
+
).rejects.toThrow(/refusing to silently re-split/)
|
|
86
|
+
await expect(
|
|
87
|
+
loadOrCreateScoreSplit({ outDir, runId: 'r4-x', instances: SIX, publicCount: 3 }),
|
|
88
|
+
).rejects.toThrow(/refusing to silently re-split/)
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it('fails loud on an unknown schema in the persisted file', async () => {
|
|
92
|
+
await writeFile(join(outDir, SCORE_SPLIT_FILENAME), JSON.stringify({ schema: 'nope' }))
|
|
93
|
+
await expect(
|
|
94
|
+
loadOrCreateScoreSplit({ outDir, runId: 'r', instances: SIX, publicCount: 4 }),
|
|
95
|
+
).rejects.toThrow(/unknown schema/)
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
describe('never-surfaced invariant helpers', () => {
|
|
100
|
+
const split = splitInstances('r4-abc123', SIX, 4)
|
|
101
|
+
|
|
102
|
+
it('leaksPrivateInstance names every private id present in a text', () => {
|
|
103
|
+
expect(leaksPrivateInstance('nothing to see', split)).toEqual([])
|
|
104
|
+
const leakText = `evidence for ${split.privateInstances[0]} here`
|
|
105
|
+
expect(leaksPrivateInstance(leakText, split)).toEqual([split.privateInstances[0]])
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it('publicOnly drops private-instance records and is identity without a split', () => {
|
|
109
|
+
const records = SIX.map((iid) => ({ iid, x: 1 }))
|
|
110
|
+
const filtered = publicOnly(records, (r) => r.iid, split)
|
|
111
|
+
expect(filtered.map((r) => r.iid).sort()).toEqual(split.publicInstances)
|
|
112
|
+
expect(publicOnly(records, (r) => r.iid, null)).toEqual(records)
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
it('subScores counts fail-closed AND-verdicts per half (missing verdict = 0)', () => {
|
|
116
|
+
const verdicts: Record<string, boolean> = {}
|
|
117
|
+
verdicts[split.publicInstances[0]!] = true
|
|
118
|
+
verdicts[split.publicInstances[1]!] = false
|
|
119
|
+
verdicts[split.privateInstances[0]!] = true
|
|
120
|
+
// privateInstances[1] has NO verdict — counts 0.
|
|
121
|
+
expect(subScores(verdicts, split)).toEqual({ publicResolvedCount: 1, privateResolvedCount: 1 })
|
|
122
|
+
})
|
|
123
|
+
})
|
package/src/swe-arena/types.ts
CHANGED
|
@@ -30,6 +30,58 @@ export interface SweInstance {
|
|
|
30
30
|
environment_setup_commit: string | null
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* One factory-bench instance — a merged feature PR from our own repo history
|
|
35
|
+
* turned into a gradable end-to-end feature-building task (see
|
|
36
|
+
* supervisor-lab/factory-bench/docs/design.md). The worker sees only the tree
|
|
37
|
+
* at `base_commit` (archive export, synthetic git history) plus the rewritten
|
|
38
|
+
* spec; the PR's own added test files are the hidden judge, overlaid from
|
|
39
|
+
* `judge_ref` at judge time. Field names mirror the instance dirs'
|
|
40
|
+
* `manifest.json` byte-for-byte, same policy as SweInstance vs task-meta.json.
|
|
41
|
+
*/
|
|
42
|
+
export interface FactoryInstance {
|
|
43
|
+
/** `factory.<repo>.<pr>` */
|
|
44
|
+
id: string
|
|
45
|
+
/** `owner/name` */
|
|
46
|
+
repo: string
|
|
47
|
+
/** Judge-side local mirror; NEVER exposed to the worker workspace. */
|
|
48
|
+
repo_local_mirror: string
|
|
49
|
+
/** The worker's world — the PR's base commit. */
|
|
50
|
+
base_commit: string
|
|
51
|
+
/** Merge commit the judge tests are read from (`git show <judge_ref>:<path>`). */
|
|
52
|
+
judge_ref: string
|
|
53
|
+
/** Instance-dir-relative spec file (PM-ticket grade rewrite of the PR body). */
|
|
54
|
+
spec_md: string
|
|
55
|
+
/** Hidden judge test files, overlaid at judge time only. */
|
|
56
|
+
judge_tests: string[]
|
|
57
|
+
/** Flaky/env-dependent tests excluded at calibration, reasons in calibration.md. */
|
|
58
|
+
excluded_tests: string[]
|
|
59
|
+
/** Immutable Node container image used for setup and judge commands. */
|
|
60
|
+
command_image: string
|
|
61
|
+
setup_cmds: string[]
|
|
62
|
+
judge_cmds: string[]
|
|
63
|
+
/** e.g. "all 30 judge tests pass; partial score = passed/30" — the /NN is parsed. */
|
|
64
|
+
resolved_criterion: string
|
|
65
|
+
timeout_s: number
|
|
66
|
+
worker_visible_paths_note?: string
|
|
67
|
+
runtime?: string
|
|
68
|
+
calibration?: { gold: string; base: string; receipts: string }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Discriminated instance union for the seams that used to assume SweInstance.
|
|
73
|
+
* A tagged wrapper (not a structural union) because both shapes mirror their
|
|
74
|
+
* on-disk artifacts byte-for-byte and neither may grow a discriminant field.
|
|
75
|
+
*/
|
|
76
|
+
export type ArenaInstance =
|
|
77
|
+
| { kind: 'swe'; instance: SweInstance }
|
|
78
|
+
| { kind: 'factory'; instance: FactoryInstance }
|
|
79
|
+
|
|
80
|
+
/** The ledger/judge identity: SWE `instance_id` or factory `id`. */
|
|
81
|
+
export function arenaInstanceId(a: ArenaInstance): string {
|
|
82
|
+
return a.kind === 'swe' ? a.instance.instance_id : a.instance.id
|
|
83
|
+
}
|
|
84
|
+
|
|
33
85
|
/** Per-run opencode usage breakdown captured on the SOLO arm. */
|
|
34
86
|
export interface SoloUsage {
|
|
35
87
|
steps: number
|