Skip to main content
The platform includes endpoints that simulate replay and analyze runs for non-determinism.
In v0.1 the platform replay endpoint does not execute your code. For actual replay execution, use the SDK (Replay).

Endpoint summary

Replay a run (simulation)

This inspects recorded inputs and flags common sources of non-determinism (timestamps, random values, UUIDs).

Determinism analysis

Returns a comprehensive “determinism score” and actionable recommendations.

What it analyzes

The determinism analyzer performs static analysis on your run’s actions to identify patterns that indicate non-deterministic behavior: Timestamp dependencies
  • datetime.now(), time.time(), current_time
  • Actions that depend on current timestamps
  • Date/time-based logic that varies per execution
Random value generation
  • random.random(), random.randint(), random.choice()
  • Unseeded random number generators
  • Stochastic sampling
UUID generation
  • uuid.uuid4() and other UUID variants
  • Auto-generated IDs that change per run
  • Non-deterministic identifiers
Process/environment dependencies
  • os.getpid(), process IDs
  • socket.gethostname(), hostnames
  • Platform-specific values
API variability
  • Request IDs, trace IDs, session IDs
  • Dynamic response fields that change per call
  • Non-deterministic external service responses
Order-dependent operations
  • Dictionary iteration (Python < 3.7)
  • Set operations with undefined order
  • Concurrent operations without synchronization

Response format

Determinism score

The determinism score (0-100) indicates how reliably the run could be replayed:
  • 90-100 🟢 - High reliability, minimal issues
  • 70-89 🟡 - Moderate risk, some non-deterministic patterns
  • 0-69 🔴 - High risk, significant non-determinism
Score calculation:
Actions with more issues get penalized more heavily.

Issue severity levels

High severity - Definitely causes non-determinism:
  • Timestamp dependencies
  • Random value generation
  • Unseeded randomness
Medium severity - Likely causes issues:
  • UUID generation
  • Environment dependencies
  • Process-specific values
Low severity - May cause issues:
  • API variability (trace IDs, etc.)
  • Order-dependent operations

Recommendations format

Each recommendation includes:
  • Priority - high/medium/low
  • Category - determinism/performance/reliability
  • Title - Brief summary
  • Description - What the issue is
  • Solution - How to fix it
  • Code example - Concrete fix (optional)

Using in the console

The determinism analysis is available in the Console UI:
  1. Navigate to Runs page
  2. Click on a specific run to open its details modal
  3. Switch to the Determinism tab (microscope icon)
  4. View the analysis with:
    • Determinism score and severity badge
    • Patterns detected summary
    • Detailed issues by action
    • Prioritized recommendations with code examples

Example issues and fixes

Issue: Timestamp dependency
Issue: Random generation
Issue: UUID generation

Limitations

What it CAN detect:
  • Static patterns in inputs/outputs
  • Known non-deterministic keywords
  • Common anti-patterns
What it CANNOT detect:
  • Non-deterministic behavior in external services
  • Race conditions in concurrent code
  • Hardware-dependent behavior
  • Implicit state dependencies
For actual replay validation, use the SDK’s Replay Mode.

Local replay submissions

After the SDK finishes a local replay (via replay_mode(...)), it posts a summary back to the platform:
The submissions show up in the Replay Hub (/api/v1/replay/history/), with per-run drill-down at /api/v1/replay/history/{run_id}.

Run bundle download

Returns a JSON bundle (run_id, agent_id, timestamp, status, total_cost, ordered actions[]) suitable for ReplayMode.from_run_id() to consume locally without re-hitting external APIs.

What-if policy evaluation

Re-runs the recorded actions through evaluate_run_against_policy and reports which would have been blocked by the alternative policy. Used by the console’s “preview new policy” workflow.

Best practices

Run analysis regularly: Check determinism after significant changes to catch issues early.
Fix high-priority issues first: Start with timestamp and random dependencies - they have the biggest impact.
Use with SDK replay: Combine analysis (static) with SDK replay (dynamic) for comprehensive testing.
False positives are possible: The analyzer uses heuristics. Review recommendations and decide what makes sense for your use case.

API usage

Integration with CI/CD

Check determinism in your pipeline: