@tangle-network/agent-eval 0.145.9 → 0.145.11
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 +17 -0
- package/dist/analyst/index.d.ts +1 -1
- package/dist/analyst/index.js +1 -1
- package/dist/{benchmark-command-k6kI1D8H.js → benchmark-command-D8K5YJNS.js} +2 -2
- package/dist/{benchmark-command-k6kI1D8H.js.map → benchmark-command-D8K5YJNS.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/exec-y-DCLqK7.js +204 -0
- package/dist/exec-y-DCLqK7.js.map +1 -0
- package/dist/openapi.json +1 -1
- package/dist/steps-AmkT-GIM.d.ts +216 -0
- package/dist/steps-AmkT-GIM.d.ts.map +1 -0
- package/dist/trace-repair/index.d.ts +1 -21
- package/dist/trace-repair/index.d.ts.map +1 -1
- package/dist/trace-repair/index.js +10 -19
- package/dist/trace-repair/index.js.map +1 -1
- package/dist/trajectory-replay/index.d.ts +2 -2
- package/dist/trajectory-replay/index.js +2 -2
- package/docs/trace-repair-admission.md +134 -0
- package/docs/trajectory-replay.md +21 -1
- package/package.json +3 -3
- package/dist/exec-BLtYZdWo.js +0 -49
- package/dist/exec-BLtYZdWo.js.map +0 -1
- package/dist/steps-BArUxhna.d.ts +0 -51
- package/dist/steps-BArUxhna.d.ts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { o as runRolloutReleaseCli } from "./hf-dataset-XggBupCr.js";
|
|
3
|
-
import { n as runAnalystBenchmarkCommand } from "./benchmark-command-
|
|
3
|
+
import { n as runAnalystBenchmarkCommand } from "./benchmark-command-D8K5YJNS.js";
|
|
4
4
|
import { a as runRpcBatch, o as runRpcOnce, p as handleVersion, r as startServerAsync, s as buildOpenApi } from "./server-ulsOdrTI.js";
|
|
5
5
|
import { writeFileSync } from "node:fs";
|
|
6
6
|
//#region src/cli-config.ts
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
//#region src/trajectory-replay/steps.ts
|
|
2
|
+
/** Recorded returncode of a step, or null when the observation carries none. */
|
|
3
|
+
function parseRecordedReturncode(observation) {
|
|
4
|
+
if (!observation) return null;
|
|
5
|
+
const m = /<returncode>(-?\d+)<\/returncode>/.exec(observation);
|
|
6
|
+
return m ? Number(m[1]) : null;
|
|
7
|
+
}
|
|
8
|
+
/** Text between the observation's <output> tags, or the raw observation when
|
|
9
|
+
* the tags are absent. */
|
|
10
|
+
function parseObservationOutput(observation) {
|
|
11
|
+
if (!observation) return "";
|
|
12
|
+
const m = /<output>\n?([\s\S]*?)\n?<\/output>/.exec(observation);
|
|
13
|
+
return m ? m[1] : observation;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Stable failure-signature candidate: the first line of the recorded output
|
|
17
|
+
* that contains the word "error". Null when no such line exists — a verdict
|
|
18
|
+
* then falls back to returncode-only matching and says so.
|
|
19
|
+
* Pass an explicit signature to override (compiler quote glyphs vary with
|
|
20
|
+
* locale, so a hand-picked ASCII substring is often more robust).
|
|
21
|
+
*/
|
|
22
|
+
function deriveFailureSignature(observation) {
|
|
23
|
+
const line = parseObservationOutput(observation).split("\n").find((l) => /\berror\b/i.test(l));
|
|
24
|
+
return line ? line.trim().slice(0, 200) : null;
|
|
25
|
+
}
|
|
26
|
+
/** mini-SWE's end-of-run submit convention: the agent echoes this sentinel
|
|
27
|
+
* and dumps the diff. A label on this step marks a bad SUBMIT DECISION, not a
|
|
28
|
+
* failed command — there is no executable failure to reproduce, so it is
|
|
29
|
+
* never a counterfactual replay target. */
|
|
30
|
+
const SUBMIT_ACTION_SIGNATURE = "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT";
|
|
31
|
+
function isSubmitAction(action) {
|
|
32
|
+
return action.includes(SUBMIT_ACTION_SIGNATURE);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* True when the action is the sentinel echo and nothing else.
|
|
36
|
+
*
|
|
37
|
+
* The distinction decides whether a step may be dropped. An agent is told to
|
|
38
|
+
* issue the sentinel alone, and 5.7% of recorded runs end on a command that
|
|
39
|
+
* writes files or edits them and then echoes it. Dropping such a step because
|
|
40
|
+
* it holds the sentinel would remove the run's last state change from the
|
|
41
|
+
* replay, so the recorded end state and the replayed one would differ.
|
|
42
|
+
*/
|
|
43
|
+
function isSubmitOnlyAction(action) {
|
|
44
|
+
return /^echo\s+(?:"COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT"|'COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT'|COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT)$/.test(action.trim());
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A field the dump replaced with a counter instead of its text.
|
|
48
|
+
*
|
|
49
|
+
* The counter is hexadecimal and rises by one per dropped string in document
|
|
50
|
+
* order, so a decimal-only reading (`$12`) accepts every marker that carries a
|
|
51
|
+
* letter (`$3a`) as if it were real text. A command read that way replays as
|
|
52
|
+
* the literal two-to-four characters `$3a`, which is not the command the run
|
|
53
|
+
* executed.
|
|
54
|
+
*
|
|
55
|
+
* Nothing in the dump maps a marker back to its text: the same marker carries
|
|
56
|
+
* different content in different rows, so there is no dictionary to read. A
|
|
57
|
+
* field that matches is unrecoverable, so a caller rejects the row that holds
|
|
58
|
+
* it rather than replaying the marker.
|
|
59
|
+
*/
|
|
60
|
+
const RECORDED_ELISION_PATTERN = /^\$[0-9a-f]+$/;
|
|
61
|
+
function isElidedField(value) {
|
|
62
|
+
return typeof value === "string" && RECORDED_ELISION_PATTERN.test(value);
|
|
63
|
+
}
|
|
64
|
+
/** Substring the timeout notice always carries, whatever the command was. */
|
|
65
|
+
const TIMEOUT_OBSERVATION_MARKER = "timed out and has been killed";
|
|
66
|
+
/** Opening of the notice the scaffold writes when a turn held no single action. */
|
|
67
|
+
const FORMAT_ERROR_OBSERVATION_PREFIX = "Please always provide EXACTLY ONE action in triple backticks, found ";
|
|
68
|
+
function classifyObservation(observation) {
|
|
69
|
+
if (observation === null) return "absent";
|
|
70
|
+
if (isElidedField(observation)) return "elided";
|
|
71
|
+
if (parseRecordedReturncode(observation) !== null) return "command-result";
|
|
72
|
+
if (observation.startsWith("Please always provide EXACTLY ONE action in triple backticks, found ")) return "format-error";
|
|
73
|
+
if (observation.includes("timed out and has been killed")) return "timeout";
|
|
74
|
+
return "unreadable";
|
|
75
|
+
}
|
|
76
|
+
/** True when the recording shows the environment killed this step at its
|
|
77
|
+
* wall-clock bound. Such a step carries no returncode, so no replay can
|
|
78
|
+
* confirm or contradict it. */
|
|
79
|
+
function isRecordedTimeout(observation) {
|
|
80
|
+
return classifyObservation(observation) === "timeout";
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Pair every recorded command with the observation of its own turn.
|
|
84
|
+
*
|
|
85
|
+
* Collecting commands and observations into two lists and zipping them is the
|
|
86
|
+
* decode that looks right and is not: a turn the scaffold rejected carries an
|
|
87
|
+
* observation of its own, so from the first such turn onward every observation
|
|
88
|
+
* belongs to a different command than the one it is read against.
|
|
89
|
+
*
|
|
90
|
+
* A rejected turn executed nothing, so it is never a step — including when the
|
|
91
|
+
* dump recorded a command for it. The scaffold rejects a turn holding several
|
|
92
|
+
* bash blocks and runs none of them, while the dump keeps one of the blocks in
|
|
93
|
+
* the command field. Replaying that field would execute a command the recorded
|
|
94
|
+
* run did not, which is a worse corpus than a smaller one.
|
|
95
|
+
*
|
|
96
|
+
* A rejected turn is recognised by its observation, so a rejected turn whose
|
|
97
|
+
* observation the dump elided is indistinguishable from an executed command
|
|
98
|
+
* whose observation it elided. Both read as a step. Nothing in the dump
|
|
99
|
+
* separates them, and the row-level defence is the share of unreadable exits a
|
|
100
|
+
* caller admits: a row with no elided observation cannot hold this case at all.
|
|
101
|
+
*
|
|
102
|
+
* A trailing step that echoes the sentinel and nothing else, with no
|
|
103
|
+
* observation, is dropped from `steps` and reported as `endedOnSubmitSentinel`.
|
|
104
|
+
* The scaffold records an observation only when it hands one to the model, and
|
|
105
|
+
* the sentinel ends the run, so the missing observation is the end of the
|
|
106
|
+
* transcript rather than a gap in it. Echoing the sentinel changes no state, so
|
|
107
|
+
* the recorded end state is the state the step before it left.
|
|
108
|
+
*
|
|
109
|
+
* A step that DID get an observation stays a step: the run continued past it.
|
|
110
|
+
* So does a step that echoes the sentinel after doing real work — its state
|
|
111
|
+
* change is part of the recorded end state, and with no observation its exit is
|
|
112
|
+
* unknown, which `finalRecordedOutcome` reports rather than hides.
|
|
113
|
+
*/
|
|
114
|
+
function decodeRecordedTurns(turns) {
|
|
115
|
+
const steps = [];
|
|
116
|
+
let formatErrorTurns = 0;
|
|
117
|
+
let unreadableTurns = 0;
|
|
118
|
+
for (const turn of turns) {
|
|
119
|
+
const command = turn.tools?.[0]?.cmd ?? null;
|
|
120
|
+
const observation = turn.obs ?? null;
|
|
121
|
+
const kind = classifyObservation(observation);
|
|
122
|
+
if (kind === "format-error") {
|
|
123
|
+
formatErrorTurns += 1;
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (command === null) {
|
|
127
|
+
if (kind === "unreadable" || kind === "elided") unreadableTurns += 1;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
steps.push({
|
|
131
|
+
step_id: steps.length + 1,
|
|
132
|
+
action: command,
|
|
133
|
+
observation
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const last = steps[steps.length - 1];
|
|
137
|
+
const endedOnSubmitSentinel = last !== void 0 && last.observation === null && isSubmitOnlyAction(last.action);
|
|
138
|
+
if (endedOnSubmitSentinel) steps.pop();
|
|
139
|
+
return {
|
|
140
|
+
steps,
|
|
141
|
+
formatErrorTurns,
|
|
142
|
+
elidedCommands: steps.filter((step) => isElidedField(step.action)).length,
|
|
143
|
+
endedOnSubmitSentinel,
|
|
144
|
+
unreadableTurns
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The outcome of the last step, or `null` when the trajectory has no steps.
|
|
149
|
+
*
|
|
150
|
+
* Reads only the last step. `decodeRecordedTurns` has already removed the turns
|
|
151
|
+
* that executed nothing, so the last step is the last command the run ran.
|
|
152
|
+
*/
|
|
153
|
+
function finalRecordedOutcome(steps) {
|
|
154
|
+
const last = steps[steps.length - 1];
|
|
155
|
+
if (last === void 0) return null;
|
|
156
|
+
const kind = classifyObservation(last.observation);
|
|
157
|
+
if (kind === "command-result") return {
|
|
158
|
+
kind: "returncode",
|
|
159
|
+
value: parseRecordedReturncode(last.observation)
|
|
160
|
+
};
|
|
161
|
+
if (kind === "timeout") return { kind: "killed" };
|
|
162
|
+
return {
|
|
163
|
+
kind: "unreadable",
|
|
164
|
+
reason: kind
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Steps whose recorded exit a replay cannot check.
|
|
169
|
+
*
|
|
170
|
+
* A killed step counts: the recording holds no exit status to compare a replay
|
|
171
|
+
* against, so agreement on it cannot be measured either way.
|
|
172
|
+
*/
|
|
173
|
+
function unreadableExitCount(steps) {
|
|
174
|
+
return steps.filter((step) => classifyObservation(step.observation) !== "command-result").length;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Throw unless every recorded command survived the dump.
|
|
178
|
+
*
|
|
179
|
+
* A replay executes `steps` verbatim, so one elision marker in an action means
|
|
180
|
+
* the replay runs the literal two-to-four characters of the marker instead of
|
|
181
|
+
* the command the run executed. The guard is here so a replayer needs one call
|
|
182
|
+
* rather than a field check it can forget.
|
|
183
|
+
*/
|
|
184
|
+
function assertReplayableTrajectory(decoded) {
|
|
185
|
+
if (decoded.elidedCommands === 0) return;
|
|
186
|
+
const markers = decoded.steps.filter((step) => isElidedField(step.action)).map((step) => step.action);
|
|
187
|
+
throw new Error(`trajectory holds ${decoded.elidedCommands} command(s) the dump elided (${markers.slice(0, 5).join(", ")}); no dictionary maps a marker back to its text, so this trajectory cannot be replayed`);
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/trajectory-replay/exec.ts
|
|
191
|
+
/**
|
|
192
|
+
* mini-SWE runs every action as a fresh /bin/sh subshell from a fixed
|
|
193
|
+
* workdir. Reproduce that exactly — and stay quote-proof for arbitrary
|
|
194
|
+
* recorded actions — by piping the base64 of the action into `sh` after
|
|
195
|
+
* cd-ing to the workdir. Exit code is sh's, i.e. the action's.
|
|
196
|
+
*/
|
|
197
|
+
function wrapActionForExec(action, cwd) {
|
|
198
|
+
const b64 = Buffer.from(action, "utf8").toString("base64");
|
|
199
|
+
return `cd ${`'${cwd.replaceAll("'", `'\\''`)}'`} && printf %s ${b64} | base64 -d | sh`;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
export { unreadableExitCount as _, TIMEOUT_OBSERVATION_MARKER as a, decodeRecordedTurns as c, isElidedField as d, isRecordedTimeout as f, parseRecordedReturncode as g, parseObservationOutput as h, SUBMIT_ACTION_SIGNATURE as i, deriveFailureSignature as l, isSubmitOnlyAction as m, FORMAT_ERROR_OBSERVATION_PREFIX as n, assertReplayableTrajectory as o, isSubmitAction as p, RECORDED_ELISION_PATTERN as r, classifyObservation as s, wrapActionForExec as t, finalRecordedOutcome as u };
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=exec-y-DCLqK7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-y-DCLqK7.js","names":[],"sources":["../src/trajectory-replay/steps.ts","../src/trajectory-replay/exec.ts"],"sourcesContent":["/**\n * Recorded shell-trajectory steps and the observation grammar they carry.\n *\n * A recorded trajectory is the action/observation sequence an agent actually\n * ran. Scaffolds that execute one shell command per step (mini-SWE and the\n * CodeTracer-normalized corpora built from it) tag each observation with the\n * command's returncode and its combined output:\n *\n * <returncode>2</returncode>\n * <output>\n * …command output…\n * </output>\n *\n * That is one of four shapes a recorded turn carries, and the other three are\n * not command results at all:\n *\n * - a timeout notice, when the environment killed the command at its bound;\n * - a format-error notice, when the scaffold rejected the turn and ran\n * nothing;\n * - an elision marker `$<hex>`, when the published dump dropped the string.\n *\n * A turn also carries no observation when it is the run's last turn, because\n * the scaffold records an observation only when it hands one back to the model.\n *\n * The parsers here are the only place that grammar is decoded. Everything\n * downstream — replay verdicts, corpus enumeration, admission funnels, fix\n * prompts — reads the returncode, the output, and the failure signature through\n * these functions. A second decoder elsewhere is how a corpus reads as\n * unreplayable when it is not.\n */\n\n/**\n * One step of a recorded shell trajectory. Structural: any richer step record\n * (file refs, thinking text, tool type) satisfies it.\n */\nexport interface RecordedTrajectoryStep {\n /** 1-based position in the trajectory. */\n readonly step_id: number\n readonly action: string\n /** Null when the step recorded no observation (terminal submit steps). */\n readonly observation: string | null\n}\n\n/** Recorded returncode of a step, or null when the observation carries none. */\nexport function parseRecordedReturncode(observation: string | null): number | null {\n if (!observation) return null\n const m = /<returncode>(-?\\d+)<\\/returncode>/.exec(observation)\n return m ? Number(m[1]) : null\n}\n\n/** Text between the observation's <output> tags, or the raw observation when\n * the tags are absent. */\nexport function parseObservationOutput(observation: string | null): string {\n if (!observation) return ''\n const m = /<output>\\n?([\\s\\S]*?)\\n?<\\/output>/.exec(observation)\n return m ? m[1]! : observation\n}\n\n/**\n * Stable failure-signature candidate: the first line of the recorded output\n * that contains the word \"error\". Null when no such line exists — a verdict\n * then falls back to returncode-only matching and says so.\n * Pass an explicit signature to override (compiler quote glyphs vary with\n * locale, so a hand-picked ASCII substring is often more robust).\n */\nexport function deriveFailureSignature(observation: string | null): string | null {\n const line = parseObservationOutput(observation)\n .split('\\n')\n .find((l) => /\\berror\\b/i.test(l))\n return line ? line.trim().slice(0, 200) : null\n}\n\n/** mini-SWE's end-of-run submit convention: the agent echoes this sentinel\n * and dumps the diff. A label on this step marks a bad SUBMIT DECISION, not a\n * failed command — there is no executable failure to reproduce, so it is\n * never a counterfactual replay target. */\nexport const SUBMIT_ACTION_SIGNATURE = 'COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT'\n\nexport function isSubmitAction(action: string): boolean {\n return action.includes(SUBMIT_ACTION_SIGNATURE)\n}\n\n/**\n * True when the action is the sentinel echo and nothing else.\n *\n * The distinction decides whether a step may be dropped. An agent is told to\n * issue the sentinel alone, and 5.7% of recorded runs end on a command that\n * writes files or edits them and then echoes it. Dropping such a step because\n * it holds the sentinel would remove the run's last state change from the\n * replay, so the recorded end state and the replayed one would differ.\n */\nexport function isSubmitOnlyAction(action: string): boolean {\n return /^echo\\s+(?:\"COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT\"|'COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT'|COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT)$/.test(\n action.trim(),\n )\n}\n\n// ── Fields the published dump dropped ────────────────────────────────\n\n/**\n * A field the dump replaced with a counter instead of its text.\n *\n * The counter is hexadecimal and rises by one per dropped string in document\n * order, so a decimal-only reading (`$12`) accepts every marker that carries a\n * letter (`$3a`) as if it were real text. A command read that way replays as\n * the literal two-to-four characters `$3a`, which is not the command the run\n * executed.\n *\n * Nothing in the dump maps a marker back to its text: the same marker carries\n * different content in different rows, so there is no dictionary to read. A\n * field that matches is unrecoverable, so a caller rejects the row that holds\n * it rather than replaying the marker.\n */\nexport const RECORDED_ELISION_PATTERN = /^\\$[0-9a-f]+$/\n\nexport function isElidedField(value: string | null | undefined): boolean {\n return typeof value === 'string' && RECORDED_ELISION_PATTERN.test(value)\n}\n\n// ── Observation grammar ──────────────────────────────────────────────\n\n/** Substring the timeout notice always carries, whatever the command was. */\nexport const TIMEOUT_OBSERVATION_MARKER = 'timed out and has been killed'\n\n/** Opening of the notice the scaffold writes when a turn held no single action. */\nexport const FORMAT_ERROR_OBSERVATION_PREFIX =\n 'Please always provide EXACTLY ONE action in triple backticks, found '\n\n/**\n * What a recorded observation is.\n *\n * `command-result` is the only kind that carries an exit status. `timeout` and\n * `format-error` are the scaffold speaking rather than a command: the first\n * says the environment killed the command, the second says no command ran at\n * all. `elided` and `absent` carry no information about the step, and\n * `unreadable` is a shape this grammar does not know — never assumed to be\n * anything.\n */\nexport type RecordedObservationKind =\n | 'command-result'\n | 'timeout'\n | 'format-error'\n | 'elided'\n | 'absent'\n | 'unreadable'\n\nexport function classifyObservation(observation: string | null): RecordedObservationKind {\n if (observation === null) return 'absent'\n if (isElidedField(observation)) return 'elided'\n if (parseRecordedReturncode(observation) !== null) return 'command-result'\n if (observation.startsWith(FORMAT_ERROR_OBSERVATION_PREFIX)) return 'format-error'\n if (observation.includes(TIMEOUT_OBSERVATION_MARKER)) return 'timeout'\n return 'unreadable'\n}\n\n/** True when the recording shows the environment killed this step at its\n * wall-clock bound. Such a step carries no returncode, so no replay can\n * confirm or contradict it. */\nexport function isRecordedTimeout(observation: string | null): boolean {\n return classifyObservation(observation) === 'timeout'\n}\n\n// ── Turns to steps ───────────────────────────────────────────────────\n\n/**\n * One turn as the published trajectory dump holds it.\n *\n * A turn is not a step: the system prompt, the task statement and every turn\n * the scaffold rejected are turns that executed nothing.\n */\nexport interface RecordedTrajectoryTurn {\n readonly src?: string | null\n readonly msg?: string | null\n readonly tools?: readonly { readonly cmd?: string | null }[] | null\n readonly obs?: string | null\n}\n\nexport interface DecodedTrajectory {\n /** Executed commands in recorded order, each holding its OWN observation. */\n readonly steps: readonly RecordedTrajectoryStep[]\n /** Turns the scaffold rejected before anything ran. */\n readonly formatErrorTurns: number\n /**\n * Executed commands whose text the dump dropped.\n *\n * The step stays in `steps` carrying the marker, because the run did execute\n * a command there and a shorter list would misreport the trajectory. The\n * marker is not a command, so any count above zero means this trajectory\n * cannot be replayed: gate on it, or call `assertReplayableTrajectory`.\n */\n readonly elidedCommands: number\n /** True when the run's last turn was the submit sentinel with no observation. */\n readonly endedOnSubmitSentinel: boolean\n /** Turns carrying an observation this grammar cannot read. */\n readonly unreadableTurns: number\n}\n\n/**\n * Pair every recorded command with the observation of its own turn.\n *\n * Collecting commands and observations into two lists and zipping them is the\n * decode that looks right and is not: a turn the scaffold rejected carries an\n * observation of its own, so from the first such turn onward every observation\n * belongs to a different command than the one it is read against.\n *\n * A rejected turn executed nothing, so it is never a step — including when the\n * dump recorded a command for it. The scaffold rejects a turn holding several\n * bash blocks and runs none of them, while the dump keeps one of the blocks in\n * the command field. Replaying that field would execute a command the recorded\n * run did not, which is a worse corpus than a smaller one.\n *\n * A rejected turn is recognised by its observation, so a rejected turn whose\n * observation the dump elided is indistinguishable from an executed command\n * whose observation it elided. Both read as a step. Nothing in the dump\n * separates them, and the row-level defence is the share of unreadable exits a\n * caller admits: a row with no elided observation cannot hold this case at all.\n *\n * A trailing step that echoes the sentinel and nothing else, with no\n * observation, is dropped from `steps` and reported as `endedOnSubmitSentinel`.\n * The scaffold records an observation only when it hands one to the model, and\n * the sentinel ends the run, so the missing observation is the end of the\n * transcript rather than a gap in it. Echoing the sentinel changes no state, so\n * the recorded end state is the state the step before it left.\n *\n * A step that DID get an observation stays a step: the run continued past it.\n * So does a step that echoes the sentinel after doing real work — its state\n * change is part of the recorded end state, and with no observation its exit is\n * unknown, which `finalRecordedOutcome` reports rather than hides.\n */\nexport function decodeRecordedTurns(turns: readonly RecordedTrajectoryTurn[]): DecodedTrajectory {\n const steps: RecordedTrajectoryStep[] = []\n let formatErrorTurns = 0\n let unreadableTurns = 0\n for (const turn of turns) {\n const command = turn.tools?.[0]?.cmd ?? null\n const observation = turn.obs ?? null\n const kind = classifyObservation(observation)\n if (kind === 'format-error') {\n formatErrorTurns += 1\n continue\n }\n if (command === null) {\n if (kind === 'unreadable' || kind === 'elided') unreadableTurns += 1\n continue\n }\n steps.push({ step_id: steps.length + 1, action: command, observation })\n }\n const last = steps[steps.length - 1]\n const endedOnSubmitSentinel =\n last !== undefined && last.observation === null && isSubmitOnlyAction(last.action)\n if (endedOnSubmitSentinel) steps.pop()\n return {\n steps,\n formatErrorTurns,\n elidedCommands: steps.filter((step) => isElidedField(step.action)).length,\n endedOnSubmitSentinel,\n unreadableTurns,\n }\n}\n\n// ── The state a trajectory ended in ──────────────────────────────────\n\n/**\n * How the recorded run's last executed command ended.\n *\n * `killed` is a measured outcome, not a missing one: the environment stopped\n * the command at its bound and wrote a notice instead of an exit status.\n * `unreadable` names the observation kind that blocked the read, so a funnel\n * can report which shape cost it the row.\n */\nexport type RecordedFinalOutcome =\n | { readonly kind: 'returncode'; readonly value: number }\n | { readonly kind: 'killed' }\n | { readonly kind: 'unreadable'; readonly reason: RecordedObservationKind }\n\n/**\n * The outcome of the last step, or `null` when the trajectory has no steps.\n *\n * Reads only the last step. `decodeRecordedTurns` has already removed the turns\n * that executed nothing, so the last step is the last command the run ran.\n */\nexport function finalRecordedOutcome(\n steps: readonly RecordedTrajectoryStep[],\n): RecordedFinalOutcome | null {\n const last = steps[steps.length - 1]\n if (last === undefined) return null\n const kind = classifyObservation(last.observation)\n if (kind === 'command-result') {\n return { kind: 'returncode', value: parseRecordedReturncode(last.observation)! }\n }\n if (kind === 'timeout') return { kind: 'killed' }\n return { kind: 'unreadable', reason: kind }\n}\n\n/**\n * Steps whose recorded exit a replay cannot check.\n *\n * A killed step counts: the recording holds no exit status to compare a replay\n * against, so agreement on it cannot be measured either way.\n */\nexport function unreadableExitCount(steps: readonly RecordedTrajectoryStep[]): number {\n return steps.filter((step) => classifyObservation(step.observation) !== 'command-result').length\n}\n\n/**\n * Throw unless every recorded command survived the dump.\n *\n * A replay executes `steps` verbatim, so one elision marker in an action means\n * the replay runs the literal two-to-four characters of the marker instead of\n * the command the run executed. The guard is here so a replayer needs one call\n * rather than a field check it can forget.\n */\nexport function assertReplayableTrajectory(decoded: DecodedTrajectory): void {\n if (decoded.elidedCommands === 0) return\n const markers = decoded.steps\n .filter((step) => isElidedField(step.action))\n .map((step) => step.action)\n throw new Error(\n `trajectory holds ${decoded.elidedCommands} command(s) the dump elided (${markers.slice(0, 5).join(', ')}); ` +\n 'no dictionary maps a marker back to its text, so this trajectory cannot be replayed',\n )\n}\n","/**\n * The execution boundary replay runs across.\n *\n * A replay needs one thing from its environment: a session that runs a shell\n * command inside the trajectory's own image and reports the exit code and\n * output. That is the whole contract. Concrete backends — a sandbox platform\n * client, a docker exec, an SSH shell — live with the consumer that owns the\n * infrastructure, so this package depends on no sandbox client.\n */\n\nexport interface ReplayExecResult {\n exitCode: number\n stdout: string\n stderr: string\n}\n\nexport interface ReplayExecSession {\n exec(command: string, timeoutMs: number): Promise<ReplayExecResult>\n close(): Promise<void>\n}\n\nexport interface ReplayExecBackend {\n /** One fresh execution environment per call; the caller closes it. */\n open(): Promise<ReplayExecSession>\n}\n\n/** Builds a backend pinned to one image. Callers that resolve images\n * internally (batch, corpus wire, finding verification) take this instead of\n * a backend, so every case runs against its own image. */\nexport type ReplayExecBackendFactory = (image: string) => ReplayExecBackend\n\n/**\n * mini-SWE runs every action as a fresh /bin/sh subshell from a fixed\n * workdir. Reproduce that exactly — and stay quote-proof for arbitrary\n * recorded actions — by piping the base64 of the action into `sh` after\n * cd-ing to the workdir. Exit code is sh's, i.e. the action's.\n */\nexport function wrapActionForExec(action: string, cwd: string): string {\n const b64 = Buffer.from(action, 'utf8').toString('base64')\n const quotedCwd = `'${cwd.replaceAll(\"'\", `'\\\\''`)}'`\n return `cd ${quotedCwd} && printf %s ${b64} | base64 -d | sh`\n}\n"],"mappings":";;AA4CA,SAAgB,wBAAwB,aAA2C;CACjF,IAAI,CAAC,aAAa,OAAO;CACzB,MAAM,IAAI,oCAAoC,KAAK,WAAW;CAC9D,OAAO,IAAI,OAAO,EAAE,EAAE,IAAI;AAC5B;;;AAIA,SAAgB,uBAAuB,aAAoC;CACzE,IAAI,CAAC,aAAa,OAAO;CACzB,MAAM,IAAI,qCAAqC,KAAK,WAAW;CAC/D,OAAO,IAAI,EAAE,KAAM;AACrB;;;;;;;;AASA,SAAgB,uBAAuB,aAA2C;CAChF,MAAM,OAAO,uBAAuB,WAAW,CAAC,CAC7C,MAAM,IAAI,CAAC,CACX,MAAM,MAAM,aAAa,KAAK,CAAC,CAAC;CACnC,OAAO,OAAO,KAAK,KAAK,CA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2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "@tangle-network/agent-eval — wire protocol",
|
|
5
|
-
"version": "0.145.
|
|
5
|
+
"version": "0.145.11",
|
|
6
6
|
"description": "HTTP and stdio RPC interface to agent-eval. The TypeScript runtime is the source of truth; this spec is the contract that cross-language clients (Python, Rust, Go) generate from.\n\nWire-protocol version: 1.0.0. Bumps on breaking changes to request/response schemas.",
|
|
7
7
|
"contact": {
|
|
8
8
|
"name": "Tangle Network",
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
//#region src/trajectory-replay/steps.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Recorded shell-trajectory steps and the observation grammar they carry.
|
|
4
|
+
*
|
|
5
|
+
* A recorded trajectory is the action/observation sequence an agent actually
|
|
6
|
+
* ran. Scaffolds that execute one shell command per step (mini-SWE and the
|
|
7
|
+
* CodeTracer-normalized corpora built from it) tag each observation with the
|
|
8
|
+
* command's returncode and its combined output:
|
|
9
|
+
*
|
|
10
|
+
* <returncode>2</returncode>
|
|
11
|
+
* <output>
|
|
12
|
+
* …command output…
|
|
13
|
+
* </output>
|
|
14
|
+
*
|
|
15
|
+
* That is one of four shapes a recorded turn carries, and the other three are
|
|
16
|
+
* not command results at all:
|
|
17
|
+
*
|
|
18
|
+
* - a timeout notice, when the environment killed the command at its bound;
|
|
19
|
+
* - a format-error notice, when the scaffold rejected the turn and ran
|
|
20
|
+
* nothing;
|
|
21
|
+
* - an elision marker `$<hex>`, when the published dump dropped the string.
|
|
22
|
+
*
|
|
23
|
+
* A turn also carries no observation when it is the run's last turn, because
|
|
24
|
+
* the scaffold records an observation only when it hands one back to the model.
|
|
25
|
+
*
|
|
26
|
+
* The parsers here are the only place that grammar is decoded. Everything
|
|
27
|
+
* downstream — replay verdicts, corpus enumeration, admission funnels, fix
|
|
28
|
+
* prompts — reads the returncode, the output, and the failure signature through
|
|
29
|
+
* these functions. A second decoder elsewhere is how a corpus reads as
|
|
30
|
+
* unreplayable when it is not.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* One step of a recorded shell trajectory. Structural: any richer step record
|
|
34
|
+
* (file refs, thinking text, tool type) satisfies it.
|
|
35
|
+
*/
|
|
36
|
+
interface RecordedTrajectoryStep {
|
|
37
|
+
/** 1-based position in the trajectory. */
|
|
38
|
+
readonly step_id: number;
|
|
39
|
+
readonly action: string;
|
|
40
|
+
/** Null when the step recorded no observation (terminal submit steps). */
|
|
41
|
+
readonly observation: string | null;
|
|
42
|
+
}
|
|
43
|
+
/** Recorded returncode of a step, or null when the observation carries none. */
|
|
44
|
+
declare function parseRecordedReturncode(observation: string | null): number | null;
|
|
45
|
+
/** Text between the observation's <output> tags, or the raw observation when
|
|
46
|
+
* the tags are absent. */
|
|
47
|
+
declare function parseObservationOutput(observation: string | null): string;
|
|
48
|
+
/**
|
|
49
|
+
* Stable failure-signature candidate: the first line of the recorded output
|
|
50
|
+
* that contains the word "error". Null when no such line exists — a verdict
|
|
51
|
+
* then falls back to returncode-only matching and says so.
|
|
52
|
+
* Pass an explicit signature to override (compiler quote glyphs vary with
|
|
53
|
+
* locale, so a hand-picked ASCII substring is often more robust).
|
|
54
|
+
*/
|
|
55
|
+
declare function deriveFailureSignature(observation: string | null): string | null;
|
|
56
|
+
/** mini-SWE's end-of-run submit convention: the agent echoes this sentinel
|
|
57
|
+
* and dumps the diff. A label on this step marks a bad SUBMIT DECISION, not a
|
|
58
|
+
* failed command — there is no executable failure to reproduce, so it is
|
|
59
|
+
* never a counterfactual replay target. */
|
|
60
|
+
declare const SUBMIT_ACTION_SIGNATURE = "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT";
|
|
61
|
+
declare function isSubmitAction(action: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* True when the action is the sentinel echo and nothing else.
|
|
64
|
+
*
|
|
65
|
+
* The distinction decides whether a step may be dropped. An agent is told to
|
|
66
|
+
* issue the sentinel alone, and 5.7% of recorded runs end on a command that
|
|
67
|
+
* writes files or edits them and then echoes it. Dropping such a step because
|
|
68
|
+
* it holds the sentinel would remove the run's last state change from the
|
|
69
|
+
* replay, so the recorded end state and the replayed one would differ.
|
|
70
|
+
*/
|
|
71
|
+
declare function isSubmitOnlyAction(action: string): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* A field the dump replaced with a counter instead of its text.
|
|
74
|
+
*
|
|
75
|
+
* The counter is hexadecimal and rises by one per dropped string in document
|
|
76
|
+
* order, so a decimal-only reading (`$12`) accepts every marker that carries a
|
|
77
|
+
* letter (`$3a`) as if it were real text. A command read that way replays as
|
|
78
|
+
* the literal two-to-four characters `$3a`, which is not the command the run
|
|
79
|
+
* executed.
|
|
80
|
+
*
|
|
81
|
+
* Nothing in the dump maps a marker back to its text: the same marker carries
|
|
82
|
+
* different content in different rows, so there is no dictionary to read. A
|
|
83
|
+
* field that matches is unrecoverable, so a caller rejects the row that holds
|
|
84
|
+
* it rather than replaying the marker.
|
|
85
|
+
*/
|
|
86
|
+
declare const RECORDED_ELISION_PATTERN: RegExp;
|
|
87
|
+
declare function isElidedField(value: string | null | undefined): boolean;
|
|
88
|
+
/** Substring the timeout notice always carries, whatever the command was. */
|
|
89
|
+
declare const TIMEOUT_OBSERVATION_MARKER = "timed out and has been killed";
|
|
90
|
+
/** Opening of the notice the scaffold writes when a turn held no single action. */
|
|
91
|
+
declare const FORMAT_ERROR_OBSERVATION_PREFIX = "Please always provide EXACTLY ONE action in triple backticks, found ";
|
|
92
|
+
/**
|
|
93
|
+
* What a recorded observation is.
|
|
94
|
+
*
|
|
95
|
+
* `command-result` is the only kind that carries an exit status. `timeout` and
|
|
96
|
+
* `format-error` are the scaffold speaking rather than a command: the first
|
|
97
|
+
* says the environment killed the command, the second says no command ran at
|
|
98
|
+
* all. `elided` and `absent` carry no information about the step, and
|
|
99
|
+
* `unreadable` is a shape this grammar does not know — never assumed to be
|
|
100
|
+
* anything.
|
|
101
|
+
*/
|
|
102
|
+
type RecordedObservationKind = 'command-result' | 'timeout' | 'format-error' | 'elided' | 'absent' | 'unreadable';
|
|
103
|
+
declare function classifyObservation(observation: string | null): RecordedObservationKind;
|
|
104
|
+
/** True when the recording shows the environment killed this step at its
|
|
105
|
+
* wall-clock bound. Such a step carries no returncode, so no replay can
|
|
106
|
+
* confirm or contradict it. */
|
|
107
|
+
declare function isRecordedTimeout(observation: string | null): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* One turn as the published trajectory dump holds it.
|
|
110
|
+
*
|
|
111
|
+
* A turn is not a step: the system prompt, the task statement and every turn
|
|
112
|
+
* the scaffold rejected are turns that executed nothing.
|
|
113
|
+
*/
|
|
114
|
+
interface RecordedTrajectoryTurn {
|
|
115
|
+
readonly src?: string | null;
|
|
116
|
+
readonly msg?: string | null;
|
|
117
|
+
readonly tools?: readonly {
|
|
118
|
+
readonly cmd?: string | null;
|
|
119
|
+
}[] | null;
|
|
120
|
+
readonly obs?: string | null;
|
|
121
|
+
}
|
|
122
|
+
interface DecodedTrajectory {
|
|
123
|
+
/** Executed commands in recorded order, each holding its OWN observation. */
|
|
124
|
+
readonly steps: readonly RecordedTrajectoryStep[];
|
|
125
|
+
/** Turns the scaffold rejected before anything ran. */
|
|
126
|
+
readonly formatErrorTurns: number;
|
|
127
|
+
/**
|
|
128
|
+
* Executed commands whose text the dump dropped.
|
|
129
|
+
*
|
|
130
|
+
* The step stays in `steps` carrying the marker, because the run did execute
|
|
131
|
+
* a command there and a shorter list would misreport the trajectory. The
|
|
132
|
+
* marker is not a command, so any count above zero means this trajectory
|
|
133
|
+
* cannot be replayed: gate on it, or call `assertReplayableTrajectory`.
|
|
134
|
+
*/
|
|
135
|
+
readonly elidedCommands: number;
|
|
136
|
+
/** True when the run's last turn was the submit sentinel with no observation. */
|
|
137
|
+
readonly endedOnSubmitSentinel: boolean;
|
|
138
|
+
/** Turns carrying an observation this grammar cannot read. */
|
|
139
|
+
readonly unreadableTurns: number;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Pair every recorded command with the observation of its own turn.
|
|
143
|
+
*
|
|
144
|
+
* Collecting commands and observations into two lists and zipping them is the
|
|
145
|
+
* decode that looks right and is not: a turn the scaffold rejected carries an
|
|
146
|
+
* observation of its own, so from the first such turn onward every observation
|
|
147
|
+
* belongs to a different command than the one it is read against.
|
|
148
|
+
*
|
|
149
|
+
* A rejected turn executed nothing, so it is never a step — including when the
|
|
150
|
+
* dump recorded a command for it. The scaffold rejects a turn holding several
|
|
151
|
+
* bash blocks and runs none of them, while the dump keeps one of the blocks in
|
|
152
|
+
* the command field. Replaying that field would execute a command the recorded
|
|
153
|
+
* run did not, which is a worse corpus than a smaller one.
|
|
154
|
+
*
|
|
155
|
+
* A rejected turn is recognised by its observation, so a rejected turn whose
|
|
156
|
+
* observation the dump elided is indistinguishable from an executed command
|
|
157
|
+
* whose observation it elided. Both read as a step. Nothing in the dump
|
|
158
|
+
* separates them, and the row-level defence is the share of unreadable exits a
|
|
159
|
+
* caller admits: a row with no elided observation cannot hold this case at all.
|
|
160
|
+
*
|
|
161
|
+
* A trailing step that echoes the sentinel and nothing else, with no
|
|
162
|
+
* observation, is dropped from `steps` and reported as `endedOnSubmitSentinel`.
|
|
163
|
+
* The scaffold records an observation only when it hands one to the model, and
|
|
164
|
+
* the sentinel ends the run, so the missing observation is the end of the
|
|
165
|
+
* transcript rather than a gap in it. Echoing the sentinel changes no state, so
|
|
166
|
+
* the recorded end state is the state the step before it left.
|
|
167
|
+
*
|
|
168
|
+
* A step that DID get an observation stays a step: the run continued past it.
|
|
169
|
+
* So does a step that echoes the sentinel after doing real work — its state
|
|
170
|
+
* change is part of the recorded end state, and with no observation its exit is
|
|
171
|
+
* unknown, which `finalRecordedOutcome` reports rather than hides.
|
|
172
|
+
*/
|
|
173
|
+
declare function decodeRecordedTurns(turns: readonly RecordedTrajectoryTurn[]): DecodedTrajectory;
|
|
174
|
+
/**
|
|
175
|
+
* How the recorded run's last executed command ended.
|
|
176
|
+
*
|
|
177
|
+
* `killed` is a measured outcome, not a missing one: the environment stopped
|
|
178
|
+
* the command at its bound and wrote a notice instead of an exit status.
|
|
179
|
+
* `unreadable` names the observation kind that blocked the read, so a funnel
|
|
180
|
+
* can report which shape cost it the row.
|
|
181
|
+
*/
|
|
182
|
+
type RecordedFinalOutcome = {
|
|
183
|
+
readonly kind: 'returncode';
|
|
184
|
+
readonly value: number;
|
|
185
|
+
} | {
|
|
186
|
+
readonly kind: 'killed';
|
|
187
|
+
} | {
|
|
188
|
+
readonly kind: 'unreadable';
|
|
189
|
+
readonly reason: RecordedObservationKind;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* The outcome of the last step, or `null` when the trajectory has no steps.
|
|
193
|
+
*
|
|
194
|
+
* Reads only the last step. `decodeRecordedTurns` has already removed the turns
|
|
195
|
+
* that executed nothing, so the last step is the last command the run ran.
|
|
196
|
+
*/
|
|
197
|
+
declare function finalRecordedOutcome(steps: readonly RecordedTrajectoryStep[]): RecordedFinalOutcome | null;
|
|
198
|
+
/**
|
|
199
|
+
* Steps whose recorded exit a replay cannot check.
|
|
200
|
+
*
|
|
201
|
+
* A killed step counts: the recording holds no exit status to compare a replay
|
|
202
|
+
* against, so agreement on it cannot be measured either way.
|
|
203
|
+
*/
|
|
204
|
+
declare function unreadableExitCount(steps: readonly RecordedTrajectoryStep[]): number;
|
|
205
|
+
/**
|
|
206
|
+
* Throw unless every recorded command survived the dump.
|
|
207
|
+
*
|
|
208
|
+
* A replay executes `steps` verbatim, so one elision marker in an action means
|
|
209
|
+
* the replay runs the literal two-to-four characters of the marker instead of
|
|
210
|
+
* the command the run executed. The guard is here so a replayer needs one call
|
|
211
|
+
* rather than a field check it can forget.
|
|
212
|
+
*/
|
|
213
|
+
declare function assertReplayableTrajectory(decoded: DecodedTrajectory): void;
|
|
214
|
+
//#endregion
|
|
215
|
+
export { isSubmitAction as _, RecordedObservationKind as a, parseRecordedReturncode as b, SUBMIT_ACTION_SIGNATURE as c, classifyObservation as d, decodeRecordedTurns as f, isRecordedTimeout as g, isElidedField as h, RecordedFinalOutcome as i, TIMEOUT_OBSERVATION_MARKER as l, finalRecordedOutcome as m, FORMAT_ERROR_OBSERVATION_PREFIX as n, RecordedTrajectoryStep as o, deriveFailureSignature as p, RECORDED_ELISION_PATTERN as r, RecordedTrajectoryTurn as s, DecodedTrajectory as t, assertReplayableTrajectory as u, isSubmitOnlyAction as v, unreadableExitCount as x, parseObservationOutput as y };
|
|
216
|
+
//# sourceMappingURL=steps-AmkT-GIM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps-AmkT-GIM.d.ts","names":[],"sources":["../src/trajectory-replay/steps.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmCiB;;WAEN;WACA;;WAEA;;;iBAIK,wBAAwB;;;iBAQxB,uBAAuB;;;;;;;;iBAavB,uBAAuB;;;;;cAW1B;iBAEG,eAAe;;;;;;;;;;iBAaf,mBAAmB;;;;;;;;;;;;;;;cAsBtB,0BAAwB;iBAErB,cAAc;;cAOjB;;cAGA;;;;;;;;;;;KAaD;iBAQI,oBAAoB,6BAA6B;;;;iBAYjD,kBAAkB;;;;;;;UAYjB;WACN;WACA;WACA;aAA4B;;WAC5B;;UAGM;;WAEN,gBAAgB;;WAEhB;;;;;;;;;WASA;;WAEA;;WAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmCK,oBAAoB,gBAAgB,2BAA2B;;;;;;;;;KAyCnE;WACG;WAA6B;;WAC7B;;WACA;WAA6B,QAAQ;;;;;;;;iBAQpC,qBACd,gBAAgB,2BACf;;;;;;;iBAiBa,oBAAoB,gBAAgB;;;;;;;;;iBAYpC,2BAA2B,SAAS"}
|
|
@@ -4,19 +4,8 @@ import { b as CustomTokenPricing, c as CostLedgerHandle, p as CostProvenance } f
|
|
|
4
4
|
import { u as RunTokenUsage } from "../run-record-DVV82Gwh.js";
|
|
5
5
|
import { a as TraceAnalystLimits, n as TraceAnalysisEngine } from "../engine-DJqRKbhs.js";
|
|
6
6
|
import { t as PrimeBridgeTransport } from "../prime-bridge-transport-6feEglLf.js";
|
|
7
|
-
import {
|
|
7
|
+
import { g as isRecordedTimeout, o as RecordedTrajectoryStep } from "../steps-AmkT-GIM.js";
|
|
8
8
|
//#region src/trace-repair/mini-swe-scaffold.d.ts
|
|
9
|
-
/**
|
|
10
|
-
* The mini-swe-agent scaffold as the Terminal-Bench-2 trajectory corpus
|
|
11
|
-
* recorded it: one bash block per turn, one observation per command, and a
|
|
12
|
-
* sentinel command that ends the run.
|
|
13
|
-
*
|
|
14
|
-
* Every template here is byte-verified against
|
|
15
|
-
* `yoonholee/terminalbench-trajectories` (agent = `mini-swe-agent`, 6663 rows,
|
|
16
|
-
* one distinct system prompt across all of them). A continuation that renders
|
|
17
|
-
* different bytes puts the model in a different distribution than the prefix
|
|
18
|
-
* it inherits, so these strings are pinned, not configurable.
|
|
19
|
-
*/
|
|
20
9
|
/** Whole-line marker that ends a run. The first output line must equal it and the command must exit 0. */
|
|
21
10
|
declare const SUBMIT_SENTINEL = "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT";
|
|
22
11
|
/** Outputs at or above this length are elided head+tail instead of shown whole. */
|
|
@@ -62,15 +51,6 @@ interface CommandOutput {
|
|
|
62
51
|
declare function renderObservation(output: CommandOutput): string;
|
|
63
52
|
/** The observation after the environment killed a command for exceeding its timeout. */
|
|
64
53
|
declare function renderTimeoutObservation(command: string, partialOutput: string): string;
|
|
65
|
-
/**
|
|
66
|
-
* True when the recording shows the environment killed this step at its
|
|
67
|
-
* wall-clock bound.
|
|
68
|
-
*
|
|
69
|
-
* Such a step carries no returncode, so no replay can confirm or contradict
|
|
70
|
-
* it. Callers use this to bound the replay of that step cheaply rather than to
|
|
71
|
-
* decide agreement.
|
|
72
|
-
*/
|
|
73
|
-
declare function isRecordedTimeout(observation: string | null): boolean;
|
|
74
54
|
/** The observation after a turn that did not contain exactly one bash block. */
|
|
75
55
|
declare function renderFormatErrorObservation(actionCount: number): string;
|
|
76
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/trace-repair/mini-swe-scaffold.ts","../../src/trace-repair/action-budget.ts","../../src/trace-repair/continuation-records.ts","../../src/trace-repair/control-policy.ts","../../src/trace-repair/admission-records.ts","../../src/trace-repair/continuation-policy.ts","../../src/trace-repair/oracle-determinism.ts","../../src/trace-repair/admission.ts","../../src/trace-repair/admission-contract.ts","../../src/trace-repair/admission-report.ts","../../src/trace-repair/analyst-response.ts","../../src/trace-repair/blinding.ts","../../src/trace-repair/analyst-arm.ts","../../src/trace-repair/arm-completion.ts","../../src/trace-repair/arm-dspy.ts","../../src/trace-repair/degenerate-strategies.ts","../../src/trace-repair/ports.ts","../../src/trace-repair/funnel.ts","../../src/trace-repair/grade.ts","../../src/trace-repair/delta-repair.ts","../../src/trace-repair/docker-environment.ts","../../src/trace-repair/repair-prompt.ts","../../src/trace-repair/test-oracle.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAaa;;cAGA;;cAGA;cAEA;UAiBI;;EAEf;;;;;EAKA;;;iBAIc,sBAAsB,OAAO;KAiFjC;EACN;EAAgB;;EAChB;EAAsB;;;;;;;iBASZ,YAAY,2BAA2B;UAMtC;EACf;EACA;;EAEA;;;;;;;iBAQc,kBAAkB,QAAQ;;iBAsB1B,yBAAyB,iBAAiB;;;;;;;;;iBAmB1C,kBAAkB;;iBAKlB,6BAA6B;;;;;;iBAyB7B,aAAa,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;KC3MzB;UAEK;;WAEN;;WAEA;;WAEA;;;cAIE,8BAA8B;;;;;;;cAY9B;;;;;;;;;;iBAgCG,gBAAgB;EAAmB;EAAsB;;;;iBA8QzD,sBAAsB,iBAAiB;;;KAM3C;UAQK;EACf;EACA;EACA;;EAEA,SAAS;;EAET,UAAU;;KAGA;WACG;WAA2B,aAAa;;WAExC;WACA,W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gB;iBAWhC,mBAAmB,SAAS,4BAA4B"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/trace-repair/mini-swe-scaffold.ts","../../src/trace-repair/action-budget.ts","../../src/trace-repair/continuation-records.ts","../../src/trace-repair/control-policy.ts","../../src/trace-repair/admission-records.ts","../../src/trace-repair/continuation-policy.ts","../../src/trace-repair/oracle-determinism.ts","../../src/trace-repair/admission.ts","../../src/trace-repair/admission-contract.ts","../../src/trace-repair/admission-report.ts","../../src/trace-repair/analyst-response.ts","../../src/trace-repair/blinding.ts","../../src/trace-repair/analyst-arm.ts","../../src/trace-repair/arm-completion.ts","../../src/trace-repair/arm-dspy.ts","../../src/trace-repair/degenerate-strategies.ts","../../src/trace-repair/ports.ts","../../src/trace-repair/funnel.ts","../../src/trace-repair/grade.ts","../../src/trace-repair/delta-repair.ts","../../src/trace-repair/docker-environment.ts","../../src/trace-repair/repair-prompt.ts","../../src/trace-repair/test-oracle.ts"],"mappings":";;;;;;;;;cAyBa;;cAGA;;cAGA;cAEA;UAiBI;;EAEf;;;;;EAKA;;;iBAIc,sBAAsB,OAAO;KAiFjC;EACN;EAAgB;;EAChB;EAAsB;;;;;;;iBASZ,YAAY,2BAA2B;UAMtC;EACf;EACA;;EAEA;;;;;;;iBAQc,kBAAkB,QAAQ;;iBAsB1B,yBAAyB,iBAAiB;;iBAS1C,6BAA6B;;;;;;iBAyB7B,aAAa,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;KCxMzB;UAEK;;WAEN;;WAEA;;WAEA;;;cAIE,8BAA8B;;;;;;;cAY9B;;;;;;;;;;iBAgCG,gBAAgB;EAAmB;EAAsB;;;;iBA8QzD,sBAAsB,iBAAiB;;;KAM3C;UAQK;EACf;EACA;EACA;;EAEA,SAAS;;EAET,UAAU;;KAGA;WACG;WAA2B,aAAa;;WAExC;WACA,WAAW;WACX;WACA,aAAa;;;;;;;;;;;;;;;iBAqBZ,wBACd,gBACA,cAAc,mBACd,SAAQ,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ict-cache-mZf5FEiY.js";
|
|
|
4
4
|
import { t as certificationEvidenceDigest } from "../verdict-BndeTAh_.js";
|
|
5
5
|
import { t as packageVersion } from "../package-version-D7lQHt_-.js";
|
|
6
6
|
import { d as runPrimeExchange, n as buildPrimePrompt, p as assertEqualDeclarativeTerms, t as analystUsageReceiptFromPrimeUsage } from "../prime-protocol-6tZTVsWm.js";
|
|
7
|
-
import {
|
|
7
|
+
import { a as TIMEOUT_OBSERVATION_MARKER, f as isRecordedTimeout, g as parseRecordedReturncode, i as SUBMIT_ACTION_SIGNATURE, l as deriveFailureSignature, n as FORMAT_ERROR_OBSERVATION_PREFIX, t as wrapActionForExec } from "../exec-y-DCLqK7.js";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { constants } from "node:os";
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
@@ -19,9 +19,13 @@ import { spawn } from "node:child_process";
|
|
|
19
19
|
* one distinct system prompt across all of them). A continuation that renders
|
|
20
20
|
* different bytes puts the model in a different distribution than the prefix
|
|
21
21
|
* it inherits, so these strings are pinned, not configurable.
|
|
22
|
+
*
|
|
23
|
+
* The markers a reader matches on live in `trajectory-replay/steps`, which owns
|
|
24
|
+
* the recorded grammar. This module writes with them so a rendered observation
|
|
25
|
+
* and a recorded one classify the same way.
|
|
22
26
|
*/
|
|
23
27
|
/** Whole-line marker that ends a run. The first output line must equal it and the command must exit 0. */
|
|
24
|
-
const SUBMIT_SENTINEL =
|
|
28
|
+
const SUBMIT_SENTINEL = SUBMIT_ACTION_SIGNATURE;
|
|
25
29
|
/** Outputs at or above this length are elided head+tail instead of shown whole. */
|
|
26
30
|
const OUTPUT_ELISION_THRESHOLD = 1e4;
|
|
27
31
|
/** Characters kept from each end of an elided output. */
|
|
@@ -159,24 +163,11 @@ If you really need to see something from the full command's output, you can redi
|
|
|
159
163
|
}
|
|
160
164
|
/** The observation after the environment killed a command for exceeding its timeout. */
|
|
161
165
|
function renderTimeoutObservation(command, partialOutput) {
|
|
162
|
-
return `The last command <command>${command}</command>
|
|
163
|
-
}
|
|
164
|
-
/** Substring `renderTimeoutObservation` always writes, whatever the command was. */
|
|
165
|
-
const TIMEOUT_OBSERVATION_MARKER = "timed out and has been killed";
|
|
166
|
-
/**
|
|
167
|
-
* True when the recording shows the environment killed this step at its
|
|
168
|
-
* wall-clock bound.
|
|
169
|
-
*
|
|
170
|
-
* Such a step carries no returncode, so no replay can confirm or contradict
|
|
171
|
-
* it. Callers use this to bound the replay of that step cheaply rather than to
|
|
172
|
-
* decide agreement.
|
|
173
|
-
*/
|
|
174
|
-
function isRecordedTimeout(observation) {
|
|
175
|
-
return observation?.includes(TIMEOUT_OBSERVATION_MARKER) === true;
|
|
166
|
+
return `The last command <command>${command}</command> ${TIMEOUT_OBSERVATION_MARKER}.\nThe output of the command was:\n <output>\n${partialOutput}\n</output>\nPlease try another command and make sure to avoid those requiring interactive input.`;
|
|
176
167
|
}
|
|
177
168
|
/** The observation after a turn that did not contain exactly one bash block. */
|
|
178
169
|
function renderFormatErrorObservation(actionCount) {
|
|
179
|
-
return
|
|
170
|
+
return `${FORMAT_ERROR_OBSERVATION_PREFIX}${actionCount} actions.\nIf you want to end the task, please issue the following command: \`echo ${SUBMIT_SENTINEL}\`\nwithout any other command.
|
|
180
171
|
Else, please format your response exactly as follows:
|
|
181
172
|
|
|
182
173
|
<response_example>
|
|
@@ -199,7 +190,7 @@ function submissionOf(output) {
|
|
|
199
190
|
if (output.returncode !== 0) return null;
|
|
200
191
|
const lines = output.output.replace(/^\s+/, "").split(/(?<=\n)/);
|
|
201
192
|
const first = lines[0];
|
|
202
|
-
if (first === void 0 || first.trim() !==
|
|
193
|
+
if (first === void 0 || first.trim() !== SUBMIT_SENTINEL) return null;
|
|
203
194
|
return lines.slice(1).join("");
|
|
204
195
|
}
|
|
205
196
|
//#endregion
|
|
@@ -544,7 +535,7 @@ function checkInterventionBudget(action, declaredKind, budget = SCAFFOLD_INTERVE
|
|
|
544
535
|
if (measurement.bytes > budget.maxBytes) return reject("over-byte-cap", `${measurement.bytes} bytes exceeds the ${budget.maxBytes}-byte action budget`);
|
|
545
536
|
if (measurement.statements > budget.maxStatements) return reject("multiple-statements", `${measurement.statements} top-level statements exceeds the ${budget.maxStatements} the scaffold takes per action`);
|
|
546
537
|
if (measurement.heredocs > budget.maxHeredocs) return reject("multiple-heredocs", `${measurement.heredocs} heredocs exceeds the ${budget.maxHeredocs} one edit may author`);
|
|
547
|
-
if (action.includes(
|
|
538
|
+
if (action.includes(SUBMIT_SENTINEL)) return reject("submit-instead-of-repair", "the action submits the run instead of repairing it");
|
|
548
539
|
if (NO_OP_ACTIONS.includes(action.trim())) return reject("no-op-action", `"${action.trim()}" changes nothing`);
|
|
549
540
|
return {
|
|
550
541
|
admissible: true,
|