{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-replay-divergence-when-agent-traces-are-reconstructed-from-lossy-span-logs",
  "title": "Which invariants prevent replay divergence when agent traces are reconstructed from lossy span logs",
  "date_of_record": "2026 December 4",
  "scope": "Applies to forensic replay of agentic execution traces reconstructed from span/event logs that omit full prompt bodies, tool response bytes, or sampling parameters. Does not apply to deterministic replay from complete byte-exact transcripts (e.g., full request/response capture at the model gateway).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-replay-divergence-when-agent-traces-are-reconstructed-from-lossy-span-logs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-replay-divergence-when-agent-traces-are-reconstructed-from-lossy-span-logs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-replay-divergence-when-agent-traces-are-reconstructed-from-lossy-span-logs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1545,
    "python_slice_tokens": 436,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things practitioners conflate under \"replay\": *re-execution* and *reconstruction*. Re-execution re-runs the agent loop against recorded inputs and asserts output equality. Reconstruction rebuilds the causal chain from logged spans so an auditor can explain *why* step N happened, without ever invoking a model. The boundary failure lives in recon...",
    "what_was_observed": "An agent performing a multi-tool task emitted spans of the form `{span_id, parent_id, tool_name, args_digest, status, latency_ms}`. The `args_digest` was a hash, not the args. The model's reasoning text was logged only when `verbosity=debug`, which production ran without. On a post-incident reconstruction, the auditor replayed the span tree and found a tool call B whose `args_digest` matched a prior call A's digest, ...",
    "condition_of_validity": "Reconstruction is only sound when three invariants hold simultaneously: 1. **Provenance completeness:** every causal edge in the reconstructed DAG is either (a) directly recorded as a parent/child span link, or (b) explicitly marked `inferred` with the inference rule named. An edge that is neither is a fabrication. 2. **Digest injectivity within the log's do...",
    "decision_boundary": "The boundary is: **may the reconstructor merge, reorder, or re-parent spans based on derived fields?** The answer is no unless digest injectivity is proven over the observed value set. In practice this means the reconstructor must: - Treat `args_digest` equality as *candidate* identity only, and require a second recorded field (full args, or a length+digest ...",
    "operational_effect": "After enforcing these invariants, reconstructions that previously \"succeeded\" now return `PartialReconstruction` with explicit gaps, and the incident review must treat those gaps as unknowns rather than resolved. The operational cost is that some forensic questions become unanswerable from logs alone and require re-execution against captured inputs. The bene..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "cab8c654de6285bca6ff7bfd8b7247a56d045eb76978fe8834c8b29e5b9d11a6",
    "verified_classes": [
      "ReplayDivergenceError",
      "Span",
      "ReconstructedEdge"
    ],
    "verified_functions": [
      "reconstruct"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReplayDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
