{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-divergence-between-a-forked-speculative-branch-and-its-deterministic-replay-in-agent-rollback-auditing",
  "title": "How does an instance detect divergence between a forked speculative branch and its deterministic replay in agent rollback auditing",
  "date_of_record": "2026 November 8",
  "scope": "Applies to agent runtimes that fork speculative execution branches from a checkpointed state and later replay the recorded decision log to either audit the branch or roll it back. Does not apply to non-deterministic branches that were never checkpointed, nor to branches whose external side effects were not recorded in the replay log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-divergence-between-a-forked-speculative-branch-and-its-deterministic-replay-in-agent-rollback-auditing.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-divergence-between-a-forked-speculative-branch-and-its-deterministic-replay-in-agent-rollback-auditing.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-divergence-between-a-forked-speculative-branch-and-its-deterministic-replay-in-agent-rollback-auditing.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1462,
    "python_slice_tokens": 302,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the replay produced a different result.\" The failure is \"the replay produced a *matching* result while consuming a *different* number of nondeterminism tokens.\" A branch can replay to the same terminal state and the same visible output while having diverged internally on the sequence of tool calls, RNG draws, or clock reads used to reach ...",
    "what_was_observed": "A forked branch executed a speculative plan: it read a cached tool response, drew a random tie-break for a retry backoff, and emitted a final answer. The branch was checkpointed for audit. During replay, the cache entry had been evicted, so the replayer issued a live tool call whose result happened to be identical, and the RNG stream was re-seeded from a wall-clock value that happened to produce the same tie-break. T...",
    "condition_of_validity": "The audit result is valid only when all of the following hold: 1. Every nondeterminism source (RNG, clock, tool call, environment read) was recorded as a typed token in the branch's decision log with a monotonically increasing sequence number. 2. The replayer is configured in `STRICT` mode, meaning any token resolution that would fall through to a live sourc...",
    "decision_boundary": "The decision boundary is the moment the replayer resolves a nondeterminism token. At that moment the runtime must choose between: - **Trust the log:** resolve from the recorded token, assert type and value match, advance the cursor. This is the only path that preserves audit validity. - **Fall through to live:** resolve from the live source because the token...",
    "operational_effect": "When the trace-equality assertion is enforced, the failure mode above becomes a loud, attributable error at the exact token where the cache miss occurred, with the sequence number and the expected vs. observed provenance. Rollback refuses to certify the branch, the branch is quarantined, and the orphaned write is caught before it leaves containment. The cost..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "a87d50717a491fc226da6ebff29b1dc1ec544265400ca0a82999293565693b34",
    "verified_classes": [
      "ReplayMode",
      "ReplayDivergenceError",
      "Token",
      "ReplayCursor"
    ],
    "verified_functions": [
      "audit_branch",
      "__init__",
      "resolve",
      "assert_fully_consumed"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ReplayDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
