Update README.md
Browse files
README.md
CHANGED
|
@@ -12,23 +12,24 @@ short_description: Diff agent timelines. Find first divergence. Export forensic
|
|
| 12 |
thumbnail: >-
|
| 13 |
https://cdn-uploads.huggingface.co/production/uploads/685edcb04796127b024b4805/cc2glLOtiZJWxbbDoELfT.jpeg
|
| 14 |
---
|
| 15 |
-
|
| 16 |
|
| 17 |
-
Production agents
|
| 18 |
-
Benchmarks tell you *whether* you failed. Logs tell you *what happened once*.
|
|
|
|
| 19 |
|
| 20 |
## What this Space does
|
| 21 |
- Upload **two DRP trace bundles (.zip)**
|
| 22 |
- Computes:
|
| 23 |
-
- **
|
| 24 |
-
-
|
| 25 |
-
-
|
|
|
|
| 26 |
- Exports:
|
| 27 |
-
- `report.md
|
| 28 |
-
-
|
| 29 |
-
-
|
| 30 |
-
-
|
| 31 |
-
- Create a patched “fork” bundle (counterfactual edit) for sandbox what-if workflows
|
| 32 |
|
| 33 |
## DRP bundle format (v0)
|
| 34 |
A bundle is a `.zip` containing:
|
|
@@ -38,17 +39,22 @@ A bundle is a `.zip` containing:
|
|
| 38 |
Each event is hash-chained:
|
| 39 |
- `prev` is the previous event hash
|
| 40 |
- `hash` is SHA-256 of canonical event JSON
|
| 41 |
-
This
|
| 42 |
|
| 43 |
-
##
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
## Quick start (local)
|
| 49 |
-
```bash
|
| 50 |
-
pip install -r requirements.txt
|
| 51 |
-
python app.py
|
| 52 |
Suggested event kinds
|
| 53 |
• llm_sample
|
| 54 |
• tool_call
|
|
@@ -57,9 +63,17 @@ Suggested event kinds
|
|
| 57 |
• plan_step
|
| 58 |
• guardrail
|
| 59 |
• state_snapshot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
---
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
```python
|
| 65 |
__all__ = [
|
|
@@ -71,6 +85,7 @@ __all__ = [
|
|
| 71 |
"write_bundle_zip",
|
| 72 |
"diff_bundles",
|
| 73 |
"render_report_markdown",
|
|
|
|
| 74 |
"make_demo_bundle_zip",
|
| 75 |
"fork_patch_bundle",
|
| 76 |
]
|
|
|
|
| 12 |
thumbnail: >-
|
| 13 |
https://cdn-uploads.huggingface.co/production/uploads/685edcb04796127b024b4805/cc2glLOtiZJWxbbDoELfT.jpeg
|
| 14 |
---
|
| 15 |
+
TimelineDiff — Differential Reproducibility Protocol (DRP)
|
| 16 |
|
| 17 |
+
Production agents diverge: sampling variance, flaky tools, drifting data, timing/race effects.
|
| 18 |
+
Benchmarks tell you *whether* you failed. Logs tell you *what happened once*.
|
| 19 |
+
TimelineDiff tells you **why two runs diverged**.
|
| 20 |
|
| 21 |
## What this Space does
|
| 22 |
- Upload **two DRP trace bundles (.zip)**
|
| 23 |
- Computes:
|
| 24 |
+
- **Timeline alignment** (same / diff / missing)
|
| 25 |
+
- **First divergence index**
|
| 26 |
+
- Divergence class (sampling / tool / memory / control-flow / governance / state)
|
| 27 |
+
- Per-event structured diffs (JSON)
|
| 28 |
- Exports:
|
| 29 |
+
- `report.md` (human-readable)
|
| 30 |
+
- `report.pdf` (stakeholder-ready)
|
| 31 |
+
- `diff.json` (machine-readable)
|
| 32 |
+
- `drp-diff-report.zip` (all of the above)
|
|
|
|
| 33 |
|
| 34 |
## DRP bundle format (v0)
|
| 35 |
A bundle is a `.zip` containing:
|
|
|
|
| 39 |
Each event is hash-chained:
|
| 40 |
- `prev` is the previous event hash
|
| 41 |
- `hash` is SHA-256 of canonical event JSON
|
| 42 |
+
This makes the timeline tamper-evident.
|
| 43 |
|
| 44 |
+
## Optional ReplayProof deep-linking
|
| 45 |
+
If you include either of the following in `manifest.json`, TimelineDiff will generate per-event links:
|
| 46 |
+
|
| 47 |
+
### Option A (recommended)
|
| 48 |
+
```json
|
| 49 |
+
"replay": {
|
| 50 |
+
"base_url": "https://your-space-or-site",
|
| 51 |
+
"pattern": "/?run_id={run_id}&i={i}"
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
Option B
|
| 55 |
+
"run_url": "https://your-viewer/run/demo-123"
|
| 56 |
+
Links will appear in the report and in the diff JSON.
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
Suggested event kinds
|
| 59 |
• llm_sample
|
| 60 |
• tool_call
|
|
|
|
| 63 |
• plan_step
|
| 64 |
• guardrail
|
| 65 |
• state_snapshot
|
| 66 |
+
|
| 67 |
+
Optional reward delta
|
| 68 |
+
|
| 69 |
+
If your state_snapshot.payload includes:
|
| 70 |
+
• reward_total, or
|
| 71 |
+
• metrics.reward_total
|
| 72 |
+
|
| 73 |
+
…TimelineDiff will compute final_reward_delta.
|
| 74 |
---
|
| 75 |
|
| 76 |
+
## `drp/__init__.py`
|
| 77 |
|
| 78 |
```python
|
| 79 |
__all__ = [
|
|
|
|
| 85 |
"write_bundle_zip",
|
| 86 |
"diff_bundles",
|
| 87 |
"render_report_markdown",
|
| 88 |
+
"write_pdf_report",
|
| 89 |
"make_demo_bundle_zip",
|
| 90 |
"fork_patch_bundle",
|
| 91 |
]
|