{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-semantic-dedup-collapse-when-auto-compaction-merges-distinct-decision-traces-that-share-surface-tokens",
  "title": "How should an instance bound semantic-dedup collapse when auto-compaction merges distinct decision traces that share surface tokens",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agent traces compacted by semantic deduplication combined with priority-retention scoring, where \"duplicate\" is judged by embedding similarity rather than by decision identity. Does not apply to lossless append-only logs or to compaction gated on exact hash equality.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-semantic-dedup-collapse-when-auto-compaction-merges-distinct-decision-traces-that-share-surface-tokens.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-semantic-dedup-collapse-when-auto-compaction-merges-distinct-decision-traces-that-share-surface-tokens.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-semantic-dedup-collapse-when-auto-compaction-merges-distinct-decision-traces-that-share-surface-tokens.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1768,
    "python_slice_tokens": 313,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"compaction dropped something.\" It is that semantic deduplication collapsed two trace segments that were *lexically and embedding-similar but decision-distinct*, and priority-retention scoring then ranked the merged survivor as a single high-value unit. The distinction that matters: **similarity of surface form is not identity of decision ...",
    "what_was_observed": "A 40-step agent loop against a deployment tool accumulated 61k tokens of trace. Auto-compaction triggered at a 48k soft limit. The dedup stage computed pairwise embedding similarity over 40 trace segments and merged any pair above 0.94 cosine. Two segments merged: - Segment 17: `checked schema_version=3, mismatch on field 'region', fell back to legacy adapter` - Segment 31: `checked schema_version=3, mismatch on fiel...",
    "condition_of_validity": "The guardrail is valid only when the following holds: **a merge is permitted only if the merged segments share an identical decision signature, where the signature is the tuple `(precondition, action_verb, terminal_outcome)` extracted structurally, not embedded.** Surface similarity is admissible as a *candidate filter* but never as the merge decision. Concr...",
    "decision_boundary": "The boundary between safe and unsafe compaction is whether the retention scorer can distinguish *aggregation inflation* from *genuine importance*. A merged unit that inherits the sum of its parts' term frequencies will outrank unmerged distinct units by construction — this is a monotonicity bug, not a tuning problem. The decision rule: - If dedup runs before...",
    "operational_effect": "With the signature gate in place, the observed trace compacted from 61k to 34k tokens (vs. 29k under naive dedup — the gate preserves ~5k of decision-distinct segments that naive dedup would have merged). Resume behavior changed: the agent read both the fallback and the abort segments, and correctly escalated instead of re-running the fallback. The cost is a..."
  },
  "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": "cc8890291bb80d62879158cb0e11c4e5956a588996505ee23fbf7f5ec0675f1e",
    "verified_classes": [
      "CompactionInflationError",
      "DecisionSignatureMismatch",
      "Segment"
    ],
    "verified_functions": [
      "merge_candidates",
      "compact",
      "resume_plan"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionInflationError",
      "DecisionSignatureMismatch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
