@tangle-network/traces 0.16.3 → 0.17.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/cli.js CHANGED
@@ -31,6 +31,7 @@ import {
31
31
  indexSessionIdsByTrace,
32
32
  inspectSessionIndex,
33
33
  isBridgeMismatchError,
34
+ iterSerializedSpans,
34
35
  knownHarnesses,
35
36
  loadTraceQuestionsFile,
36
37
  loadTracesConfig,
@@ -61,7 +62,6 @@ import {
61
62
  selectAdapters,
62
63
  serializePolicyEvidence,
63
64
  serializeSessionIndex,
64
- serializeSpans,
65
65
  serializeTraceStreamEvent,
66
66
  sessionReportSource,
67
67
  streamSessions,
@@ -83,7 +83,7 @@ import {
83
83
  writeSessionIndexFile,
84
84
  writeTraceEvidenceExportFile,
85
85
  writeTraceQuestionsArtifacts
86
- } from "./chunk-G5KKIQZ6.js";
86
+ } from "./chunk-4QY4U4XW.js";
87
87
 
88
88
  // src/cli.ts
89
89
  import { readFileSync } from "fs";
@@ -1194,7 +1194,7 @@ async function cmdFacts(args) {
1194
1194
  const collected = await collectSpans(args);
1195
1195
  if (collected.spans.length === 0) throw new Error("no spans found for the given selection");
1196
1196
  warnIncompleteWorkflow(collected.workflow);
1197
- const report = buildSessionFactsReport(collected.spans, { harness: collected.harness });
1197
+ const report = buildSessionFactsReport(collected.spans, { harness: collected.harness, includeContent: !args.noContent });
1198
1198
  const unread = report.sessions.filter((facts) => facts.recordSpans === 0);
1199
1199
  if (unread.length > 0) {
1200
1200
  throw new Error(
@@ -1234,7 +1234,7 @@ async function cmdExport(args) {
1234
1234
  return;
1235
1235
  }
1236
1236
  const result = await exportTraceEvidenceFile(args.input, { format, attributes });
1237
- process.stdout.write(serializeSpans(result.spans));
1237
+ for (const line of iterSerializedSpans(result.spans)) process.stdout.write(line);
1238
1238
  }
1239
1239
  async function cmdImportCodeTraceBench(args) {
1240
1240
  if (!args.input) {
@@ -2110,7 +2110,8 @@ Options:
2110
2110
  --window <m> watch/stream: only sessions active in the last N minutes (default 30)
2111
2111
  --min-loop <n> Min identical repeated calls to flag a loop (default 3)
2112
2112
  --dry-run upload: redact + dedup + preview, write OTLP, but do NOT send
2113
- --no-content upload: strip prompt/response text; send metadata only
2113
+ --no-content facts: omit conversation, commands, paths and assignments;
2114
+ upload: strip prompt/response text; send metadata only
2114
2115
  --redactor <cmd> upload: external PII scrubber (JSON array stdin\u2192stdout) after the redaction core
2115
2116
  --yes, -y upload: skip the confirmation prompt
2116
2117
  --version, -v Print the installed traces version
package/dist/index.d.ts CHANGED
@@ -355,9 +355,18 @@ declare const EXPORT_RULE: Readonly<Record<SubstitutedField, ExportRule>>;
355
355
  declare function toOpenInferenceSpan(s: OtlpSpan): Record<string, unknown>;
356
356
  /** Serialize spans to OpenInference JSONL (one complete span per line). This is a
357
357
  * standard OpenInference representation: it feeds our analysts, HALO, and other
358
- * OpenInference tools directly — no per-tool conversion. */
358
+ * OpenInference tools directly — no per-tool conversion.
359
+ *
360
+ * The returned string is the WHOLE export; for span counts whose export can
361
+ * approach V8's maximum string length, iterate {@link iterSerializedSpans}
362
+ * instead so the export never has to exist as one allocation. */
359
363
  declare function serializeSpans(spans: readonly OtlpSpan[]): string;
360
- /** Write spans to an OTLP-JSONL file (a temp file when no path is given). */
364
+ /** Yield the export one span line at a time (each line ends in `\n`), so a
365
+ * writer stays bounded no matter how many spans it is handed. */
366
+ declare function iterSerializedSpans(spans: readonly OtlpSpan[]): Generator<string>;
367
+ /** Write spans to an OTLP-JSONL file (a temp file when no path is given), one
368
+ * bounded chunk at a time — never the whole export as one string, so a
369
+ * session larger than V8's string limit still exports. */
361
370
  declare function writeOtlpFile(spans: readonly OtlpSpan[], outPath?: string): Promise<string>;
362
371
 
363
372
  interface JsonlCorruptionReceipt {
@@ -1870,6 +1879,9 @@ interface AdoptionOptions {
1870
1879
  * passes the cwds of the analyzed sessions. */
1871
1880
  cwds?: readonly string[];
1872
1881
  }
1882
+ /** Pure span evidence. Repository history is added only by analyzeAdoption. */
1883
+ declare function computeAdoption(spans: readonly OtlpSpan[]): AdoptionReport;
1884
+ /** Add only explicitly requested repository history to the same span measurements. */
1873
1885
  declare function analyzeAdoption(spans: readonly OtlpSpan[], opts?: AdoptionOptions): Promise<AdoptionReport>;
1874
1886
 
1875
1887
  type TraceAgenticRouteReasonCode = 'requested-baseline' | 'execution-failures' | 'repeated-tool-loops' | 'corrective-human-feedback';
@@ -3507,6 +3519,66 @@ declare function renderTraceQuestionsReport(result: Omit<TraceQuestionsResult, '
3507
3519
  /** Write `answers.json` and `report.md` next to the trace file the engine read. */
3508
3520
  declare function writeTraceQuestionsArtifacts(result: TraceQuestionsResult, outDir: string): Promise<TraceQuestionsArtifacts>;
3509
3521
 
3522
+ /** Coverage counts refer to observed records, never an assertion that capture was complete. */
3523
+ interface CoveredMeasurement {
3524
+ readonly total: number | null;
3525
+ readonly measured: number;
3526
+ readonly eligible: number;
3527
+ readonly unavailable: string | null;
3528
+ }
3529
+ interface ToolMeasurement {
3530
+ readonly name: string;
3531
+ readonly calls: number;
3532
+ readonly outcomes: {
3533
+ readonly ok: number;
3534
+ readonly error: number;
3535
+ readonly unset: number;
3536
+ };
3537
+ readonly inputBytes: CoveredMeasurement;
3538
+ readonly outputBytes: CoveredMeasurement;
3539
+ /** Recorded call-to-result interval. Not CPU time or model latency; overlaps may occur. */
3540
+ readonly callToResultMs: CoveredMeasurement;
3541
+ readonly spanIds: readonly string[];
3542
+ }
3543
+ interface CompactionMeasurement {
3544
+ readonly spanId: string;
3545
+ readonly at: string;
3546
+ readonly sincePreviousMs: number | null;
3547
+ readonly latencyMs: number | null;
3548
+ readonly tokensBefore: number | null;
3549
+ readonly tokensAfter: number | null;
3550
+ }
3551
+ interface ContentFootprint {
3552
+ readonly spanId: string;
3553
+ readonly field: string;
3554
+ readonly bytes: number;
3555
+ readonly lines: number;
3556
+ readonly entries: number | null;
3557
+ /** Source representation, not the reconstructed full model request. */
3558
+ readonly scope: 'captured-attribute';
3559
+ }
3560
+ interface SessionMeasurements {
3561
+ readonly execution: ExecutionReport | null;
3562
+ readonly adoption: AdoptionReport;
3563
+ readonly relationship: SessionRelationship;
3564
+ readonly tools: readonly ToolMeasurement[];
3565
+ readonly observedSpawns: number;
3566
+ readonly spawnIntervalsMs: readonly {
3567
+ readonly spanId: string;
3568
+ readonly intervalMs: number | null;
3569
+ }[];
3570
+ readonly compactions: SessionFact<readonly CompactionMeasurement[]>;
3571
+ readonly contextFootprints: readonly ContentFootprint[];
3572
+ readonly coverage: {
3573
+ readonly profile: string;
3574
+ readonly materializedResources: string;
3575
+ readonly contextTokens: string;
3576
+ readonly toolTokens: string;
3577
+ readonly compaction: string;
3578
+ readonly semanticAssessments: string;
3579
+ };
3580
+ }
3581
+
3510
3582
  /**
3511
3583
  * Which pull requests a session created, and which it merged.
3512
3584
  *
@@ -3621,6 +3693,12 @@ declare function readPullRequests(spans: readonly OtlpSpan[]): PullRequestReadin
3621
3693
  * {@link SessionFacts.tokenTotal} states that rather than summing the per-turn
3622
3694
  * deltas, which is a different (and smaller) number.
3623
3695
  */
3696
+ /** Cache invalidation key for deterministic measurements and prepared analyst context. */
3697
+ declare const SESSION_FACTS_MEASUREMENT_VERSION = "3";
3698
+ interface SessionFactsOptions {
3699
+ /** Defaults to true for compatibility. False withholds conversation, commands, paths and assignment text. */
3700
+ readonly includeContent?: boolean;
3701
+ }
3624
3702
  declare const SESSION_TOKEN_TOTAL_ATTR = "traces.session.total_tokens";
3625
3703
  /**
3626
3704
  * The first marker an adapter used for a span it created to describe a
@@ -3772,11 +3850,18 @@ interface SessionFacts {
3772
3850
  * Failures that ended at the same instant are `ambiguous`, never guessed.
3773
3851
  */
3774
3852
  readonly firstFailure: FirstFailure;
3853
+ readonly measurements: SessionMeasurements;
3775
3854
  }
3776
3855
  interface SessionFactsReport {
3777
3856
  readonly schemaVersion: 1;
3778
3857
  readonly kind: 'traces.session_facts_report';
3779
3858
  readonly generatedAt: string;
3859
+ readonly measurementVersion: typeof SESSION_FACTS_MEASUREMENT_VERSION;
3860
+ /** SHA-256 of the canonical selected spans, including content, attributes, links and timing. */
3861
+ readonly sourceDigest: string;
3862
+ /** Latest recorded endpoint, not the last time the filesystem was checked. */
3863
+ readonly evidenceThrough: string | null;
3864
+ readonly contentIncluded: boolean;
3780
3865
  readonly harness: string | null;
3781
3866
  readonly spanCount: number;
3782
3867
  readonly sessions: readonly SessionFacts[];
@@ -3786,9 +3871,9 @@ interface SessionFactsReport {
3786
3871
  * Deterministic and free: the same spans always produce the same sheet, and no
3787
3872
  * model, network call, or budget is involved.
3788
3873
  */
3789
- declare function computeSessionFacts(spans: readonly OtlpSpan[]): SessionFacts[];
3874
+ declare function computeSessionFacts(spans: readonly OtlpSpan[], options?: SessionFactsOptions): SessionFacts[];
3790
3875
  /** The facts sheet for a set of spans, as one report. */
3791
- declare function buildSessionFactsReport(spans: readonly OtlpSpan[], options?: {
3876
+ declare function buildSessionFactsReport(spans: readonly OtlpSpan[], options?: SessionFactsOptions & {
3792
3877
  harness?: string | null;
3793
3878
  generatedAt?: string;
3794
3879
  }): SessionFactsReport;
@@ -3834,7 +3919,7 @@ declare function sessionFactsContext(spans: readonly OtlpSpan[], options?: {
3834
3919
  * prepared context changed is a different analyst. Wrapping therefore bumps the
3835
3920
  * version instead of quietly changing what the same version does.
3836
3921
  */
3837
- declare const SESSION_FACTS_VERSION_SUFFIX = "session-facts.2";
3922
+ declare const SESSION_FACTS_VERSION_SUFFIX: string;
3838
3923
  /**
3839
3924
  * Supply the sheet to every definition as prepared context, before the model
3840
3925
  * runs. A definition that already prepares context keeps it; the sheet is
@@ -3976,26 +4061,33 @@ declare function hodoscopeAnalyzer(options?: HodoscopeAnalyzerOptions): External
3976
4061
  * one-shot RLM over the OTLP-JSONL artifact through an OpenAI-compatible
3977
4062
  * bridge (cli-bridge's prime backend, or any `/v1/chat/completions` endpoint).
3978
4063
  *
3979
- * Protocol, in one pass with no tools:
3980
- * 1. The FULL span projection is inlined into the prompt as JSON — prime has
3981
- * no REPL and no trace tools, so unlike the dspy-rlm analysts (which
3982
- * drill via viewSpans/searchTrace) every fact must travel in the prompt.
3983
- * 2. The reply contract is one fenced ```json block of SHORT strings
3984
- * (long strings get corrupted in transport), citing span ids verbatim.
3985
- * 3. A structurally malformed reply gets ONE bounded stateless repair turn
3986
- * carrying the malformed reply plus the contract — never the trajectory —
3987
- * mirroring the typed-adapter repair the dspy arm gets, so both arms face
3988
- * the same structured-output affordance.
3989
- * 4. Cited span ids are resolved against the artifact; rows citing unknown
3990
- * or ambiguous ids are rejected with a recorded reason, never guessed.
3991
- * Zero findings from a well-formed reply is an honest null, not an error.
3992
- *
3993
- * Oversized traces: when the rendered projection exceeds the inline budget it
3994
- * is re-rendered with a per-attribute character cap (the prompt-side analog of
3995
- * the trace store's per-attribute byte cap); if still oversized the run fails
3996
- * loud — inline delivery is the only delivery, so silently dropping spans
3997
- * would understate the trajectory. The delivery decision is recorded in the
3998
- * result output.
4064
+ * Delivery, small traces first:
4065
+ * 1. INLINE — the full span projection is inlined into the prompt as JSON.
4066
+ * Cheap and bridge-portable, but bounded: past `maxInlineChars` the
4067
+ * projection is re-rendered with a per-attribute character cap (the
4068
+ * prompt-side analog of the trace store's per-attribute byte cap).
4069
+ * 2. FILE — when even the capped render overflows the budget, the artifact
4070
+ * is copied into a per-run directory and that directory is passed as
4071
+ * `cwd` on the chat-completions request (cli-bridge starts prime there).
4072
+ * Prime is a recursive language model with a REPL, so the prompt tells
4073
+ * it to load `trajectory.otlp.jsonl` itself and fan out with `rlm()` —
4074
+ * the trajectory travels as a file, not as prompt bytes. A bridged
4075
+ * prime must be able to READ that directory (host-mode bridges do; a
4076
+ * jailed or remote bridge needs the dir registered/uploaded on the
4077
+ * bridge side — cli-bridge's jail already covers its own dirs).
4078
+ *
4079
+ * Reply contract, both modes: one fenced ```json block of SHORT strings
4080
+ * (long strings get corrupted in transport), citing span ids verbatim.
4081
+ * - A structurally malformed reply gets ONE bounded stateless repair turn
4082
+ * carrying the malformed reply plus the contract — never the trajectory —
4083
+ * mirroring the typed-adapter repair the dspy arm gets, so both arms face
4084
+ * the same structured-output affordance.
4085
+ * - Cited span ids are resolved against the artifact in BOTH delivery
4086
+ * modes; rows citing unknown or ambiguous ids are rejected with a recorded
4087
+ * reason, never guessed. Zero findings from a well-formed reply is an
4088
+ * honest null, not an error.
4089
+ *
4090
+ * The delivery decision is recorded in the result output.
3999
4091
  *
4000
4092
  * Usage (bridge-reported token counts and call count) is recorded in the
4001
4093
  * result output; cost stays uncaptured because the bridge reports no priced
@@ -4010,6 +4102,9 @@ interface PrimeTransportRequest {
4010
4102
  role: 'user';
4011
4103
  content: string;
4012
4104
  }>;
4105
+ /** File delivery: the per-run directory the artifact was copied into;
4106
+ * cli-bridge starts prime here, so `trajectory.otlp.jsonl` resolves. */
4107
+ cwd?: string;
4013
4108
  };
4014
4109
  /** Aborts on the analyzer's deadline AND the caller's signal. */
4015
4110
  signal: AbortSignal;
@@ -4035,6 +4130,11 @@ interface PrimeAnalyzerOptions {
4035
4130
  maxInlineChars?: number;
4036
4131
  /** Character cap applied to each attribute on the oversized re-render. */
4037
4132
  perAttributeCharCap?: number;
4133
+ /** How the trajectory reaches prime. `auto` (default) inlines when it fits
4134
+ * the budget and falls back to file delivery when it does not; `file`
4135
+ * always ships the artifact as `cwd` + `trajectory.otlp.jsonl`; `inline`
4136
+ * keeps the legacy refusal when the capped render still overflows. */
4137
+ delivery?: 'auto' | 'file' | 'inline';
4038
4138
  /** Disable the bounded repair turn (one extra call on a malformed reply). */
4039
4139
  repair?: boolean;
4040
4140
  transport?: PrimeTransport;
@@ -4834,4 +4934,4 @@ interface ExecuteOptions {
4834
4934
  /** Send the final, new outbound items (or write their dry-run OTLP). */
4835
4935
  declare function executeUpload(plan: UploadPlan, opts?: ExecuteOptions): Promise<UploadResult>;
4836
4936
 
4837
- export { ACTOR_ATTR, ATTR, type Actor, type AdoptionOptions, type AdoptionReport, AmpAdapter, type AnalysisEngineFromEnvOptions, type AnalyzeOptions, type AnalyzeResult, type AnswerSchema, type AssembleSessionBundleOptions, BLOBS_DIR, type BuildPolicyEvidenceOptions, type BuildSessionIndexOptions, type BuildTraceFindingPacketOptions, CHANGED_FILE_LIST_CAP, CITATION_NORMALIZATION_VERSION, CONTENT_CAP, COORDINATION_LOG_FILE, CORRECTIVE_REACTIONS, type ChangedFileFact, type ChatTrajectory, type ChatTrajectoryMessage, type ChatTrajectoryOptions, ClaudeAdapter, type CodeTraceBenchFileRef, type CodeTraceBenchImportOptions, type CodeTraceBenchImportReceipt, type CodeTraceBenchImportResult, type CodeTraceBenchImportedTrace, type CodeTraceBenchStep, CodexAdapter, CodexExecAdapter, CodexExecStreamError, CodexTaskScopeError, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, type CollectSessionSelectionOptions, type CollectSessionWorkflowOptions, type ConformanceRenderOptions, type CoordinationLog, type CoordinationQuestion, type CoordinationSteer, CopilotAdapter, type CorruptionMode, DEFAULT_ANALYST_MODEL, DEFAULT_ASK_CONCURRENCY, DEFAULT_HARNESS, DEFAULT_SANDBOX_BASE_URL, EMPTY_SPAN_RUN_SNAPSHOT, EXPORT_RULE, EmptySessionError, type EvidenceOnlyVerdict, type ExcludedTurnFact, type ExecuteOptions, type ExportRule, type ExternalAnalysisKind, type ExternalAnalysisPayload, type ExternalAnalysisResult, type ExternalAnalyzer, type ExternalAnalyzerOptions, type ExternalDiscoveryCandidate, FACT_LIST_CAP, FACT_TEXT_CAP, FactoryAdapter, type FailureFollowUp, type FailureFollowUpReport, type FileRunContextReaderOptions, type FinalMessageFact, type FindSessionTextLeaksOptions, type FindingRejectionCounts, type FindingRejectionReasons, type FindingRejectionTally, type FollowUpKind, ForgeAdapter, GeminiAdapter, type HaloAnalyzerOptions, type HaloReasoningEffort, type HarnessTraceAdapter, type HodoscopeAnalyzerOptions, type HodoscopeInput, type HodoscopeMessage, type HodoscopeSourceMapEntry, type HodoscopeTrajectory, INGEST_SOURCE_CLI, INHERITED_SOURCE_ATTR, INHERITED_SPANS_OMITTED_ATTR, INHERITED_SPAN_ATTR, INHERITED_SPAN_COUNT_ATTR, type InheritedSpanSource, type InspectSessionIndexOptions, JsonSourceError, type JsonlCorruptionReceipt, JsonlParseError, type JsonlReadOptions, type LiveBatchOptions, type LocateOptions, type LoopConvergence, type LoopConvergenceReport, type LoopIteration, type LoopTrend, type LoopTrendBasis, MAX_SHELL_DEPTH, MAX_TRACE_QUESTION_CHARS, type ObservedLoop, type ObserverOptions, OpencodeAdapter, type OtlpIngestIssue, type OtlpIngestIssueKind, type OtlpInput, type OtlpInputFile, type OtlpRowConversion, type OtlpSpan, type OtlpSpanKind, type OtlpSpanLink, type OtlpStatusCode, POLICY_EVIDENCE_NOTE, PREPARED_CONTEXT_BYTE_CEILING, type ParentTaskResolution, type ParseOptions, PartialUploadError, PiAdapter, type PiAdapterOptions, type PipelineOptions, type PipelineReport, type PlanOptions, type PolicyEvidenceLoopSummary, type PolicyEvidenceRecord, type PolicyEvidenceToolSummary, type PrimeAnalyzerOptions, type PrimeTransport, type PrimeTransportRequest, type PrimeTransportResponse, type ProjectSessionBundleOptions, type ProjectSessionBundleResult, type PullRequestFact, type PullRequestFacts, type PullRequestReading, QwenAdapter, REACTIONS, RESULT_FILE, RULE, type Reaction, type ReactionReport, type ReactionSessionReport, type RedactSpansOptions, type Redactor, type RefusedSession, type RepoAttrs, type RepoResolution, type RepoResolutionSource, type ResolvedOtlpInput, type RunContextJournal, type RunContextNode, type RunContextResult, type RunContextSnapshot, type RunDiffOptions, type RunDiffReport, type RunDiffSide, type RunResult, type RunWatchSnapshot, type RunWatchTarget, type RuntimeTrace, SESSION_FACTS_VERSION_SUFFIX, SESSION_TOKEN_TOTAL_ATTR, SOURCE_ATTRIBUTE_PREFIX, SPAN_SYNTHESIZED_ATTR, SPAWN_JOURNAL_FILE, STATUS_MARK, SYNTHESIZED_SOURCE_ATTR, SYNTHESIZED_SPAN_ATTR, type SandboxReplayBackendOptions, type ScanOptions, type ScannedSession, type SessionBatch, type SessionBundleAbsence, type SessionBundleCarriedSignatures, type SessionBundleExclusion, type SessionBundleExclusionRule, type SessionBundleFile, type SessionBundleIssue, type SessionBundleIssueKind, type SessionBundleLeakCheck, type SessionBundleLedgerSlice, type SessionBundleManifest, type SessionBundleProjection, type SessionBundleResult, type SessionBundleSliceRule, type SessionBundleVerification, type SessionBundleView, type SessionCorruptionReceipt, type SessionEnvironment, type SessionFact, type SessionFacts, type SessionFactsReport, type SessionIdentityConflict, type SessionIdentityIndex, type SessionIntegrity, type SessionRef, type SessionRelationship, type SessionRole, type SessionSeedGroup, type SessionSelection, type SessionSelectionRow, type SessionSourceFile, type SessionTextLeak, type SessionTextLeakReport, type SessionTurnFact, type SessionWorkflow, SessionWorkflowError, type SessionWorkflowErrorCode, type SessionWorkflowIssue, type SessionWorkflowSession, type SessionWorkflowSummary, type SkippedAnalysis, type SkippedInputFile, type SourceRecordReference, type SpanInput, type SpanNodeStatus, type SpanRedaction, type SpanRunNode, type SpanRunSnapshot, type SpanStructure, type SpawnedChildResolution, type SpendRoll, type SteeringChainReport, type SteeringEdge, type SubagentSpawnFact, TRACE_QUESTION_PREVIEW_HEAD_CHARS, type TraceAgenticRoute, type TraceAgenticRouteReason, type TraceAgenticRouteReasonCode, 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 TraceQuestion, type TraceQuestionAnswer, type TraceQuestionCitation, type TraceQuestionFailureKind, type TraceQuestionTrace, type TraceQuestionsArtifacts, type TraceQuestionsOptions, type TraceQuestionsResult, type TraceQuestionsTotals, type TraceSessionIndex, type TraceSessionIndexRow, type TraceStoreInvestigationOptions, type TraceStoreInvestigationResult, type TraceStreamEvent, type TraceStreamOptions, type TraceStreamReplayOptions, type TraceStreamSession, type TracesConfig, type TriggerPair, type TurnActorCount, type UnavailableCapabilities, type UploadBackend, type UploadIdentity, type UploadItem, type UploadPlan, type UploadRecord, type UploadResult, type UploadState, type UserPromptInput, type VerifySafeOptions, type VerifySafeResult, type WatchRunTargetOptions, ZERO_ROLL, type ZaiChatCallerOptions, addSpend, alreadyUploaded, analysisEngineFromEnv, analyzeAdoption, analyzeLiveBatch, analyzeLoopConvergence, analyzeReactions, analyzeSpans, analyzeSteeringChain, answerSchemaErrors, applyRedactor, assembleSessionBundle, assertAnswerSchema, assertSandboxReachable, assessSpans, buildPolicyEvidenceRecord, buildSessionFactsReport, buildSessionIndex, buildSessionIndexFromRows, buildSpanRunTree, buildTraceFindingPacket, capText, chatTrajectoryToSpans, classifyEvidenceOnlyPath, classifyFailureFollowUps, classifyLiveActions, classifyReaction, claudeActor, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessionSelection, collectSessionWorkflow, collectSessions, commandAnalyzer, commandRedactor, commandTextFromInput, computeSessionFacts, conformanceOfSpans, connectors, countSkillRunsJsonl, createBundleSourceReader, createFindingRejectionTally, cwdMatchesSelection, cwdMatchesSelectionResolved, defaultTraceLiveAnalysts, describeSessionRelationship, diffRuns, engineCallReservationFloorUsd, environmentAttributes, environmentFromSpanAttributes, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, externalFailureMessage, fileRunContextSupervisorRunReader, fileSha256, findContextRoot, findSessionTextLeaks, findSpanSourceFiles, findingRejection, findingRejectionDetail, forEachTreeNode, formatFindingRejections, formatVerdict, haloAnalyzer, hashSessionBundleFiles, hodoscopeAnalyzer, httpJsonTransport, importCodeTraceBench, incompleteInputsNote, indexSessionIdsByTrace, inferRole, inferSpanKind, inspectSessionIndex, int, isBridgeMismatchError, isChatTrajectory, isChatTrajectoryMessage, isFileRunContextDir, isInheritedSpan, isSynthesizedSpan, knownHarnesses, listAdapters, listSessionBundleFiles, loadState, loadTraceQuestionsFile, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeRolls, mergeTracesConfig, ms, normalizeAnalystCitations, normalizeRemote, normalizeTraceQuestions, otlpRowToSpan, outboundHash, parseIsoToEpochMs, parseJsonAnswer, parseSession, parseSince, planTraceAgenticRoute, planUpload, primeAnalyzer, projectSessionBundle, readCoordinationLog, readFileRunContext, readJsonFile, readJsonl, readOtlpInput, readPullRequests, readRunContextJournal, readRunContextSnapshot, readRunSide, readRunWatchSnapshot, readSessionBundleManifest, readSessionIndexFile, readSpanRunSnapshot, recordSessionCorruption, redactSpans, renderConformance, renderInspectionReport, renderRunContextSnapshot, renderRunDiff, renderRunWatchSnapshot, renderSessionFacts, renderSessionFactsContext, renderSpanRunSnapshot, renderTraceQuestionInstructions, renderTraceQuestionPrompt, renderTraceQuestionsReport, renderValidation, resolveAdapter, resolveOtlpInputFiles, resolveRepoAttrs, resolveRunContextDir, resolveRunWatchTarget, resolveSessionRepoAttrs, runCommand, runExternalAnalyzers, runPipelines, runTotals, runTraceImprovement, runTraceInvestigation, runTraceQuestions, runTraceStoreInvestigation, sandboxReplayBackend, saveReport, saveState, scanSessions, selectAdapters, serializeInspectionReport, serializePolicyEvidence, serializeSessionIndex, serializeSpans, serializeTraceStreamEvent, sessionFactsContext, sessionHash, sessionIdFromAttributes, sessionIntegrityAttributes, sessionTextSignatures, shellCommands, skippedAnalyses, span, spanRunTotals, stampEnvironmentAttrs, stampRepoAttrs, stampSessionIdentity, stampSessionIntegrity, stampSpanWorkdirRepoAttrs, streamSessions, summarizeOtlpExecution, summarizeSpanExecution, summarizeSpanStructure, takeJsonl, textIsSynthetic, toOpenInferenceSpan, toRuntimeStore, toTraceSpanEvents, tokens, totalAgenticFailureMessage, totalFindingRejections, traceAgenticKinds, traceCitationsInText, traceStreamEventsFromSpans, unavailableCapabilities, uploadKey, usd, userPromptSpan, validateOtlpSpans, validationExitCode, verdictExitCode, verifyFindingsInSandbox, verifySafe, verifySessionBundle, watchRunTarget, watchSessions, withSessionFactsContext, wrap, writeHodoscopeInput, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionBundleManifest, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts, writeTraceQuestionsArtifacts, zaiChatCaller, zeroPricedCost };
4937
+ export { ACTOR_ATTR, ATTR, type Actor, type AdoptionOptions, type AdoptionReport, AmpAdapter, type AnalysisEngineFromEnvOptions, type AnalyzeOptions, type AnalyzeResult, type AnswerSchema, type AssembleSessionBundleOptions, BLOBS_DIR, type BuildPolicyEvidenceOptions, type BuildSessionIndexOptions, type BuildTraceFindingPacketOptions, CHANGED_FILE_LIST_CAP, CITATION_NORMALIZATION_VERSION, CONTENT_CAP, COORDINATION_LOG_FILE, CORRECTIVE_REACTIONS, type ChangedFileFact, type ChatTrajectory, type ChatTrajectoryMessage, type ChatTrajectoryOptions, ClaudeAdapter, type CodeTraceBenchFileRef, type CodeTraceBenchImportOptions, type CodeTraceBenchImportReceipt, type CodeTraceBenchImportResult, type CodeTraceBenchImportedTrace, type CodeTraceBenchStep, CodexAdapter, CodexExecAdapter, CodexExecStreamError, CodexTaskScopeError, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, type CollectSessionSelectionOptions, type CollectSessionWorkflowOptions, type CompactionMeasurement, type ConformanceRenderOptions, type ContentFootprint, type CoordinationLog, type CoordinationQuestion, type CoordinationSteer, CopilotAdapter, type CorruptionMode, type CoveredMeasurement, DEFAULT_ANALYST_MODEL, DEFAULT_ASK_CONCURRENCY, DEFAULT_HARNESS, DEFAULT_SANDBOX_BASE_URL, EMPTY_SPAN_RUN_SNAPSHOT, EXPORT_RULE, EmptySessionError, type EvidenceOnlyVerdict, type ExcludedTurnFact, type ExecuteOptions, type ExportRule, type ExternalAnalysisKind, type ExternalAnalysisPayload, type ExternalAnalysisResult, type ExternalAnalyzer, type ExternalAnalyzerOptions, type ExternalDiscoveryCandidate, FACT_LIST_CAP, FACT_TEXT_CAP, FactoryAdapter, type FailureFollowUp, type FailureFollowUpReport, type FileRunContextReaderOptions, type FinalMessageFact, type FindSessionTextLeaksOptions, type FindingRejectionCounts, type FindingRejectionReasons, type FindingRejectionTally, type FollowUpKind, ForgeAdapter, GeminiAdapter, type HaloAnalyzerOptions, type HaloReasoningEffort, type HarnessTraceAdapter, type HodoscopeAnalyzerOptions, type HodoscopeInput, type HodoscopeMessage, type HodoscopeSourceMapEntry, type HodoscopeTrajectory, INGEST_SOURCE_CLI, INHERITED_SOURCE_ATTR, INHERITED_SPANS_OMITTED_ATTR, INHERITED_SPAN_ATTR, INHERITED_SPAN_COUNT_ATTR, type InheritedSpanSource, type InspectSessionIndexOptions, JsonSourceError, type JsonlCorruptionReceipt, JsonlParseError, type JsonlReadOptions, type LiveBatchOptions, type LocateOptions, type LoopConvergence, type LoopConvergenceReport, type LoopIteration, type LoopTrend, type LoopTrendBasis, MAX_SHELL_DEPTH, MAX_TRACE_QUESTION_CHARS, type ObservedLoop, type ObserverOptions, OpencodeAdapter, type OtlpIngestIssue, type OtlpIngestIssueKind, type OtlpInput, type OtlpInputFile, type OtlpRowConversion, type OtlpSpan, type OtlpSpanKind, type OtlpSpanLink, type OtlpStatusCode, POLICY_EVIDENCE_NOTE, PREPARED_CONTEXT_BYTE_CEILING, type ParentTaskResolution, type ParseOptions, PartialUploadError, PiAdapter, type PiAdapterOptions, type PipelineOptions, type PipelineReport, type PlanOptions, type PolicyEvidenceLoopSummary, type PolicyEvidenceRecord, type PolicyEvidenceToolSummary, type PrimeAnalyzerOptions, type PrimeTransport, type PrimeTransportRequest, type PrimeTransportResponse, type ProjectSessionBundleOptions, type ProjectSessionBundleResult, type PullRequestFact, type PullRequestFacts, type PullRequestReading, QwenAdapter, REACTIONS, RESULT_FILE, RULE, type Reaction, type ReactionReport, type ReactionSessionReport, type RedactSpansOptions, type Redactor, type RefusedSession, type RepoAttrs, type RepoResolution, type RepoResolutionSource, type ResolvedOtlpInput, type RunContextJournal, type RunContextNode, type RunContextResult, type RunContextSnapshot, type RunDiffOptions, type RunDiffReport, type RunDiffSide, type RunResult, type RunWatchSnapshot, type RunWatchTarget, type RuntimeTrace, SESSION_FACTS_MEASUREMENT_VERSION, SESSION_FACTS_VERSION_SUFFIX, SESSION_TOKEN_TOTAL_ATTR, SOURCE_ATTRIBUTE_PREFIX, SPAN_SYNTHESIZED_ATTR, SPAWN_JOURNAL_FILE, STATUS_MARK, SYNTHESIZED_SOURCE_ATTR, SYNTHESIZED_SPAN_ATTR, type SandboxReplayBackendOptions, type ScanOptions, type ScannedSession, type SessionBatch, type SessionBundleAbsence, type SessionBundleCarriedSignatures, type SessionBundleExclusion, type SessionBundleExclusionRule, type SessionBundleFile, type SessionBundleIssue, type SessionBundleIssueKind, type SessionBundleLeakCheck, type SessionBundleLedgerSlice, type SessionBundleManifest, type SessionBundleProjection, type SessionBundleResult, type SessionBundleSliceRule, type SessionBundleVerification, type SessionBundleView, type SessionCorruptionReceipt, type SessionEnvironment, type SessionFact, type SessionFacts, type SessionFactsOptions, type SessionFactsReport, type SessionIdentityConflict, type SessionIdentityIndex, type SessionIntegrity, type SessionMeasurements, type SessionRef, type SessionRelationship, type SessionRole, type SessionSeedGroup, type SessionSelection, type SessionSelectionRow, type SessionSourceFile, type SessionTextLeak, type SessionTextLeakReport, type SessionTurnFact, type SessionWorkflow, SessionWorkflowError, type SessionWorkflowErrorCode, type SessionWorkflowIssue, type SessionWorkflowSession, type SessionWorkflowSummary, type SkippedAnalysis, type SkippedInputFile, type SourceRecordReference, type SpanInput, type SpanNodeStatus, type SpanRedaction, type SpanRunNode, type SpanRunSnapshot, type SpanStructure, type SpawnedChildResolution, type SpendRoll, type SteeringChainReport, type SteeringEdge, type SubagentSpawnFact, TRACE_QUESTION_PREVIEW_HEAD_CHARS, type ToolMeasurement, type TraceAgenticRoute, type TraceAgenticRouteReason, type TraceAgenticRouteReasonCode, 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 TraceQuestion, type TraceQuestionAnswer, type TraceQuestionCitation, type TraceQuestionFailureKind, type TraceQuestionTrace, type TraceQuestionsArtifacts, type TraceQuestionsOptions, type TraceQuestionsResult, type TraceQuestionsTotals, type TraceSessionIndex, type TraceSessionIndexRow, type TraceStoreInvestigationOptions, type TraceStoreInvestigationResult, type TraceStreamEvent, type TraceStreamOptions, type TraceStreamReplayOptions, type TraceStreamSession, type TracesConfig, type TriggerPair, type TurnActorCount, type UnavailableCapabilities, type UploadBackend, type UploadIdentity, type UploadItem, type UploadPlan, type UploadRecord, type UploadResult, type UploadState, type UserPromptInput, type VerifySafeOptions, type VerifySafeResult, type WatchRunTargetOptions, ZERO_ROLL, type ZaiChatCallerOptions, addSpend, alreadyUploaded, analysisEngineFromEnv, analyzeAdoption, analyzeLiveBatch, analyzeLoopConvergence, analyzeReactions, analyzeSpans, analyzeSteeringChain, answerSchemaErrors, applyRedactor, assembleSessionBundle, assertAnswerSchema, assertSandboxReachable, assessSpans, buildPolicyEvidenceRecord, buildSessionFactsReport, buildSessionIndex, buildSessionIndexFromRows, buildSpanRunTree, buildTraceFindingPacket, capText, chatTrajectoryToSpans, classifyEvidenceOnlyPath, classifyFailureFollowUps, classifyLiveActions, classifyReaction, claudeActor, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessionSelection, collectSessionWorkflow, collectSessions, commandAnalyzer, commandRedactor, commandTextFromInput, computeAdoption, computeSessionFacts, conformanceOfSpans, connectors, countSkillRunsJsonl, createBundleSourceReader, createFindingRejectionTally, cwdMatchesSelection, cwdMatchesSelectionResolved, defaultTraceLiveAnalysts, describeSessionRelationship, diffRuns, engineCallReservationFloorUsd, environmentAttributes, environmentFromSpanAttributes, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, externalFailureMessage, fileRunContextSupervisorRunReader, fileSha256, findContextRoot, findSessionTextLeaks, findSpanSourceFiles, findingRejection, findingRejectionDetail, forEachTreeNode, formatFindingRejections, formatVerdict, haloAnalyzer, hashSessionBundleFiles, hodoscopeAnalyzer, httpJsonTransport, importCodeTraceBench, incompleteInputsNote, indexSessionIdsByTrace, inferRole, inferSpanKind, inspectSessionIndex, int, isBridgeMismatchError, isChatTrajectory, isChatTrajectoryMessage, isFileRunContextDir, isInheritedSpan, isSynthesizedSpan, iterSerializedSpans, knownHarnesses, listAdapters, listSessionBundleFiles, loadState, loadTraceQuestionsFile, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeRolls, mergeTracesConfig, ms, normalizeAnalystCitations, normalizeRemote, normalizeTraceQuestions, otlpRowToSpan, outboundHash, parseIsoToEpochMs, parseJsonAnswer, parseSession, parseSince, planTraceAgenticRoute, planUpload, primeAnalyzer, projectSessionBundle, readCoordinationLog, readFileRunContext, readJsonFile, readJsonl, readOtlpInput, readPullRequests, readRunContextJournal, readRunContextSnapshot, readRunSide, readRunWatchSnapshot, readSessionBundleManifest, readSessionIndexFile, readSpanRunSnapshot, recordSessionCorruption, redactSpans, renderConformance, renderInspectionReport, renderRunContextSnapshot, renderRunDiff, renderRunWatchSnapshot, renderSessionFacts, renderSessionFactsContext, renderSpanRunSnapshot, renderTraceQuestionInstructions, renderTraceQuestionPrompt, renderTraceQuestionsReport, renderValidation, resolveAdapter, resolveOtlpInputFiles, resolveRepoAttrs, resolveRunContextDir, resolveRunWatchTarget, resolveSessionRepoAttrs, runCommand, runExternalAnalyzers, runPipelines, runTotals, runTraceImprovement, runTraceInvestigation, runTraceQuestions, runTraceStoreInvestigation, sandboxReplayBackend, saveReport, saveState, scanSessions, selectAdapters, serializeInspectionReport, serializePolicyEvidence, serializeSessionIndex, serializeSpans, serializeTraceStreamEvent, sessionFactsContext, sessionHash, sessionIdFromAttributes, sessionIntegrityAttributes, sessionTextSignatures, shellCommands, skippedAnalyses, span, spanRunTotals, stampEnvironmentAttrs, stampRepoAttrs, stampSessionIdentity, stampSessionIntegrity, stampSpanWorkdirRepoAttrs, streamSessions, summarizeOtlpExecution, summarizeSpanExecution, summarizeSpanStructure, takeJsonl, textIsSynthetic, toOpenInferenceSpan, toRuntimeStore, toTraceSpanEvents, tokens, totalAgenticFailureMessage, totalFindingRejections, traceAgenticKinds, traceCitationsInText, traceStreamEventsFromSpans, unavailableCapabilities, uploadKey, usd, userPromptSpan, validateOtlpSpans, validationExitCode, verdictExitCode, verifyFindingsInSandbox, verifySafe, verifySessionBundle, watchRunTarget, watchSessions, withSessionFactsContext, wrap, writeHodoscopeInput, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionBundleManifest, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts, writeTraceQuestionsArtifacts, zaiChatCaller, zeroPricedCost };
package/dist/index.js CHANGED
@@ -44,6 +44,7 @@ import {
44
44
  REACTIONS,
45
45
  RESULT_FILE,
46
46
  RULE,
47
+ SESSION_FACTS_MEASUREMENT_VERSION,
47
48
  SESSION_FACTS_VERSION_SUFFIX,
48
49
  SESSION_TOKEN_TOTAL_ATTR,
49
50
  SOURCE_ATTRIBUTE_PREFIX,
@@ -91,6 +92,7 @@ import {
91
92
  commandAnalyzer,
92
93
  commandRedactor,
93
94
  commandTextFromInput,
95
+ computeAdoption,
94
96
  computeSessionFacts,
95
97
  conformanceOfSpans,
96
98
  connectors,
@@ -138,6 +140,7 @@ import {
138
140
  isFileRunContextDir,
139
141
  isInheritedSpan,
140
142
  isSynthesizedSpan,
143
+ iterSerializedSpans,
141
144
  knownHarnesses,
142
145
  listAdapters,
143
146
  listSessionBundleFiles,
@@ -267,7 +270,7 @@ import {
267
270
  writeTraceQuestionsArtifacts,
268
271
  zaiChatCaller,
269
272
  zeroPricedCost
270
- } from "./chunk-G5KKIQZ6.js";
273
+ } from "./chunk-4QY4U4XW.js";
271
274
 
272
275
  // src/collect.ts
273
276
  async function collectSessions(opts = {}) {
@@ -345,6 +348,7 @@ export {
345
348
  REACTIONS,
346
349
  RESULT_FILE,
347
350
  RULE,
351
+ SESSION_FACTS_MEASUREMENT_VERSION,
348
352
  SESSION_FACTS_VERSION_SUFFIX,
349
353
  SESSION_TOKEN_TOTAL_ATTR,
350
354
  SOURCE_ATTRIBUTE_PREFIX,
@@ -395,6 +399,7 @@ export {
395
399
  commandAnalyzer,
396
400
  commandRedactor,
397
401
  commandTextFromInput,
402
+ computeAdoption,
398
403
  computeSessionFacts,
399
404
  conformanceOfSpans,
400
405
  connectors,
@@ -444,6 +449,7 @@ export {
444
449
  isFileRunContextDir,
445
450
  isInheritedSpan,
446
451
  isSynthesizedSpan,
452
+ iterSerializedSpans,
447
453
  knownHarnesses,
448
454
  listAdapters,
449
455
  listSessionBundleFiles,
@@ -353,8 +353,12 @@ Hodoscope always returns `discovery`, and each candidate has `status: 'needs_rev
353
353
  ### Prime engine
354
354
 
355
355
  `--analyzer prime` runs a one-shot analyst over the emitted OTLP artifact through an OpenAI-compatible bridge, such as cli-bridge's prime backend.
356
- Unlike the `--llm` analysts, which drill into the trace with paged tools, prime has no REPL and no trace tools: the full span projection is inlined into a single prompt as JSON.
357
- Oversized projections are re-rendered with a per-attribute character cap; if the projection still exceeds the inline budget the engine fails loud instead of silently dropping spans.
356
+ Unlike the `--llm` analysts, which drill into the trace with paged tools, prime is a recursive language model with its own REPL, so the trajectory reaches it one of two ways:
357
+
358
+ - **Inline (small traces):** the full span projection is inlined into a single prompt as JSON. Oversized projections are re-rendered with a per-attribute character cap.
359
+ - **File (large traces):** when even the capped projection exceeds the inline budget, the artifact is copied into a per-run directory, that directory is sent as `cwd` on the chat-completions request (cli-bridge starts prime there), and the prompt tells prime to load `trajectory.otlp.jsonl` itself and fan out with `rlm()` — so the trajectory travels as a readable file, not prompt bytes, and no trace is refused for size. The bridge must be able to read that directory: host-mode bridges do by construction; a jailed or remote bridge needs the directory registered or uploaded on the bridge side.
360
+
361
+ Span-id grounding is identical in both modes: every cited id is validated against the artifact, and the delivery decision is recorded in the result output.
358
362
 
359
363
  Prerequisites:
360
364
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tangle-network/traces",
3
- "version": "0.16.3",
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.",
3
+ "version": "0.17.0",
4
+ "description": "Point it at your coding-agent session traces (Claude Code, Codex, OpenCode, Gemini, Pi, \u2026) and get failure-mode + efficiency findings. CLI + SDK over the @tangle-network/agent-eval analyst suite \u2014 observe live sessions, run your own analysts, redact, and upload to the Tangle Intelligence Platform.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -61,11 +61,11 @@
61
61
  "prepublishOnly": "pnpm check:source && pnpm build && pnpm check:package"
62
62
  },
63
63
  "dependencies": {
64
- "@tangle-network/agent-eval": "0.197.0",
65
- "@tangle-network/agent-interface": "2.12.0",
66
- "@tangle-network/agent-runtime": "0.277.0",
67
- "@tangle-network/agent-trace-contract": "1.3.0",
68
- "@tangle-network/sandbox": "0.45.0"
64
+ "@tangle-network/agent-eval": "0.205.1",
65
+ "@tangle-network/agent-interface": "2.17.0",
66
+ "@tangle-network/agent-runtime": "0.293.0",
67
+ "@tangle-network/agent-trace-contract": "2.0.0",
68
+ "@tangle-network/sandbox": "0.60.10"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/node": "^22.20.4",
@@ -9,37 +9,30 @@ Use the deterministic CLI first; keep inspection local and read-only.
9
9
 
10
10
  ## Choose the way in
11
11
 
12
- If the trace is already OTLP (any `@tangle-network/agent-trace-contract` emitter or other
13
- conforming exporter), read it directly. No adapter is involved.
12
+ Read conforming OTLP directly, including `@tangle-network/agent-trace-contract` exports.
14
13
 
15
14
  ```bash
16
- traces validate spans.otlp.jsonl # what can this trace answer? exit 1 on error findings
15
+ traces validate spans.otlp.jsonl # exit 1 on error findings
17
16
  traces analyze --otlp spans.otlp.jsonl --out .traces/current.md
18
17
  traces analyze --otlp results/sessions --out .traces/all.md # a directory of exports
19
18
  ```
20
19
 
21
- Use `--harness` only for coding agents whose on-disk format we do not control.
22
- Those adapters are the legacy edge, not the way to integrate a system you own.
20
+ Use `--harness` for native coding-agent formats; integrate systems you own through OTLP.
23
21
 
24
- In a run directory only the OTLP files are read; other `*.jsonl` logs are listed with
25
- what they hold. An `otlp/` subdirectory, when present, is read on its own.
22
+ Directories read only OTLP files, preferring an `otlp/` subdirectory; other JSONL logs are listed separately.
26
23
 
27
- A section headed `inputs incomplete`, or carrying an `Inputs incomplete` line above its
28
- table, is computed from a field the trace does not carry everywhere. Report those numbers
29
- as uncaptured, never as zero spend. The `trace conformance` section names each such
30
- capability once; the markers repeat it at the number.
24
+ Report `Inputs incomplete` values as uncaptured, never zero spend.
25
+ The `trace conformance` section lists missing capabilities.
31
26
 
32
- For a loop trace, read `round-over-round convergence` (did round N+1 improve on N) and
33
- `steering chain` (which verdict caused which retry) before drawing any conclusion about
34
- whether the agent was making progress.
27
+ For loops, inspect `round-over-round convergence` and `steering chain` before judging progress.
35
28
 
36
29
  ## Select the workflow
37
30
 
38
31
  ```bash
39
32
  traces --version
40
33
  traces list --harness codex --cwd "$PWD"
41
- traces analyze --harness codex --current --latest-turn --workflow \
42
- --out .traces/current.md
34
+ traces facts --harness codex --current --latest-turn --workflow \
35
+ --format text --out .traces/current-facts.txt
43
36
  ```
44
37
 
45
38
  - Use `--current` for the active Codex session.
@@ -50,6 +43,19 @@ traces analyze --harness codex --current --latest-turn --workflow \
50
43
  - For Claude Code, use `--harness claude-code --session <path> --latest-turn`; nested subagents are included.
51
44
 
52
45
  Never join agents by display name or timestamp when Traces reports missing or conflicting IDs.
46
+ Read facts before full transcripts or analysis.
47
+ Check parent and worker counts against the task being investigated.
48
+ Run `analyze` only for questions the facts sheet cannot answer:
49
+
50
+ ```bash
51
+ traces analyze --harness codex --current --latest-turn --workflow \
52
+ --out .traces/current.md
53
+ ```
54
+
55
+ For moved evidence, keep byte-identical transcripts and record their source paths and hashes.
56
+ Preserve Claude's `<session UUID>/subagents/workflows/<run ID>` subtree beside the copied parent JSONL file.
57
+ Restore missing child files from the source; rewriting recorded paths loses the original evidence.
58
+ Check current branches, edits, commits, and PRs before reporting unfinished work; transcripts describe past actions.
53
59
 
54
60
  ## Export
55
61
 
@@ -70,41 +76,37 @@ traces improve --harness codex --current --latest-turn --workflow \
70
76
  `improve` writes findings, evidence, a report, and spans.
71
77
  It edits no agent, repository, memory store, or knowledge base.
72
78
 
73
- Write one session's durable evidence directory for a later reader:
79
+ Preserve a session for later inspection:
74
80
 
75
81
  ```bash
76
82
  traces bundle --harness claude-code --session <id-or-path> --out .traces/bundle
77
83
  ```
78
84
 
79
- `bundle` copies the transcript, the derived report and spans, the `.evolve` ledger rows inside the session window, and a `manifest.json` with a SHA-256 per file.
80
- It spends no model call.
81
- A missing transcript stops the assembly; an absent optional input is recorded in `manifest.absent` with the probed path.
85
+ `bundle` copies transcripts, report, spans, and session-window `.evolve` rows with per-file SHA-256 hashes.
86
+ It uses no model calls.
87
+ Missing transcripts stop assembly; optional missing inputs appear in `manifest.absent`.
82
88
 
83
89
  ## Pick the view for the reader
84
90
 
85
- That bundle is the FULL view (`manifest.view: "full"`) and holds the whole session transcript.
86
- Never give it to a writer that must not see an earlier conclusion: the transcript holds the text of every file the session wrote, so a check for the earlier report FILE passes while its CONTENT is still readable.
87
-
88
- Project the writer's copy instead:
91
+ The full bundle includes transcripts containing prior reports, even when report files are removed.
92
+ For a writer who must not see earlier conclusions, project an evidence-only copy:
89
93
 
90
94
  ```bash
91
95
  traces bundle-view .traces/bundle --view evidence-only --out .traces/writer
92
96
  ```
93
97
 
94
- It carries `derived/session-index.json`, `derived/evidence.jsonl`, and the structured `ledger/` records.
95
- It excludes the transcripts, report, spans, and every prose ledger file by name, with the rules and hashes in `manifest.excluded`.
96
- It also drops any carried file that repeats an 8-word run of prose from an excluded one.
97
- `manifest.view` names which copy you hold.
98
+ This retains the session index, evidence JSONL, and structured ledger records.
99
+ It excludes transcripts, reports, spans, prose ledgers, and files repeating an eight-word passage from excluded prose.
100
+ Check `manifest.view` and the rules and hashes in `manifest.excluded`.
98
101
 
99
102
  ## Ask your own question
100
103
 
101
- `traces ask --last 1 --question "<text>" --budget 2 --dir .traces/ask` keeps the engine's
102
- prose answer, resolves every `trace://` citation in it, and spends model calls to do it.
104
+ `traces ask --last 1 --question "<text>" --budget 2 --dir .traces/ask` spends model calls and resolves answer citations.
103
105
 
104
106
  ## Report
105
107
 
106
108
  - State the source (`--otlp <path>` or the harness), selected task boundary, session and span counts, and integrity warnings.
107
- - State which capabilities the trace could not support, and name the analyses that reported nothing because of it.
109
+ - Name missing capabilities and analyses affected by them.
108
110
  - Cite each finding with its exact `trace://` reference.
109
111
  - Mark missing outcome, cost, token, skill, or relationship data unknown.
110
112
  - Do not infer task success from a completion message.
@@ -1,76 +0,0 @@
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.