@tangle-network/traces 0.8.26 → 0.9.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/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ToolUseMetrics, InMemoryTraceStore } from '@tangle-network/agent-eval';
2
- import { StuckLoopReport } from '@tangle-network/agent-eval/pipelines';
2
+ import { StuckLoopReport, FailureClusterReport } from '@tangle-network/agent-eval/pipelines';
3
3
  import { AxAIService } from '@ax-llm/ax';
4
+ import { ExecutionReport } from '@tangle-network/agent-eval/contract';
4
5
  import { AnalystRegistry, buildDefaultAnalystRegistry, AnalystFinding, AnalystRunResult, Analyst } from '@tangle-network/agent-eval/analyst';
5
6
  export { Analyst, AnalystContext, AnalystFinding, AnalystRegistry, buildDefaultAnalystRegistry, makeFinding } from '@tangle-network/agent-eval/analyst';
6
7
  import { TraceAnalysisStore, RedactionRule, RedactionReport } from '@tangle-network/agent-eval/traces';
@@ -23,7 +24,7 @@ export { HostedClient, createHostedClient, hostedClientFromEnv } from '@tangle-n
23
24
  * - `service.name` → harness id (claude-code, codex, …)
24
25
  * - `agent.name` → agent / subagent name
25
26
  * - `llm.model_name` → model
26
- * - `llm.input_tokens` / `llm.output_tokens` → behavioral token trajectories
27
+ * - shared `llm.token_count.*` keys → input, output, reasoning, and cache usage
27
28
  * - `tool.name` → tool histogram (monoculture / no-verify)
28
29
  * - `step` → run order (falls back to start_time)
29
30
  */
