@tangle-network/agent-bench 0.3.8 → 0.4.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.
- package/CHANGELOG.md +7 -0
- package/README.md +7 -0
- package/package.json +4 -4
- package/scripts/trata-hedge/README.md +6 -5
- package/src/gate.ts +1 -1
- package/src/hev-eval.mts +5 -2
- package/src/hev-improve.mts +118 -73
- package/src/official-optimizer-config.mts +89 -0
- package/src/official-optimizer-config.test.mts +88 -0
- package/src/profiles.ts +2 -2
- package/src/rollout-ledger/backfill-swe-arena.test.mts +28 -24
- package/src/smoke-structural-rollout.mts +15 -9
- package/src/swe-arena/activation.mts +1 -4
- package/src/swe-arena/activation.test.mts +10 -13
- package/src/swe-arena/gepa-seat.mts +425 -131
- package/src/swe-arena/gepa-seat.test.mts +524 -100
- package/src/swe-arena/implementation-ref.test.mts +64 -0
- package/src/swe-arena/implementation-ref.ts +62 -0
- package/src/swe-arena/outer-loop.mts +103 -76
- package/src/swe-arena/proposer-fanout.mts +51 -36
- package/src/swe-arena/proposer-fanout.test.mts +0 -1
- package/src/swe-arena/proposer-provenance.mts +11 -16
- package/src/swe-arena/scratch-worktree.test.mts +55 -0
- package/src/swe-arena/scratch-worktree.ts +34 -0
- package/src/swe-code-improve.mts +24 -25
- package/src/swe-improve.mts +129 -96
- package/src/swe-local-proof.mts +6 -1
- package/src/swe-stream.mts +4 -2
- package/src/tb-container-executor.test.mts +30 -6
- package/src/tb-supervisor-sidecar.mts +2 -1
- package/src/trata-gepa.mts +182 -245
- package/src/live-improve-campaign-mbpp.mts +0 -641
- package/src/live-improve-campaign.mts +0 -500
- package/src/swe-arena/lineage-record.mts +0 -164
- package/src/swe-arena/lineage-record.test.mts +0 -115
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gen-5 lineage DAG wiring: baseline root + pareto-parent nodes + candidate
|
|
3
|
-
* nodes (multi-parent merge), append-only idempotence at the
|
|
4
|
-
* .evolve-compatible store, and the recorded governor decision.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { readFile, rm } from 'node:fs/promises'
|
|
8
|
-
import { mkdtemp } from 'node:fs/promises'
|
|
9
|
-
import { tmpdir } from 'node:os'
|
|
10
|
-
import { join } from 'node:path'
|
|
11
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
12
|
-
import { Lineage } from '@tangle-network/agent-eval/campaign'
|
|
13
|
-
import { LINEAGE_STORE_RELPATH, recordLineageGeneration, type LineageRecordArgs } from './lineage-record.mts'
|
|
14
|
-
|
|
15
|
-
const SIX = ['a-1', 'b-2', 'c-3', 'd-4', 'e-5', 'f-6']
|
|
16
|
-
|
|
17
|
-
describe('recordLineageGeneration', () => {
|
|
18
|
-
let outDir: string
|
|
19
|
-
|
|
20
|
-
beforeEach(async () => {
|
|
21
|
-
outDir = await mkdtemp(join(tmpdir(), 'lineage-rec-'))
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
afterEach(async () => {
|
|
25
|
-
await rm(outDir, { recursive: true, force: true })
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
const args = (): LineageRecordArgs => ({
|
|
29
|
-
outDir,
|
|
30
|
-
runId: 'r4-test',
|
|
31
|
-
instances: SIX,
|
|
32
|
-
baseline: { commit: 'base'.repeat(10), resolvedCount: 1, verdicts: { 'a-1': true } },
|
|
33
|
-
paretoParents: [
|
|
34
|
-
{ label: 'default-author', commit: 'p1p1'.repeat(10), resolvedInstances: ['d-4', 'f-6'] },
|
|
35
|
-
{ label: 'prompts-author', commit: 'p2p2'.repeat(10), resolvedInstances: ['b-2', 'd-4'] },
|
|
36
|
-
],
|
|
37
|
-
candidates: [
|
|
38
|
-
{
|
|
39
|
-
label: 'claude-author',
|
|
40
|
-
commit: 'c1c1'.repeat(10),
|
|
41
|
-
resolvedCount: 2,
|
|
42
|
-
verdicts: { 'a-1': true, 'd-4': true },
|
|
43
|
-
merge: false,
|
|
44
|
-
verdict: 'accepted',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: 'merge-author',
|
|
48
|
-
commit: 'c2c2'.repeat(10),
|
|
49
|
-
resolvedCount: 3,
|
|
50
|
-
verdicts: { 'a-1': true, 'b-2': true, 'd-4': true },
|
|
51
|
-
merge: true,
|
|
52
|
-
verdict: 'accepted',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
label: 'killed-author',
|
|
56
|
-
commit: null,
|
|
57
|
-
resolvedCount: 0,
|
|
58
|
-
verdicts: {},
|
|
59
|
-
merge: false,
|
|
60
|
-
verdict: 'rejected-prefilter',
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('records root + parents + candidates at the .evolve-compatible store; merge is MULTI-PARENT', async () => {
|
|
66
|
-
const result = await recordLineageGeneration(args())
|
|
67
|
-
expect(result.path).toBe(join(outDir, LINEAGE_STORE_RELPATH))
|
|
68
|
-
expect(result.path).toContain('.evolve')
|
|
69
|
-
// root + 2 parents + 2 committed candidates (killed-author skipped).
|
|
70
|
-
expect(result.nodesTotal).toBe(5)
|
|
71
|
-
expect(result.appended).toHaveLength(5)
|
|
72
|
-
expect(result.skipped).toEqual(['killed-author'])
|
|
73
|
-
|
|
74
|
-
const raw = await readFile(result.path, 'utf8')
|
|
75
|
-
const lineage = Lineage.fromJSONL(raw)
|
|
76
|
-
const root = lineage.roots()
|
|
77
|
-
expect(root).toHaveLength(1)
|
|
78
|
-
expect(root[0]!.track).toBe('baseline')
|
|
79
|
-
expect(root[0]!.score).toBeCloseTo(1 / 6)
|
|
80
|
-
|
|
81
|
-
const merge = lineage.all().find((n) => n.track === 'merge-author')!
|
|
82
|
-
expect(merge.parentIds).toHaveLength(2)
|
|
83
|
-
const parentTracks = merge.parentIds.map((id) => lineage.all().find((n) => n.id === id)!.track).sort()
|
|
84
|
-
expect(parentTracks).toEqual(['default-author', 'prompts-author'])
|
|
85
|
-
expect(merge.proposer).toBe('merge')
|
|
86
|
-
expect(merge.score).toBeCloseTo(3 / 6)
|
|
87
|
-
|
|
88
|
-
const single = lineage.all().find((n) => n.track === 'claude-author')!
|
|
89
|
-
expect(single.parentIds).toEqual([root[0]!.id])
|
|
90
|
-
expect(single.rationale).toContain('accepted')
|
|
91
|
-
// scoreVector: sorted instance order, fail-closed 0 for missing verdicts.
|
|
92
|
-
expect(single.scoreVector).toEqual([1, 0, 0, 1, 0, 0])
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
it('is idempotent: re-recording the identical generation appends ZERO nodes', async () => {
|
|
96
|
-
const first = await recordLineageGeneration(args())
|
|
97
|
-
const second = await recordLineageGeneration(args())
|
|
98
|
-
expect(first.appended).toHaveLength(5)
|
|
99
|
-
expect(second.appended).toHaveLength(0)
|
|
100
|
-
expect(second.nodesTotal).toBe(5)
|
|
101
|
-
const raw = await readFile(second.path, 'utf8')
|
|
102
|
-
expect(raw.trim().split('\n')).toHaveLength(5)
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
it('returns a governor continuation decision (recorded, never acted on here)', async () => {
|
|
106
|
-
const result = await recordLineageGeneration(args())
|
|
107
|
-
expect(['extend', 'branch', 'merge', 'prune', 'stop']).toContain(result.governor.op)
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
it('fails loud when a merge candidate has fewer than 2 parent nodes', async () => {
|
|
111
|
-
const bad = args()
|
|
112
|
-
bad.paretoParents = bad.paretoParents.slice(0, 1)
|
|
113
|
-
await expect(recordLineageGeneration(bad)).rejects.toThrow(/needs >=2/)
|
|
114
|
-
})
|
|
115
|
-
})
|