@tangle-network/traces 0.9.18 → 0.10.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/README.md +6 -2
- package/dist/{chunk-F2OEMHVZ.js → chunk-7BQ2CVEA.js} +1155 -460
- package/dist/cli.js +107 -16
- package/dist/index.d.ts +95 -9
- package/dist/index.js +3 -1
- package/package.json +2 -3
package/dist/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
exportTraceEvidenceFile,
|
|
15
15
|
haloAnalyzer,
|
|
16
16
|
hodoscopeAnalyzer,
|
|
17
|
+
importCodeTraceBench,
|
|
17
18
|
indexSessionIdsByTrace,
|
|
18
19
|
inspectSessionIndex,
|
|
19
20
|
knownHarnesses,
|
|
@@ -43,7 +44,7 @@ import {
|
|
|
43
44
|
writePolicyEvidenceFile,
|
|
44
45
|
writeSessionIndexFile,
|
|
45
46
|
writeTraceEvidenceExportFile
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-7BQ2CVEA.js";
|
|
47
48
|
|
|
48
49
|
// src/cli.ts
|
|
49
50
|
import { readFileSync } from "fs";
|
|
@@ -57,8 +58,9 @@ import {
|
|
|
57
58
|
renderSupervisorRunMarkdown,
|
|
58
59
|
rollupSupervisorRuns
|
|
59
60
|
} from "@tangle-network/agent-eval/supervisor-run";
|
|
60
|
-
import {
|
|
61
|
+
import { createDspyRlmTraceEngine } from "@tangle-network/agent-eval/analyst";
|
|
61
62
|
var DEFAULT_ANALYST_MODEL = "gpt-5-mini";
|
|
63
|
+
var TANGLE_ROUTER_BASE_URL = "https://router.tangle.tools/v1";
|
|
62
64
|
function packageVersion() {
|
|
63
65
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
64
66
|
if (typeof pkg.version !== "string" || !pkg.version) throw new Error("package.json is missing version");
|
|
@@ -87,7 +89,8 @@ function parseArgs(argv) {
|
|
|
87
89
|
replay: false,
|
|
88
90
|
noSpans: false,
|
|
89
91
|
noFindings: false,
|
|
90
|
-
attrs: []
|
|
92
|
+
attrs: [],
|
|
93
|
+
concurrency: 4
|
|
91
94
|
};
|
|
92
95
|
for (let i = 1; i < argv.length; i++) {
|
|
93
96
|
const arg = argv[i];
|
|
@@ -124,6 +127,15 @@ function parseArgs(argv) {
|
|
|
124
127
|
case "--supervisor-run-dir":
|
|
125
128
|
a.supervisorRunDir = next();
|
|
126
129
|
break;
|
|
130
|
+
case "--trajectory-dir":
|
|
131
|
+
a.trajectoryDir = next();
|
|
132
|
+
break;
|
|
133
|
+
case "--revision":
|
|
134
|
+
a.revision = next();
|
|
135
|
+
break;
|
|
136
|
+
case "--concurrency":
|
|
137
|
+
a.concurrency = Number(next());
|
|
138
|
+
break;
|
|
127
139
|
case "--since":
|
|
128
140
|
a.since = next();
|
|
129
141
|
break;
|
|
@@ -335,15 +347,23 @@ async function resolveSelectedSession(args) {
|
|
|
335
347
|
`session ID "${args.session}" is ambiguous across ${matches.length} files; select one harness or pass its explicit session path`
|
|
336
348
|
);
|
|
337
349
|
}
|
|
338
|
-
|
|
339
|
-
const
|
|
350
|
+
function buildAnalysisEngine(model) {
|
|
351
|
+
const tangleKey = process.env.TANGLE_API_KEY;
|
|
352
|
+
const openAiKey = process.env.OPENAI_API_KEY;
|
|
353
|
+
const apiKey = tangleKey || openAiKey;
|
|
340
354
|
if (!apiKey) {
|
|
341
355
|
throw new Error(
|
|
342
|
-
"--llm needs
|
|
356
|
+
"--llm needs a model key: TANGLE_API_KEY for the Tangle router (the default endpoint), or OPENAI_API_KEY for OpenAI. Set OPENAI_BASE_URL to target any other OpenAI-compatible gateway. Deterministic analysis needs no key."
|
|
343
357
|
);
|
|
344
358
|
}
|
|
345
|
-
const
|
|
346
|
-
|
|
359
|
+
const baseUrl = process.env.OPENAI_BASE_URL || (tangleKey ? TANGLE_ROUTER_BASE_URL : "https://api.openai.com/v1");
|
|
360
|
+
const python = process.env.TRACES_PYTHON;
|
|
361
|
+
return createDspyRlmTraceEngine({
|
|
362
|
+
apiKey,
|
|
363
|
+
baseUrl,
|
|
364
|
+
model,
|
|
365
|
+
...python ? { runner: { command: python } } : {}
|
|
366
|
+
});
|
|
347
367
|
}
|
|
348
368
|
async function cmdList(args) {
|
|
349
369
|
const groups = await discover({ ...args, last: args.last || 20 });
|
|
@@ -528,6 +548,51 @@ async function cmdExport(args) {
|
|
|
528
548
|
const result = await exportTraceEvidenceFile(args.input, { format, attributes });
|
|
529
549
|
process.stdout.write(serializeSpans(result.spans));
|
|
530
550
|
}
|
|
551
|
+
async function cmdImportCodeTraceBench(args) {
|
|
552
|
+
if (!args.input) {
|
|
553
|
+
throw new Error(
|
|
554
|
+
"import-codetracebench needs the native CodeTraceBench rows JSON or JSONL file"
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
if (!args.trajectoryDir) {
|
|
558
|
+
throw new Error(
|
|
559
|
+
"import-codetracebench needs --trajectory-dir with <traj_id>/steps.json directories"
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
if (!args.out) {
|
|
563
|
+
throw new Error("import-codetracebench needs a new --out directory");
|
|
564
|
+
}
|
|
565
|
+
if (!args.revision) {
|
|
566
|
+
throw new Error(
|
|
567
|
+
"import-codetracebench needs --revision with a full 40- or 64-character hexadecimal commit or digest"
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
const controller = new AbortController();
|
|
571
|
+
const interrupt = () => controller.abort(
|
|
572
|
+
new Error("import-codetracebench interrupted")
|
|
573
|
+
);
|
|
574
|
+
process.once("SIGINT", interrupt);
|
|
575
|
+
process.once("SIGTERM", interrupt);
|
|
576
|
+
try {
|
|
577
|
+
const result = await importCodeTraceBench({
|
|
578
|
+
rowsPath: args.input,
|
|
579
|
+
trajectoryDir: args.trajectoryDir,
|
|
580
|
+
outDir: args.out,
|
|
581
|
+
revision: args.revision,
|
|
582
|
+
concurrency: args.concurrency,
|
|
583
|
+
signal: controller.signal
|
|
584
|
+
});
|
|
585
|
+
const traceCount = result.receipt.counts.traces;
|
|
586
|
+
const stepCount = result.receipt.counts.steps;
|
|
587
|
+
const spanCount = result.receipt.counts.spans;
|
|
588
|
+
console.log(
|
|
589
|
+
`imported ${traceCount} CodeTraceBench ${traceCount === 1 ? "trajectory" : "trajectories"} (${stepCount} ${stepCount === 1 ? "step" : "steps"}, ${spanCount} ${spanCount === 1 ? "span" : "spans"}) \u2192 ${result.directory}; receipt: ${result.receiptPath}`
|
|
590
|
+
);
|
|
591
|
+
} finally {
|
|
592
|
+
process.removeListener("SIGINT", interrupt);
|
|
593
|
+
process.removeListener("SIGTERM", interrupt);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
531
596
|
function traceEvidenceFormat(raw) {
|
|
532
597
|
const format = raw ?? "auto";
|
|
533
598
|
if (format !== "auto" && format !== "policy-evidence" && format !== "sandbox-events" && format !== "openinference" && format !== "intelligence-spans" && format !== "chat-trajectory") {
|
|
@@ -646,7 +711,7 @@ async function investigate(args, options = {}) {
|
|
|
646
711
|
if (spans.length === 0) throw new Error("no spans found for the given selection");
|
|
647
712
|
const config = args.config !== void 0 || options.loadDefaultConfig !== false ? await loadTracesConfig(args.config) : void 0;
|
|
648
713
|
const analystModel = args.model ?? process.env.TRACES_ANALYST_MODEL ?? DEFAULT_ANALYST_MODEL;
|
|
649
|
-
const
|
|
714
|
+
const engine = args.llm ? buildAnalysisEngine(analystModel) : void 0;
|
|
650
715
|
return runTraceInvestigation(mergeTracesConfig({
|
|
651
716
|
spans,
|
|
652
717
|
harness,
|
|
@@ -654,7 +719,7 @@ async function investigate(args, options = {}) {
|
|
|
654
719
|
workflow,
|
|
655
720
|
cwds,
|
|
656
721
|
minLoopOccurrences: args.minLoop,
|
|
657
|
-
|
|
722
|
+
engine,
|
|
658
723
|
model: args.llm ? analystModel : args.model,
|
|
659
724
|
budgetUsd: args.budget,
|
|
660
725
|
otlpOutPath: args.otlp,
|
|
@@ -669,7 +734,7 @@ async function cmdImprove(args) {
|
|
|
669
734
|
if (spans.length === 0) throw new Error("no spans found for the given selection");
|
|
670
735
|
const config = await loadTracesConfig(args.config);
|
|
671
736
|
const analystModel = args.model ?? process.env.TRACES_ANALYST_MODEL ?? DEFAULT_ANALYST_MODEL;
|
|
672
|
-
const
|
|
737
|
+
const engine = args.llm ? buildAnalysisEngine(analystModel) : void 0;
|
|
673
738
|
const result = await runTraceImprovement({
|
|
674
739
|
...mergeTracesConfig({
|
|
675
740
|
spans,
|
|
@@ -678,7 +743,7 @@ async function cmdImprove(args) {
|
|
|
678
743
|
workflow,
|
|
679
744
|
cwds,
|
|
680
745
|
minLoopOccurrences: args.minLoop,
|
|
681
|
-
|
|
746
|
+
engine,
|
|
682
747
|
model: args.llm ? analystModel : args.model,
|
|
683
748
|
budgetUsd: args.budget,
|
|
684
749
|
otlpOutPath: args.otlp,
|
|
@@ -921,6 +986,22 @@ Safety:
|
|
|
921
986
|
export runs the same local regex redaction used by upload before writing spans.
|
|
922
987
|
--metadata must be a JSON object; --attr key=value is repeatable and overrides matching metadata keys.`);
|
|
923
988
|
}
|
|
989
|
+
function usageImportCodeTraceBench() {
|
|
990
|
+
console.log(`traces import-codetracebench: write one label-free OTLP file per trajectory
|
|
991
|
+
|
|
992
|
+
Usage:
|
|
993
|
+
traces import-codetracebench <rows.jsonl|rows.json> \\
|
|
994
|
+
--trajectory-dir <normalized-dir> --out <new-trace-dir> \\
|
|
995
|
+
--revision <40-or-64-character-hex> [--concurrency 4]
|
|
996
|
+
|
|
997
|
+
Input layout:
|
|
998
|
+
<normalized-dir>/<traj_id>/steps.json
|
|
999
|
+
<normalized-dir>/<traj_id>/task.md optional
|
|
1000
|
+
|
|
1001
|
+
The command validates every native step, rejects annotation leakage, writes
|
|
1002
|
+
<traj_id>.otlp.jsonl files, and records input and output SHA-256 hashes in
|
|
1003
|
+
codetracebench-import.json. The output directory must not already exist.`);
|
|
1004
|
+
}
|
|
924
1005
|
function usage() {
|
|
925
1006
|
console.log(`traces: analyze, observe & upload coding-agent sessions
|
|
926
1007
|
|
|
@@ -934,6 +1015,8 @@ Commands:
|
|
|
934
1015
|
index Emit a reusable session index JSON for later investigation
|
|
935
1016
|
inspect Read a session index and print ranked improvement findings
|
|
936
1017
|
export Convert evidence/events files to OpenInference JSONL for HALO
|
|
1018
|
+
import-codetracebench
|
|
1019
|
+
Convert CodeTracer-normalized CodeTraceBench trajectories in bulk
|
|
937
1020
|
evidence Emit compact session-evidence JSONL for downstream policy miners
|
|
938
1021
|
stream Emit JSONL trace stream events for live visualizers or replay
|
|
939
1022
|
watch Online observer: tail active sessions, notify on loops + semantic findings
|
|
@@ -965,7 +1048,10 @@ Options:
|
|
|
965
1048
|
--replay, --once stream: scan once and exit (default for positional input / --session)
|
|
966
1049
|
--no-spans stream: omit per-span pulse events
|
|
967
1050
|
--no-findings stream: omit semantic live-finding events
|
|
968
|
-
--llm Enable agentic RLM analysts
|
|
1051
|
+
--llm Enable agentic RLM analysts. Runs on the Tangle router by
|
|
1052
|
+
default (TANGLE_API_KEY); OPENAI_API_KEY alone targets OpenAI,
|
|
1053
|
+
OPENAI_BASE_URL overrides the endpoint. Needs Python with
|
|
1054
|
+
agent-eval-rpc[dspy] (TRACES_PYTHON selects the interpreter).
|
|
969
1055
|
--model <id> Model for --llm, HALO, and Hodoscope (default for --llm: ${DEFAULT_ANALYST_MODEL})
|
|
970
1056
|
--config <path> investigate/improve/stream: JS config with analysts, liveAnalysts, or external analyzers
|
|
971
1057
|
--budget <usd> USD cap for agentic analysts
|
|
@@ -979,7 +1065,7 @@ Options:
|
|
|
979
1065
|
--redactor <cmd> upload: external PII scrubber (JSON array stdin\u2192stdout) after the regex pass
|
|
980
1066
|
--yes, -y upload: skip the confirmation prompt
|
|
981
1067
|
--version, -v Print the installed traces version
|
|
982
|
-
--help, -h Show help (use \`traces export --help\`
|
|
1068
|
+
--help, -h Show help (use \`traces export --help\` or \`traces import-codetracebench --help\`)
|
|
983
1069
|
|
|
984
1070
|
Upload env: TANGLE_INGEST_URL (or TANGLE_ORCHESTRATOR_URL), TANGLE_INGEST_API_KEY (or TANGLE_API_KEY), TANGLE_TENANT_ID`);
|
|
985
1071
|
}
|
|
@@ -991,14 +1077,16 @@ async function main() {
|
|
|
991
1077
|
}
|
|
992
1078
|
const parsedArgs = parseArgs(rawArgs);
|
|
993
1079
|
if (parsedArgs.help) {
|
|
994
|
-
if (parsedArgs.command === "
|
|
1080
|
+
if (parsedArgs.command === "import-codetracebench" || parsedArgs.command === "help" && parsedArgs.input === "import-codetracebench") usageImportCodeTraceBench();
|
|
1081
|
+
else if (parsedArgs.command === "export" || parsedArgs.command === "help" && parsedArgs.input === "export") usageExport();
|
|
995
1082
|
else usage();
|
|
996
1083
|
return;
|
|
997
1084
|
}
|
|
998
1085
|
const args = validateWorkflowSelection(applyCurrentSessionSelection(parsedArgs));
|
|
999
1086
|
switch (args.command) {
|
|
1000
1087
|
case "help":
|
|
1001
|
-
if (args.input === "
|
|
1088
|
+
if (args.input === "import-codetracebench") usageImportCodeTraceBench();
|
|
1089
|
+
else if (args.input === "export") usageExport();
|
|
1002
1090
|
else usage();
|
|
1003
1091
|
break;
|
|
1004
1092
|
case "list":
|
|
@@ -1025,6 +1113,9 @@ async function main() {
|
|
|
1025
1113
|
case "export":
|
|
1026
1114
|
await cmdExport(args);
|
|
1027
1115
|
break;
|
|
1116
|
+
case "import-codetracebench":
|
|
1117
|
+
await cmdImportCodeTraceBench(args);
|
|
1118
|
+
break;
|
|
1028
1119
|
case "evidence":
|
|
1029
1120
|
await cmdEvidence(args);
|
|
1030
1121
|
break;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ToolUseMetrics, InMemoryTraceStore } from '@tangle-network/agent-eval';
|
|
2
2
|
import { StuckLoopReport, FailureClusterReport } from '@tangle-network/agent-eval/pipelines';
|
|
3
|
-
import {
|
|
3
|
+
import { TraceAnalystDefinition, TraceAnalysisEngine, AnalystRegistry, AnalystFinding, buildDefaultAnalystRegistry, AnalystRunResult, Analyst } from '@tangle-network/agent-eval/analyst';
|
|
4
4
|
export { Analyst, AnalystContext, AnalystFinding, AnalystRegistry, buildDefaultAnalystRegistry, makeFinding } from '@tangle-network/agent-eval/analyst';
|
|
5
|
-
import { AxAIService } from '@ax-llm/ax';
|
|
6
5
|
import { ExecutionReport } from '@tangle-network/agent-eval/contract';
|
|
7
6
|
import { TraceAnalysisStore, RedactionRule, RedactionReport } from '@tangle-network/agent-eval/traces';
|
|
8
7
|
export { DEFAULT_REDACTION_RULES, ErrorCluster, RedactionReport, RedactionRule, TraceAnalysisStore, redactString, redactValue } from '@tangle-network/agent-eval/traces';
|
|
@@ -208,6 +207,89 @@ interface HarnessTraceAdapter {
|
|
|
208
207
|
resolveParentTask?(ref: SessionRef, childSessionId: string, options?: Pick<ParseOptions, 'corruptionMode' | 'signal'>): Promise<ParentTaskResolution>;
|
|
209
208
|
}
|
|
210
209
|
|
|
210
|
+
interface CodeTraceBenchFileRef {
|
|
211
|
+
readonly path: string;
|
|
212
|
+
readonly line_start: number;
|
|
213
|
+
readonly line_end: number;
|
|
214
|
+
readonly content: string;
|
|
215
|
+
}
|
|
216
|
+
interface CodeTraceBenchStep {
|
|
217
|
+
readonly step_id: number;
|
|
218
|
+
readonly action: string;
|
|
219
|
+
readonly observation: string | null;
|
|
220
|
+
readonly thinking?: string;
|
|
221
|
+
readonly parallel_group?: number;
|
|
222
|
+
readonly tool_type?: string;
|
|
223
|
+
readonly action_ref: CodeTraceBenchFileRef | null;
|
|
224
|
+
readonly observation_ref: CodeTraceBenchFileRef | null;
|
|
225
|
+
}
|
|
226
|
+
interface CodeTraceBenchImportOptions {
|
|
227
|
+
readonly rowsPath: string;
|
|
228
|
+
/** CodeTracer-normalized root containing `<traj_id>/steps.json`. */
|
|
229
|
+
readonly trajectoryDir: string;
|
|
230
|
+
/** Must not exist. It is published only after every trajectory succeeds. */
|
|
231
|
+
readonly outDir: string;
|
|
232
|
+
/** Full 40-character commit SHA or 64-character hexadecimal digest. */
|
|
233
|
+
readonly revision: string;
|
|
234
|
+
readonly concurrency?: number;
|
|
235
|
+
readonly signal?: AbortSignal;
|
|
236
|
+
}
|
|
237
|
+
interface CodeTraceBenchImportedTrace {
|
|
238
|
+
readonly index: number;
|
|
239
|
+
readonly traceId: string;
|
|
240
|
+
readonly stepCount: number;
|
|
241
|
+
readonly spanCount: number;
|
|
242
|
+
readonly taskSource: 'task.md' | 'task_name';
|
|
243
|
+
readonly input: {
|
|
244
|
+
readonly stepsPath: string;
|
|
245
|
+
readonly stepsSha256: string;
|
|
246
|
+
readonly stepsBytes: number;
|
|
247
|
+
readonly taskPath?: string;
|
|
248
|
+
readonly taskSha256?: string;
|
|
249
|
+
readonly taskBytes?: number;
|
|
250
|
+
};
|
|
251
|
+
readonly output: {
|
|
252
|
+
readonly path: string;
|
|
253
|
+
readonly sha256: string;
|
|
254
|
+
readonly bytes: number;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
interface CodeTraceBenchImportReceipt {
|
|
258
|
+
readonly kind: 'traces.codetracebench-import';
|
|
259
|
+
readonly generatedAt: string;
|
|
260
|
+
readonly input: {
|
|
261
|
+
readonly revision: string;
|
|
262
|
+
readonly rowsFile: string;
|
|
263
|
+
readonly rowsSha256: string;
|
|
264
|
+
readonly rowsBytes: number;
|
|
265
|
+
readonly trajectoryDirectory: string;
|
|
266
|
+
readonly sha256: string;
|
|
267
|
+
};
|
|
268
|
+
readonly settings: {
|
|
269
|
+
readonly concurrency: number;
|
|
270
|
+
readonly outputLayout: '<traj_id>.otlp.jsonl';
|
|
271
|
+
};
|
|
272
|
+
readonly counts: {
|
|
273
|
+
readonly rows: number;
|
|
274
|
+
readonly traces: number;
|
|
275
|
+
readonly steps: number;
|
|
276
|
+
readonly spans: number;
|
|
277
|
+
};
|
|
278
|
+
readonly safety: {
|
|
279
|
+
readonly labelLeakScan: 'passed';
|
|
280
|
+
readonly outputDirectoryCreatedExclusively: true;
|
|
281
|
+
readonly filesPublishedAtomically: true;
|
|
282
|
+
};
|
|
283
|
+
readonly traces: readonly CodeTraceBenchImportedTrace[];
|
|
284
|
+
readonly outputSha256: string;
|
|
285
|
+
}
|
|
286
|
+
interface CodeTraceBenchImportResult {
|
|
287
|
+
readonly directory: string;
|
|
288
|
+
readonly receiptPath: string;
|
|
289
|
+
readonly receipt: CodeTraceBenchImportReceipt;
|
|
290
|
+
}
|
|
291
|
+
declare function importCodeTraceBench(options: CodeTraceBenchImportOptions): Promise<CodeTraceBenchImportResult>;
|
|
292
|
+
|
|
211
293
|
/**
|
|
212
294
|
* Span-attribute keys the upload path stamps. The CLI is the producer; the
|
|
213
295
|
* Tangle Intelligence Platform is the consumer.
|
|
@@ -1071,7 +1153,7 @@ interface TraceAgenticRoute {
|
|
|
1071
1153
|
*/
|
|
1072
1154
|
declare function planTraceAgenticRoute(pipelines: PipelineReport, reactions: ReactionReport): TraceAgenticRoute;
|
|
1073
1155
|
/** Resolve a route into the maintained agent-eval kind specifications. */
|
|
1074
|
-
declare function traceAgenticKinds(route: TraceAgenticRoute): readonly
|
|
1156
|
+
declare function traceAgenticKinds(route: TraceAgenticRoute): readonly TraceAnalystDefinition[];
|
|
1075
1157
|
|
|
1076
1158
|
/**
|
|
1077
1159
|
* Project normalized `OtlpSpan[]` onto agent-eval's runtime trace store.
|
|
@@ -1107,8 +1189,12 @@ declare function toRuntimeStore(spans: readonly OtlpSpan[]): Promise<RuntimeTrac
|
|
|
1107
1189
|
*/
|
|
1108
1190
|
|
|
1109
1191
|
interface AnalyzeOptions {
|
|
1110
|
-
/**
|
|
1111
|
-
|
|
1192
|
+
/**
|
|
1193
|
+
* Recursive analysis engine enabling the agentic analyst kinds. Omit →
|
|
1194
|
+
* deterministic only. The engine's id, version, and model become the
|
|
1195
|
+
* exact-run identity of every analyst it executes.
|
|
1196
|
+
*/
|
|
1197
|
+
engine?: TraceAnalysisEngine;
|
|
1112
1198
|
model?: string;
|
|
1113
1199
|
/** USD cap across agentic analysts. */
|
|
1114
1200
|
budgetUsd?: number;
|
|
@@ -1123,7 +1209,7 @@ interface AnalyzeOptions {
|
|
|
1123
1209
|
* deterministic pass and receives its compact findings as prior context. */
|
|
1124
1210
|
agenticRegistry?: AnalystRegistry;
|
|
1125
1211
|
/** Select a subset of agent-eval's maintained trace analyst kinds. */
|
|
1126
|
-
agenticKinds?: readonly
|
|
1212
|
+
agenticKinds?: readonly TraceAnalystDefinition[];
|
|
1127
1213
|
/** Compact deterministic findings that agents receive before reading spans. */
|
|
1128
1214
|
agenticPriorFindings?: readonly AnalystFinding[];
|
|
1129
1215
|
/** Where to write the OTLP-JSONL artifact. Defaults to a temp file. */
|
|
@@ -1744,7 +1830,7 @@ interface TraceInvestigationOptions {
|
|
|
1744
1830
|
readonly workflow?: SessionWorkflowSummary;
|
|
1745
1831
|
readonly cwds?: readonly string[];
|
|
1746
1832
|
readonly minLoopOccurrences?: number;
|
|
1747
|
-
readonly
|
|
1833
|
+
readonly engine?: TraceAnalysisEngine;
|
|
1748
1834
|
readonly model?: string;
|
|
1749
1835
|
readonly budgetUsd?: number;
|
|
1750
1836
|
readonly registry?: AnalystRegistry;
|
|
@@ -1814,7 +1900,7 @@ interface BuildTraceFindingPacketOptions {
|
|
|
1814
1900
|
interface TraceStoreInvestigationOptions {
|
|
1815
1901
|
readonly traceStore: TraceAnalysisStore;
|
|
1816
1902
|
readonly registry?: AnalystRegistry;
|
|
1817
|
-
readonly
|
|
1903
|
+
readonly engine?: TraceAnalysisEngine;
|
|
1818
1904
|
readonly model?: string;
|
|
1819
1905
|
readonly budgetUsd?: number;
|
|
1820
1906
|
readonly runId?: string;
|
|
@@ -2102,4 +2188,4 @@ interface ExecuteOptions {
|
|
|
2102
2188
|
/** Send the final, new outbound items (or write their dry-run OTLP). */
|
|
2103
2189
|
declare function executeUpload(plan: UploadPlan, opts?: ExecuteOptions): Promise<UploadResult>;
|
|
2104
2190
|
|
|
2105
|
-
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, type ChatTrajectory, type ChatTrajectoryMessage, type ChatTrajectoryOptions, ClaudeAdapter, CodexAdapter, CodexExecAdapter, CodexExecStreamError, CodexTaskScopeError, type CollectOptions, type CollectPolicyEvidenceOptions, type CollectSessionIndexOptions, type CollectSessionSelectionOptions, type CollectSessionWorkflowOptions, CopilotAdapter, type CorruptionMode, DEFAULT_HARNESS, EmptySessionError, type ExecuteOptions, type ExternalAnalysisKind, type ExternalAnalysisPayload, type ExternalAnalysisResult, type ExternalAnalyzer, type ExternalAnalyzerOptions, type ExternalDiscoveryCandidate, FactoryAdapter, ForgeAdapter, GeminiAdapter, type HaloAnalyzerOptions, type HaloReasoningEffort, type HarnessTraceAdapter, type HodoscopeAnalyzerOptions, type HodoscopeInput, type HodoscopeMessage, type HodoscopeSourceMapEntry, type HodoscopeTrajectory, 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 ParentTaskResolution, 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 SessionRelationship, type SessionRole, type SessionSeedGroup, type SessionSelection, type SessionSelectionRow, type SessionSourceFile, type SessionWorkflow, SessionWorkflowError, type SessionWorkflowErrorCode, type SessionWorkflowIssue, type SessionWorkflowSession, type SessionWorkflowSummary, type SpanInput, type SpanRedaction, TRACES_REDACTION_RULES, 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 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, chatTrajectoryToSpans, classifyLiveActions, classifyReaction, claudeActor, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessionSelection, collectSessionWorkflow, collectSessions, commandAnalyzer, commandRedactor, countSkillRunsJsonl, cwdMatchesSelection, defaultTraceLiveAnalysts, describeSessionRelationship, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, haloAnalyzer, hodoscopeAnalyzer, indexSessionIdsByTrace, inspectSessionIndex, isChatTrajectory, isChatTrajectoryMessage, knownHarnesses, listAdapters, loadState, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeTracesConfig, normalizeRemote, outboundHash, parseIsoToEpochMs, parseSession, parseSince, planTraceAgenticRoute, 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, traceAgenticKinds, traceStreamEventsFromSpans, uploadKey, userPromptSpan, validateOtlpSpans, watchSessions, writeHodoscopeInput, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts };
|
|
2191
|
+
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, 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, CopilotAdapter, type CorruptionMode, DEFAULT_HARNESS, EmptySessionError, type ExecuteOptions, type ExternalAnalysisKind, type ExternalAnalysisPayload, type ExternalAnalysisResult, type ExternalAnalyzer, type ExternalAnalyzerOptions, type ExternalDiscoveryCandidate, FactoryAdapter, ForgeAdapter, GeminiAdapter, type HaloAnalyzerOptions, type HaloReasoningEffort, type HarnessTraceAdapter, type HodoscopeAnalyzerOptions, type HodoscopeInput, type HodoscopeMessage, type HodoscopeSourceMapEntry, type HodoscopeTrajectory, 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 ParentTaskResolution, 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 SessionRelationship, type SessionRole, type SessionSeedGroup, type SessionSelection, type SessionSelectionRow, type SessionSourceFile, type SessionWorkflow, SessionWorkflowError, type SessionWorkflowErrorCode, type SessionWorkflowIssue, type SessionWorkflowSession, type SessionWorkflowSummary, type SpanInput, type SpanRedaction, TRACES_REDACTION_RULES, 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 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, chatTrajectoryToSpans, classifyLiveActions, classifyReaction, claudeActor, codexActor, collectPolicyEvidence, collectSessionIndex, collectSessionSelection, collectSessionWorkflow, collectSessions, commandAnalyzer, commandRedactor, countSkillRunsJsonl, cwdMatchesSelection, defaultTraceLiveAnalysts, describeSessionRelationship, equivalentGitCwds, executeUpload, exportTraceEvidenceFile, exportTraceEvidenceRows, exportTraceEvidenceText, haloAnalyzer, hodoscopeAnalyzer, importCodeTraceBench, indexSessionIdsByTrace, inspectSessionIndex, isChatTrajectory, isChatTrajectoryMessage, knownHarnesses, listAdapters, loadState, loadTracesConfig, locateSessions, looksLikeAgentPrompt, mergeTracesConfig, normalizeRemote, outboundHash, parseIsoToEpochMs, parseSession, parseSince, planTraceAgenticRoute, 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, traceAgenticKinds, traceStreamEventsFromSpans, uploadKey, userPromptSpan, validateOtlpSpans, watchSessions, writeHodoscopeInput, writeInspectionReportFile, writeOtlpFile, writePolicyEvidenceFile, writeSessionIndexFile, writeTraceEvidenceExportFile, writeTraceImprovementArtifacts };
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ import {
|
|
|
59
59
|
exportTraceEvidenceText,
|
|
60
60
|
haloAnalyzer,
|
|
61
61
|
hodoscopeAnalyzer,
|
|
62
|
+
importCodeTraceBench,
|
|
62
63
|
indexSessionIdsByTrace,
|
|
63
64
|
inspectSessionIndex,
|
|
64
65
|
isChatTrajectory,
|
|
@@ -130,7 +131,7 @@ import {
|
|
|
130
131
|
writeSessionIndexFile,
|
|
131
132
|
writeTraceEvidenceExportFile,
|
|
132
133
|
writeTraceImprovementArtifacts
|
|
133
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-7BQ2CVEA.js";
|
|
134
135
|
|
|
135
136
|
// src/collect.ts
|
|
136
137
|
async function collectSessions(opts = {}) {
|
|
@@ -221,6 +222,7 @@ export {
|
|
|
221
222
|
haloAnalyzer,
|
|
222
223
|
hodoscopeAnalyzer,
|
|
223
224
|
hostedClientFromEnv,
|
|
225
|
+
importCodeTraceBench,
|
|
224
226
|
indexSessionIdsByTrace,
|
|
225
227
|
inspectSessionIndex,
|
|
226
228
|
isChatTrajectory,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/traces",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Point it at your coding-agent session traces (Claude Code, Codex, OpenCode, Gemini, Pi, …) and get failure-mode + efficiency findings. CLI + SDK over the @tangle-network/agent-eval analyst suite — observe live sessions, run your own analysts, redact, and upload to the Tangle Intelligence Platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,8 +47,7 @@
|
|
|
47
47
|
"node": ">=22"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@
|
|
51
|
-
"@tangle-network/agent-eval": "0.137.0"
|
|
50
|
+
"@tangle-network/agent-eval": "0.139.3"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"@types/node": "^22.0.0",
|