@tangle-network/traces 0.8.5 → 0.8.12

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
@@ -17,6 +17,7 @@ It reads the transcripts your harness leaves on disk, reconstructs the run as sp
17
17
  - [What it finds](#what-it-finds)
18
18
  - [Supported harnesses](#supported-harnesses)
19
19
  - [CLI reference](#cli-reference)
20
+ - [Session index](#session-index)
20
21
  - [Policy-mining evidence](#policy-mining-evidence)
21
22
  - [Upload to the Intelligence Platform](#upload-to-the-intelligence-platform)
22
23
  - [External engines (bring your own)](#external-engines-bring-your-own)
@@ -27,9 +28,12 @@ It reads the transcripts your harness leaves on disk, reconstructs the run as sp
27
28
  ## Install
28
29
 
29
30
  ```bash
30
- npm i -g @tangle-network/traces # the `traces` CLI
31
- npx @tangle-network/traces analyze # or run without installing
32
- npm i @tangle-network/traces # or use it as a library
31
+ curl -fsSL https://raw.githubusercontent.com/tangle-network/traces/main/install.sh | bash
32
+ traces --version
33
+
34
+ npx --yes @tangle-network/traces@latest analyze --harness claude-code --last 1 # run without installing
35
+ npm i -g @tangle-network/traces # install manually
36
+ npm i @tangle-network/traces # use it as a library
33
37
  ```
34
38
 
35
39
  Requires Node ≥ 22.
@@ -86,6 +90,8 @@ traces list --harness claude-code --last 20 # discover sessions
86
90
  traces analyze --harness codex --last 1 # $0 deterministic report
87
91
  traces analyze --all --since 2026-06-18 --out report.md
88
92
  traces convert --harness claude-code --last 1 --otlp spans.jsonl # OTLP only
93
+ traces index --all --since 24h --out session-index.json
94
+ traces inspect session-index.json --out inspection-report.md
89
95
  traces evidence --harness codex --last 20 --out policy-evidence.jsonl
90
96
  traces export policy-evidence.jsonl --out spans.openinference.jsonl
91
97
  traces watch --all # live observer; notify on stuck loops
@@ -110,6 +116,27 @@ traces upload --since 24h # upload last day to the Inte
110
116
  | `--no-content` | `upload`: send metadata only — strip all prompt/response text |
111
117
  | `--dry-run` / `--yes` | `upload`: preview without sending / skip the confirm prompt |
112
118
 
119
+ ## Session index
120
+
121
+ `traces index` writes one general JSON catalog over the selected sessions.
122
+ It is meant for deeper investigation and joins with other local data, not for one specific workflow.
123
+
124
+ ```bash
125
+ traces index --all --since 24h --out session-index.json
126
+ traces inspect session-index.json --out inspection-report.md
127
+ ```
128
+
129
+ The index contains:
130
+
131
+ - selection metadata and aggregate totals
132
+ - one row per session with harness, session id, path, cwd, repo labels, and time bounds
133
+ - behavior metrics: spans, LLM turns, tool calls, tool errors, tokens, models, and tools
134
+ - signal summaries: stuck loops and tool error rate
135
+ - nearby context files for joins: `AGENTS.md`, `CLAUDE.md`, and `.evolve` JSONL / reflection artifacts, with markdown heading/ToC and JSONL key summaries
136
+
137
+ `traces inspect` reads that index back and prints ranked improvement findings over the sessions and nearby context.
138
+ It is intentionally read-only: it points to repeated-call loops, high tool-error sessions, missing repo attribution, long docs without Contents, invalid JSONL rows, and skill-run rows that cannot be joined back to a session.
139
+
113
140
  ## Policy-mining evidence
114
141
 
115
142
  `traces` does **not** emit benchmark campaign cells. It emits normalized coding-agent session evidence that another system can mine.
@@ -203,6 +230,7 @@ Merging to `main` publishes a patch release automatically:
203
230
  2. It commits `chore(release): vX.Y.(Z+1) [skip release]` back to `main`.
204
231
  3. It pushes the matching `vX.Y.(Z+1)` tag.
205
232
  4. The same workflow verifies the tag, builds, publishes to npm, and creates a GitHub release.
233
+ 5. `pnpm check:package` proves the npm tarball contains the `traces` binary before release.
206
234
 
207
235
  Minor releases are manual. Run the Publish workflow from GitHub Actions and choose `minor`; it publishes `X.(Y+1).0`. Use manual `patch` only when you need a patch release without merging a new code change.
208
236
 
@@ -214,6 +242,8 @@ The CLI is a thin consumer of these exports.
214
242
  |---|---|---|
215
243
  | `analyzeSpans` | `(spans, { registry?, ai?, budgetUsd? }) → AnalyzeResult` | run analysts — built-in, or **your own** via `registry` |
216
244
  | `watchSessions` | `(ObserverOptions) → Promise<void>` | live observer; `onLoop` / `onReport` / `signal` / `adapters` |
245
+ | `collectSessionIndex` | `(ScanOptions) → TraceSessionIndex` | scan sessions and return a reusable JSON-ready catalog |
246
+ | `inspectSessionIndex` | `(TraceSessionIndex) → TraceInspectionReport` | rank improvement findings from an index without rescanning sessions |
217
247
  | `buildPolicyEvidenceRecord` | `(ref, spans, opts?) → PolicyEvidenceRecord` | summarize one session for downstream policy mining |
218
248
  | `collectPolicyEvidence` | `(ScanOptions) → PolicyEvidenceRecord[]` | scan harness sessions and emit policy-evidence rows |
219
249
  | `exportTraceEvidenceFile` | `(path, opts?) → { format, spans, redactionCount }` | convert compact evidence/events/OpenInference files to redacted OpenInference spans |