@tangle-network/traces 0.8.23 → 0.8.24

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 CHANGED
@@ -55,7 +55,7 @@ Add `--llm` for the **agentic analysts** (failure-mode / knowledge-gap / knowled
55
55
 
56
56
  Every run also writes a **canonical OpenInference JSONL artifact**, so you can run external engines like [HALO](https://github.com/context-labs/halo) over it directly with `--analyzer halo`. See [External engines](#external-engines-bring-your-own). Analysis is never locked to one engine.
57
57
 
58
- `traces improve` is the reviewable action path. It writes typed artifacts: findings, recommendations, evidence rows, claims, report, and before/after replay metadata. Another agent, CI job, or hosted product can consume the result without scraping prose.
58
+ `traces improve` is the reviewable action path. It writes typed artifacts: findings, recommendations, proposal-only artifacts, evidence rows, claims, report, and before/after replay metadata. Another agent, CI job, or hosted product can consume the result without scraping prose.
59
59
 
60
60
  ## What it finds
61
61
 
@@ -197,6 +197,7 @@ The directory contains:
197
197
  |---|---|
198
198
  | `findings.json` | typed `AnalystFinding[]`; finding ids, severity, evidence refs, recommended action, validation plan |
199
199
  | `recommendations.json` | ranked actions derived from analyst, deterministic, and external findings |
200
+ | `proposals.json` | reviewable proposal-only artifacts linked to recommendation ids and evidence refs |
200
201
  | `evidence.jsonl` | one row per evidence ref, suitable for downstream mining |
201
202
  | `claims.json` | compact claim list for review agents and dashboards |
202
203
  | `report.md` | human-readable report rendered from the typed data |
@@ -214,7 +215,7 @@ The config can export:
214
215
  - `liveAnalysts`: deterministic online analysts that implement the `TraceLiveAnalyst` contract for `traces stream`
215
216
  - `registry`: a prebuilt `AnalystRegistry`
216
217
  - `externalAnalyzers`: HALO or any command/model adapter that reads the OTLP artifact
217
- - `improvementAdapter`: a proposal writer that maps recommendations to patches, profile edits, prompts, or validation commands
218
+ - `improvementAdapter`: a proposal writer that replaces the default proposal set with product-specific patches, profile edits, prompts, or validation commands
218
219
 
219
220
  `traces` does not apply patches or open PRs by default. The public engine produces reviewable artifacts; hosted products can decide how to deliver, approve, or apply them.
220
221
 
@@ -344,7 +345,7 @@ The CLI is a thin consumer of these exports.
344
345
  |---|---|---|
345
346
  | `analyzeSpans` | `(spans, { registry?, ai?, budgetUsd? }) → AnalyzeResult` | run built-in analysts, or **your own** via `registry` |
346
347
  | `runTraceInvestigation` | `(TraceInvestigationOptions) → TraceInvestigationResult` | typed findings, recommendations, claims, external analyzer output, and report |
347
- | `runTraceImprovementLoop` | `(TraceImprovementOptions) → TraceImprovementResult` | writes the full improvement artifact pack and optional proposal output |
348
+ | `runTraceImprovementLoop` | `(TraceImprovementOptions) → TraceImprovementResult` | writes the full improvement artifact pack and proposal-only output |
348
349
  | `buildTraceFindingPacket` | `({ findings }) → TraceFindingPacket` | turn any `AnalystFinding[]` into recommendations, claims, and a report |
349
350
  | `runTraceStoreInvestigation` | `({ traceStore }) → TraceStoreInvestigationResult` | run the same packet layer over a hosted/custom `TraceAnalysisStore` |
350
351
  | `loadTracesConfig` | `(path?) → TracesConfig \| undefined` | load BYO analysts, external analyzers, and proposal adapters |
@@ -4091,6 +4091,27 @@ function buildTraceFindingPacket(opts) {
4091
4091
  };
4092
4092
  return { ...packet, report: renderFindingPacket(packet, opts.title) };
4093
4093
  }
4094
+ function buildDefaultImprovementProposals(input) {
4095
+ return input.recommendations.slice(0, 5).map((recommendation, index) => {
4096
+ const matchingFindings = input.findings.filter((finding2) => recommendation.findingIds.includes(finding2.finding_id));
4097
+ const evidenceRefs = recommendation.evidenceRefs.length > 0 ? recommendation.evidenceRefs : matchingFindings.flatMap((finding2) => finding2.evidence_refs);
4098
+ return {
4099
+ id: `proposal-${index + 1}-${slug(recommendation.title)}`,
4100
+ title: recommendation.title,
4101
+ description: [
4102
+ recommendation.action,
4103
+ "",
4104
+ `Why: ${recommendation.rationale}`,
4105
+ `Validation: ${recommendation.validationPlan}`,
4106
+ "",
4107
+ "This is a proposal-only artifact. It does not mutate code, prompts, skills, tools, MCP config, hooks, subagents, or external systems until a human applies it and reruns validation."
4108
+ ].join("\n"),
4109
+ recommendationIds: [recommendation.id],
4110
+ validationCommand: "traces improve --last 1 --dir .traces/improvement",
4111
+ evidenceRefs
4112
+ };
4113
+ });
4114
+ }
4094
4115
  function renderExternal(results) {
4095
4116
  if (results.length === 0) return "";
4096
4117
  const lines = ["## external analyzers", ""];
@@ -4258,6 +4279,7 @@ async function writeTraceImprovementArtifacts(result, outDir) {
4258
4279
  directory,
4259
4280
  findings: join16(directory, "findings.json"),
4260
4281
  recommendations: join16(directory, "recommendations.json"),
4282
+ proposals: join16(directory, "proposals.json"),
4261
4283
  evidence: join16(directory, "evidence.jsonl"),
4262
4284
  claims: join16(directory, "claims.json"),
4263
4285
  report: join16(directory, "report.md"),
@@ -4266,6 +4288,7 @@ async function writeTraceImprovementArtifacts(result, outDir) {
4266
4288
  await Promise.all([
4267
4289
  writeFile4(paths.findings, json(result.findings), "utf8"),
4268
4290
  writeFile4(paths.recommendations, json(result.recommendations), "utf8"),
4291
+ writeFile4(paths.proposals, json(result.proposals), "utf8"),
4269
4292
  writeFile4(paths.evidence, jsonl(buildEvidenceRows(result.findings)), "utf8"),
4270
4293
  writeFile4(paths.claims, json(result.claims), "utf8"),
4271
4294
  writeFile4(paths.report, result.report, "utf8"),
@@ -4275,13 +4298,14 @@ async function writeTraceImprovementArtifacts(result, outDir) {
4275
4298
  }
4276
4299
  async function runTraceImprovementLoop(opts) {
4277
4300
  const investigation = await runTraceInvestigation(opts);
4278
- const proposals = opts.adapter ? await opts.adapter.propose({
4301
+ const adapterInput = {
4279
4302
  findings: investigation.findings,
4280
4303
  recommendations: investigation.recommendations,
4281
4304
  claims: investigation.claims,
4282
4305
  spans: opts.spans,
4283
4306
  otlpPath: investigation.otlpPath
4284
- }) : [];
4307
+ };
4308
+ const proposals = opts.adapter ? await opts.adapter.propose(adapterInput) : buildDefaultImprovementProposals(adapterInput);
4285
4309
  const replay = replayProof(investigation, proposals);
4286
4310
  const result = {
4287
4311
  ...investigation,
package/dist/cli.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
  writePolicyEvidenceFile,
45
45
  writeSessionIndexFile,
46
46
  writeTraceEvidenceExportFile
47
- } from "./chunk-YS5KIWLY.js";
47
+ } from "./chunk-4LLOYL36.js";
48
48
 
49
49
  // src/cli.ts
50
50
  import { readFileSync } from "fs";
package/dist/index.d.ts CHANGED
@@ -1381,6 +1381,7 @@ interface TraceImprovementArtifacts {
1381
1381
  readonly directory: string;
1382
1382
  readonly findings: string;
1383
1383
  readonly recommendations: string;
1384
+ readonly proposals: string;
1384
1385
  readonly evidence: string;
1385
1386
  readonly claims: string;
1386
1387
  readonly report: string;
@@ -1448,7 +1449,7 @@ declare function loadTracesConfig(path?: string): Promise<TracesConfig | undefin
1448
1449
  declare function mergeTracesConfig(opts: TraceInvestigationOptions, config?: TracesConfig): TraceInvestigationOptions;
1449
1450
  declare function runTraceInvestigation(opts: TraceInvestigationOptions): Promise<TraceInvestigationResult>;
1450
1451
  declare function runTraceStoreInvestigation(opts: TraceStoreInvestigationOptions): Promise<TraceStoreInvestigationResult>;
1451
- declare function writeTraceImprovementArtifacts(result: Pick<TraceImprovementResult, 'findings' | 'recommendations' | 'claims' | 'report' | 'replay'>, outDir?: string): Promise<TraceImprovementArtifacts>;
1452
+ declare function writeTraceImprovementArtifacts(result: Pick<TraceImprovementResult, 'findings' | 'recommendations' | 'proposals' | 'claims' | 'report' | 'replay'>, outDir?: string): Promise<TraceImprovementArtifacts>;
1452
1453
  declare function runTraceImprovementLoop(opts: TraceImprovementOptions): Promise<TraceImprovementResult>;
1453
1454
  declare function saveReport(path: string, report: string): Promise<void>;
1454
1455
 
package/dist/index.js CHANGED
@@ -98,7 +98,7 @@ import {
98
98
  writeSessionIndexFile,
99
99
  writeTraceEvidenceExportFile,
100
100
  writeTraceImprovementArtifacts
101
- } from "./chunk-YS5KIWLY.js";
101
+ } from "./chunk-4LLOYL36.js";
102
102
 
103
103
  // src/collect.ts
104
104
  async function collectSessions(opts = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/traces",
3
- "version": "0.8.23",
3
+ "version": "0.8.24",
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",