@tangle-network/traces 0.8.27 → 0.9.1

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
@@ -49,13 +49,15 @@ traces watch --all
49
49
  traces stream --all --mode findings
50
50
  ```
51
51
 
52
- That's the command in the demo above. The **deterministic pass** checks stuck loops, token growth, output decay, missing self-verification, and tool monoculture. It needs no API key and costs nothing.
52
+ That's the command in the demo above. The **deterministic pass** checks stuck loops, token growth, output decay, missing self-verification, tool failures, and human corrections. Each supported issue is returned as a finding with evidence, an action, confidence, and a validation plan. It needs no API key and costs nothing.
53
53
 
54
54
  Add `--llm` for the **agentic analysts** (failure-mode / knowledge-gap / knowledge-poisoning / improvement); they call OpenAI and respect `--budget <usd>`.
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, 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.
58
+ `traces improve` is the reviewable action path.
59
+ It writes one typed result, one report, flattened evidence rows, and the canonical OTLP trace.
60
+ Each finding already contains the claim, evidence, recommended action, confidence, and validation plan.
59
61
 
60
62
  ## What it finds
61
63
 
@@ -94,8 +96,8 @@ Every adapter captures the full conversation: the **user's prompt** and the **as
94
96
 
95
97
  ```bash
96
98
  traces list --harness claude-code --last 20 # discover sessions
97
- traces analyze --harness codex --last 1 # $0 deterministic report
98
- traces investigate --all --last 10 --out report.md # typed findings + recommendations
99
+ traces analyze --harness codex --last 1 # $0 findings with actions + checks
100
+ traces investigate --all --last 10 --out report.md # explicit investigation alias
99
101
  traces improve --all --last 10 --dir .traces/improvement
100
102
  traces analyze --all --since 2026-06-18 --out report.md
101
103
  traces convert --harness claude-code --last 1 --otlp spans.jsonl # OTLP only
@@ -124,7 +126,7 @@ traces upload --since 24h # upload last day to the Inte
124
126
  | `--otlp <path>` | OTLP artifact path (also evidence provenance / dry-run upload preview) |
125
127
  | `--format <kind>` | `export` / file `stream`: `auto`, `policy-evidence`, `sandbox-events`, or `openinference` |
126
128
  | `--llm` / `--budget <usd>` | Enable agentic analysts (needs `OPENAI_API_KEY`) / cap their spend |
127
- | `--config <path>` | `investigate` / `improve` / `stream`: load BYO analysts, live analysts, external analyzers, and proposal adapters |
129
+ | `--config <path>` | `analyze` / `investigate` / `improve` / `stream`: load BYO analysts, live analysts, and external analyzers |
128
130
  | `--interval <s>` / `--window <m>` | `watch` / live `stream`: poll seconds (default 5) / active-session window minutes (default 30) |
129
131
  | `--min-loop <n>` | Identical repeated calls before flagging a loop (default 3) |
130
132
  | `--mode <kind>` | `stream`: `visualizer` (spans + findings), `findings` (low-volume), or `agent` (findings + reports) |
@@ -195,15 +197,12 @@ The directory contains:
195
197
 
196
198
  | File | Purpose |
197
199
  |---|---|
198
- | `findings.json` | typed `AnalystFinding[]`; finding ids, severity, evidence refs, recommended action, validation plan |
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
+ | `result.json` | findings, actions, checks, execution facts, and adoption data |
201
201
  | `evidence.jsonl` | one row per evidence ref, suitable for downstream mining |
202
- | `claims.json` | compact claim list for review agents and dashboards |
203
202
  | `report.md` | human-readable report rendered from the typed data |
204
- | `replay-before-after.json` | baseline counts plus proposal-only replay metadata |
203
+ | `traces.otlp.jsonl` | canonical trace used by the analysts and execution accounting |
205
204
 
206
- Bring your own analysts and proposal writer with a config file:
205
+ Bring your own analysts with a config file:
207
206
 
208
207
  ```bash
209
208
  traces improve --last 5 --config examples/improvement-config.mjs --dir .traces/improvement
@@ -215,9 +214,8 @@ The config can export:
215
214
  - `liveAnalysts`: deterministic online analysts that implement the `TraceLiveAnalyst` contract for `traces stream`
216
215
  - `registry`: a prebuilt `AnalystRegistry`
217
216
  - `externalAnalyzers`: HALO or any command/model adapter that reads the OTLP artifact
218
- - `improvementAdapter`: a proposal writer that replaces the default proposal set with product-specific patches, profile edits, prompts, or validation commands
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.
217
+ Traces does not pretend that an action is a measured candidate.
218
+ Use `agent-eval` to propose and compare candidate changes, `agent-runtime` to package an approved improvement, and `agent-interface` to represent profile edits.
221
219
 
222
220
  ## Session index
223
221
 
@@ -344,11 +342,11 @@ The CLI is a thin consumer of these exports.
344
342
  | Export | Signature | Use |
345
343
  |---|---|---|
346
344
  | `analyzeSpans` | `(spans, { registry?, ai?, budgetUsd? }) → AnalyzeResult` | run built-in analysts, or **your own** via `registry` |
347
- | `runTraceInvestigation` | `(TraceInvestigationOptions) → TraceInvestigationResult` | typed findings, recommendations, claims, external analyzer output, and report |
348
- | `runTraceImprovementLoop` | `(TraceImprovementOptions) → TraceImprovementResult` | writes the full improvement artifact pack and proposal-only output |
349
- | `buildTraceFindingPacket` | `({ findings }) → TraceFindingPacket` | turn any `AnalystFinding[]` into recommendations, claims, and a report |
345
+ | `runTraceInvestigation` | `(TraceInvestigationOptions) → TraceInvestigationResult` | typed findings with actions/checks, execution facts, external analyzer output, and report |
346
+ | `runTraceImprovement` | `(TraceImprovementOptions) → TraceImprovementResult` | writes the full findings, evidence, report, and trace artifact pack |
347
+ | `buildTraceFindingPacket` | `({ findings }) → TraceFindingPacket` | render any `AnalystFinding[]` without changing its schema |
350
348
  | `runTraceStoreInvestigation` | `({ traceStore }) → TraceStoreInvestigationResult` | run the same packet layer over a hosted/custom `TraceAnalysisStore` |
351
- | `loadTracesConfig` | `(path?) → TracesConfig \| undefined` | load BYO analysts, external analyzers, and proposal adapters |
349
+ | `loadTracesConfig` | `(path?) → TracesConfig \| undefined` | load BYO analysts and external analyzers |
352
350
  | `watchSessions` | `(ObserverOptions) → Promise<void>` | live observer; `onLoop` / `onReport` / `signal` / `adapters` |
353
351
  | `streamSessions` | `(TraceStreamOptions) → Promise<void>` | live JSONL-ready event stream over active sessions |
354
352
  | `traceStreamEventsFromSpans` | `(spans, opts?) → TraceStreamEvent[]` | replay an existing span list as stream events |