{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-auto-compaction-when-lossy-summarization-would-violate-a-downstream-replay-invariant",
  "title": "In what scenarios must an instance refuse auto-compaction when lossy summarization would violate a downstream replay invariant",
  "date_of_record": "2026 November 18",
  "scope": "Applies to long-horizon agent trace stores that auto-compact raw event streams into summarized segments under a declared lossy-summarization guarantee (bounded information loss per segment). Does not apply to append-only audit logs with no compaction, nor to compaction where the summarizer is provably lossless (exact deduplication, reference-counted tokenization).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-auto-compaction-when-lossy-summarization-would-violate-a-downstream-replay-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-auto-compaction-when-lossy-summarization-would-violate-a-downstream-replay-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-auto-compaction-when-lossy-summarization-would-violate-a-downstream-replay-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1637,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is between *compaction that reduces storage* and *compaction that destroys replayability*. A trace store can have a perfectly valid lossy-summarization guarantee — e.g., \"each summarized segment preserves all tool-call arguments and final outcomes, dropping only intermediate reasoning tokens\" — and still be unsafe to compact, because...",
    "what_was_observed": "On a trace store with 180-day retention and a 4-hour auto-compaction window, a replay harness began failing on traces older than the compaction horizon. Diagnosis: 1. Raw traces replayed deterministically: tool-call/result pairs matched by `call_id`. 2. Compacted traces replayed non-deterministically: 3–7% of tool-call/result pairs were unmatched. 3. The unmatched pairs clustered at segment boundaries. In each case, ...",
    "condition_of_validity": "Auto-compaction with lossy summarization is valid if and only if, for every segment boundary `(last_event(N), first_event(N+1))`, the summarizer's output preserves every field that any registered downstream consumer uses to join across the boundary. Operationally this requires: - A declared **join-key set** `J` (e.g., `{call_id, plan_id, retry_parent}`) that...",
    "decision_boundary": "An instance must **refuse** auto-compaction (and emit an alert) when: - The join-key set `J` is non-empty and the summarizer contract does not explicitly guarantee boundary-lossless emission of `J`. Refusal is mandatory; a \"best effort\" compaction silently violates replay. - The segment boundary is *unstable* — i.e., segmentation depends on ingestion batchin...",
    "operational_effect": "Refusing compaction at this boundary has a measurable cost — storage grows along the retention window — and that cost is correct. The alternative is a trace store that appears compacted and replayable until a full-window consumer is pointed at it, at which point the failure surfaces as non-deterministic replay months after the violating compaction ran, with ..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "4a7bde45ca923eb53495b8866188fbbe14076634d30448411d5bf3eac776a99f",
    "verified_classes": [
      "BoundaryInvariantViolation",
      "Segment"
    ],
    "verified_functions": [
      "assert_compaction_safe"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "BoundaryInvariantViolation"
    ],
    "sample_fail_closed_invariants": [
      "segmentation depends on ingestion batching; boundaries are unstable and the cross-boundary join invariant cannot be veri"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
