@tangle-network/traces 0.11.2 → 0.11.3

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/dist/index.js CHANGED
@@ -32,6 +32,7 @@ import {
32
32
  RULE,
33
33
  SPAWN_JOURNAL_FILE,
34
34
  STATUS_MARK,
35
+ SUBMIT_ACTION_SIGNATURE,
35
36
  SandboxCounterfactualRunner,
36
37
  SessionWorkflowError,
37
38
  TRACES_REDACTION_RULES,
@@ -45,6 +46,7 @@ import {
45
46
  analyzeSpans,
46
47
  analyzeSteeringChain,
47
48
  applyRedactor,
49
+ buildFixPrompt,
48
50
  buildPolicyEvidenceRecord,
49
51
  buildSessionIndex,
50
52
  buildSessionIndexFromRows,
@@ -56,6 +58,7 @@ import {
56
58
  classifyReaction,
57
59
  claudeActor,
58
60
  cmdReplayVerify,
61
+ cmdReplayVerifyBatch,
59
62
  codexActor,
60
63
  collectPolicyEvidence,
61
64
  collectSessionIndex,
@@ -69,15 +72,21 @@ import {
69
72
  cwdMatchesSelection,
70
73
  defaultTraceLiveAnalysts,
71
74
  deriveFailureSignature,
75
+ derivedImageTag,
72
76
  describeSessionRelationship,
77
+ dockerImagePreparer,
78
+ enumerateReplayableCases,
73
79
  equivalentGitCwds,
74
80
  executeUpload,
75
81
  exportTraceEvidenceFile,
76
82
  exportTraceEvidenceRows,
77
83
  exportTraceEvidenceText,
84
+ extractFixCommand,
78
85
  fileRunContextSupervisorRunReader,
79
86
  findSpanSourceFiles,
80
87
  forEachTreeNode,
88
+ generateFixCommand,
89
+ goldIncorrectSteps,
81
90
  haloAnalyzer,
82
91
  hodoscopeAnalyzer,
83
92
  importCodeTraceBench,
@@ -91,6 +100,7 @@ import {
91
100
  isChatTrajectory,
92
101
  isChatTrajectoryMessage,
93
102
  isFileRunContextDir,
103
+ isSubmitAction,
94
104
  knownHarnesses,
95
105
  listAdapters,
96
106
  loadState,
@@ -103,9 +113,11 @@ import {
103
113
  normalizeRemote,
104
114
  otlpRowToSpan,
105
115
  outboundHash,
116
+ parseCorpusFlag,
106
117
  parseIsoToEpochMs,
107
118
  parseObservationOutput,
108
119
  parseRecordedReturncode,
120
+ parseReplayBatchArgs,
109
121
  parseReplayVerifyArgs,
110
122
  parseSession,
111
123
  parseSince,
@@ -115,6 +127,7 @@ import {
115
127
  readFileRunContext,
116
128
  readJsonFile,
117
129
  readJsonl,
130
+ readLabelEntries,
118
131
  readOtlpInput,
119
132
  readRunContextJournal,
120
133
  readRunContextSnapshot,
@@ -123,15 +136,18 @@ import {
123
136
  readSpanRunSnapshot,
124
137
  recordSessionCorruption,
125
138
  redactSpans,
139
+ renderBatchReport,
126
140
  renderConformance,
127
141
  renderInspectionReport,
128
142
  renderRunContextSnapshot,
129
143
  renderRunWatchSnapshot,
130
144
  renderSpanRunSnapshot,
131
145
  renderValidation,
146
+ replayBatchUsage,
132
147
  replayVerify,
133
148
  replayVerifyUsage,
134
149
  resolveAdapter,
150
+ resolveCaseResources,
135
151
  resolveOtlpInputFiles,
136
152
  resolveRepoAttrs,
137
153
  resolveRunContextDir,
@@ -140,6 +156,7 @@ import {
140
156
  runCommand,
141
157
  runExternalAnalyzers,
142
158
  runPipelines,
159
+ runReplayBatch,
143
160
  runTotals,
144
161
  runTraceImprovement,
145
162
  runTraceInvestigation,
@@ -148,6 +165,7 @@ import {
148
165
  saveReport,
149
166
  saveState,
150
167
  scanSessions,
168
+ seededSample,
151
169
  selectAdapters,
152
170
  serializeInspectionReport,
153
171
  serializePolicyEvidence,
@@ -194,8 +212,9 @@ import {
194
212
  writeSessionIndexFile,
195
213
  writeTraceEvidenceExportFile,
196
214
  writeTraceImprovementArtifacts,
215
+ zaiChatCaller,
197
216
  zeroPricedCost
198
- } from "./chunk-UY3M7XUF.js";
217
+ } from "./chunk-CK5F5TWO.js";
199
218
 
200
219
  // src/collect.ts
201
220
  async function collectSessions(opts = {}) {
@@ -211,6 +230,79 @@ async function collectSessions(opts = {}) {
211
230
  return out;
212
231
  }
213
232
 
233
+ // src/replay-wire.ts
234
+ var SUBJECT_PATTERN = /^incorrect-steps-(\d+)-(\d+)-(escaped|unescaped)-consequence-(\d+)$/;
235
+ function parseIncorrectStepsSubject(subject) {
236
+ const match = SUBJECT_PATTERN.exec(subject);
237
+ if (!match) return null;
238
+ return {
239
+ firstStep: Number(match[1]),
240
+ lastStep: Number(match[2]),
241
+ escapeStatus: match[3],
242
+ consequenceStep: Number(match[4])
243
+ };
244
+ }
245
+ function resolveFindingInvocation(finding, corpora) {
246
+ const subject = parseIncorrectStepsSubject(finding.subject);
247
+ if (!subject) {
248
+ throw new Error(
249
+ `replay-wire: subject '${finding.subject}' is not incorrect-steps-<first>-<last>-<escaped|unescaped>-consequence-<step>`
250
+ );
251
+ }
252
+ const failures = [];
253
+ for (const corpus of corpora) {
254
+ const resolution = resolveCaseResources(corpus, finding.trajId);
255
+ if (resolution.resolved) {
256
+ const at = subject.firstStep;
257
+ const step = resolution.resources.steps.find((s) => s.step_id === at);
258
+ if (!step) {
259
+ throw new Error(
260
+ `replay-wire: finding step ${at} is outside ${finding.trajId} (${resolution.resources.steps.length} steps)`
261
+ );
262
+ }
263
+ return { resources: resolution.resources, subject, at };
264
+ }
265
+ failures.push(`${corpus.name}: ${resolution.reason}`);
266
+ }
267
+ throw new Error(
268
+ `replay-wire: trajectory ${finding.trajId} is not replayable in any corpus \u2014 ${failures.join("; ")}`
269
+ );
270
+ }
271
+ async function replayVerifyFinding(finding, options) {
272
+ if (options.fixCaller && options.fixCommand !== void 0) {
273
+ throw new Error("replay-wire: pass fixCaller or fixCommand, not both");
274
+ }
275
+ const invocation = resolveFindingInvocation(finding, options.corpora);
276
+ let fixCommand = options.fixCommand ?? null;
277
+ if (options.fixCaller) {
278
+ const generated = await generateFixCommand(options.fixCaller, {
279
+ taskStatement: invocation.resources.taskStatement,
280
+ steps: invocation.resources.steps,
281
+ k: invocation.at
282
+ });
283
+ if (!generated.succeeded) {
284
+ throw new Error(`replay-wire: fix generation failed \u2014 ${generated.error}`);
285
+ }
286
+ fixCommand = generated.value.command;
287
+ }
288
+ const verdict = await replayVerify({
289
+ stepsPath: invocation.resources.stepsPath,
290
+ image: invocation.resources.image,
291
+ at: invocation.at,
292
+ fixCommand: fixCommand ?? void 0,
293
+ cwd: invocation.resources.cwd,
294
+ out: options.out,
295
+ caseId: invocation.resources.trajId,
296
+ stepTimeoutMs: options.stepTimeoutMs ?? invocation.resources.recordedStepTimeoutMs ?? void 0,
297
+ prefixLimit: options.prefixLimit,
298
+ backend: options.backend,
299
+ apiKey: options.apiKey,
300
+ baseUrl: options.baseUrl,
301
+ onProgress: options.onProgress
302
+ });
303
+ return { invocation, fixCommand, verdict };
304
+ }
305
+
214
306
  // src/index.ts
215
307
  import {
216
308
  AnalystRegistry,
@@ -255,6 +347,7 @@ export {
255
347
  RULE,
256
348
  SPAWN_JOURNAL_FILE,
257
349
  STATUS_MARK,
350
+ SUBMIT_ACTION_SIGNATURE,
258
351
  SandboxCounterfactualRunner,
259
352
  SessionWorkflowError,
260
353
  TRACES_REDACTION_RULES,
@@ -269,6 +362,7 @@ export {
269
362
  analyzeSteeringChain,
270
363
  applyRedactor,
271
364
  buildDefaultAnalystRegistry,
365
+ buildFixPrompt,
272
366
  buildPolicyEvidenceRecord,
273
367
  buildSessionIndex,
274
368
  buildSessionIndexFromRows,
@@ -280,6 +374,7 @@ export {
280
374
  classifyReaction,
281
375
  claudeActor,
282
376
  cmdReplayVerify,
377
+ cmdReplayVerifyBatch,
283
378
  codexActor,
284
379
  collectPolicyEvidence,
285
380
  collectSessionIndex,
@@ -295,15 +390,21 @@ export {
295
390
  cwdMatchesSelection,
296
391
  defaultTraceLiveAnalysts,
297
392
  deriveFailureSignature,
393
+ derivedImageTag,
298
394
  describeSessionRelationship,
395
+ dockerImagePreparer,
396
+ enumerateReplayableCases,
299
397
  equivalentGitCwds,
300
398
  executeUpload,
301
399
  exportTraceEvidenceFile,
302
400
  exportTraceEvidenceRows,
303
401
  exportTraceEvidenceText,
402
+ extractFixCommand,
304
403
  fileRunContextSupervisorRunReader,
305
404
  findSpanSourceFiles,
306
405
  forEachTreeNode,
406
+ generateFixCommand,
407
+ goldIncorrectSteps,
307
408
  haloAnalyzer,
308
409
  hodoscopeAnalyzer,
309
410
  hostedClientFromEnv,
@@ -318,6 +419,7 @@ export {
318
419
  isChatTrajectory,
319
420
  isChatTrajectoryMessage,
320
421
  isFileRunContextDir,
422
+ isSubmitAction,
321
423
  knownHarnesses,
322
424
  listAdapters,
323
425
  loadState,
@@ -331,9 +433,12 @@ export {
331
433
  normalizeRemote,
332
434
  otlpRowToSpan,
333
435
  outboundHash,
436
+ parseCorpusFlag,
437
+ parseIncorrectStepsSubject,
334
438
  parseIsoToEpochMs,
335
439
  parseObservationOutput,
336
440
  parseRecordedReturncode,
441
+ parseReplayBatchArgs,
337
442
  parseReplayVerifyArgs,
338
443
  parseSession,
339
444
  parseSince,
@@ -343,6 +448,7 @@ export {
343
448
  readFileRunContext,
344
449
  readJsonFile,
345
450
  readJsonl,
451
+ readLabelEntries,
346
452
  readOtlpInput,
347
453
  readRunContextJournal,
348
454
  readRunContextSnapshot,
@@ -353,15 +459,20 @@ export {
353
459
  redactSpans,
354
460
  redactString,
355
461
  redactValue,
462
+ renderBatchReport,
356
463
  renderConformance,
357
464
  renderInspectionReport,
358
465
  renderRunContextSnapshot,
359
466
  renderRunWatchSnapshot,
360
467
  renderSpanRunSnapshot,
361
468
  renderValidation,
469
+ replayBatchUsage,
362
470
  replayVerify,
471
+ replayVerifyFinding,
363
472
  replayVerifyUsage,
364
473
  resolveAdapter,
474
+ resolveCaseResources,
475
+ resolveFindingInvocation,
365
476
  resolveOtlpInputFiles,
366
477
  resolveRepoAttrs,
367
478
  resolveRunContextDir,
@@ -370,6 +481,7 @@ export {
370
481
  runCommand,
371
482
  runExternalAnalyzers,
372
483
  runPipelines,
484
+ runReplayBatch,
373
485
  runTotals,
374
486
  runTraceImprovement,
375
487
  runTraceInvestigation,
@@ -378,6 +490,7 @@ export {
378
490
  saveReport,
379
491
  saveState,
380
492
  scanSessions,
493
+ seededSample,
381
494
  selectAdapters,
382
495
  serializeInspectionReport,
383
496
  serializePolicyEvidence,
@@ -424,5 +537,6 @@ export {
424
537
  writeSessionIndexFile,
425
538
  writeTraceEvidenceExportFile,
426
539
  writeTraceImprovementArtifacts,
540
+ zaiChatCaller,
427
541
  zeroPricedCost
428
542
  };
@@ -0,0 +1,76 @@
1
+ # Replay-verify batch — first measured replayability and fix-flip rates (2026-08-02)
2
+
3
+ Provenance: labels shas in `~/bench-cache/ctb-20260801/replay-batch/label-shas.txt`; docker 29.6.1; node v24.16.0; orchestrator :4095 + SDK adapter :4097; seed 17; fix model glm-5.2 via z.ai direct (16k cap, one doubled retry on length-empty); command recorded in `run2-20260802.log` header.
4
+ Corpora: dev-32, holdout-1, holdout-2, split3 (all spent mini-SWE splits; submit-only golds excluded per the split3 positional-degeneracy finding).
5
+
6
+ ## Headline (n=22 replayable of 133 label entries)
7
+
8
+ | Rate | Value |
9
+ | --- | --- |
10
+ | Replayability (prefix ≤10% divergence AND arm A reproduces recorded returncode at the gold step) | 16/22 = 72.7% |
11
+ | Strict signature match (returncode + output substring) | 13/22 = 59.1% |
12
+ | Fix-flip (one-shot glm-5.2 corrected command makes the failure vanish) | 9/11 = 81.8% |
13
+ | Fix-flip, nonzero-returncode subset | 7/9 = 77.8% |
14
+
15
+ Exclusions (101 of 133, all named): 65 no-swe-raw-trajectory, 21 no-docker-image, 21 gold-only-submit-step, 4 no-gold-incorrect-step.
16
+ LLM: 16 calls, 5 residual failures (long-reasoning cases exceeding the doubled cap), 41,878 prompt + 51,312 completion tokens (~$0.14).
17
+
18
+
19
+ Generated 2026-08-02T00:55:37.309Z.
20
+
21
+ ## Headline
22
+
23
+ - **Replayability rate: 72.7%** (16/22 replayable cases where the prefix replayed with ≤10% returncode divergence AND arm A reproduced the recorded returncode at the gold step k).
24
+ - Signature-strict rate: 59.1% (13/22; additionally requires the recorded error substring in arm A output).
25
+ - **Fix-flip rate: 81.8%** (9/11 arm-B-executed cases where the generated fix made the failure vanish).
26
+ - Fix-flip rate on recorded-rc≠0 cases: 77.8% (7/9; real recorded failures — a gold step recorded with rc 0 flips vacuously).
27
+
28
+ ## Enumeration
29
+
30
+ 133 label entries across 4 corpora → 22 replayable (SWE-style docker image + ≥1 gold incorrect step), 22 executed.
31
+
32
+ | exclusion reason | count |
33
+ | --- | --- |
34
+ | no-swe-raw-trajectory | 65 |
35
+ | no-docker-image | 21 |
36
+ | gold-only-submit-step | 21 |
37
+ | no-gold-incorrect-step | 4 |
38
+
39
+ Submit-command golds are never counterfactual targets (a gold on the submit step marks a bad submit decision, not a failed command):
40
+
41
+ | corpus | cases excluded (all golds = submit) | golds skipped within replayable cases |
42
+ | --- | --- | --- |
43
+ | dev-32 | 1 | 0 |
44
+ | holdout-1 | 2 | 0 |
45
+ | split3 | 18 | 0 |
46
+
47
+ ## Per-case results
48
+
49
+ | corpus | trajectory | k | rc@k | prefix | div | div% | armA exit | rc match | sig match | replayed | fix | armB exit | vanished | wall s |
50
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
51
+ holdout-1 | miniswe-OpenAI__GPT-5-clap-rs__clap-3179-107b… | 33 | 0 | 32 | 4 | 12.5 | 0 | yes | yes | no | — | — | — | 10.6
52
+ holdout-1 | miniswe-OpenAI__GPT-5-clap-rs__clap-3421-8c92… | 23 | 2 | 22 | 1 | 4.5 | 2 | yes | no | **yes** | llm-failed | — | — | 7.2
53
+ holdout-1 | miniswe-OpenAI__GPT-5-clap-rs__clap-3975-5f1a… | 33 | 101 | 32 | 1 | 3.1 | 127 | no | no | no | — | — | — | 13.0
54
+ holdout-1 | miniswe-OpenAI__GPT-5-clap-rs__clap-4248-85bd… | 23 | 2 | 22 | 0 | 0 | 2 | yes | no | **yes** | generated | 0 | **yes** | 35.3
55
+ holdout-2 | miniswe-OpenAI__GPT-5-instance_ansible__ansib… | 7 | 127 | 6 | 0 | 0 | 127 | yes | yes | **yes** | generated | 0 | **yes** | 20.0
56
+ holdout-2 | miniswe-OpenAI__GPT-5-instance_ansible__ansib… | 13 | 0 | 12 | 0 | 0 | 0 | yes | yes | **yes** | llm-failed | — | — | 13.5
57
+ holdout-2 | miniswe-OpenAI__GPT-5-instance_element-hq__el… | 17 | 2 | 16 | 0 | 0 | 2 | yes | no | **yes** | llm-failed | — | — | 25.9
58
+ holdout-2 | miniswe-OpenAI__GPT-5-instance_internetarchiv… | 10 | 0 | 9 | 0 | 0 | 0 | yes | yes | **yes** | generated | 0 | **yes** | 4.8
59
+ holdout-2 | miniswe-OpenAI__GPT-5-instance_qutebrowser__q… | 15 | 127 | 14 | 0 | 0 | 127 | yes | yes | **yes** | generated | 0 | **yes** | 4.1
60
+ holdout-2 | miniswe-OpenAI__GPT-5-instance_qutebrowser__q… | 18 | 127 | 17 | 0 | 0 | 127 | yes | yes | **yes** | generated | 0 | **yes** | 4.1
61
+ holdout-2 | miniswe-OpenAI__GPT-5-ponylang__ponyc-1057-56… | 35 | 127 | 34 | 0 | 0 | 127 | yes | yes | **yes** | generated | 0 | **yes** | 4.4
62
+ holdout-2 | miniswe-OpenAI__GPT-5-ponylang__ponyc-2532-98… | 12 | 1 | 11 | 0 | 0 | 1 | yes | yes | **yes** | generated | 0 | **yes** | 4.4
63
+ holdout-2 | miniswe-OpenAI__GPT-5-sveltejs__svelte-10608-… | 23 | 127 | 22 | 0 | 0 | 127 | yes | yes | **yes** | generated | 0 | **yes** | 4.7
64
+ split3 | miniswe-OpenAI__GPT-5-fasterxml__jackson-data… | 18 | 127 | 17 | 0 | 0 | 127 | yes | yes | **yes** | generated | 127 | no | 5.7
65
+ split3 | miniswe-OpenAI__GPT-5-instance_ansible__ansib… | 21 | 0 | 20 | 1 | 5 | 2 | no | no | no | — | — | — | 4.8
66
+ split3 | miniswe-OpenAI__GPT-5-instance_element-hq__el… | 21 | 0 | 20 | 0 | 0 | 2 | no | no | no | — | — | — | 6.3
67
+ split3 | miniswe-OpenAI__GPT-5-nushell__nushell-13357-… | 28 | 127 | 27 | 0 | 0 | 127 | yes | yes | **yes** | generated | 127 | no | 5.9
68
+ split3 | miniswe-OpenAI__GPT-5-ponylang__ponyc-2205-2a… | 27 | 127 | 26 | 0 | 0 | 0 | no | no | no | — | — | — | 5.4
69
+ split3 | miniswe-OpenAI__GPT-5-ponylang__ponyc-3973-60… | 20 | 0 | 19 | 0 | 0 | 127 | no | no | no | — | — | — | 5.8
70
+ split3 | miniswe-OpenAI__GPT-5-simdjson__simdjson-2016… | 24 | 0 | 23 | 0 | 0 | 0 | yes | yes | **yes** | llm-failed | — | — | 5.2
71
+ split3 | miniswe-OpenAI__GPT-5-sveltejs__svelte-11913-… | 19 | 0 | 18 | 0 | 0 | 0 | yes | yes | **yes** | generated | 0 | **yes** | 41.2
72
+ split3 | miniswe-OpenAI__GPT-5-sveltejs__svelte-9962-5… | 21 | 127 | 20 | 0 | 0 | 127 | yes | yes | **yes** | llm-failed | — | — | 4.3
73
+
74
+ ## LLM fix generation
75
+
76
+ Model glm-5.2: 16 calls (5 failed), 41878 prompt + 51312 completion tokens.
@@ -49,6 +49,56 @@ A high divergence rate is a finding about replayability, not a failure of the to
49
49
  - **Environment drift shows up as divergence.** The sandbox mounts a workspace at `/home/agent` and injects platform env; recorded observations that depend on exact `ls` output or env contents can differ while returncodes still match. Only returncodes drive the divergence count.
50
50
  - **The failure signature is derived, not assumed.** Default: the first recorded-output line containing "error". Compiler quote glyphs vary with locale, so prefer an explicit `--signature` with an ASCII-stable substring.
51
51
 
52
+ ## Batch mode — replayability and fix-flip rates
53
+
54
+ `traces replay-verify-batch` runs the proof at corpus scale over gold-labeled CodeTraceBench corpora and measures two headline numbers nobody had before:
55
+
56
+ - **Replayability rate** — fraction of replayable cases where the prefix replays with ≤10% returncode divergence AND arm A reproduces the recorded returncode at the gold step k (k = the first gold incorrect step from `incorrect_stages[].incorrect_step_ids` that is a real mid-trajectory action; see the submit-step rule below).
57
+ - **Fix-flip rate** — fraction of arm-B-executed cases where a generated corrected command made the failure vanish.
58
+
59
+ ```sh
60
+ traces replay-verify-batch \
61
+ --corpus dev-32=<labels.json>::<prepared-dir> \
62
+ --corpus holdout-1=<labels.json>::<prepared-dir> \
63
+ --out ./replay-batch-out \
64
+ --fix generate --max-fix-cases 30 --seed 17 \
65
+ --base-url http://127.0.0.1:4097 --api-key-env SANDBOX_API_KEY \
66
+ --fix-api-key-env ZAI_GLM_API_KEY
67
+ ```
68
+
69
+ A corpus is a gold label file plus a prepared directory (`normalized/<traj_id>/steps.json` + `extracted/<traj_id>/swe_raw/**`). Replayable = the raw trajectory carries `info.docker_config.base_image` AND the labels mark ≥1 gold incorrect step that is a real mid-trajectory action. The batch:
70
+
71
+ - reports the true replayable count and a per-reason exclusion table (`--enumerate-only` prints both without touching a sandbox);
72
+ - **skips submit-command golds when choosing k.** A gold step whose action is the agent's end-of-run submit (`COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`) marks a bad submit *decision*, not a failed command — there is no executable failure to reproduce, so it is never a counterfactual target. k advances to the first non-submit gold; a case whose golds are all submit steps is excluded as `gold-only-submit-step`. The report carries a per-corpus table of both counts (this matters most for split3, whose gold labels concentrate on the submit decision);
73
+ - derives the working directory from the recorded run config (`info.config.environment.cwd`), falling back to `docker_config.cwd`, then to the first `pwd` observation;
74
+ - builds and caches a uid-1000 derived image per (base image, cwd) pair — `ctb-replay:<hash>-uid1000` — because the sandbox platform pins commands to a non-root identity;
75
+ - runs every case serially (image pulls contend on disk and registry bandwidth) and records pull/build failures as report rows, never silent skips;
76
+ - uses the recorded per-step timeout (`info.config.environment.timeout`) unless `--step-timeout` overrides it.
77
+
78
+ Fix generation (`--fix generate`) runs ONE chat completion per arm-A-reproduced case against an OpenAI-compatible endpoint (default: glm-5.2 on z.ai). The prompt carries the gold step's action and observation, ±3 surrounding steps, and the task statement; the reply must be a single corrected shell command. Cases beyond `--max-fix-cases` are excluded by a seeded random sample and marked `sampled-out` in the report. Arm B replays the prefix in its own fresh sandbox and executes the corrected command; `failureVanished` = exit 0 with the failure signature absent.
79
+
80
+ Honest-reporting notes baked into the report:
81
+
82
+ - A gold step whose recorded observation carries **no returncode** can never satisfy "arm A reproduces the recorded returncode": it counts against the replayability rate and the per-case table says why.
83
+ - A gold step recorded with **returncode 0** (the labeled mistake succeeded — a wrong-direction action, not a crash) reproduces trivially; for such cases `failureVanished` is vacuous, so read the headline's separate fix-flip rate on the recorded-rc≠0 subset.
84
+
85
+ Outputs: `batch-report.json`, `batch-report.md` (headline + exclusion + pull-failure + per-case tables), `cases.jsonl` (incremental, crash-safe), and one directory per case with the full `replay-verify` artifacts plus `armB-result.json`.
86
+
87
+ ## Analyst wire — finding in, executed proof out
88
+
89
+ `replayVerifyFinding` (exported from the package root, `src/replay-wire.ts`) is the entry point the analyst product calls:
90
+
91
+ ```ts
92
+ import { replayVerifyFinding } from '@tangle-network/traces'
93
+
94
+ const { invocation, fixCommand, verdict } = await replayVerifyFinding(
95
+ { trajId: 'miniswe-…-zstd-1733-786102c1', subject: 'incorrect-steps-37-37-unescaped-consequence-39' },
96
+ { corpora, out: './proof', fixCaller, baseUrl, apiKey },
97
+ )
98
+ ```
99
+
100
+ The subject grammar is the analyst benchmark's `incorrect-steps-<first>-<last>-<escaped|unescaped>-consequence-<step>`; `--at` is the finding's **first** incorrect step (the finding's claim, which may differ from the gold label). The wire resolves the trajectory across the given corpora, generates the arm-B fix through the same one-call generator (or accepts a pre-supplied `fixCommand`), and returns the full `ReplayVerdict`. It throws with a precise reason when the finding cannot be replayed (malformed subject, unknown trajectory, non-SWE case, step out of range) — the product surfaces that reason instead of a proof.
101
+
52
102
  ## Orchestrator prerequisites
53
103
 
54
104
  replay-verify talks to a sandbox API (`--base-url`); in local development that is the sandbox SDK adapter in front of an orchestrator running the docker driver.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/traces",
3
- "version": "0.11.2",
3
+ "version": "0.11.3",
4
4
  "description": "Point it at your coding-agent session traces (Claude Code, Codex, OpenCode, Gemini, Pi, …) and get failure-mode + efficiency findings. CLI + SDK over the @tangle-network/agent-eval analyst suite — observe live sessions, run your own analysts, redact, and upload to the Tangle Intelligence Platform.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@tangle-network/agent-eval": "0.140.1",
51
- "@tangle-network/agent-runtime": "0.120.0",
51
+ "@tangle-network/agent-runtime": "0.121.0",
52
52
  "@tangle-network/agent-trace-contract": "^1.0.2",
53
- "@tangle-network/sandbox": "0.15.2"
53
+ "@tangle-network/sandbox": "0.16.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^22.0.0",