@tangle-network/traces 0.15.0 → 0.15.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
@@ -51,10 +51,8 @@ import {
51
51
  SPAN_SYNTHESIZED_ATTR,
52
52
  SPAWN_JOURNAL_FILE,
53
53
  STATUS_MARK,
54
- SUBMIT_ACTION_SIGNATURE,
55
54
  SYNTHESIZED_SOURCE_ATTR,
56
55
  SYNTHESIZED_SPAN_ATTR,
57
- SandboxCounterfactualRunner,
58
56
  SessionWorkflowError,
59
57
  TRACES_REDACTION_RULES,
60
58
  TRACE_QUESTION_PREVIEW_HEAD_CHARS,
@@ -73,9 +71,7 @@ import {
73
71
  assembleSessionBundle,
74
72
  assertAnswerSchema,
75
73
  assertSandboxReachable,
76
- buildFixPrompt,
77
74
  buildPolicyEvidenceRecord,
78
- buildRetryFixPrompt,
79
75
  buildSessionFactsReport,
80
76
  buildSessionIndex,
81
77
  buildSessionIndexFromRows,
@@ -87,12 +83,7 @@ import {
87
83
  classifyFailureFollowUps,
88
84
  classifyLiveActions,
89
85
  classifyReaction,
90
- classifyVerdict,
91
86
  claudeActor,
92
- clipText,
93
- cmdReplayVerify,
94
- cmdReplayVerifyBatch,
95
- cmdVerifyFindings,
96
87
  codexActor,
97
88
  collectPolicyEvidence,
98
89
  collectSessionIndex,
@@ -104,19 +95,14 @@ import {
104
95
  computeSessionFacts,
105
96
  conformanceOfSpans,
106
97
  connectors,
107
- countScriptCommands,
108
98
  countSkillRunsJsonl,
109
99
  createBundleSourceReader,
110
100
  createFindingRejectionTally,
111
101
  cwdMatchesSelection,
112
102
  cwdMatchesSelectionResolved,
113
103
  defaultTraceLiveAnalysts,
114
- deriveFailureSignature,
115
- derivedImageTag,
116
104
  describeSessionRelationship,
117
- dockerImagePreparer,
118
105
  engineCallReservationFloorUsd,
119
- enumerateReplayableCases,
120
106
  environmentAttributes,
121
107
  environmentFromSpanAttributes,
122
108
  equivalentGitCwds,
@@ -125,7 +111,6 @@ import {
125
111
  exportTraceEvidenceRows,
126
112
  exportTraceEvidenceText,
127
113
  externalFailureMessage,
128
- extractFixCommand,
129
114
  fileRunContextSupervisorRunReader,
130
115
  fileSha256,
131
116
  findContextRoot,
@@ -133,12 +118,8 @@ import {
133
118
  findSpanSourceFiles,
134
119
  findingRejection,
135
120
  findingRejectionDetail,
136
- findingReplayStep,
137
- findingTrajectoryId,
138
121
  forEachTreeNode,
139
122
  formatFindingRejections,
140
- generateFixCommand,
141
- goldIncorrectSteps,
142
123
  haloAnalyzer,
143
124
  hashSessionBundleFiles,
144
125
  hodoscopeAnalyzer,
@@ -148,7 +129,6 @@ import {
148
129
  indexSessionIdsByTrace,
149
130
  inferRole,
150
131
  inferSpanKind,
151
- ingestCodeTraceBenchSteps,
152
132
  inspectSessionIndex,
153
133
  int,
154
134
  isBridgeMismatchError,
@@ -156,7 +136,6 @@ import {
156
136
  isChatTrajectoryMessage,
157
137
  isFileRunContextDir,
158
138
  isInheritedSpan,
159
- isSubmitAction,
160
139
  isSynthesizedSpan,
161
140
  knownHarnesses,
162
141
  listAdapters,
@@ -174,27 +153,18 @@ import {
174
153
  normalizeTraceQuestions,
175
154
  otlpRowToSpan,
176
155
  outboundHash,
177
- parseCorpusFlag,
178
- parseIncorrectStepsSubject,
179
156
  parseIsoToEpochMs,
180
157
  parseJsonAnswer,
181
- parseObservationOutput,
182
- parseRecordedReturncode,
183
- parseReplayBatchArgs,
184
- parseReplayVerifyArgs,
185
158
  parseSession,
186
159
  parseSince,
187
- parseVerifyFindingsArgs,
188
160
  planTraceAgenticRoute,
189
161
  planUpload,
190
162
  primeAnalyzer,
191
163
  projectSessionBundle,
192
164
  readCoordinationLog,
193
165
  readFileRunContext,
194
- readFindingsFile,
195
166
  readJsonFile,
196
167
  readJsonl,
197
- readLabelEntries,
198
168
  readOtlpInput,
199
169
  readPullRequests,
200
170
  readRunContextJournal,
@@ -205,7 +175,6 @@ import {
205
175
  readSpanRunSnapshot,
206
176
  recordSessionCorruption,
207
177
  redactSpans,
208
- renderBatchReport,
209
178
  renderConformance,
210
179
  renderInspectionReport,
211
180
  renderRunContextSnapshot,
@@ -217,15 +186,7 @@ import {
217
186
  renderTraceQuestionPrompt,
218
187
  renderTraceQuestionsReport,
219
188
  renderValidation,
220
- renderVerifiedFindingsSection,
221
- replayBatchUsage,
222
- replayVerify,
223
- replayVerifyFinding,
224
- replayVerifyUsage,
225
189
  resolveAdapter,
226
- resolveCaseResources,
227
- resolveFindingInvocation,
228
- resolveFindingReplayability,
229
190
  resolveOtlpInputFiles,
230
191
  resolveRepoAttrs,
231
192
  resolveRunContextDir,
@@ -233,9 +194,7 @@ import {
233
194
  resolveSessionRepoAttrs,
234
195
  runCommand,
235
196
  runExternalAnalyzers,
236
- runFixLoop,
237
197
  runPipelines,
238
- runReplayBatch,
239
198
  runTotals,
240
199
  runTraceImprovement,
241
200
  runTraceInvestigation,
@@ -245,7 +204,6 @@ import {
245
204
  saveReport,
246
205
  saveState,
247
206
  scanSessions,
248
- seededSample,
249
207
  selectAdapters,
250
208
  serializeInspectionReport,
251
209
  serializePolicyEvidence,
@@ -287,13 +245,12 @@ import {
287
245
  userPromptSpan,
288
246
  validateOtlpSpans,
289
247
  validationExitCode,
290
- verifyFindings,
291
- verifyFindingsUsage,
248
+ verifyFindingsInSandbox,
249
+ verifySessionBundle,
292
250
  watchRunTarget,
293
251
  watchSessions,
294
252
  withSessionFactsContext,
295
253
  wrap,
296
- wrapActionForExec,
297
254
  writeHodoscopeInput,
298
255
  writeInspectionReportFile,
299
256
  writeOtlpFile,
@@ -305,7 +262,7 @@ import {
305
262
  writeTraceQuestionsArtifacts,
306
263
  zaiChatCaller,
307
264
  zeroPricedCost
308
- } from "./chunk-7DOBU7BJ.js";
265
+ } from "./chunk-U4EB4HK7.js";
309
266
 
310
267
  // src/collect.ts
311
268
  async function collectSessions(opts = {}) {
@@ -322,6 +279,7 @@ async function collectSessions(opts = {}) {
322
279
  }
323
280
 
324
281
  // src/index.ts
282
+ export * from "@tangle-network/agent-eval/trajectory-replay";
325
283
  import {
326
284
  AnalystRegistry,
327
285
  buildDefaultAnalystRegistry,
@@ -384,10 +342,8 @@ export {
384
342
  SPAN_SYNTHESIZED_ATTR,
385
343
  SPAWN_JOURNAL_FILE,
386
344
  STATUS_MARK,
387
- SUBMIT_ACTION_SIGNATURE,
388
345
  SYNTHESIZED_SOURCE_ATTR,
389
346
  SYNTHESIZED_SPAN_ATTR,
390
- SandboxCounterfactualRunner,
391
347
  SessionWorkflowError,
392
348
  TRACES_REDACTION_RULES,
393
349
  TRACE_QUESTION_PREVIEW_HEAD_CHARS,
@@ -407,9 +363,7 @@ export {
407
363
  assertAnswerSchema,
408
364
  assertSandboxReachable,
409
365
  buildDefaultAnalystRegistry,
410
- buildFixPrompt,
411
366
  buildPolicyEvidenceRecord,
412
- buildRetryFixPrompt,
413
367
  buildSessionFactsReport,
414
368
  buildSessionIndex,
415
369
  buildSessionIndexFromRows,
@@ -421,12 +375,7 @@ export {
421
375
  classifyFailureFollowUps,
422
376
  classifyLiveActions,
423
377
  classifyReaction,
424
- classifyVerdict,
425
378
  claudeActor,
426
- clipText,
427
- cmdReplayVerify,
428
- cmdReplayVerifyBatch,
429
- cmdVerifyFindings,
430
379
  codexActor,
431
380
  collectPolicyEvidence,
432
381
  collectSessionIndex,
@@ -439,7 +388,6 @@ export {
439
388
  computeSessionFacts,
440
389
  conformanceOfSpans,
441
390
  connectors,
442
- countScriptCommands,
443
391
  countSkillRunsJsonl,
444
392
  createBundleSourceReader,
445
393
  createFindingRejectionTally,
@@ -447,12 +395,8 @@ export {
447
395
  cwdMatchesSelection,
448
396
  cwdMatchesSelectionResolved,
449
397
  defaultTraceLiveAnalysts,
450
- deriveFailureSignature,
451
- derivedImageTag,
452
398
  describeSessionRelationship,
453
- dockerImagePreparer,
454
399
  engineCallReservationFloorUsd,
455
- enumerateReplayableCases,
456
400
  environmentAttributes,
457
401
  environmentFromSpanAttributes,
458
402
  equivalentGitCwds,
@@ -461,7 +405,6 @@ export {
461
405
  exportTraceEvidenceRows,
462
406
  exportTraceEvidenceText,
463
407
  externalFailureMessage,
464
- extractFixCommand,
465
408
  fileRunContextSupervisorRunReader,
466
409
  fileSha256,
467
410
  findContextRoot,
@@ -469,12 +412,8 @@ export {
469
412
  findSpanSourceFiles,
470
413
  findingRejection,
471
414
  findingRejectionDetail,
472
- findingReplayStep,
473
- findingTrajectoryId,
474
415
  forEachTreeNode,
475
416
  formatFindingRejections,
476
- generateFixCommand,
477
- goldIncorrectSteps,
478
417
  haloAnalyzer,
479
418
  hashSessionBundleFiles,
480
419
  hodoscopeAnalyzer,
@@ -485,7 +424,6 @@ export {
485
424
  indexSessionIdsByTrace,
486
425
  inferRole,
487
426
  inferSpanKind,
488
- ingestCodeTraceBenchSteps,
489
427
  inspectSessionIndex,
490
428
  int,
491
429
  isBridgeMismatchError,
@@ -493,7 +431,6 @@ export {
493
431
  isChatTrajectoryMessage,
494
432
  isFileRunContextDir,
495
433
  isInheritedSpan,
496
- isSubmitAction,
497
434
  isSynthesizedSpan,
498
435
  knownHarnesses,
499
436
  listAdapters,
@@ -512,27 +449,18 @@ export {
512
449
  normalizeTraceQuestions,
513
450
  otlpRowToSpan,
514
451
  outboundHash,
515
- parseCorpusFlag,
516
- parseIncorrectStepsSubject,
517
452
  parseIsoToEpochMs,
518
453
  parseJsonAnswer,
519
- parseObservationOutput,
520
- parseRecordedReturncode,
521
- parseReplayBatchArgs,
522
- parseReplayVerifyArgs,
523
454
  parseSession,
524
455
  parseSince,
525
- parseVerifyFindingsArgs,
526
456
  planTraceAgenticRoute,
527
457
  planUpload,
528
458
  primeAnalyzer,
529
459
  projectSessionBundle,
530
460
  readCoordinationLog,
531
461
  readFileRunContext,
532
- readFindingsFile,
533
462
  readJsonFile,
534
463
  readJsonl,
535
- readLabelEntries,
536
464
  readOtlpInput,
537
465
  readPullRequests,
538
466
  readRunContextJournal,
@@ -545,7 +473,6 @@ export {
545
473
  redactSpans,
546
474
  redactString,
547
475
  redactValue,
548
- renderBatchReport,
549
476
  renderConformance,
550
477
  renderInspectionReport,
551
478
  renderRunContextSnapshot,
@@ -557,15 +484,7 @@ export {
557
484
  renderTraceQuestionPrompt,
558
485
  renderTraceQuestionsReport,
559
486
  renderValidation,
560
- renderVerifiedFindingsSection,
561
- replayBatchUsage,
562
- replayVerify,
563
- replayVerifyFinding,
564
- replayVerifyUsage,
565
487
  resolveAdapter,
566
- resolveCaseResources,
567
- resolveFindingInvocation,
568
- resolveFindingReplayability,
569
488
  resolveOtlpInputFiles,
570
489
  resolveRepoAttrs,
571
490
  resolveRunContextDir,
@@ -573,9 +492,7 @@ export {
573
492
  resolveSessionRepoAttrs,
574
493
  runCommand,
575
494
  runExternalAnalyzers,
576
- runFixLoop,
577
495
  runPipelines,
578
- runReplayBatch,
579
496
  runTotals,
580
497
  runTraceImprovement,
581
498
  runTraceInvestigation,
@@ -585,7 +502,6 @@ export {
585
502
  saveReport,
586
503
  saveState,
587
504
  scanSessions,
588
- seededSample,
589
505
  selectAdapters,
590
506
  serializeInspectionReport,
591
507
  serializePolicyEvidence,
@@ -627,13 +543,12 @@ export {
627
543
  userPromptSpan,
628
544
  validateOtlpSpans,
629
545
  validationExitCode,
630
- verifyFindings,
631
- verifyFindingsUsage,
546
+ verifyFindingsInSandbox,
547
+ verifySessionBundle,
632
548
  watchRunTarget,
633
549
  watchSessions,
634
550
  withSessionFactsContext,
635
551
  wrap,
636
- wrapActionForExec,
637
552
  writeHodoscopeInput,
638
553
  writeInspectionReportFile,
639
554
  writeOtlpFile,
@@ -7,7 +7,8 @@ An analyst finding today is a cited claim: "step 37 is where the run went wrong.
7
7
  - **Arm B** executes a corrected step k and checks the failure vanishes (exit 0 and the signature absent).
8
8
 
9
9
  Each arm gets a fresh sandbox with its own prefix replay, so arm B is never contaminated by arm A's side effects.
10
- Under the hood each arm is an agent-eval `runCounterfactual` meta-run (`layer='meta'`, `parentRunId` = the ingested trajectory run), with the sandbox-backed `CounterfactualRunner` from `src/replay-verify.ts` supplying the `executeFrom` callback that scaffold leaves to consumers.
10
+ Under the hood each arm is an agent-eval `runCounterfactual` meta-run (`layer='meta'`, `parentRunId` = the ingested trajectory run), with the `SandboxCounterfactualRunner` from `@tangle-network/agent-eval/trajectory-replay` supplying the `executeFrom` callback that scaffold leaves to consumers.
11
+ The replay engine is agent-eval's; traces supplies only the Tangle Sandbox execution backend and the CLI (`src/replay.ts`).
11
12
 
12
13
  ## Usage
13
14
 
@@ -79,7 +80,7 @@ Fix generation (`--fix generate`) runs ONE chat completion per arm-A-reproduced
79
80
 
80
81
  ### Iterative fix loop (`--fix loop`)
81
82
 
82
- `--fix loop` (in `src/replay-fix-loop.ts`) replaces the single shot with an execution-feedback loop of up to `--fix-attempts` attempts (default 3) per case:
83
+ `--fix loop` (agent-eval `runFixLoop`) replaces the single shot with an execution-feedback loop of up to `--fix-attempts` attempts (default 3) per case:
83
84
 
84
85
  - Attempt 1 is byte-identical to the one-shot prompt, so the report's `fixFlipAttempt1` stays directly comparable to `--fix generate`.
85
86
  - When an arm fails (nonzero exit or the failure signature persists) or the model call itself fails, the next prompt carries every prior command with its REAL executed stdout/stderr (clipped tails), never a paraphrase.
@@ -97,14 +98,14 @@ Outputs: `batch-report.json`, `batch-report.md` (headline + exclusion + pull-fai
97
98
 
98
99
  ## Analyst wire — finding in, executed proof out
99
100
 
100
- `replayVerifyFinding` (exported from the package root, `src/replay-wire.ts`) is the entry point the analyst product calls:
101
+ `replayVerifyFinding` (from `@tangle-network/agent-eval/trajectory-replay`, re-exported by this package) is the entry point the analyst product calls:
101
102
 
102
103
  ```ts
103
- import { replayVerifyFinding } from '@tangle-network/traces'
104
+ import { replayVerifyFinding, sandboxReplayBackend } from '@tangle-network/traces'
104
105
 
105
106
  const { invocation, fixCommand, verdict } = await replayVerifyFinding(
106
107
  { trajId: 'miniswe-…-zstd-1733-786102c1', subject: 'incorrect-steps-37-37-unescaped-consequence-39' },
107
- { corpora, out: './proof', fixCaller, baseUrl, apiKey },
108
+ { corpora, out: './proof', fixCaller, backendFactory: (image) => sandboxReplayBackend({ image, apiKey, baseUrl }) },
108
109
  )
109
110
  ```
110
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/traces",
3
- "version": "0.15.0",
3
+ "version": "0.15.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",
@@ -60,19 +60,19 @@
60
60
  "prepublishOnly": "pnpm check:source && pnpm build && pnpm check:package"
61
61
  },
62
62
  "dependencies": {
63
- "@tangle-network/agent-eval": "0.182.0",
64
- "@tangle-network/agent-interface": "2.6.1",
65
- "@tangle-network/agent-runtime": "0.231.1",
66
- "@tangle-network/agent-trace-contract": "1.0.2",
67
- "@tangle-network/sandbox": "0.40.2"
63
+ "@tangle-network/agent-eval": "0.186.2",
64
+ "@tangle-network/agent-interface": "2.12.0",
65
+ "@tangle-network/agent-runtime": "0.257.0",
66
+ "@tangle-network/agent-trace-contract": "1.2.0",
67
+ "@tangle-network/sandbox": "0.45.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@types/node": "^22.0.0",
71
- "postcss": "^8.5.26",
72
- "tsup": "^8.0.0",
73
- "tsx": "^4.23.13",
74
- "typescript": "^5.7.0",
75
- "vite": "^8.2.2",
76
- "vitest": "^4.1.11"
70
+ "@types/node": "^22.20.4",
71
+ "postcss": "^8.5.28",
72
+ "tsup": "^8.5.1",
73
+ "tsx": "^4.23.15",
74
+ "typescript": "~5.9.3",
75
+ "vite": "^8.3.0",
76
+ "vitest": "^5.0.1"
77
77
  }
78
78
  }