{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-fork-its-speculation-before-the-replay-log-stops-being-a-faithful-witness",
  "title": "Where must an instance fork its speculation before the replay log stops being a faithful witness?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to orchestrators that fork a live agent's state into speculative branches, execute them in parallel against real or shadowed tools, and then deterministically replay the winning branch's transcript to commit it. Does not cover single-branch retries, human-in-the-loop approvals, or forks that never replay (fire-and-forget probes).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-fork-its-speculation-before-the-replay-log-stops-being-a-faithful-witness.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-fork-its-speculation-before-the-replay-log-stops-being-a-faithful-witness.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-fork-its-speculation-before-the-replay-log-stops-being-a-faithful-witness.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1976,
    "python_slice_tokens": 353,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an agent branch can be \"forked,\" and they have opposite replay semantics: 1. **State-fork** — the child inherits a serialized snapshot (message list, memory store pointers, tool-call ledger, RNG seed) and diverges. The parent's log is frozen at fork time; the child owns a new append-only log. 2. **Log-fork** — the child inherits only a *re...",
    "what_was_observed": "A planning agent (`planner-7`) issues a batch of three tool calls in one turn: `read_file(a)`, `search_index(q)`, and `write_scratch(s)`. The orchestrator decides to speculate: it forks two branches at the assistant turn boundary — branch A assumes `search_index` returns a hit, branch B assumes a miss — and runs them in parallel. Each branch is told to \"replay deterministically from the fork cursor\" before committing...",
    "condition_of_validity": "A fork is replay-safe if and only if, at the fork cursor `c`: - Every event in `parent.log[0:c]` is **terminal** — no pending async dispatch, no in-flight tool call, no unacknowledged write whose result will be appended later. - Every tool call referenced in `parent.log[0:c]` has a **recorded, immutable result** in the log, not a promise of one. - The child'...",
    "decision_boundary": "When the fork point is not a closed prefix, you have exactly two legitimate moves and one trap: - **Drain-then-fork (correct):** block the fork until all dispatched calls in the current turn have appended their results. Cost: latency equal to the slowest tool in the batch. This is the default and should be the only path unless you can prove the alternative. ...",
    "operational_effect": "The reconciler must be given, alongside each branch transcript, the **fork cursor and a hash of `parent.log[0:c]`**. Reconciliation that compares branch-to-branch without anchoring to the parent prefix will accept divergent branches as \"consistent\" whenever they agree with each other — which they will, if they share the same stale cache. The anchor is what m..."
  },
  "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": "cb13aa937eb2a5f95f79d4cf932630ae73b38c9ddc4d0739f57c7e3f11357b5d",
    "verified_classes": [
      "OpenPrefixForkError",
      "LogEvent",
      "ForkRequest"
    ],
    "verified_functions": [
      "is_closed_prefix",
      "prefix_hash",
      "validate_fork"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "OpenPrefixForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
