@tangle-network/agent-eval 0.186.1 → 0.187.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 +21 -0
- package/dist/analyst/index.d.ts +1 -1
- package/dist/analyst/index.js +1 -1
- package/dist/{benchmark-command-lwSFWbc6.js → benchmark-command-j1YV50m1.js} +2 -2
- package/dist/{benchmark-command-lwSFWbc6.js.map → benchmark-command-j1YV50m1.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/diagnosis/index.d.ts.map +1 -1
- package/dist/diagnosis/index.js +8 -8
- package/dist/diagnosis/index.js.map +1 -1
- package/dist/{exec-D9WpA2p-.js → exec-ChJ6d5if.js} +10 -6
- package/dist/exec-ChJ6d5if.js.map +1 -0
- package/dist/experiment/index.d.ts +155 -1
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js +268 -2
- package/dist/experiment/index.js.map +1 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -1
- package/dist/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{steps-CiNVJry_.d.ts → steps-Bg5-KVx1.d.ts} +4 -4
- package/dist/{steps-CiNVJry_.d.ts.map → steps-Bg5-KVx1.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +1 -1
- package/dist/trace-repair/index.js +1 -1
- package/dist/trajectory-replay/index.d.ts +11 -11
- package/dist/trajectory-replay/index.d.ts.map +1 -1
- package/dist/trajectory-replay/index.js +35 -16
- package/dist/trajectory-replay/index.js.map +1 -1
- package/docs/experiment.md +94 -0
- package/docs/trajectory-replay.md +9 -4
- package/package.json +1 -1
- package/dist/exec-D9WpA2p-.js.map +0 -1
package/dist/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "@tangle-network/agent-eval — wire protocol",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.187.0",
|
|
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.1.0. Bumps on breaking changes to request/response schemas.",
|
|
7
7
|
"contact": {
|
|
8
8
|
"name": "Tangle Network",
|
|
@@ -46,9 +46,9 @@ declare function parseRecordedReturncode(observation: string | null): number | n
|
|
|
46
46
|
* the tags are absent. */
|
|
47
47
|
declare function parseObservationOutput(observation: string | null): string;
|
|
48
48
|
/**
|
|
49
|
-
* Stable failure-signature candidate: the first line
|
|
50
|
-
*
|
|
51
|
-
*
|
|
49
|
+
* Stable failure-signature candidate: the first error line, or a shell
|
|
50
|
+
* command-not-found suffix. Null when neither exists — a verdict then falls
|
|
51
|
+
* back to returncode-only matching and says so.
|
|
52
52
|
* Pass an explicit signature to override (compiler quote glyphs vary with
|
|
53
53
|
* locale, so a hand-picked ASCII substring is often more robust).
|
|
54
54
|
*/
|
|
@@ -198,4 +198,4 @@ declare function unreadableExitCount(steps: readonly RecordedTrajectoryStep[]):
|
|
|
198
198
|
declare function assertReplayableTrajectory(decoded: DecodedTrajectory): void;
|
|
199
199
|
//#endregion
|
|
200
200
|
export { isSubmitOnlyAction as _, RecordedTrajectoryStep as a, unreadableExitCount as b, TIMEOUT_OBSERVATION_MARKER as c, decodeRecordedTurns as d, deriveFailureSignature as f, isSubmitAction as g, isRecordedTimeout as h, RecordedObservationKind as i, assertReplayableTrajectory as l, isElidedField as m, FORMAT_ERROR_OBSERVATION_PREFIX as n, RecordedTrajectoryTurn as o, finalRecordedOutcome as p, RecordedFinalOutcome as r, SUBMIT_ACTION_SIGNATURE as s, DecodedTrajectory as t, classifyObservation as u, parseObservationOutput as v, parseRecordedReturncode as y };
|
|
201
|
-
//# sourceMappingURL=steps-
|
|
201
|
+
//# sourceMappingURL=steps-Bg5-KVx1.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps-
|
|
1
|
+
{"version":3,"file":"steps-Bg5-KVx1.d.ts","names":[],"sources":["../src/trajectory-replay/steps.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmCiB;;WAEN;WACA;;WAEA;;;iBAIK,wBAAwB;;;iBAQxB,uBAAuB;;;;;;;;iBAavB,uBAAuB;;;;;cAc1B;iBAEG,eAAe;;;;;;;;;;iBAaf,mBAAmB;iBAwBnB,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,7 +4,7 @@ import { u as RunTokenUsage } from "../run-record-D9wS35fK.js";
|
|
|
4
4
|
import { t as DefaultVerdict } from "../verdict-E4eRNf7-.js";
|
|
5
5
|
import { a as TraceAnalystLimits, n as TraceAnalysisEngine } from "../engine-DNlKhIm0.js";
|
|
6
6
|
import { t as PrimeBridgeTransport } from "../prime-bridge-transport-6feEglLf.js";
|
|
7
|
-
import { a as RecordedTrajectoryStep, h as isRecordedTimeout } from "../steps-
|
|
7
|
+
import { a as RecordedTrajectoryStep, h as isRecordedTimeout } from "../steps-Bg5-KVx1.js";
|
|
8
8
|
//#region src/trace-repair/mini-swe-scaffold.d.ts
|
|
9
9
|
/** Whole-line marker that ends a run. The first output line must equal it and the command must exit 0. */
|
|
10
10
|
declare const SUBMIT_SENTINEL = "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT";
|
|
@@ -6,7 +6,7 @@ import { t as certificationEvidenceDigest } from "../verdict-DhPoXApk.js";
|
|
|
6
6
|
import { t as packageVersion } from "../package-version-D7lQHt_-.js";
|
|
7
7
|
import { t as assertEqualDeclarativeTerms } from "../equal-terms-Blx9Zk5I.js";
|
|
8
8
|
import { d as runPrimeExchange, n as buildPrimePrompt, t as analystUsageReceiptFromPrimeUsage } from "../prime-protocol-DcAK9pC8.js";
|
|
9
|
-
import { c as deriveFailureSignature, d as isRecordedTimeout, h as parseRecordedReturncode, i as TIMEOUT_OBSERVATION_MARKER, n as FORMAT_ERROR_OBSERVATION_PREFIX, r as SUBMIT_ACTION_SIGNATURE, t as wrapActionForExec } from "../exec-
|
|
9
|
+
import { c as deriveFailureSignature, d as isRecordedTimeout, h as parseRecordedReturncode, i as TIMEOUT_OBSERVATION_MARKER, n as FORMAT_ERROR_OBSERVATION_PREFIX, r as SUBMIT_ACTION_SIGNATURE, t as wrapActionForExec } from "../exec-ChJ6d5if.js";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
import { constants } from "node:os";
|
|
12
12
|
import { spawn } from "node:child_process";
|
|
@@ -2,7 +2,7 @@ import { s as TraceStore } from "../store-BErPvYBr.js";
|
|
|
2
2
|
import { t as DefaultVerdict } from "../verdict-E4eRNf7-.js";
|
|
3
3
|
import { i as TraceEmitter } from "../emitter-Cs0egaFd.js";
|
|
4
4
|
import { i as CounterfactualRunner, t as CounterfactualContext } from "../counterfactual-CLgrwhkY.js";
|
|
5
|
-
import { _ as isSubmitOnlyAction, a as RecordedTrajectoryStep, b as unreadableExitCount, c as TIMEOUT_OBSERVATION_MARKER, d as decodeRecordedTurns, f as deriveFailureSignature, g as isSubmitAction, h as isRecordedTimeout, i as RecordedObservationKind, l as assertReplayableTrajectory, m as isElidedField, n as FORMAT_ERROR_OBSERVATION_PREFIX, o as RecordedTrajectoryTurn, p as finalRecordedOutcome, r as RecordedFinalOutcome, s as SUBMIT_ACTION_SIGNATURE, t as DecodedTrajectory, u as classifyObservation, v as parseObservationOutput, y as parseRecordedReturncode } from "../steps-
|
|
5
|
+
import { _ as isSubmitOnlyAction, a as RecordedTrajectoryStep, b as unreadableExitCount, c as TIMEOUT_OBSERVATION_MARKER, d as decodeRecordedTurns, f as deriveFailureSignature, g as isSubmitAction, h as isRecordedTimeout, i as RecordedObservationKind, l as assertReplayableTrajectory, m as isElidedField, n as FORMAT_ERROR_OBSERVATION_PREFIX, o as RecordedTrajectoryTurn, p as finalRecordedOutcome, r as RecordedFinalOutcome, s as SUBMIT_ACTION_SIGNATURE, t as DecodedTrajectory, u as classifyObservation, v as parseObservationOutput, y as parseRecordedReturncode } from "../steps-Bg5-KVx1.js";
|
|
6
6
|
//#region src/trajectory-replay/corpus.d.ts
|
|
7
7
|
interface CorpusSpec {
|
|
8
8
|
readonly name: string;
|
|
@@ -11,7 +11,7 @@ interface CorpusSpec {
|
|
|
11
11
|
}
|
|
12
12
|
/** Parses `name=<labelsPath>::<preparedDir>` (paths may contain `=`, not `::`). */
|
|
13
13
|
declare function parseCorpusFlag(value: string): CorpusSpec;
|
|
14
|
-
type ReplayExclusionReason = 'no-swe-raw-trajectory' | 'ambiguous-swe-raw-trajectory' | 'unreadable-raw-trajectory' | 'no-docker-image' | 'no-gold-incorrect-step' | 'gold-only-submit-step' | 'missing-steps-json' | 'gold-step-outside-steps' | 'cwd-underivable';
|
|
14
|
+
type ReplayExclusionReason = 'no-swe-raw-trajectory' | 'ambiguous-swe-raw-trajectory' | 'unreadable-raw-trajectory' | 'no-docker-image' | 'no-gold-incorrect-step' | 'gold-only-submit-step' | 'missing-steps-json' | 'gold-step-outside-steps' | 'cwd-underivable' | 'no-recorded-returncode-at-k';
|
|
15
15
|
interface ExcludedCase {
|
|
16
16
|
readonly corpus: string;
|
|
17
17
|
readonly trajId: string;
|
|
@@ -36,7 +36,8 @@ interface ReplayableCase extends CaseResources {
|
|
|
36
36
|
/** 1-based gold incorrect step ids, ascending. */
|
|
37
37
|
readonly goldIncorrectSteps: readonly number[];
|
|
38
38
|
/** k — the first gold incorrect step that is a real mid-trajectory action;
|
|
39
|
-
* submit-
|
|
39
|
+
* submit-only golds are skipped. A step that also changes state stays in
|
|
40
|
+
* the trajectory and is excluded below if its exit was not recorded. */
|
|
40
41
|
readonly k: number;
|
|
41
42
|
/** Gold steps before k skipped because their action is the submit command. */
|
|
42
43
|
readonly submitGoldsSkipped: number;
|
|
@@ -358,8 +359,8 @@ interface ReplayBatchCaseRow {
|
|
|
358
359
|
readonly armAExit: number | null;
|
|
359
360
|
readonly armAReturncodeMatch: boolean;
|
|
360
361
|
readonly armASignatureMatch: boolean;
|
|
361
|
-
/** Headline predicate: prefix
|
|
362
|
-
*
|
|
362
|
+
/** Headline predicate: prefix within tolerance and arm A reproduced an
|
|
363
|
+
* observed failure at k. */
|
|
363
364
|
readonly replayed: boolean;
|
|
364
365
|
readonly fix: ReplayBatchFixResult | null;
|
|
365
366
|
readonly wallMs: number;
|
|
@@ -377,7 +378,7 @@ interface ReplayBatchReport {
|
|
|
377
378
|
readonly executed: number;
|
|
378
379
|
readonly excludedByReason: Record<string, number>;
|
|
379
380
|
/** Per-corpus submit-gold accounting: cases dropped because every gold is
|
|
380
|
-
*
|
|
381
|
+
* a pure submit, and such golds skipped inside replayable cases. */
|
|
381
382
|
readonly submitGoldsByCorpus: Record<string, {
|
|
382
383
|
submitOnlyCases: number;
|
|
383
384
|
goldsSkippedWithinReplayable: number;
|
|
@@ -413,8 +414,7 @@ interface ReplayBatchReport {
|
|
|
413
414
|
denominator: number;
|
|
414
415
|
value: number | null;
|
|
415
416
|
} | null;
|
|
416
|
-
/** Fix-flip restricted to cases whose recorded returncode at k is nonzero
|
|
417
|
-
* real recorded failures, where "the failure vanished" is not vacuous. */
|
|
417
|
+
/** Fix-flip restricted to cases whose recorded returncode at k is nonzero. */
|
|
418
418
|
readonly fixFlipRateNonzeroRc: {
|
|
419
419
|
numerator: number;
|
|
420
420
|
denominator: number;
|
|
@@ -564,9 +564,9 @@ interface ReplayArmVerdict {
|
|
|
564
564
|
prefix: PrefixReplayResult;
|
|
565
565
|
}
|
|
566
566
|
/** Extends the substrate verdict spine: `valid` = the claim the caller asked
|
|
567
|
-
* to verify held under execution — arm A reproduced
|
|
567
|
+
* to verify held under execution — arm A reproduced a recorded failure on
|
|
568
568
|
* an in-tolerance prefix, and, when arm B ran, the corrected step made the
|
|
569
|
-
* failure vanish. `score` is the same bit as a number; the sub-measurements
|
|
569
|
+
* failure vanish on another in-tolerance prefix. `score` is the same bit as a number; the sub-measurements
|
|
570
570
|
* live in `scores`. Certified as `'replication'`: a re-execution from the
|
|
571
571
|
* pinned image, deterministic given the pins. */
|
|
572
572
|
interface ReplayVerdict extends DefaultVerdict {
|
|
@@ -717,7 +717,7 @@ interface VerifyFindingsOptions {
|
|
|
717
717
|
readonly onProgress?: (message: string) => void;
|
|
718
718
|
}
|
|
719
719
|
/**
|
|
720
|
-
* Arm A reproduced
|
|
720
|
+
* Arm A reproduced an observed failure on a confirmed prefix → a fix flipping it
|
|
721
721
|
* beats plain reproduction; anything else diverged. A proof standing on a
|
|
722
722
|
* prefix outside the divergence tolerance is divergent no matter what arm A
|
|
723
723
|
* did: the state it ran against is not the recorded state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/trajectory-replay/corpus.ts","../../src/trajectory-replay/exec.ts","../../src/trajectory-replay/fix.ts","../../src/trajectory-replay/fix-loop.ts","../../src/trajectory-replay/image-preparer.ts","../../src/trajectory-replay/batch.ts","../../src/trajectory-replay/verify.ts","../../src/trajectory-replay/findings.ts","../../src/trajectory-replay/wire.ts"],"mappings":";;;;;;UAyBiB;WACN;WACA;WACA;;;iBAIK,gBAAgB,gBAAgB;KAYpC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/trajectory-replay/corpus.ts","../../src/trajectory-replay/exec.ts","../../src/trajectory-replay/fix.ts","../../src/trajectory-replay/fix-loop.ts","../../src/trajectory-replay/image-preparer.ts","../../src/trajectory-replay/batch.ts","../../src/trajectory-replay/verify.ts","../../src/trajectory-replay/findings.ts","../../src/trajectory-replay/wire.ts"],"mappings":";;;;;;UAyBiB;WACN;WACA;WACA;;;iBAIK,gBAAgB,gBAAgB;KAYpC;UAYK;WACN;WACA;WACA,QAAQ;WACR;;KAGC;;UAGK;WACN;WACA;WACA;WACA,gBAAgB;WAChB;WACA;WACA;WACA,WAAW;;WAEX;;UAGM,uBAAuB;;WAE7B;;;;WAIA;;WAEA;;WAEA;;UAGD;WACC;WACA;aAAuC;;;iBAGlC,iBAAiB,qBAAqB;iBAWtC,mBAAmB,OAAO;KAuD9B;WACG;WAAyB,WAAW;;WACpC;WAA0B,QAAQ;WAAgC;;;;;;iBAMjE,qBAAqB,QAAQ,YAAY,iBAAiB;UAiEzD;WACN,YAAY;WACZ,UAAU;WACV;;;;;;;;;;iBAWK,yBAAyB,kBAAkB,eAAe;;;;;;;;;;;;UChPzD;EACf;EACA;EACA;;UAGe;EACf,KAAK,iBAAiB,oBAAoB,QAAQ;EAClD,SAAS;;UAGM;;EAEf,QAAQ,QAAQ;;;;;KAMN,4BAA4B,kBAAkB;;;;;;;iBAQ1C,kBAAkB,gBAAgB;;;UCrBjC;WACN;WACA;;KAGC;WACG;WAA0B;IAAS;IAAiB,OAAO;;;WAC3D;WAA2B;;UAEzB;EACf,SAAS,gBAAgB,eAAe,QAAQ;;UAGjC;WACN;WACA,gBAAgB;;WAEhB;;WAEA;;;iBAIK,SAAS,cAAc;iBAuCvB,eAAe,OAAO;EAAmB;EAAgB;;;UAiBxD;WACN;;WAEA;WACA;WACA;WACA;WACA;;;;;;;iBA4BK,oBACd,OAAO,gBACP,wBAAwB,oBACxB;EACG;EAAgB;;;iBAwBL,oBAAoB;;iBAMpB,kBAAkB;KAQtB;WACG;WAA0B;IAAS;IAAiB,OAAO;;;WAC3D;WAA2B;;iBAEpB,mBACpB,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AS;;;;;;;;iBAWf,kBAAkB,SAAS;;iBAgB3B,oBAAoB,SAAS;;;;;;;;;;KAoBjC;WAEG;WACA;WACA;WACA;WACA;;WAGA;WACA,kBAAkB;WAClB,WAAW;;UAGT;WACN;WACA;;WAEA;WACA;;WAEA;WACA;WACA;;KAGC;WACG;WAA2B,UAAU;;WACrC;WAA4B;;;;;;;iBAiC3B,4BACd,SAAS,mBACT,QAAQ,sBACP;KAmFS;UAMK;WACN;WACA;WACA;;WAEA;WACA,UAAU;;WAEV;;WAEA;WACA;;WAEA;;;;;;;;UASM,0BAA0B;WAChC;WACA,wBAAwB;WACxB,QAAQ,SAAS,OAAO;;WAExB;;UAGM;WACN,QAAQ;;WAER;;WAEA;WACA;WACA;;WAEA,gBAAgB;;;WAGhB,kBAAkB;WAClB,cAAc;;;;;;;;iBAST,gBAAgB,SAAS,gBAAgB;;;;;;;iBAyGnC,eACpB,mBAAmB,qBACnB,SAAS,wBACR,QAAQ;;iBAwNK,8BAA8B,KAAK;;;;;;iBAmCnC,iBAAiB,eAAe;;;UCvoB/B;WACN;WACA;WACA;WACA;;;iBAMK,2BAA2B,kBAAkB;UAW5C;WACN;WACA;;UAGM;WACN,WAAW;WACX,SAAS;;WAET;;;;;;;;iBASK,yBACd,SAAS,sBACT,kBAAkB,eACjB;UAuCc;WACN,kBAAkB;WAClB;;WAEA,YAAY;;WAEZ;WACA;WACA;;WAEA,gBAAgB;WAChB,cAAc;;UAGR;WACN,YAAY;WACZ;WACA,SAAS;;;;;;;iBAQE,oBACpB,SAAS,sBACT,SAAS,uBACR,QAAQ"}
|
|
@@ -4,7 +4,7 @@ import { t as TraceEmitter } from "../emitter-DeQHiDMm.js";
|
|
|
4
4
|
import { t as runCounterfactual } from "../counterfactual-Bjq1mlUu.js";
|
|
5
5
|
import { n as InMemoryTraceStore } from "../store-DNe_Uv1Q.js";
|
|
6
6
|
import { t as packageVersion } from "../package-version-D7lQHt_-.js";
|
|
7
|
-
import { a as assertReplayableTrajectory, c as deriveFailureSignature, d as isRecordedTimeout, f as isSubmitAction, g as unreadableExitCount, h as parseRecordedReturncode, i as TIMEOUT_OBSERVATION_MARKER, l as finalRecordedOutcome, m as parseObservationOutput, n as FORMAT_ERROR_OBSERVATION_PREFIX, o as classifyObservation, p as isSubmitOnlyAction, r as SUBMIT_ACTION_SIGNATURE, s as decodeRecordedTurns, t as wrapActionForExec, u as isElidedField } from "../exec-
|
|
7
|
+
import { a as assertReplayableTrajectory, c as deriveFailureSignature, d as isRecordedTimeout, f as isSubmitAction, g as unreadableExitCount, h as parseRecordedReturncode, i as TIMEOUT_OBSERVATION_MARKER, l as finalRecordedOutcome, m as parseObservationOutput, n as FORMAT_ERROR_OBSERVATION_PREFIX, o as classifyObservation, p as isSubmitOnlyAction, r as SUBMIT_ACTION_SIGNATURE, s as decodeRecordedTurns, t as wrapActionForExec, u as isElidedField } from "../exec-ChJ6d5if.js";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { appendFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { join } from "node:path";
|
|
@@ -198,7 +198,7 @@ function enumerateReplayableCases(corpora) {
|
|
|
198
198
|
missingGoldId = goldId;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
|
-
if (
|
|
201
|
+
if (step.action.trim() === "submit" || isSubmitOnlyAction(step.action)) {
|
|
202
202
|
submitGoldsSkipped += 1;
|
|
203
203
|
continue;
|
|
204
204
|
}
|
|
@@ -223,12 +223,22 @@ function enumerateReplayableCases(corpora) {
|
|
|
223
223
|
});
|
|
224
224
|
continue;
|
|
225
225
|
}
|
|
226
|
+
const recordedReturncodeAtK = parseRecordedReturncode(target.observation);
|
|
227
|
+
if (recordedReturncodeAtK === null) {
|
|
228
|
+
excluded.push({
|
|
229
|
+
corpus: corpus.name,
|
|
230
|
+
trajId,
|
|
231
|
+
reason: "no-recorded-returncode-at-k",
|
|
232
|
+
detail: `k=${target.step_id}; arm A cannot confirm execution without a recorded returncode`
|
|
233
|
+
});
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
226
236
|
replayable.push({
|
|
227
237
|
...resources,
|
|
228
238
|
goldIncorrectSteps: gold,
|
|
229
239
|
k: target.step_id,
|
|
230
240
|
submitGoldsSkipped,
|
|
231
|
-
recordedReturncodeAtK
|
|
241
|
+
recordedReturncodeAtK
|
|
232
242
|
});
|
|
233
243
|
}
|
|
234
244
|
return {
|
|
@@ -831,7 +841,7 @@ async function replayVerify(options) {
|
|
|
831
841
|
if (target.step_id !== options.at) throw new Error(`trajectory-replay: steps[${index}].step_id=${target.step_id} != at ${options.at}; steps.json must be ordered with 1-based contiguous step_ids`);
|
|
832
842
|
const caseId = options.caseId ?? options.stepsPath;
|
|
833
843
|
const recordedReturncode = parseRecordedReturncode(target.observation);
|
|
834
|
-
const signature = options.signature
|
|
844
|
+
const signature = options.signature === void 0 ? deriveFailureSignature(target.observation) : options.signature.trim() || null;
|
|
835
845
|
const signatureBasis = signature ? "returncode+output-substring" : "returncode-only";
|
|
836
846
|
const runnerOptions = {
|
|
837
847
|
cwd: options.cwd,
|
|
@@ -853,7 +863,9 @@ async function replayVerify(options) {
|
|
|
853
863
|
const armAMs = Date.now() - armAStart;
|
|
854
864
|
const armAExec = requireExec(armARunner, "arm A");
|
|
855
865
|
const armAOutput = `${armAExec.stdout}\n${armAExec.stderr}`;
|
|
856
|
-
const
|
|
866
|
+
const returncodeMatch = recordedReturncode !== null && armAExec.exitCode === recordedReturncode;
|
|
867
|
+
const failureSignatureMatch = returncodeMatch && signature !== null && armAOutput.includes(signature);
|
|
868
|
+
const failureReproduced = recordedReturncode !== 0 && returncodeMatch && (signature === null || failureSignatureMatch);
|
|
857
869
|
let armBRunner = null;
|
|
858
870
|
let armBExec = null;
|
|
859
871
|
let armBRunId = null;
|
|
@@ -909,7 +921,7 @@ async function replayVerify(options) {
|
|
|
909
921
|
exitCode: armBExec.exitCode,
|
|
910
922
|
wallMs: armBExec.wallMs,
|
|
911
923
|
prefix: requirePrefix(armBRunner, "arm B"),
|
|
912
|
-
failureVanished: armBExec.exitCode === 0 && (signature && armBOutput ? !armBOutput.includes(signature) : true)
|
|
924
|
+
failureVanished: requirePrefix(armBRunner, "arm B").prefixWithinTolerance && armBExec.exitCode === 0 && (signature && armBOutput ? !armBOutput.includes(signature) : true)
|
|
913
925
|
} : null,
|
|
914
926
|
timings: {
|
|
915
927
|
armAMs,
|
|
@@ -926,14 +938,15 @@ async function replayVerify(options) {
|
|
|
926
938
|
if (armAPrefix.prefixUnknownExpectations > 0) assumptions.push(`${armAPrefix.prefixUnknownExpectations} prefix step(s) carry no recorded returncode — agreement with the recording is unestablished there`);
|
|
927
939
|
if (options.prefixLimit !== void 0 && options.prefixLimit < index) assumptions.push(`prefix truncated at ${options.prefixLimit} of ${index} recorded steps — state fidelity at k is weakened`);
|
|
928
940
|
if (signatureBasis === "returncode-only") assumptions.push("no output substring derived from the recording — reproduction rests on the returncode alone");
|
|
929
|
-
|
|
941
|
+
if (core.armB !== null && !core.armB.prefix.prefixWithinTolerance) assumptions.push("arm B prefix diverged beyond tolerance — the corrected step ran from a different state");
|
|
942
|
+
const valid = core.prefixWithinTolerance && failureReproduced && (core.armB === null || core.armB.failureVanished);
|
|
930
943
|
const verdict = {
|
|
931
944
|
...core,
|
|
932
945
|
valid,
|
|
933
946
|
score: valid ? 1 : 0,
|
|
934
947
|
scores: {
|
|
935
948
|
prefixFidelity: 1 - core.prefixDivergencePct / 100,
|
|
936
|
-
armAReproduced:
|
|
949
|
+
armAReproduced: failureReproduced ? 1 : 0,
|
|
937
950
|
...core.armB === null ? {} : { armBFailureVanished: core.armB.failureVanished ? 1 : 0 }
|
|
938
951
|
},
|
|
939
952
|
certification: {
|
|
@@ -1037,8 +1050,9 @@ function renderReport(verdict, target, armA, armB) {
|
|
|
1037
1050
|
*
|
|
1038
1051
|
* Headline metrics:
|
|
1039
1052
|
* replayability rate — fraction of replayable cases where the prefix
|
|
1040
|
-
* replays within the divergence tolerance AND arm A reproduces
|
|
1041
|
-
* recorded
|
|
1053
|
+
* replays within the divergence tolerance AND arm A reproduces a
|
|
1054
|
+
* recorded failure at k; a zero exit without an error signature is not
|
|
1055
|
+
* evidence of failure;
|
|
1042
1056
|
* prefix fidelity — executed prefix steps and the share of them that did
|
|
1043
1057
|
* not confirm the recording, split by kind. A corpus whose recordings
|
|
1044
1058
|
* carry no returncodes shows up here as unknown-expectation steps, never
|
|
@@ -1097,7 +1111,7 @@ async function executeArmB(replayCase, fixCommand, backend, signature, stepTimeo
|
|
|
1097
1111
|
prefixExecuted: prefix.prefixExecuted,
|
|
1098
1112
|
prefixDivergences: prefix.prefixDivergences.length,
|
|
1099
1113
|
prefixDivergencePct: prefix.prefixDivergencePct,
|
|
1100
|
-
failureVanished: exec.exitCode === 0 && (signature ? !output.includes(signature) : true),
|
|
1114
|
+
failureVanished: prefix.prefixWithinTolerance && exec.exitCode === 0 && (signature ? !output.includes(signature) : true),
|
|
1101
1115
|
stdout: exec.stdout,
|
|
1102
1116
|
stderr: exec.stderr
|
|
1103
1117
|
};
|
|
@@ -1205,7 +1219,7 @@ async function runReplayBatch(options) {
|
|
|
1205
1219
|
armAExit: verdict.armA.exitCode,
|
|
1206
1220
|
armAReturncodeMatch: returncodeMatch,
|
|
1207
1221
|
armASignatureMatch: verdict.armA.failureSignatureMatch,
|
|
1208
|
-
replayed: verdict.
|
|
1222
|
+
replayed: verdict.valid,
|
|
1209
1223
|
fix: null,
|
|
1210
1224
|
wallMs: Date.now() - caseStart
|
|
1211
1225
|
};
|
|
@@ -1557,7 +1571,7 @@ function renderBatchReport(report) {
|
|
|
1557
1571
|
lines.push("## Headline");
|
|
1558
1572
|
lines.push("");
|
|
1559
1573
|
const fidelity = headline.prefixFidelity;
|
|
1560
|
-
lines.push(`- **Replayability rate: ${pct(headline.replayabilityRate.value)}** (${headline.replayabilityRate.numerator}/${headline.replayabilityRate.denominator} replayable cases where the prefix replayed within ${fidelity.tolerancePct}% divergence AND arm A reproduced
|
|
1574
|
+
lines.push(`- **Replayability rate: ${pct(headline.replayabilityRate.value)}** (${headline.replayabilityRate.numerator}/${headline.replayabilityRate.denominator} replayable cases where the prefix replayed within ${fidelity.tolerancePct}% divergence AND arm A reproduced an observed failure at the gold step k).`);
|
|
1561
1575
|
lines.push(`- Signature-strict rate: ${pct(headline.signatureStrictRate.value)} (${headline.signatureStrictRate.numerator}/${headline.signatureStrictRate.denominator}; additionally requires the recorded error substring in arm A output).`);
|
|
1562
1576
|
lines.push(`- **Prefix divergence: ${fidelity.divergencePct === null ? "—" : `${fidelity.divergencePct}%`}** (${fidelity.divergentSteps}/${fidelity.executedSteps} executed prefix steps did not confirm the recording: ${fidelity.returncodeMismatches} returncode mismatches, ${fidelity.unknownExpectations} with no recorded returncode to check). ${fidelity.casesWithinTolerance}/${fidelity.casesExecuted} executed cases are within the ${fidelity.tolerancePct}% tolerance.`);
|
|
1563
1577
|
if (headline.fixFlipRate) lines.push(`- **Fix-flip rate: ${pct(headline.fixFlipRate.value)}** (${headline.fixFlipRate.numerator}/${headline.fixFlipRate.denominator} arm-B-executed cases where the generated fix made the failure vanish).`);
|
|
@@ -1671,7 +1685,11 @@ function resolveFindingInvocation(finding, corpora) {
|
|
|
1671
1685
|
const resolution = resolveCaseResources(corpus, finding.trajId);
|
|
1672
1686
|
if (resolution.resolved) {
|
|
1673
1687
|
const at = subject.firstStep;
|
|
1674
|
-
|
|
1688
|
+
const step = resolution.resources.steps.find((s) => s.step_id === at);
|
|
1689
|
+
if (!step) throw new Error(`trajectory-replay: finding step ${at} is outside ${finding.trajId} (${resolution.resources.steps.length} steps)`);
|
|
1690
|
+
const recordedReturncode = parseRecordedReturncode(step.observation);
|
|
1691
|
+
if (recordedReturncode === null) throw new Error(`trajectory-replay: finding step ${at} in ${finding.trajId} has no recorded returncode`);
|
|
1692
|
+
if (recordedReturncode === 0) throw new Error(`trajectory-replay: finding step ${at} in ${finding.trajId} exited 0; shell replay cannot verify its semantic error`);
|
|
1675
1693
|
return {
|
|
1676
1694
|
resources: resolution.resources,
|
|
1677
1695
|
subject,
|
|
@@ -1876,14 +1894,14 @@ function resolveFindingReplayability(finding, source) {
|
|
|
1876
1894
|
};
|
|
1877
1895
|
}
|
|
1878
1896
|
/**
|
|
1879
|
-
* Arm A reproduced
|
|
1897
|
+
* Arm A reproduced an observed failure on a confirmed prefix → a fix flipping it
|
|
1880
1898
|
* beats plain reproduction; anything else diverged. A proof standing on a
|
|
1881
1899
|
* prefix outside the divergence tolerance is divergent no matter what arm A
|
|
1882
1900
|
* did: the state it ran against is not the recorded state.
|
|
1883
1901
|
*/
|
|
1884
1902
|
function classifyVerdict(verdict) {
|
|
1885
1903
|
if (!verdict.prefixWithinTolerance) return "divergent";
|
|
1886
|
-
if (
|
|
1904
|
+
if (verdict.scores?.armAReproduced !== 1) return "divergent";
|
|
1887
1905
|
if (verdict.armB?.failureVanished) return "fix-flipped";
|
|
1888
1906
|
return "reproduced";
|
|
1889
1907
|
}
|
|
@@ -1898,6 +1916,7 @@ function receiptExecution(verdict) {
|
|
|
1898
1916
|
command: verdict.armA.command,
|
|
1899
1917
|
exitCode: verdict.armA.exitCode,
|
|
1900
1918
|
wallMs: verdict.armA.wallMs,
|
|
1919
|
+
reproduced: verdict.scores?.armAReproduced === 1,
|
|
1901
1920
|
failureSignatureMatch: verdict.armA.failureSignatureMatch
|
|
1902
1921
|
},
|
|
1903
1922
|
armB: verdict.armB ? {
|