@@ -59,6 +60,11 @@ interface SpanInput {
59
60
  tool?: string | null;
60
61
  inputTokens?: number | null;
61
62
  outputTokens?: number | null;
63
+ /** Reasoning subset of output tokens. */
64
+ reasoningTokens?: number | null;
65
+ cachedInputTokens?: number | null;
66
+ cacheWriteInputTokens?: number | null;
67
+ costUsd?: number | null;
62
68
  /** Run-order pivot; the behavioral analyst orders trajectories by this. */
63
69
  step?: number;
64
70
  /** Verbatim content the agentic analysts read via regex search. */
@@ -85,6 +91,41 @@ declare function serializeSpans(spans: readonly OtlpSpan[]): string;
85
91
  /** Write spans to an OTLP-JSONL file (a temp file when no path is given). */
86
92
  declare function writeOtlpFile(spans: readonly OtlpSpan[], outPath?: string): Promise<string>;
87
93
 
94
+ interface JsonlCorruptionReceipt {
95
+ receiptVersion: 1;
96
+ kind: 'jsonl_corruption';
97
+ status: 'degraded_not_lossless';
98
+ sourcePath: string;
99
+ /** Zero-based byte offset of the record, excluding prior line delimiters. */
100
+ byteOffset: number;
101
+ /** Exact record byte length excluding LF, but including CR when present. */
102
+ byteLength: number;
103
+ /** One-based physical line number. */
104
+ lineNumber: number;
105
+ /** SHA-256 of the exact source bytes at byteOffset/byteLength. */
106
+ sha256: string;
107
+ /** Traces retains only a fingerprint; exact bytes may be reread from the local source. */
108
+ rawBytes: 'local_source_only';
109
+ }
110
+ type JsonlReadOptions = {
111
+ mode?: 'strict';
112
+ } | {
113
+ mode: 'recover';
114
+ onCorruption: (receipt: JsonlCorruptionReceipt) => void;
115
+ };
116
+ declare class JsonlParseError extends SyntaxError {
117
+ readonly sourcePath: string;
118
+ readonly lineNumber: number;
119
+ readonly byteOffset: number;
120
+ readonly byteLength: number;
121
+ readonly sha256: string;
122
+ readonly receipt: JsonlCorruptionReceipt;
123
+ constructor(receipt: JsonlCorruptionReceipt);
124
+ }
125
+ /** Stream JSONL rows without retaining the source file. */
126
+ declare function readJsonl<T>(path: string, options?: JsonlReadOptions): AsyncGenerator<T>;
127
+ declare function takeJsonl<T>(path: string, limit: number, options?: JsonlReadOptions): Promise<T[]>;
128
+
88
129
  /**
89
130
  * Harness trace adapter contract.
90
131
  *
@@ -97,6 +138,19 @@ declare function writeOtlpFile(spans: readonly OtlpSpan[], outPath?: string): Pr
97
138
  * locates these files.
98
139
  */
99
140
 
141
+ type CorruptionMode = 'recover' | 'strict';
142
+ interface ParseOptions {
143
+ /** Recover valid JSONL records by default; strict rejects the first corruption. */
144
+ corruptionMode?: CorruptionMode;
145
+ }
146
+ interface SessionCorruptionReceipt extends JsonlCorruptionReceipt {
147
+ harness: string;
148
+ sessionId: string;
149
+ }
150
+ interface SessionIntegrity {
151
+ status: 'degraded_not_lossless';
152
+ corruptions: SessionCorruptionReceipt[];
153
+ }
100
154
  /** A single discovered session, before parsing. */
101
155
  interface SessionRef {
102
156
  /** Harness id (matches the nix profile / backend name). */
@@ -109,6 +163,8 @@ interface SessionRef {
109
163
  cwd: string | null;
110
164
  /** Last-modified epoch ms — used for `--last N` recency ordering. */
111
165
  mtimeMs: number;
166
+ /** Present when parsing recovered valid records around corrupt source records. */
167
+ integrity?: SessionIntegrity;
112
168
  }
113
169
  interface LocateOptions {
114
170
  /** Limit discovery to sessions whose cwd matches (exact or prefix). */
@@ -124,7 +180,7 @@ interface HarnessTraceAdapter {
124
180
  /** Discover session files for this harness on disk. */
125
181
  locate(opts?: LocateOptions): Promise<SessionRef[]>;
126
182
  /** Parse one discovered session into normalized OTLP spans. */
127
- parse(ref: SessionRef): Promise<OtlpSpan[]>;
183
+ parse(ref: SessionRef, options?: ParseOptions): Promise<OtlpSpan[]>;
128
184
  }
129
185
 
130
186
  /**
@@ -169,11 +225,46 @@ declare const ATTR: {
169
225
  readonly UPLOADER: "tangle.uploader";
170
226
  readonly REDACTION_VERSION: "redaction.version";
171
227
  readonly REDACTION_COUNT: "redaction.count";
228
+ /** Upload contract: bounded root summary plus location-only receipt child spans.
229
+ * Receipt hashes are deliberate integrity evidence; raw malformed bytes never upload. */
230
+ readonly SESSION_INTEGRITY: "traces.session.integrity";
231
+ readonly CORRUPTION_COUNT: "traces.session.corruption_count";
232
+ readonly CORRUPTION_DIGEST: "traces.session.corruption_digest";
233
+ readonly CORRUPTION_RECEIPT_VERSION: "traces.session.corruption.receipt_version";
234
+ readonly CORRUPTION_RECEIPT_KIND: "traces.session.corruption.kind";
235
+ readonly CORRUPTION_SOURCE_PATH: "traces.session.corruption.source_path";
236
+ readonly CORRUPTION_LINE_NUMBER: "traces.session.corruption.line_number";
237
+ readonly CORRUPTION_BYTE_OFFSET: "traces.session.corruption.byte_offset";
238
+ readonly CORRUPTION_BYTE_LENGTH: "traces.session.corruption.byte_length";
239
+ readonly CORRUPTION_SHA256: "traces.session.corruption.sha256";
240
+ readonly RAW_SOURCE_RETENTION: "traces.session.raw_source_retention";
172
241
  };
173
242
  /** `tangle.ingest_source` value for CLI-uploaded traces. Wire contract. */
174
243
  declare const INGEST_SOURCE_CLI = "cli";
175
244
  /** Harness used when none is specified on a single-harness command. */
176
245
  declare const DEFAULT_HARNESS = "claude-code";
246
+ declare function sessionIdFromAttributes(attributes: Readonly<Record<string, unknown>>): string | undefined;
247
+ interface SessionIdentityConflict {
248
+ readonly traceId: string;
249
+ readonly sessionIds: readonly string[];
250
+ }
251
+ interface SessionIdentityIndex {
252
+ readonly sessionByTrace: Map<string, string>;
253
+ readonly conflicts: readonly SessionIdentityConflict[];
254
+ }
255
+ declare function indexSessionIdsByTrace(spans: readonly {
256
+ trace_id: string;
257
+ attributes: Readonly<Record<string, unknown>>;
258
+ }[]): SessionIdentityIndex;
259
+ /**
260
+ * Ensure every locally parsed trace has one session identity without hiding
261
+ * source conflicts. Existing stable identities win; otherwise the local
262
+ * session reference is stamped on every span in that trace.
263
+ */
264
+ declare function stampSessionIdentity(spans: {
265
+ trace_id: string;
266
+ attributes: Record<string, unknown>;
267
+ }[], fallbackSessionId: string): void;
177
268
 
178
269
  /** Parse an ISO-8601 timestamp or an epoch-millis string to epoch ms.
179
270
  * Returns 0 for empty/unparseable input (callers treat 0 as "unknown"). */
@@ -182,6 +273,19 @@ declare function parseIsoToEpochMs(ts: string): number;
182
273
  * date, → epoch ms. Throws on a malformed value (fail-loud, not silent). */
183
274
  declare function parseSince(value: string): number;
184
275
 
276
+ type JsonSourceErrorKind = 'read' | 'parse';
277
+ declare class JsonSourceError extends Error {
278
+ readonly sourcePath: string;
279
+ readonly kind: JsonSourceErrorKind;
280
+ readonly code?: string;
281
+ constructor(sourcePath: string, kind: JsonSourceErrorKind, cause: unknown);
282
+ }
283
+ declare function readJsonFile<T>(path: string): Promise<T>;
284
+
285
+ declare function recordSessionCorruption(ref: SessionRef, receipt: JsonlCorruptionReceipt): void;
286
+ declare function sessionIntegrityAttributes(ref: SessionRef): Record<string, string | number>;
287
+ declare function stampSessionIntegrity(ref: SessionRef, spans: OtlpSpan[]): void;
288
+
185
289
  /**
186
290
  * Harness adapter registry — resolves a harness id (or alias) to the
187
291
  * adapter that knows its on-disk session format.
@@ -218,14 +322,18 @@ declare function selectAdapters(opts: AdapterSelection): HarnessTraceAdapter[];
218
322
  * path funnels through here so the spine can group by repo. Repo resolution is
219
323
  * computed ONCE per session; it is fail-safe and never throws.
220
324
  */
221
- declare function parseSession(adapter: HarnessTraceAdapter, ref: SessionRef): Promise<OtlpSpan[]>;
325
+ declare function parseSession(adapter: HarnessTraceAdapter, ref: SessionRef, options?: ParseOptions): Promise<OtlpSpan[]>;
326
+ declare class EmptySessionError extends Error {
327
+ readonly sourcePath: string;
328
+ constructor(sourcePath: string);
329
+ }
222
330
  /** Locate through every equivalent git worktree for the selected cwd, then
223
331
  * dedupe and apply a boundary-aware final filter. */
224
332
  declare function locateSessions(adapter: HarnessTraceAdapter, opts?: {
225
333
  cwd?: string;
226
334
  sinceMs?: number;
227
335
  }): Promise<SessionRef[]>;
228
- interface ScanOptions extends AdapterSelection {
336
+ interface ScanOptions extends AdapterSelection, ParseOptions {
229
337
  /** Filter by working directory (exact/prefix). */
230
338
  cwd?: string;
231
339
  /** Only sessions modified at/after this epoch ms. */
@@ -234,17 +342,17 @@ interface ScanOptions extends AdapterSelection {
234
342
  last?: number;
235
343
  /** Cancel the scan; iteration stops between sessions. */
236
344
  signal?: AbortSignal;
237
- /** Per-adapter locate/parse failure (the scan continues). */
345
+ /** Handle a locate/parse failure and continue. Without this callback, failures propagate. */
238
346
  onError?: (error: unknown, ref?: SessionRef) => void;
239
347
  }
240
348
  interface ScannedSession {
241
349
  adapter: HarnessTraceAdapter;
242
350
  ref: SessionRef;
243
- /** Non-empty parsed spans for the session. */
351
+ /** Parsed spans for the session. */
244
352
  spans: OtlpSpan[];
245
353
  }
246
- /** Yield every non-empty session across the selected adapters. Locate/parse
247
- * errors route to `onError` and skip that adapter/session, never aborting. */
354
+ /** Yield every session across the selected adapters. Locate/parse errors
355
+ * propagate unless an explicit `onError` callback handles them. */
248
356
  declare function scanSessions(opts: ScanOptions): AsyncGenerator<ScannedSession>;
249
357
 
250
358
  type RepoResolutionSource = 'none' | 'ref-cwd' | 'repaired-cwd' | 'span-path' | 'span-workdir';
@@ -303,7 +411,7 @@ declare class ClaudeAdapter implements HarnessTraceAdapter {
303
411
  readonly aliases: readonly ["claude", "claudish", "openclaw", "nanoclaw"];
304
412
  private root;
305
413
  locate(opts?: LocateOptions): Promise<SessionRef[]>;
306
- parse(ref: SessionRef): Promise<OtlpSpan[]>;
414
+ parse(ref: SessionRef, options?: ParseOptions): Promise<OtlpSpan[]>;
307
415
  /** Parse `<session>/subagents/agent-*.jsonl`, parenting each under its Agent call. */
308
416
  private foldSubagents;
309
417
  }
@@ -329,7 +437,7 @@ declare class CodexAdapter implements HarnessTraceAdapter {
329
437
  readonly aliases: readonly ["codex-acp"];
330
438
  private root;
331
439
  locate(opts?: LocateOptions): Promise<SessionRef[]>;
332
- parse(ref: SessionRef): Promise<OtlpSpan[]>;
440
+ parse(ref: SessionRef, options?: ParseOptions): Promise<OtlpSpan[]>;
333
441
  }
334
442
 
335
443
  /**
@@ -406,7 +514,7 @@ declare class QwenAdapter implements HarnessTraceAdapter {
406
514
  readonly aliases: readonly ["qwen-code"];
407
515
  private root;
408
516
  locate(opts?: LocateOptions): Promise<SessionRef[]>;
409
- parse(ref: SessionRef): Promise<OtlpSpan[]>;
517
+ parse(ref: SessionRef, options?: ParseOptions): Promise<OtlpSpan[]>;
410
518
  }
411
519
 
412
520
  /**
@@ -427,7 +535,7 @@ declare class FactoryAdapter implements HarnessTraceAdapter {
427
535
  readonly aliases: readonly ["factory-droids", "droid"];
428
536
  private root;
429
537
  locate(opts?: LocateOptions): Promise<SessionRef[]>;
430
- parse(ref: SessionRef): Promise<OtlpSpan[]>;
538
+ parse(ref: SessionRef, options?: ParseOptions): Promise<OtlpSpan[]>;
431
539
  }
432
540
 
433
541
  /**
@@ -443,7 +551,7 @@ declare class PiAdapter implements HarnessTraceAdapter {
443
551
  readonly harness = "pi";
444
552
  private root;
445
553
  locate(opts?: LocateOptions): Promise<SessionRef[]>;
446
- parse(ref: SessionRef): Promise<OtlpSpan[]>;
554
+ parse(ref: SessionRef, options?: ParseOptions): Promise<OtlpSpan[]>;
447
555
  }
448
556
 
449
557
  /**
@@ -476,9 +584,9 @@ declare class AmpAdapter implements HarnessTraceAdapter {
476
584
  * `assistant.usage` (ephemeral: `model`, `inputTokens`, `outputTokens`).
477
585
  *
478
586
  * Sub-agents interleave in the same stream — tool calls/results are joined by
479
- * `toolCallId`, never adjacency. Lines may contain stray newlines/separators;
480
- * parse line-tolerant. Schema from GitHub docs (high conf); parse unverified
481
- * against local data.
587
+ * `toolCallId`, never adjacency. Isolated invalid records produce corruption
588
+ * receipts while valid records continue. Schema from GitHub docs (high conf);
589
+ * parse unverified against local data.
482
590
  */
483
591
 
484
592
  declare class CopilotAdapter implements HarnessTraceAdapter {
@@ -486,14 +594,14 @@ declare class CopilotAdapter implements HarnessTraceAdapter {
486
594
  readonly aliases: readonly ["copilot"];
487
595
  private root;
488
596
  locate(opts?: LocateOptions): Promise<SessionRef[]>;
489
- parse(ref: SessionRef): Promise<OtlpSpan[]>;
597
+ parse(ref: SessionRef, options?: ParseOptions): Promise<OtlpSpan[]>;
490
598
  }
491
599
 
492
600
  /**
493
601
  * Forge adapter (antinomyhq/forge) — `/dump` JSON exports.
494
602
  *
495
603
  * Forge's primary store is SQLite (`~/.forge/.forge.db`, `conversations.context`
496
- * column). Reading it live needs a native sqlite dep, so v1 parses the
604
+ * column). Reading it live needs a native sqlite dep, so this adapter parses the
497
605
  * dependency-free `/dump` artifact instead: `<cwd>/YYYY-MM-DD_HH-MM-SS-dump.json`,
498
606
  * a single flattened `Context{ conversation_id, messages[] }`.
499
607
  *
@@ -620,7 +728,7 @@ declare const CORRECTIVE_REACTIONS: readonly Reaction[];
620
728
  *
621
729
  * These are the deterministic loop/thrash detectors that already exist in
622
730
  * `@tangle-network/agent-eval`:
623
- * - stuckLoopView — same tool + same args ≥ N times (the loop signal)
731
+ * - stuckLoopView — same tool + same args ≥ N times in a short interval
624
732
  * - computeToolUseMetrics — duplicate-call / retry / error rates per run
625
733
  *
626
734
  * `toolWasteView` is intentionally NOT used: its default heuristic needs
@@ -637,6 +745,7 @@ declare const CORRECTIVE_REACTIONS: readonly Reaction[];
637
745
 
638
746
  interface PipelineReport {
639
747
  stuckLoops: StuckLoopReport;
748
+ failureClusters: FailureClusterReport;
640
749
  toolUse: ToolUseMetrics[];
641
750
  }
642
751
  interface PipelineOptions {
@@ -702,7 +811,7 @@ declare function analyzeReactions(spans: readonly OtlpSpan[]): ReactionReport;
702
811
  * Skill + subagent adoption metrics — deterministic.
703
812
  *
704
813
  * Reports three things:
705
- * 1. skill penetration — % of sessions that invoked any skill
814
+ * 1. explicit skill invocation rate over sessions with dedicated telemetry
706
815
  * 2. per-skill invocation frequency
707
816
  * 3. subagent (Task/Agent) spawn frequency
708
817
  *
@@ -716,11 +825,24 @@ declare function analyzeReactions(spans: readonly OtlpSpan[]): ReactionReport;
716
825
  */
717
826
 
718
827
  interface AdoptionReport {
719
- sessionCount: number;
828
+ /** Identified sessions plus traces that lack session identity. */
829
+ executionGroupCount: number;
830
+ identifiedSessionCount: number;
831
+ unassignedTraceCount: number;
832
+ /** Traces omitted from session grouping because their source IDs disagree. */
833
+ sessionIdentityConflicts: readonly SessionIdentityConflict[];
720
834
  /** Sessions that invoked ≥1 skill (explicitly, via the Skill tool). */
721
835
  sessionsWithSkill: number;
722
- /** sessionsWithSkill / sessionCount (0 when no sessions). */
723
- skillPenetration: number;
836
+ /** sessionsWithSkill / skillTelemetrySessions; null when invocation is not measurable. */
837
+ skillPenetration: number | null;
838
+ /** Whether explicit Skill events can measure all, some, or none of the selected sessions. */
839
+ skillTelemetryStatus: 'measured' | 'partial' | 'unsupported' | 'unknown';
840
+ /** Sessions whose harness exposes a dedicated Skill event. */
841
+ skillTelemetrySessions: number;
842
+ /** Sessions containing materialized skill instructions or a skill catalog. */
843
+ sessionsWithMaterializedSkills: number;
844
+ /** Sessions with tool inputs that reference a SKILL.md path. */
845
+ sessionsWithSkillFileReference: number;
724
846
  /** Explicit `Skill` tool invocations per skill name, corpus-wide. */
725
847
  skillInvocations: Record<string, number>;
726
848
  /** Total explicit `Skill` tool invocations. */
@@ -762,9 +884,8 @@ declare function analyzeAdoption(spans: readonly OtlpSpan[], opts?: AdoptionOpti
762
884
  * harness — so traces reuses those shipped detectors instead of
763
885
  * reimplementing loop/stall detection.
764
886
  *
765
- * Tool `args` is the verbatim tool input we stored on the span's `content`;
766
- * `stuckLoopView` hashes it (`argHash`) so identical repeated calls collapse
767
- * to one loop finding.
887
+ * Tool `args` is the captured OpenInference input value; `stuckLoopView`
888
+ * hashes it (`argHash`) so identical repeated calls collapse to one finding.
768
889
  */
769
890
 
770
891
  interface RuntimeTrace {
@@ -807,10 +928,19 @@ interface AnalyzeOptions {
807
928
  interface AnalyzeResult {
808
929
  /** Path to the OTLP-JSONL artifact (convert to canonical for HALO). */
809
930
  otlpPath: string;
931
+ execution: ExecutionReport;
810
932
  result: Awaited<ReturnType<ReturnType<typeof buildDefaultAnalystRegistry>['run']>>;
811
933
  }
812
934
  declare function analyzeSpans(spans: readonly OtlpSpan[], opts?: AnalyzeOptions): Promise<AnalyzeResult>;
813
935
 
936
+ interface TraceExecutionOptions {
937
+ readonly experimentId?: string;
938
+ readonly candidateId?: string;
939
+ }
940
+ /** Map normalized spans into agent-eval's shared execution accounting. */
941
+ declare function summarizeOtlpExecution(otlpJsonl: string, opts?: TraceExecutionOptions): ExecutionReport;
942
+ declare function summarizeSpanExecution(spans: readonly OtlpSpan[], opts?: TraceExecutionOptions): ExecutionReport;
943
+
814
944
  interface PolicyEvidenceToolSummary {
815
945
  readonly name: string;
816
946
  readonly calls: number;
@@ -824,6 +954,7 @@ interface PolicyEvidenceRecord {
824
954
  readonly schemaVersion: 1;
825
955
  readonly kind: 'traces.policy_evidence.session';
826
956
  readonly generatedAt: string;
957
+ readonly execution: ExecutionReport;
827
958
  readonly session: {
828
959
  readonly harness: string;
829
960
  readonly sessionId: string;
@@ -898,6 +1029,7 @@ interface TraceSessionIndexRow {
898
1029
  readonly models: readonly string[];
899
1030
  readonly tools: PolicyEvidenceRecord['metrics']['tools'];
900
1031
  readonly signals: PolicyEvidenceRecord['signals'];
1032
+ readonly execution: ExecutionReport;
901
1033
  }
902
1034
  interface TraceIndexedFile {
903
1035
  readonly kind: 'instruction-doc' | 'evolve-jsonl' | 'evolve-json' | 'reflection' | 'handoff' | 'other';
@@ -1285,17 +1417,36 @@ declare function traceStreamEventsFromSpans(spans: readonly OtlpSpan[], opts?: T
1285
1417
  declare function serializeTraceStreamEvent(event: TraceStreamEvent): string;
1286
1418
  declare function streamSessions(opts: TraceStreamOptions): Promise<void>;
1287
1419
 
1420
+ /**
1421
+ * Render analyst findings as a markdown report.
1422
+ *
1423
+ * Findings are grouped by area, ordered by severity. Each carries its
1424
+ * claim, the deterministic evidence excerpt, and the recommended action —
1425
+ * the actionable output for improving a stuck/looping agent.
1426
+ */
1427
+
1428
+ interface ReportSource {
1429
+ sessionId: string;
1430
+ path: string;
1431
+ subject: string;
1432
+ role: 'operator' | 'child' | 'unknown';
1433
+ parentSessionId?: string;
1434
+ integrity?: 'complete' | 'degraded_not_lossless';
1435
+ corruptionCount?: number;
1436
+ corruptionDigest?: string;
1437
+ corruptions?: readonly SessionCorruptionReceipt[];
1438
+ }
1439
+
1288
1440
  interface TracesConfig {
1289
1441
  readonly registry?: AnalystRegistry;
1290
1442
  readonly analysts?: readonly Analyst[];
1291
1443
  readonly liveAnalysts?: readonly TraceLiveAnalyst[];
1292
1444
  readonly externalAnalyzers?: readonly ExternalAnalyzer[];
1293
- readonly improvementAdapter?: ImprovementAdapter;
1294
1445
  }
1295
1446
  interface TraceInvestigationOptions {
1296
1447
  readonly spans: readonly OtlpSpan[];
1297
1448
  readonly harness: string;
1298
- readonly sessionCount: number;
1449
+ readonly sources?: readonly ReportSource[];
1299
1450
  readonly cwds?: readonly string[];
1300
1451
  readonly minLoopOccurrences?: number;
1301
1452
  readonly ai?: AxAIService;
@@ -1308,28 +1459,6 @@ interface TraceInvestigationOptions {
1308
1459
  readonly generatedAt?: string;
1309
1460
  readonly log?: (msg: string, fields?: Record<string, unknown>) => void;
1310
1461
  }
1311
- interface TraceRecommendation {
1312
- readonly schemaVersion: 1;
1313
- readonly id: string;
1314
- readonly severity: AnalystFinding['severity'];
1315
- readonly title: string;
1316
- readonly action: string;
1317
- readonly rationale: string;
1318
- readonly evidenceRefs: readonly AnalystFinding['evidence_refs'][number][];
1319
- readonly findingIds: readonly string[];
1320
- readonly validationPlan: string;
1321
- readonly source: 'analyst' | 'deterministic' | 'external';
1322
- }
1323
- interface TraceClaim {
1324
- readonly schemaVersion: 1;
1325
- readonly id: string;
1326
- readonly severity: AnalystFinding['severity'];
1327
- readonly text: string;
1328
- readonly area: string;
1329
- readonly sourceFindingId: string;
1330
- readonly evidenceRefs: readonly AnalystFinding['evidence_refs'][number][];
1331
- readonly validationPlan?: string;
1332
- }
1333
1462
  interface TraceEvidenceRow {
1334
1463
  readonly schemaVersion: 1;
1335
1464
  readonly kind: 'traces.improvement_evidence';
@@ -1339,69 +1468,27 @@ interface TraceEvidenceRow {
1339
1468
  readonly claim: string;
1340
1469
  readonly evidence: AnalystFinding['evidence_refs'][number];
1341
1470
  }
1342
- interface ImprovementProposal {
1343
- readonly id: string;
1344
- readonly title: string;
1345
- readonly description: string;
1346
- readonly recommendationIds: readonly string[];
1347
- readonly patch?: string;
1348
- readonly validationCommand?: string;
1349
- readonly evidenceRefs?: readonly AnalystFinding['evidence_refs'][number][];
1350
- }
1351
- interface ImprovementAdapterInput {
1352
- readonly findings: readonly AnalystFinding[];
1353
- readonly recommendations: readonly TraceRecommendation[];
1354
- readonly claims: readonly TraceClaim[];
1355
- readonly spans: readonly OtlpSpan[];
1356
- readonly otlpPath: string;
1357
- }
1358
- interface ImprovementAdapter {
1359
- propose(input: ImprovementAdapterInput): Promise<readonly ImprovementProposal[]>;
1360
- }
1361
- interface FindingStore {
1362
- append(runId: string, findings: readonly AnalystFinding[]): Promise<void>;
1363
- }
1364
- interface RecommendationWriter {
1365
- write(recommendations: readonly TraceRecommendation[]): Promise<void>;
1366
- }
1367
- interface TraceReplayProof {
1368
- readonly schemaVersion: 1;
1369
- readonly kind: 'traces.improvement_replay';
1370
- readonly generatedAt: string;
1371
- readonly status: 'proposal-only' | 'not-run';
1372
- readonly candidateApplied: false;
1373
- readonly baseline: {
1374
- readonly spanCount: number;
1375
- readonly findingCount: number;
1376
- readonly recommendationCount: number;
1377
- readonly stuckLoops: number;
1378
- readonly reactionSignals: number;
1379
- readonly toolErrorRuns: number;
1380
- };
1381
- readonly proposals: readonly ImprovementProposal[];
1382
- readonly note: string;
1383
- }
1384
1471
  interface TraceImprovementArtifacts {
1385
1472
  readonly directory: string;
1386
- readonly findings: string;
1387
- readonly recommendations: string;
1388
- readonly proposals: string;
1473
+ readonly result: string;
1389
1474
  readonly evidence: string;
1390
- readonly claims: string;
1391
1475
  readonly report: string;
1392
- readonly replay: string;
1476
+ readonly traces: string;
1393
1477
  }
1394
1478
  interface TraceInvestigationResult {
1395
1479
  readonly schemaVersion: 1;
1396
1480
  readonly kind: 'traces.investigation';
1397
1481
  readonly generatedAt: string;
1398
1482
  readonly harness: string;
1483
+ /** Distinct stable session identities observed in the selected spans. */
1399
1484
  readonly sessionCount: number;
1485
+ /** Traces without exactly one stable session identity. */
1486
+ readonly unassignedTraceCount: number;
1487
+ readonly sources?: readonly ReportSource[];
1400
1488
  readonly spanCount: number;
1401
1489
  readonly otlpPath: string;
1490
+ readonly execution: ExecutionReport;
1402
1491
  readonly findings: readonly AnalystFinding[];
1403
- readonly recommendations: readonly TraceRecommendation[];
1404
- readonly claims: readonly TraceClaim[];
1405
1492
  readonly pipelines: PipelineReport;
1406
1493
  readonly reactions: ReactionReport;
1407
1494
  readonly adoption: AdoptionReport;
@@ -1414,8 +1501,6 @@ interface TraceFindingPacket {
1414
1501
  readonly generatedAt: string;
1415
1502
  readonly source: string;
1416
1503
  readonly findings: readonly AnalystFinding[];
1417
- readonly recommendations: readonly TraceRecommendation[];
1418
- readonly claims: readonly TraceClaim[];
1419
1504
  readonly report: string;
1420
1505
  }
1421
1506
  interface BuildTraceFindingPacketOptions {
@@ -1440,12 +1525,9 @@ interface TraceStoreInvestigationResult extends Omit<TraceFindingPacket, 'kind'>
1440
1525
  }
1441
1526
  interface TraceImprovementResult extends Omit<TraceInvestigationResult, 'kind'> {
1442
1527
  readonly kind: 'traces.improvement';
1443
- readonly proposals: readonly ImprovementProposal[];
1444
- readonly replay: TraceReplayProof;
1445
1528
  readonly artifacts?: TraceImprovementArtifacts;
1446
1529
  }
1447
1530
  interface TraceImprovementOptions extends TraceInvestigationOptions {
1448
- readonly adapter?: ImprovementAdapter;
1449
1531
  readonly outDir?: string;
1450
1532
  }
1451
1533
  declare function buildTraceFindingPacket(opts: BuildTraceFindingPacketOptions): TraceFindingPacket;
@@ -1453,8 +1535,8 @@ declare function loadTracesConfig(path?: string): Promise<TracesConfig | undefin
1453
1535
  declare function mergeTracesConfig(opts: TraceInvestigationOptions, config?: TracesConfig): TraceInvestigationOptions;
1454
1536
  declare function runTraceInvestigation(opts: TraceInvestigationOptions): Promise<TraceInvestigationResult>;
1455
1537
  declare function runTraceStoreInvestigation(opts: TraceStoreInvestigationOptions): Promise<TraceStoreInvestigationResult>;
1456
- declare function writeTraceImprovementArtifacts(result: Pick<TraceImprovementResult, 'findings' | 'recommendations' | 'proposals' | 'claims' | 'report' | 'replay'>, outDir?: string): Promise<TraceImprovementArtifacts>;
1457
- declare function runTraceImprovementLoop(opts: TraceImprovementOptions): Promise<TraceImprovementResult>;
1538
+ declare function writeTraceImprovementArtifacts(result: Omit<TraceImprovementResult, 'artifacts'>, outDir?: string): Promise<TraceImprovementArtifacts>;
1539
+ declare function runTraceImprovement(opts: TraceImprovementOptions): Promise<TraceImprovementResult>;
1458
1540
  declare function saveReport(path: string, report: string): Promise<void>;
1459
1541
 
1460
1542
  /**
@@ -1530,10 +1612,9 @@ interface SpanRedaction {
1530
1612
  /** Redact every span's attributes + status message. Returns scrubbed spans and
1531
1613
  * an aggregate report (count + per-rule breakdown) over the whole set. */
1532
1614
  declare function redactSpans(spans: readonly OtlpSpan[], rules?: RedactionRule[]): SpanRedaction;
1533
- /** Defense-in-depth: run an external {@link Redactor} (e.g. an ML PII model) over
1534
- * every span's captured `content` (prompt/response prose), catching free-form
1535
- * PII the regex pass misses. Compose AFTER `redactSpans`. Returns scrubbed spans
1536
- * and the number of `content` fields the model changed. */
1615
+ /** Defense-in-depth: run an external {@link Redactor} over captured conversation
1616
+ * and tool values, catching free-form PII the regex pass misses. Compose AFTER
1617
+ * `redactSpans`. Returns scrubbed spans and the number of fields changed. */
1537
1618
  declare function applyRedactor(spans: readonly OtlpSpan[], redactor: Redactor): Promise<{
1538
1619
  spans: OtlpSpan[];
1539
1620
  changed: number;
@@ -1564,12 +1645,8 @@ declare function collectSessions(opts?: CollectOptions): Promise<SessionBatch[]>
1564
1645
  /**
1565
1646
  * Local upload-dedup state.
1566
1647
  *
1567
- * Persists which sessions have been uploaded (keyed by harness:sessionId →
1568
- * content hash) so re-running `upload` over an overlapping window doesn't
1569
- * re-send unchanged sessions. The hash is over the redacted span structure, so
1570
- * a session that has GROWN since last upload re-uploads (new spans), while an
1571
- * unchanged one is skipped. Pairs with the server-side `idempotency-key` for
1572
- * belt-and-suspenders dedup.
1648
+ * Persists the final outbound content hash for each harness/session so an
1649
+ * unchanged upload is skipped while changed spans or privacy modes are sent.
1573
1650
  */
1574
1651
 
1575
1652
  interface UploadRecord {
@@ -1581,9 +1658,15 @@ interface UploadRecord {
1581
1658
  /** Keyed by `${harness}:${sessionId}`. */
1582
1659
  type UploadState = Record<string, UploadRecord>;
1583
1660
  declare function uploadKey(harness: string, sessionId: string): string;
1584
- /** Stable content hash of a session's (redacted) spans — changes iff the
1585
- * session's span set changes, so a grown session re-uploads. */
1661
+ /** Stable content hash of complete spans, including captured values and results. */
1586
1662
  declare function sessionHash(spans: readonly OtlpSpan[]): string;
1663
+ interface UploadIdentity {
1664
+ stripContent: boolean;
1665
+ redactor: string | null;
1666
+ redactionVersion: string;
1667
+ }
1668
+ /** Hash the exact outbound events and the privacy mode that produced them. */
1669
+ declare function outboundHash(events: readonly TraceSpanEvent[], identity: UploadIdentity): string;
1587
1670
  declare function loadState(): Promise<UploadState>;
1588
1671
  declare function saveState(state: UploadState): Promise<void>;
1589
1672
  /** True when this session+hash has already been uploaded. */
@@ -1593,13 +1676,13 @@ declare function alreadyUploaded(state: UploadState, harness: string, sessionId:
1593
1676
  * Upload local coding-session traces to the Tangle Intelligence Platform.
1594
1677
  *
1595
1678
  * Pipeline per session: locate (time window) → parse to OTLP spans → REDACT
1596
- * (PII/secrets) → augment with metadata → dedup (skip unchanged, already-sent
1597
- * sessions) → POST via the hosted `ingestTraces` client. The redaction happens
1679
+ * (PII/secrets) → apply the selected privacy mode → augment with metadata →
1680
+ * dedup the final events → POST via the hosted `ingestTraces` client. Redaction happens
1598
1681
  * before anything leaves the machine; the dedup is local-state + server
1599
1682
  * idempotency-key.
1600
1683
  *
1601
- * `planUpload` is read-only (select + redact + dedup); `executeUpload` does the
1602
- * actual send (or, with `dryRun`, writes the redacted OTLP it *would* send).
1684
+ * `planUpload` is read-only (select + regex redact); `executeUpload` applies
1685
+ * final privacy options, deduplicates, and sends or writes a dry-run preview.
1603
1686
  */
1604
1687
 
1605
1688
  interface UploadItem {
@@ -1607,7 +1690,9 @@ interface UploadItem {
1607
1690
  /** Redacted spans (safe to send). */
1608
1691
  spans: OtlpSpan[];
1609
1692
  redaction: RedactionReport;
1693
+ /** Source-span hash for inspection. Final outbound hashing happens in executeUpload. */
1610
1694
  hash: string;
1695
+ /** Candidate marker retained for API compatibility; final freshness depends on execute options. */
1611
1696
  isNew: boolean;
1612
1697
  }
1613
1698
  interface UploadPlan {
@@ -1616,7 +1701,7 @@ interface UploadPlan {
1616
1701
  sinceMs?: number;
1617
1702
  }
1618
1703
  type PlanOptions = ScanOptions;
1619
- /** Read-only: select sessions in the window, redact, and mark which are new. */
1704
+ /** Read-only: select sessions in the window and apply the built-in regex redaction. */
1620
1705
  declare function planUpload(opts?: PlanOptions): Promise<UploadPlan>;
1621
1706
  /** Map redacted OtlpSpan[] → the hosted TraceSpanEvent[] wire shape, attaching
1622
1707
  * session metadata to the root span(s). */
@@ -1636,22 +1721,27 @@ interface UploadBackend {
1636
1721
  accepted: number;
1637
1722
  }>;
1638
1723
  }
1724
+ declare class PartialUploadError extends Error {
1725
+ readonly sessionKey: string;
1726
+ readonly accepted: number;
1727
+ readonly expected: number;
1728
+ constructor(sessionKey: string, accepted: number, expected: number);
1729
+ }
1639
1730
  interface ExecuteOptions {
1640
1731
  dryRun?: boolean;
1641
1732
  /** Where to write the redacted OTLP-JSONL on a dry run. */
1642
1733
  otlpOut?: string;
1643
1734
  /** Custom sink. Defaults to the hosted Tangle Intelligence client from env. */
1644
1735
  backend?: UploadBackend;
1645
- /** Metadata-only upload: drop captured prompt/response `content` from every
1646
- * span before it leaves the machine (still keeps tool calls, tokens, timing,
1647
- * loop signal). The strongest privacy posture when prose can't leave. */
1736
+ /** Metadata-only upload: drop captured prompt/response/tool values before the
1737
+ * spans leave the machine (still keeps tool names, tokens, timing, and loop signal). */
1648
1738
  stripContent?: boolean;
1649
- /** External PII scrubber applied to `content` AFTER the regex pass — catches
1650
- * free-form PII (names, addresses) the rules miss. Ignored if stripContent. */
1739
+ /** External PII scrubber applied to captured conversation and tool values
1740
+ * AFTER the regex pass. Ignored if stripContent. */
1651
1741
  redactor?: Redactor;
1652
1742
  log?: (msg: string) => void;
1653
1743
  }
1654
- /** Send the NEW items (or, on dryRun, write the redacted OTLP that would send). */
1744
+ /** Send the final, new outbound items (or write their dry-run OTLP). */
1655
1745
  declare function executeUpload(plan: UploadPlan, opts?: ExecuteOptions): Promise<UploadResult>;
1656
1746
 
1657
- export { ACTOR_ATTR, ATTR, type Actor, type AdoptionOptions, type AdoptionReport, AmpAdapter, type AnalyzeOptions, type AnalyzeResult, type BuildPolicyEvidenceOptions, type BuildSessionIndexOptions, type BuildTraceFindingPacketOptions, CODING_REDACTION_RULES, CONTENT_CAP, CORRECTIVE_REACTIONS, ClaudeAdapter, CodexAdapter, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, CopilotAdapter, DEFAULT_HARNESS, type ExecuteOptions, type ExternalAnalysisResult, type ExternalAnalyzer, FactoryAdapter, type FindingStore, ForgeAdapter, GeminiAdapter, type HarnessTraceAdapter, INGEST_SOURCE_CLI, type ImprovementAdapter, type ImprovementAdapterInput, type ImprovementProposal, type InspectSessionIndexOptions, type LiveBatchOptions, type LocateOptions, type ObservedLoop, type ObserverOptions, OpencodeAdapter, type OtlpSpan, type OtlpSpanKind, type OtlpStatusCode, PiAdapter, type PipelineOptions, type PipelineReport, type PlanOptions, type PolicyEvidenceLoopSummary, type PolicyEvidenceRecord, type PolicyEvidenceToolSummary, QwenAdapter, REACTIONS, type Reaction, type ReactionReport, type ReactionSessionReport, type RecommendationWriter, type Redactor, type RepoAttrs, type RepoResolution, type RepoResolutionSource, type RunResult, type RuntimeTrace, type ScanOptions, type ScannedSession, type SessionBatch, type SessionRef, type SpanInput, type SpanRedaction, TRACES_REDACTION_RULES, type TraceClaim, type TraceContextIndex, type TraceContextRoot, type TraceEvidenceExportOptions, type TraceEvidenceExportResult, type TraceEvidenceFormatOption, type TraceEvidenceInputFormat, type TraceEvidenceRow, type TraceFindingPacket, type TraceImprovementArtifacts, type TraceImprovementOptions, type TraceImprovementResult, type TraceIndexedFile, type TraceInspectionArea, type TraceInspectionFinding, type TraceInspectionReport, type TraceInspectionSeverity, type TraceInvestigationOptions, type TraceInvestigationResult, type TraceLiveAction, type TraceLiveActionKind, type TraceLiveAnalysisContext, type TraceLiveAnalyst, type TraceLiveBatch, type TraceLiveEvidence, type TraceLiveFinding, type TraceLiveLoop, type TraceLiveSeverity, type TraceRecommendation, type TraceReplayProof, type TraceSessionIndex, type TraceSessionIndexRow, type TraceStoreInvestigationOptions, type TraceStoreInvestigationResult, type TraceStreamEvent, type TraceStreamOptions, type TraceStreamReplayOptions, type TraceStreamSession, type TracesConfig, type TriggerPair, type UploadBackend, type UploadItem, type UploadPlan, type UploadRecord, type UploadResult, type UploadState, type UserPromptInput, alreadyUploaded, analyzeAdoption, analyzeLiveBatch, analyzeReactions, analyzeSpans, applyRedactor, buildPolicyEvidenceRecord, buildSessionIndex, buildSessionIndexFromRows, buildTraceFindingPacket, capText, classifyLiveActions, classifyReaction, claudeActor, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessions, commandAnalyzer, commandRedactor, countSkillRunsJsonl, cwdMatchesSelection, defaultTraceLiveAnalysts, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, haloAnalyzer, inspectSessionIndex, knownHarnesses, listAdapters, loadState, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeTracesConfig, normalizeRemote, parseIsoToEpochMs, parseSession, parseSince, planUpload, readSessionIndexFile, redactSpans, renderInspectionReport, resolveAdapter, resolveRepoAttrs, resolveSessionRepoAttrs, runCommand, runExternalAnalyzers, runPipelines, runTraceImprovementLoop, runTraceInvestigation, runTraceStoreInvestigation, saveReport, saveState, scanSessions, selectAdapters, serializeInspectionReport, serializePolicyEvidence, serializeSessionIndex, serializeSpans, serializeTraceStreamEvent, sessionHash, span, stampRepoAttrs, stampSpanWorkdirRepoAttrs, streamSessions, textIsSynthetic, toOpenInferenceSpan, toRuntimeStore, toTraceSpanEvents, traceStreamEventsFromSpans, uploadKey, userPromptSpan, watchSessions, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts };
1747
+ export { ACTOR_ATTR, ATTR, type Actor, type AdoptionOptions, type AdoptionReport, AmpAdapter, type AnalyzeOptions, type AnalyzeResult, type BuildPolicyEvidenceOptions, type BuildSessionIndexOptions, type BuildTraceFindingPacketOptions, CODING_REDACTION_RULES, CONTENT_CAP, CORRECTIVE_REACTIONS, ClaudeAdapter, CodexAdapter, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, CopilotAdapter, type CorruptionMode, DEFAULT_HARNESS, EmptySessionError, type ExecuteOptions, type ExternalAnalysisResult, type ExternalAnalyzer, FactoryAdapter, ForgeAdapter, GeminiAdapter, type HarnessTraceAdapter, INGEST_SOURCE_CLI, type InspectSessionIndexOptions, JsonSourceError, type JsonlCorruptionReceipt, JsonlParseError, type JsonlReadOptions, type LiveBatchOptions, type LocateOptions, type ObservedLoop, type ObserverOptions, OpencodeAdapter, type OtlpSpan, type OtlpSpanKind, type OtlpStatusCode, type ParseOptions, PartialUploadError, PiAdapter, type PipelineOptions, type PipelineReport, type PlanOptions, type PolicyEvidenceLoopSummary, type PolicyEvidenceRecord, type PolicyEvidenceToolSummary, QwenAdapter, REACTIONS, type Reaction, type ReactionReport, type ReactionSessionReport, type Redactor, type RepoAttrs, type RepoResolution, type RepoResolutionSource, type RunResult, type RuntimeTrace, type ScanOptions, type ScannedSession, type SessionBatch, type SessionCorruptionReceipt, type SessionIdentityConflict, type SessionIdentityIndex, type SessionIntegrity, type SessionRef, type SpanInput, type SpanRedaction, TRACES_REDACTION_RULES, type TraceContextIndex, type TraceContextRoot, type TraceEvidenceExportOptions, type TraceEvidenceExportResult, type TraceEvidenceFormatOption, type TraceEvidenceInputFormat, type TraceEvidenceRow, type TraceExecutionOptions, type TraceFindingPacket, type TraceImprovementArtifacts, type TraceImprovementOptions, type TraceImprovementResult, type TraceIndexedFile, type TraceInspectionArea, type TraceInspectionFinding, type TraceInspectionReport, type TraceInspectionSeverity, type TraceInvestigationOptions, type TraceInvestigationResult, type TraceLiveAction, type TraceLiveActionKind, type TraceLiveAnalysisContext, type TraceLiveAnalyst, type TraceLiveBatch, type TraceLiveEvidence, type TraceLiveFinding, type TraceLiveLoop, type TraceLiveSeverity, type TraceSessionIndex, type TraceSessionIndexRow, type TraceStoreInvestigationOptions, type TraceStoreInvestigationResult, type TraceStreamEvent, type TraceStreamOptions, type TraceStreamReplayOptions, type TraceStreamSession, type TracesConfig, type TriggerPair, type UploadBackend, type UploadIdentity, type UploadItem, type UploadPlan, type UploadRecord, type UploadResult, type UploadState, type UserPromptInput, alreadyUploaded, analyzeAdoption, analyzeLiveBatch, analyzeReactions, analyzeSpans, applyRedactor, buildPolicyEvidenceRecord, buildSessionIndex, buildSessionIndexFromRows, buildTraceFindingPacket, capText, classifyLiveActions, classifyReaction, claudeActor, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessions, commandAnalyzer, commandRedactor, countSkillRunsJsonl, cwdMatchesSelection, defaultTraceLiveAnalysts, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, haloAnalyzer, indexSessionIdsByTrace, inspectSessionIndex, knownHarnesses, listAdapters, loadState, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeTracesConfig, normalizeRemote, outboundHash, parseIsoToEpochMs, parseSession, parseSince, planUpload, readJsonFile, readJsonl, readSessionIndexFile, recordSessionCorruption, redactSpans, renderInspectionReport, resolveAdapter, resolveRepoAttrs, resolveSessionRepoAttrs, runCommand, runExternalAnalyzers, runPipelines, runTraceImprovement, runTraceInvestigation, runTraceStoreInvestigation, saveReport, saveState, scanSessions, selectAdapters, serializeInspectionReport, serializePolicyEvidence, serializeSessionIndex, serializeSpans, serializeTraceStreamEvent, sessionHash, sessionIdFromAttributes, sessionIntegrityAttributes, span, stampRepoAttrs, stampSessionIdentity, stampSessionIntegrity, stampSpanWorkdirRepoAttrs, streamSessions, summarizeOtlpExecution, summarizeSpanExecution, takeJsonl, textIsSynthetic, toOpenInferenceSpan, toRuntimeStore, toTraceSpanEvents, traceStreamEventsFromSpans, uploadKey, userPromptSpan, watchSessions, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts };