@tangle-network/traces 0.9.16 → 0.9.17
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
|
@@ -23,6 +23,7 @@ It reads the transcripts your harness leaves on disk, reconstructs the run as sp
|
|
|
23
23
|
- [Policy-mining evidence](#policy-mining-evidence)
|
|
24
24
|
- [Upload to the Intelligence Platform](#upload-to-the-intelligence-platform)
|
|
25
25
|
- [Trace analysts](#trace-analysts)
|
|
26
|
+
- [Agent skills](#agent-skills)
|
|
26
27
|
- [Library (SDK)](#library-sdk)
|
|
27
28
|
- [Examples](#examples)
|
|
28
29
|
- [Develop](#develop)
|
|
@@ -373,6 +374,32 @@ See [`examples/external-engines.ts`](./examples/external-engines.ts).
|
|
|
373
374
|
|
|
374
375
|
> For the built-in agentic analysts (`--llm`), set `OPENAI_API_KEY`, or point at any OpenAI-compatible gateway with `OPENAI_BASE_URL` (e.g. an internal router) to use a non-OpenAI key.
|
|
375
376
|
|
|
377
|
+
## Agent skills
|
|
378
|
+
|
|
379
|
+
The npm package ships two AgentProfile-ready skills:
|
|
380
|
+
|
|
381
|
+
| Skill | Use |
|
|
382
|
+
|---|---|
|
|
383
|
+
| [`inspect-agent-traces`](./skills/inspect-agent-traces/SKILL.md) | select workflows and export deterministic findings |
|
|
384
|
+
| [`build-trace-analyst`](./skills/build-trace-analyst/SKILL.md) | write and calibrate a custom analyst |
|
|
385
|
+
|
|
386
|
+
Load both from GitHub:
|
|
387
|
+
|
|
388
|
+
```ts
|
|
389
|
+
import { defineGitHubResource } from '@tangle-network/agent-interface'
|
|
390
|
+
|
|
391
|
+
const ref = process.env.TRACES_SKILLS_REF
|
|
392
|
+
if (!ref) throw new Error('TRACES_SKILLS_REF must be an immutable commit')
|
|
393
|
+
|
|
394
|
+
const names = ['inspect-agent-traces', 'build-trace-analyst']
|
|
395
|
+
const skills = names.map((name) => defineGitHubResource(`skills/${name}/SKILL.md`, {
|
|
396
|
+
repository: 'tangle-network/traces',
|
|
397
|
+
ref,
|
|
398
|
+
name,
|
|
399
|
+
}))
|
|
400
|
+
const profile = { name: 'trace-reviewer', resources: { skills } }
|
|
401
|
+
```
|
|
402
|
+
|
|
376
403
|
## Release automation
|
|
377
404
|
|
|
378
405
|
Merging to `main` publishes a patch release automatically:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/traces",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17",
|
|
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",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"import": "./dist/index.js"
|
|
31
31
|
},
|
|
32
|
-
"./package.json": "./package.json"
|
|
32
|
+
"./package.json": "./package.json",
|
|
33
|
+
"./skills/*": "./skills/*"
|
|
33
34
|
},
|
|
34
35
|
"bin": {
|
|
35
36
|
"traces": "dist/cli.js"
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"dist",
|
|
39
40
|
"docs",
|
|
40
41
|
"examples",
|
|
42
|
+
"skills",
|
|
41
43
|
"install.sh",
|
|
42
44
|
"README.md"
|
|
43
45
|
],
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build-trace-analyst
|
|
3
|
+
description: Write and calibrate a custom agent-eval trace analyst on real and labeled workflows.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Build a trace analyst
|
|
7
|
+
|
|
8
|
+
Implement one measurable finding that existing analysts do not provide.
|
|
9
|
+
|
|
10
|
+
## Check coverage
|
|
11
|
+
|
|
12
|
+
1. Run maintained analysis on one positive and one clean case.
|
|
13
|
+
2. Call `buildDefaultAnalystRegistry().list()` for batch analysts.
|
|
14
|
+
Check live analysts separately only for `traces stream`.
|
|
15
|
+
3. Search source or public docs once for the target behavior, then decide.
|
|
16
|
+
|
|
17
|
+
Extend an existing analyst when it already emits the target with usable evidence.
|
|
18
|
+
Do not inspect bundled `dist` or `node_modules`.
|
|
19
|
+
|
|
20
|
+
## Implement
|
|
21
|
+
|
|
22
|
+
- Use `Analyst`, `AnalystRegistry`, `TraceAnalysisStore`, and `makeFinding` from `@tangle-network/traces`.
|
|
23
|
+
- Start with `getOverview`; narrow with `queryTraces`, `viewSpans`, or `searchTrace`.
|
|
24
|
+
- Pass `context.signal` through reads and model calls.
|
|
25
|
+
- Return stable `analyst_id`, `area`, `subject`, and `id_basis` values.
|
|
26
|
+
- Cite exact spans as `trace://<trace-id>/span/<span-id>`.
|
|
27
|
+
- Return no finding when evidence is absent.
|
|
28
|
+
- Use `cost.kind: 'deterministic'` only without model calls.
|
|
29
|
+
- For `cost.kind: 'llm'`, use the injected chat client, budget, cancellation, and usage recording.
|
|
30
|
+
- Extend `buildDefaultAnalystRegistry()` unless full replacement is intentional.
|
|
31
|
+
|
|
32
|
+
Use the [custom analyst](../../examples/custom-analyst.ts) and [config](../../examples/improvement-config.mjs) examples rather than adding a wrapper.
|
|
33
|
+
|
|
34
|
+
## Run
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm tsx examples/custom-analyst.ts --fixture
|
|
38
|
+
pnpm tsx examples/custom-analyst.ts --good-fixture
|
|
39
|
+
traces improve --harness codex --current --latest-turn --workflow \
|
|
40
|
+
--config traces.config.mjs --dir .traces/custom-analyst
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Inspect every finding and cited span.
|
|
44
|
+
|
|
45
|
+
## Calibrate
|
|
46
|
+
|
|
47
|
+
Use `runAnalystBenchmark` with `registryBenchmarkRunner` from `@tangle-network/agent-eval/analyst`.
|
|
48
|
+
Use AgentRx or CodeTraceBench labels when they match the finding.
|
|
49
|
+
Compare the candidate with a no-findings baseline and relevant maintained or external analysts on identical cases and limits.
|
|
50
|
+
|
|
51
|
+
Use at least 20 independent cases before comparative statistics.
|
|
52
|
+
Retain every case row and report exact-step recall, precision, F1, root-step accuracy when labeled, citation coverage and validity, clean-case false positives, repeat agreement, failures, latency, calls, all token fields, and known or missing cost.
|
|
53
|
+
|
|
54
|
+
Do not claim quality from fixtures alone.
|
|
55
|
+
Require a fresh task comparison before using findings to change an agent or knowledge base.
|
|
56
|
+
|
|
57
|
+
## Then consider
|
|
58
|
+
|
|
59
|
+
- Use `inspect-agent-traces` to investigate a miss or false positive on its original workflow.
|
|
60
|
+
- Use `calibrate-before-measure` before trusting a new label set or scoring rule.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: inspect-agent-traces
|
|
3
|
+
description: Inspect real agent workflows with the published Traces CLI and export cited local findings.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Inspect agent traces
|
|
7
|
+
|
|
8
|
+
Use the deterministic CLI first.
|
|
9
|
+
Keep inspection local and read-only.
|
|
10
|
+
|
|
11
|
+
## Select the workflow
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
traces --version
|
|
15
|
+
traces list --harness codex --cwd "$PWD"
|
|
16
|
+
traces analyze --harness codex --current --latest-turn --workflow \
|
|
17
|
+
--out .traces/current.md
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- Use `--current` for the active Codex session.
|
|
21
|
+
- Use `--session <id-or-path>` to pin a listed session.
|
|
22
|
+
- Use `--latest-turn` for the current task in a resumed Codex or Claude Code session.
|
|
23
|
+
- Use `--workflow` to include workers linked by stable parent and child IDs.
|
|
24
|
+
- Use `--max-workflow-sessions <n>` only when the default 100-file bound is insufficient.
|
|
25
|
+
- For Claude Code, use `--harness claude-code --session <path> --latest-turn`; nested subagents are included.
|
|
26
|
+
|
|
27
|
+
Never join agents by display name or timestamp when Traces reports missing or conflicting IDs.
|
|
28
|
+
|
|
29
|
+
## Export
|
|
30
|
+
|
|
31
|
+
Write normalized OpenInference spans for another tool:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
traces convert --harness codex --current --latest-turn --workflow \
|
|
35
|
+
--otlp .traces/current.otlp.jsonl
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Write the complete deterministic review packet:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
traces improve --harness codex --current --latest-turn --workflow \
|
|
42
|
+
--dir .traces/improvement
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`improve` writes findings, evidence, a report, and spans.
|
|
46
|
+
It does not edit an agent, repository, memory store, or knowledge base.
|
|
47
|
+
|
|
48
|
+
## Report
|
|
49
|
+
|
|
50
|
+
- State the harness, selected task boundary, session and span counts, and integrity warnings.
|
|
51
|
+
- Cite each finding with its exact `trace://` reference.
|
|
52
|
+
- Mark missing outcome, cost, token, skill, or relationship data as unknown.
|
|
53
|
+
- Do not infer task success from a completion message.
|
|
54
|
+
- Do not infer skill use from reading a `SKILL.md`.
|
|
55
|
+
- Do not upload traces unless explicitly requested.
|
|
56
|
+
|
|
57
|
+
## Then consider
|
|
58
|
+
|
|
59
|
+
- Use `build-trace-analyst` when deterministic findings cannot answer a repeated trace question.
|
|
60
|
+
- Use `autopsy` when the result is empty, surprising, or suspiciously strong.
|