agent-tracegraph 0.2.0__py3-none-any.whl

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.
@@ -0,0 +1,380 @@
1
+ Metadata-Version: 2.5
2
+ Name: agent-tracegraph
3
+ Version: 0.2.0
4
+ Summary: Time-travel debugging and causal RCA for LangGraph agent traces, on a causal graph.
5
+ Project-URL: Homepage, https://github.com/memtomem/tracegraph
6
+ Project-URL: Repository, https://github.com/memtomem/tracegraph
7
+ Project-URL: Issues, https://github.com/memtomem/tracegraph/issues
8
+ Project-URL: Changelog, https://github.com/memtomem/tracegraph/blob/tracegraph-mvp/CHANGELOG.md
9
+ Author: Tracegraph contributors
10
+ Author-email: "DAPADA Inc." <contact@dapada.co.kr>
11
+ License: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: agents,causal-graph,debugging,langgraph,observability,otlp,phoenix,root-cause-analysis,tracing
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Classifier: Topic :: Software Development :: Debuggers
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.12
22
+ Requires-Dist: langgraph-checkpoint-sqlite>=2
23
+ Requires-Dist: langgraph-checkpoint>=4.1
24
+ Requires-Dist: pydantic<3,>=2
25
+ Requires-Dist: rich>=13
26
+ Requires-Dist: typer>=0.12
27
+ Requires-Dist: xxhash>=3
28
+ Provides-Extra: cypher
29
+ Requires-Dist: ladybug<0.19,>=0.18; extra == 'cypher'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # tracegraph
33
+
34
+ Causal-graph analysis of LangGraph agent traces — *time-travel debugging and
35
+ root-cause analysis on a causal graph.*
36
+
37
+ tracegraph ingests agent execution traces that already exist (LangGraph checkpoint,
38
+ Phoenix CLI exports, and OpenInference/OTLP spans) into a **normalized causal graph**,
39
+ then runs analyses the mainstream observability tools don't:
40
+
41
+ - **`explain`** — walk backward from a failure over the *raw* causal graph to every real cause.
42
+ - **`diff`** — exact structural regression diff between two runs (rooted-tree / AHU isomorphism).
43
+ - **cross-trace pattern matching** — e.g. "tool X → retry → tool X → failure" across all runs.
44
+
45
+ It is **not** a checkpointer — a graph-backed `BaseCheckpointSaver` already exists.
46
+ tracegraph is the read-path *analysis* layer. See [`docs/FEASIBILITY.md`](docs/FEASIBILITY.md)
47
+ for the full rationale and competitive landscape. Korean readers can start with
48
+ [`docs/USAGE_KO.md`](docs/USAGE_KO.md).
49
+ Current delivery evidence, known limitations, and next work are maintained in
50
+ [`docs/HANDOFF.md`](docs/HANDOFF.md).
51
+
52
+ ## Install
53
+
54
+ ```bash
55
+ uv tool install agent-tracegraph
56
+ # or: python -m pip install agent-tracegraph
57
+
58
+ # With the optional Cypher accelerator (LadybugDB):
59
+ uv tool install "agent-tracegraph[cypher]"
60
+
61
+ # Or run it without installing:
62
+ uvx --from agent-tracegraph tracegraph --version
63
+ ```
64
+
65
+ **The distribution is `agent-tracegraph`; the command and the import package are
66
+ `tracegraph`.** The plain name was already taken on PyPI by an unrelated project, so only the
67
+ name you install differs — you still run `tracegraph` and still `import tracegraph`.
68
+
69
+ Requires Python 3.12. CI exercises 3.12 on Linux; other versions and platforms are untested
70
+ rather than unsupported.
71
+
72
+ ## Design commitment: causality is never faked
73
+
74
+ We persist the **raw multi-parent causal graph** as the system of record (`CAUSED_BY`,
75
+ keeping *every* real predecessor) and treat the single-parent tree (`TREE_PARENT`) as an
76
+ explicitly **derived, lossy projection**. Any step whose causality is collapsed for the
77
+ tree view is flagged `projection_lossy`, so RCA never silently presents a fabricated cause.
78
+
79
+ | analysis | reads |
80
+ |---|---|
81
+ | `explain` / RCA | raw `CAUSED_BY` |
82
+ | `diff` (AHU) | derived `TREE_PARENT` |
83
+ | `inspect` render | derived `TREE_PARENT` (lossiness annotated) |
84
+
85
+ ## Usage
86
+
87
+ ```bash
88
+ # ingest a LangGraph thread's checkpoint history from a SqliteSaver DB
89
+ tracegraph ingest --sqlite trace.db --thread A -o A.json
90
+ tracegraph ingest --sqlite trace.db --thread B -o B.json
91
+
92
+ tracegraph inspect A.json # render the causal tree (errors in red)
93
+ tracegraph explain A.json <step_id> # raw causal chain back to the root cause
94
+ tracegraph diff A.json B.json # structural regression diff (AHU isomorphism)
95
+ tracegraph validate A.json traces/ # validate artifacts before CI/query jobs
96
+ tracegraph analyze A.json # automatically select and explain failures
97
+
98
+ # Phoenix: one command after configuring the official `px` CLI
99
+ tracegraph phoenix doctor
100
+ tracegraph phoenix diagnose # latest failed trace; latest trace as fallback
101
+ tracegraph phoenix diagnose <trace-id> # explicit trace
102
+ tracegraph phoenix diagnose --project my-agent
103
+ # save only the body-free normalized evidence/report when needed
104
+ tracegraph phoenix diagnose <trace-id> --save-artifact safe.json --json-out report.json
105
+
106
+ tracegraph presets # list cross-trace query patterns
107
+ tracegraph query tool-failure A.json B.json # find a causal pattern across many traces
108
+ tracegraph query tool-retry-failure *.json # explicit retry marker, then same tool failing
109
+ tracegraph query tool-failure --backend ladybug A.json B.json # use the optional Cypher accelerator
110
+
111
+ # export versioned, body-free governance evidence (an empty match set is a valid report)
112
+ tracegraph export-review-candidates tool-retry-failure *.json -o candidates.json
113
+ ```
114
+
115
+ Frequently-used options, beyond `--out` / `--json-out`:
116
+
117
+ | option | commands | effect |
118
+ |---|---|---|
119
+ | `--trace`, `-t` | `ingest-otlp`, `ingest-phoenix`, `analyze` | Pick one trace out of a multi-trace export. |
120
+ | `--error-channel` | `ingest` | LangGraph state channel that signals a step error (default `error`). |
121
+ | `--baseline`, `--baseline-trace` | `analyze`, `phoenix diagnose` | Compare against a known-good run, and pick its trace out of a multi-trace file. |
122
+ | `--limit`, `-l` | `analyze`, `phoenix diagnose`, `query` | Cap how many failure candidates or matches are rendered (default 3 for diagnosis). |
123
+ | `--explain` | `query` | Print each match's raw causal chain back to its root cause. |
124
+ | `--structure` | `diff` | Compare topology only, ignoring labels. |
125
+ | `--backend` | `query` | Use the optional LadybugDB Cypher accelerator instead of the pure-Python matcher. |
126
+
127
+ ## Phoenix-first workflow
128
+
129
+ Phoenix remains the trace UI, evaluation, and operational-observability layer. tracegraph
130
+ adds deterministic causal diagnosis, retry-pattern detection, and baseline regression analysis
131
+ without copying prompt or output bodies into its artifacts.
132
+
133
+ Instrument LangGraph with the official OpenInference integration and configure Phoenix CLI
134
+ 1.0.4 or newer as described in the
135
+ [Phoenix LangGraph guide](https://arize.com/docs/phoenix/integrations/python/langgraph/langgraph-tracing)
136
+ and [Phoenix CLI reference](https://arize.com/docs/phoenix/sdk-api-reference/typescript/arizeai-phoenix-cli).
137
+ Check the connection, then diagnose without finding a trace id first:
138
+
139
+ ```bash
140
+ tracegraph phoenix doctor
141
+ tracegraph phoenix diagnose
142
+ tracegraph phoenix diagnose --project my-agent
143
+ tracegraph phoenix diagnose <trace-id>
144
+ tracegraph phoenix diagnose <trace-id> --baseline <known-good-trace-id>
145
+ ```
146
+
147
+ Without a trace id, tracegraph scans Phoenix's 20 newest traces and selects the newest failed
148
+ trace. If none failed, it says so and diagnoses the newest trace, so a first successful run is
149
+ still useful. Explicit ids bypass that selection. The command invokes only read-only
150
+ `px trace list/get --include-annotations` exports, analyzes them in memory, and does not persist
151
+ the raw Phoenix response. Phoenix connection details and credentials remain owned by `px`
152
+ profiles or environment variables; tracegraph never accepts an API key option. For an already
153
+ exported file or a shell pipeline:
154
+
155
+ Automatic retry diagnosis intentionally requires an upstream `retry:` CHAIN marker. SyncMill's
156
+ controlled retry telemetry emits this contract; generic OTLP and LangGraph-checkpoint producers
157
+ that do not emit it will not be labeled as retries automatically. Their repeated-tool signal
158
+ remains available with `tracegraph query tool-repeat-failure-heuristic`, but this inference-only
159
+ preset cannot create governance review candidates.
160
+
161
+ ```bash
162
+ tracegraph ingest-phoenix --file phoenix-trace.json --out tracegraph.json
163
+ tracegraph analyze phoenix-trace.json --json-out analysis.json
164
+ px trace get <trace-id> --format raw --no-progress | tracegraph analyze -
165
+ ```
166
+
167
+ Phoenix exports preserve span parents but currently do not expose the original OTLP span
168
+ links. These artifacts are explicitly marked `causal_fidelity=parent_only`; tracegraph warns
169
+ that additional fan-in causes may be missing instead of claiming a complete DAG.
170
+
171
+ The exact Phoenix CLI and server versions used by CI are centrally pinned. See the
172
+ [Phoenix runtime pin maintenance runbook](docs/phoenix-cli-contract.md) for the controlled
173
+ upgrade and contract-verification procedure, and the
174
+ [Phoenix + SyncMill operational E2E runbook](docs/phoenix-syncmill-e2e.md) for the scheduled
175
+ real-server verification boundary.
176
+
177
+ The default `safe-v1` privacy contract governs **analysis reports** (`analyze`,
178
+ `phoenix diagnose`, `--json-out`). It retains structural IDs, identifier-shaped operation
179
+ names, kind/status/time, tokens, explicit cost, and annotation name/label/score. It drops
180
+ prompts, inputs/outputs, messages, tool arguments/results, retrieved documents, arbitrary
181
+ metadata, raw errors and stacktraces, annotation explanations, session/user/project
182
+ identifiers, and credentials. Missing metrics are reported as `unavailable`, never as zero.
183
+
184
+ **Artifacts are not reports.** Phoenix ingestion applies the same filtering at the source
185
+ (identifier-shaped span names only, error messages dropped), but the OTLP and LangGraph
186
+ adapters record the span name and error text they were given: OTLP keeps `status.message`
187
+ and exception messages, and LangGraph stringifies the configured error state channel. Those
188
+ values reach the artifact on disk and are printed verbatim by `inspect` and `explain`. If
189
+ your producer puts prompt text or secrets in span names or error strings, treat artifacts
190
+ from those two adapters as sensitive, or ingest through Phoenix. See "Analysis and output
191
+ guarantees" below.
192
+
193
+ For link-preserving analysis, use the optional Collector fan-out example at
194
+ [`examples/otel-collector-phoenix-tracegraph.yaml`](examples/otel-collector-phoenix-tracegraph.yaml).
195
+ It sends the normal stream to Phoenix and an allowlisted JSONL copy to tracegraph. Then run:
196
+
197
+ ```bash
198
+ tracegraph ingest-otlp --file /tmp/tracegraph-otlp.jsonl --trace <trace-id> -o full-dag.json
199
+ tracegraph analyze full-dag.json
200
+ ```
201
+
202
+ The JSON analysis-report contract is versioned at
203
+ [`contracts/analysis-report.schema.json`](contracts/analysis-report.schema.json).
204
+ Schema v2 can also carry body-free Toolgraph preflight evidence: an exact SHA-256 artifact
205
+ digest, non-negative graph generation, and bounded verdict. This is trace metadata, never a
206
+ `CAUSED_BY` edge.
207
+
208
+ ```text
209
+ $ tracegraph inspect A.json
210
+ A (langgraph)
211
+ └── -1: CHAIN
212
+ └── 0: CHAIN
213
+ └── 1: plan
214
+ └── 2: call_tool ✗ tool failed on input 'boom-please'
215
+ └── 3: handle_error
216
+ └── 4: respond
217
+ 6 steps · 1 tool · 1 error · 0 lossy-projection
218
+
219
+ $ tracegraph diff A.json B.json
220
+ NOT IDENTICAL
221
+ • only in A under CHAIN > CHAIN > plan > call_tool: subtree handle_error(respond)
222
+ • only in B under CHAIN > CHAIN > plan > call_tool: subtree respond
223
+
224
+ $ tracegraph query tool-failure A.json B.json
225
+ A: call_tool
226
+ 1 match(es) across 1 trace(s)
227
+
228
+ $ tracegraph query tool-retry-failure retry.json
229
+ retry: search → retry:search → search
230
+ 1 match(es) across 1 trace(s)
231
+ ```
232
+
233
+ The official `tool-retry-failure@v2` matches three consecutive causal steps:
234
+ `TOOL X → CHAIN retry:* → TOOL X (ERROR)`. The producer must supply the explicit
235
+ retry marker and the endpoint must name the same tool. This strict pattern is review-exportable.
236
+ `tool-repeat-failure-heuristic` uses an unbounded gap and
237
+ `tool-retry-failure-near` a bounded gap (up to 30); both are query-only heuristics.
238
+ The generic matcher still supports gaps and back-references. Unbounded or oversized
239
+ Cypher patterns fall back to the Python matcher without truncating results.
240
+
241
+ Every shipped preset has a stable `pattern_id` and positive integer `pattern_version`, shown
242
+ as `pattern-id@vN` by `presets` and `query`. Increment the version when match semantics or
243
+ review-export eligibility changes; wording-only description edits keep the current version.
244
+
245
+ `export-review-candidates` accepts the same artifact-file/directory batches as `query` and
246
+ writes a deterministic schema-v1 envelope. Only presets ending in a failing `TOOL` predicate
247
+ are eligible. The matched endpoint name must already be a qualified `server::tool` key —
248
+ tracegraph never guesses that identity. Each candidate contains only `run_id`, pattern
249
+ id/version, tool key, and the SHA-256 digest of the exact normalized artifact that was queried.
250
+ There are no prompts, outputs, errors, step IDs, trace IDs, or local paths, and the command
251
+ never changes a Toolgraph manifest or policy. A matching artifact without `run_id` fails the
252
+ entire batch and leaves an existing output untouched; export never silently drops evidence.
253
+ The public schema is a repository-vendored contract (not wheel package data) at
254
+ [`contracts/review-candidates.schema.json`](contracts/review-candidates.schema.json); G3
255
+ consumers should vendor that file explicitly.
256
+
257
+ SyncMill can consume the report without importing this package:
258
+
259
+ ```bash
260
+ SYNCMILL_BOARD__ENABLED=true syncmill board import-review-candidates candidates.json
261
+ ```
262
+
263
+ The importer creates deterministic, human-required `review` items. It does not run agents,
264
+ invoke Toolgraph, or reinterpret strict enforcement policy. Controlled SyncMill E2E covers qualified tool spans, explicit retry causality, Phoenix
265
+ streaming, and review intake. Fixture tests remain separate evidence; general deployment
266
+ coverage and production acceptance are not established by the controlled workflow.
267
+
268
+ Toolgraph G3 can independently review the same report with `review-candidates list/annotate`.
269
+ Like SyncMill, it derives the same UUIDv5 from the exact candidate tuple for correlation,
270
+ but stores dispositions in a separate exact-report-digest-bound sidecar. Toolgraph
271
+ `accepted` neither completes the SyncMill board item nor changes a manifest, selector
272
+ result, blast radius, preflight result, or graph state.
273
+
274
+ ## Status
275
+
276
+ **MVP works** — LangGraph/Phoenix/OTLP ingest plus inspect, explain, analyze, diff, and query.
277
+
278
+ - **Phase 0 (frozen contract):** `RawTrace` vs `NormalizedTrace`, portable JSON artifact (system of record), `validate_raw` → projection → `validate_tree`/`validate_normalized`, in-memory store, `explain`.
279
+ - **Phase 1 (ingestion):** `LangGraphCheckpointAdapter` reads any `BaseCheckpointSaver`, including subgraph checkpoint namespaces, and reconstructs declared checkpoint parentage; `examples/tiny_agent.py` generates real traces.
280
+ - **Phase 2 (analysis + CLI):** AHU rooted-tree diff and the Typer CLI.
281
+ - **Phase 3 (cross-trace queries):** backend-neutral `PathPattern` matcher over the raw causal graph + `query`/`presets` CLI — pure-Python, proving the "graph queries" value before any Cypher backend. The official `tool-retry-failure@v2` requires an explicit producer marker; variable-length **gaps** and **back-references** (`same_name_as`) remain available for query-only heuristics. Uncompilable unbounded patterns degrade honestly rather than truncate.
282
+ - **Phase 5 (OTLP/OpenInference adapter):** `OTLPSpanAdapter` ingests Collector JSON/JSONL spans into the same causal model — the source that exercises full link-preserving raw/derived causality.
283
+ - **Phoenix diagnosis:** `PhoenixExportAdapter`, `analyze`, and `phoenix diagnose` provide body-free automatic failure selection, retry detection, telemetry/evaluation summaries, and explicit parent-only fidelity warnings.
284
+ - **Phase 6 (optional Cypher backend):** `agent-tracegraph[cypher]` ships a `LadybugStore` that compiles the **same** `PathPattern` spec to Cypher (`compile_to_cypher`); equivalence with the pure-Python matcher is the test contract, so the Cypher path is an accelerator, never a second source of truth.
285
+ - **Ecosystem T3/P4 review slice:** OTLP `syncmill.run_id` correlation, versioned presets, deterministic body-free `export-review-candidates`, SyncMill human-review board intake, Toolgraph G3 artifact annotation, and the pinned live single-failure review path are complete. Explicit retry causality and SyncMill-to-Phoenix streaming are covered by the controlled E2E workflow; broader operational coverage remains separate.
286
+ - **SyncMill contract completion:** route/pipeline/compete/council/decompose plus cancellation fixtures, stable span naming, body-free artifact digests, fail-open exporter reference behavior, operational failure presets, and non-causal Toolgraph preflight evidence are covered by executable tests.
287
+
288
+ Caveat for the checkpoint adapter: it is a **checkpoint-level** view (one node per
289
+ super-step), and node names/kinds are best-effort metadata. Phoenix/OTLP adapters are
290
+ span-level. Subgraph checkpoints are namespaced, but cross-namespace causality remains
291
+ limited to parent links declared by LangGraph checkpoint metadata.
292
+
293
+ ## Develop
294
+
295
+ ```bash
296
+ uv sync # core only
297
+ uv sync --extra cypher # include the optional LadybugDB backend
298
+ uv run pytest # headless
299
+ ```
300
+
301
+ CI also builds the wheel and installs it with locked runtime dependencies in fresh
302
+ core and Cypher environments. `scripts/verify_wheel.py` exercises the installed CLI
303
+ outside the checkout, checks candidate golden bytes and baseline diagnosis, and verifies
304
+ the optional-backend boundary and parity. See the [handoff runbook](docs/HANDOFF.md)
305
+ for local reproduction and the distinction between local checks and remote/server evidence.
306
+
307
+ Releases are tag-driven: a `v*` tag publishes to PyPI through Trusted Publishing, and a
308
+ `test-v*` tag rehearses the same build against TestPyPI. The procedure, including what is
309
+ verified before anything is uploaded, is in the [release runbook](docs/releasing.md).
310
+
311
+ The optional Cypher accelerator (`agent-tracegraph[cypher]`, LadybugDB) is **not** required for the
312
+ core; `explain` and `query` can opt into it with `--backend ladybug`. Its tests are marked
313
+ `@pytest.mark.cypher` and skip cleanly without the extra. The tested LadybugDB compatibility
314
+ range is declared in `pyproject.toml`; its embedded cache format is not load-bearing because
315
+ the portable JSON artifact remains authoritative and can rebuild the cache.
316
+
317
+ ## Analysis and output guarantees
318
+
319
+ Implicit ingest filenames keep short portable identifiers as `<id>.json`; other IDs use
320
+ `trace-<sha256>.json`. Existing default outputs cause exit 2; use `--out` to explicitly
321
+ replace a file. Outputs cannot alias an input or another output. Completed artifacts
322
+ are published atomically. SQLite ingest uses a read-only connection and a private backup
323
+ with a 30-second deadline, preserving source data, schema, and journal mode. Live WAL
324
+ readers can still participate in SQLite's WAL/shared-memory coordination.
325
+
326
+ `safe-v1` reports retain identifier-shaped display names and replace other display text
327
+ with deterministic SHA-256 aliases, and disclose in `warnings` when an alias actually reached
328
+ the report. Trace/step identifiers remain; this is not anonymization.
329
+ Raw artifact names and bytes are not rewritten for report privacy or matching, so the
330
+ artifact — unlike the report — can still carry whatever the producer put in a span name or
331
+ error message (Phoenix ingestion excepted; it filters at the source).
332
+ `export-review-candidates` output is not passed through the report redactor: its `tool_key`
333
+ is the raw endpoint span name. Logical
334
+ comparison keys are JSON-encoded typed paths; consumers should treat them as opaque strings.
335
+ Containment and unknown edges preserve all error investigation candidates, deeper first.
336
+ Explicit causal ancestry supplies context, not proof that an exception propagated.
337
+ Explicit OTLP OK takes precedence over handled exception events on new ingestion; old
338
+ artifacts are not reinterpreted.
339
+
340
+ LangGraph ingestion reads both the configured error state channel and native task failures
341
+ from checkpoint pending writes. A node that raises becomes a derived `task` step under the
342
+ checkpoint that scheduled it, never a mark on that checkpoint, whose own name belongs to the
343
+ node that produced it. The failing node is named by recomputing LangGraph's task id from
344
+ checkpoint data; when nothing proves which node ran, the step stays unnamed rather than
345
+ borrowing a neighbour's name. When one task raises, LangGraph
346
+ cancels its siblings and records that through the same channel; a cancelled task is reported
347
+ as an `unset` step with no message, because it was torn down rather than at fault. Only the
348
+ latest persisted error survives per task, so repeated attempts are not reconstructed, and
349
+ `Send` packets are nameable only where `langgraph.types` is importable — an ordinary install discloses them instead. An artifact carrying derived task
350
+ steps declares artifact `schema_version` 3, so an older reader refuses it by name; artifacts
351
+ without them still serialize as version 2, byte for byte. Missing observed errors still do not
352
+ prove success: an artifact ingested by an older build, or one using an unrecognized checkpoint
353
+ layout, carries no derived step and looks exactly like a clean run, which is why the capture
354
+ disclosure is unconditional. Link preservation
355
+ means valid in-trace links only. Structural diff compares the derived tree and discloses
356
+ lossy step counts. Metrics sum available span observations: partial coverage and producer
357
+ aggregation can undercount or double count. Coverage gaps are disclosed rather than absorbed
358
+ — a wall duration derived from a subset of steps says so, one whose end precedes its start is
359
+ withheld, and a single unparseable cost withholds the whole total instead of understating it. File input has a size limit, but stdin/Phoenix
360
+ subprocess output and query materialization are not streaming memory guarantees.
361
+
362
+ Both stores isolate returned mutable objects. InMemory node upsert replaces by ID;
363
+ Ladybug's existing insertion semantics are unchanged. Use `is_isomorphic` or `diff` for
364
+ deep-tree equality; `canonical()` preserves nested tuples, whose external Python equality
365
+ can still reach the interpreter recursion limit. CI currently covers Python 3.12/Linux;
366
+ other supported Python versions and platforms require separate validation.
367
+
368
+ ## Contributing, security, and license
369
+
370
+ - **Contributing:** [CONTRIBUTING.md](CONTRIBUTING.md) — development setup, what this project
371
+ treats as a defect, and the Contributor License Agreement.
372
+ - **CLA:** [CLA.md](CLA.md). Signing is one-time per GitHub account per repository; a workflow
373
+ comments on your first pull request with instructions.
374
+ - **Code of conduct:** [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) — applies to issues, pull
375
+ requests and discussions.
376
+ - **Security:** [SECURITY.md](SECURITY.md) — please use private vulnerability reporting rather
377
+ than a public issue. Read the redaction boundary there before sharing artifacts: reports are
378
+ filtered, **artifacts are not**.
379
+ - **License:** Apache License 2.0 — see [LICENSE](LICENSE).
380
+ Copyright 2025-2026 DAPADA Inc. and memtomem contributors.
@@ -0,0 +1,28 @@
1
+ tracegraph/__init__.py,sha256=gqODZ0MzozSo5hhOSDuYHIRxIQx5f3SAAHE8ZMzMCeU,1090
2
+ tracegraph/artifact.py,sha256=uv3WUAdugnX7sw1RKso909ecjOXW6fcO5hATessHykA,9699
3
+ tracegraph/cli.py,sha256=MWafSXg1kSNFhYtBNsNWtmVzyj04gNzupTRcEVZtMyI,53211
4
+ tracegraph/input_validation.py,sha256=Q7wr8OGb76k9A7JnqRTDfvhzpr5SmWXoa-DJSBEtjLo,485
5
+ tracegraph/model.py,sha256=PmVJF1nY_1SZlKeLXAMk4-2tAAduwWuQg3O9RcskYgo,8268
6
+ tracegraph/normalize.py,sha256=yh07rnwE1EfH502rEelYwuaLZwdZr6X5hexHBL2ctts,12173
7
+ tracegraph/review_candidates.py,sha256=N2YwbjJJzXhwPWdO2I8zdVLU69PIuMuo55aQ7q3cMoQ,5284
8
+ tracegraph/sqlite_snapshot.py,sha256=ueBMsjyO6-qyjU9AyVFDphqjEqU7EWKXAeMQNW6MvfQ,3134
9
+ tracegraph/adapters/__init__.py,sha256=SdcYE6855d67-6bH_YXNXPeIdfk8iqVBbp8DkHWeiyo,439
10
+ tracegraph/adapters/base.py,sha256=9lKWLLRzTi4URhEDbKLRjAuvjtL2fC4zbfryOQGXiCo,699
11
+ tracegraph/adapters/langgraph_checkpoint.py,sha256=qfzdOGRF7J5VsmkN33MMyin9wzEqverlE9lXMLlNVZk,37328
12
+ tracegraph/adapters/otlp_spans.py,sha256=ujn9dIWQrnjx280T6Ns92MiLZd6vja6jTbLL4kKHvto,31615
13
+ tracegraph/adapters/phoenix_export.py,sha256=W0O0ZK4IEiuNMQxaGeUkb1NvVb0Ykyrm-BfXfjKrk98,8101
14
+ tracegraph/analysis/__init__.py,sha256=5A09X2PjZi2AFbt61YO1KW1MtFqLn49hCNbrRLFwlNE,1244
15
+ tracegraph/analysis/ahu.py,sha256=TVcIG4nHbQ8ZLKs8f63BpDkHt_KOXZ3CPW7QgTP7K_8,14180
16
+ tracegraph/analysis/diagnose.py,sha256=OZmN7dclbKntq0yxWOxKBmOStfGa0MYpDoTzrwb-70w,27528
17
+ tracegraph/analysis/explain.py,sha256=TTGqZQgzyUaYxWfz5mqwNwIda5TxMoA_bP64SnFM2g8,1791
18
+ tracegraph/analysis/patterns.py,sha256=yO7I-O-3UHWp6XxfVmoqt4CdYEAFnWEahkqt97UXCJs,28954
19
+ tracegraph/store/__init__.py,sha256=lbBjqr5hNDMCdjoqKXQm3sku9brWeZs_H84wi8-cjT8,886
20
+ tracegraph/store/base.py,sha256=fKGgRQ371nkHyLcxo-Xj-TA-WdYXtVavwojPcAGqvF8,1611
21
+ tracegraph/store/in_memory.py,sha256=EpxzRZwWzwOpEMKY0aarwIWIhu4Eeab1XfW5cMr5S8w,3547
22
+ tracegraph/store/ladybug.py,sha256=PGL_BcYJpLvwkSjUcLL67VPh9vNtEUxWR5p_JflwZfY,21464
23
+ tracegraph/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
+ agent_tracegraph-0.2.0.dist-info/METADATA,sha256=Nt07aaePjfJB3usw3855jg4fSMmSmOs85ef4LidSja8,23319
25
+ agent_tracegraph-0.2.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
26
+ agent_tracegraph-0.2.0.dist-info/entry_points.txt,sha256=wCC0rwSF1hQpQ0uXokX882aNFKYz5sm986UUzZ_n8kE,51
27
+ agent_tracegraph-0.2.0.dist-info/licenses/LICENSE,sha256=g5TN30YQu2ELU5GmcdoxaxXI_IfrxVtU39K1IE2gWsY,10794
28
+ agent_tracegraph-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ tracegraph = tracegraph.cli:main
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2025-2026 DAPADA Inc. and memtomem contributors
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
tracegraph/__init__.py ADDED
@@ -0,0 +1,38 @@
1
+ """tracegraph — causal-graph analysis of LangGraph agent traces."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version as _version
4
+
5
+ from tracegraph.model import (
6
+ Edge,
7
+ EdgeType,
8
+ NormalizedTrace,
9
+ RawTrace,
10
+ Step,
11
+ StepKind,
12
+ StepSource,
13
+ StepStatus,
14
+ Trace,
15
+ )
16
+
17
+ try:
18
+ #: Read from the installed distribution so there is exactly one source of truth for the
19
+ #: version — pyproject.toml. A hard-coded literal here would silently drift from it.
20
+ #: The *distribution* name, which is not the import name: `tracegraph` was taken on PyPI.
21
+ #: Getting this wrong is silent — the lookup raises PackageNotFoundError and the except
22
+ #: branch below reports 0.0.0.dev0 for a perfectly good install.
23
+ __version__ = _version("agent-tracegraph")
24
+ except PackageNotFoundError: # running from a source tree that was never installed
25
+ __version__ = "0.0.0.dev0"
26
+
27
+ __all__ = [
28
+ "__version__",
29
+ "Edge",
30
+ "EdgeType",
31
+ "NormalizedTrace",
32
+ "RawTrace",
33
+ "Step",
34
+ "StepKind",
35
+ "StepSource",
36
+ "StepStatus",
37
+ "Trace",
38
+ ]