This document defines the design principles, scope, and execution roadmap for Forkline.
It is the canonical source of truth for what Forkline is, what it is not, and how it evolves. All feature work and design decisions should align with this document.
Forkline is a local-first, replay-first tracing and diffing library for agentic AI workflows.
Its core goal is to make agent runs:
- reproducible
- inspectable
- diffable
Forkline treats nondeterminism as a bug to be controlled, not a mystery to be observed.
Forkline explicitly does not aim to be:
- an evaluation or benchmarking framework
- prompt engineering or prompt optimization tooling
- a hosted SaaS or dashboard product
- a generic “AI observability” platform
- a metrics-first analytics system
If a feature does not help reproduce, replay, or diff an agent run, it does not belong in Forkline.
These principles are non-negotiable and inform every design decision.
Forkline prioritizes deterministic replay over real-time inspection. A run that cannot be replayed is considered incomplete.
Forkline prefers correctness and reproducibility over aggregated metrics or trends. Understanding why something changed matters more than observing that it changed.
All artifacts are stored locally. Replay must work offline. No hidden remote state is allowed in the core workflow.
Forkline treats agent behavior like code. Changes are understood through diffs, not charts.
Run artifacts, tool calls, and metadata use explicit, versioned schemas. Implicit behavior is avoided.
Forkline is CLI-first by design.
The CLI defines the real API surface and semantic contract. Any future UI must be a thin layer on top of the CLI, never the source of truth.
Forkline follows semantic versioning with strict guarantees.
- v0.x
- APIs may change
- Focus is on correctness, determinism, and core semantics
- v1.0
- Artifact formats stabilized
- Replay and diff semantics locked
- Backward compatibility guaranteed
Breaking changes after v1.0 are strongly discouraged.
The v0 series is intentionally narrow. The goal is to establish a trustworthy core, not a feature-rich platform.
- Deterministic recording of agent runs
- Self-contained run artifacts
- Local storage (file-based or SQLite)
- No replay yet, record-only
- Replay runs without re-invoking the LLM
- No network calls during replay
- Identical behavior guaranteed
- Step-by-step comparison with first-divergence semantics
- ReplayContext for injecting recorded outputs
- Step-by-step comparison of two runs
- Detection of first divergence with resync window
- Deterministic canonicalization (NFC unicode, sorted keys, stable floats)
- Structured JSON diff patches (add/remove/replace with stable ordering)
- Seven divergence types: exact_match, input/output/op/error divergence, missing/extra steps
- Clear presentation of old vs new state with context window
- JSON-serializable
FirstDivergenceResult
forkline run <script> [-- args...]— execute under tracing, record metadata, print run_idforkline list [--limit N] [--json]— list runs newest-first (table or JSON)forkline replay <run_id> [--json]— load run and print summary (events, duration, status)forkline diff <run_a> <run_b> [--format pretty|json]— event-level first-divergence diff- Human-readable text output and JSON output
- Scriptable exit codes (0 = success, 1 = diff found, 2 = missing run / bad input)
--dbflag on every subcommand for custom database pathFORKLINE_TRACING,FORKLINE_RUN_ID,FORKLINE_DBenv vars for script integration- Ollama Qwen3 example demonstrating nondeterminism detection (
examples/ollama_qwen3.py)
- Deterministic execution for tests
- Fail CI on unexpected diffs
- Zero network dependency
The following are explicitly out of scope for the v0 series:
- Web dashboards or UIs
- Hosted services
- Model evaluation or scoring
- Prompt experimentation tooling
- Visualization-heavy workflows
These may be reconsidered only after v1.0.
If Forkline cannot explain why an agent changed behavior, it has failed its purpose.