{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-self-editing-context-failure-salience-score-inversion-at-the-pruning-horizon",
  "title": "What structural signals indicate a self-editing context failure: salience-score inversion at the pruning horizon",
  "date_of_record": "2026 November 16",
  "scope": "Applies to agents that rewrite their own context window via model-driven pruning or salience scoring, where the pruning policy is re-evaluated against a context that has already been partially edited. Does not apply to stateless retrieve-then-generate pipelines, nor to fixed-budget truncation that never re-scores after a rewrite.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-failure-salience-score-inversion-at-the-pruning-horizon.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-failure-salience-score-inversion-at-the-pruning-horizon.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-failure-salience-score-inversion-at-the-pruning-horizon.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1397,
    "python_slice_tokens": 244,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two failure modes that look identical in the logs but have opposite remediations. **Score drift** is when a salience function assigns different scores to the same segment across passes because the surrounding context changed. **Score inversion** is when a segment's rank order flips relative to another segment *because the pruning itself removed the...",
    "what_was_observed": "In a 14-day operational sample of a long-horizon agent that compacted its own context every 8k tokens, we observed a recurring signature. On pass *n*, a segment S (a constraint statement, e.g. \"the API rejects payloads over 4 MB\") scored low because the immediately preceding turn was a verbose tool trace that dominated attention. S was pruned. On pass *n+1*, the tool trace had itself been summarized and its salience ...",
    "condition_of_validity": "The inversion invariant holds only when all of the following are true: - The salience function is **context-dependent** (attention- or embedding-relative), not a static per-segment weight. - The rewrite is **destructive** (pruned segments are not retained in an external store the agent can re-fetch). - At least one scoring pass occurs **after** a prior rewri...",
    "decision_boundary": "The operational rule is not \"never prune context-dependent scores.\" It is: **freeze the scoring context before applying any rewrite, and require a re-scoring pass to justify a *second* removal of the same cluster.** Concretely: - Snapshot the context, compute all scores against the snapshot, apply the rewrite atomically, and discard the snapshot only after t...",
    "operational_effect": "When the boundary is enforced, compaction ratio stabilizes instead of creeping, and constraint-cluster retention over a 14-day horizon went from a mean of 2.1 passes to full-session retention in our sample. When it is not enforced, the agent does not fail loudly — it fails by becoming confidently wrong about constraints it once knew, and the failure is only ..."
  },
  "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": "f4e3f71358081756d9323e92dd080740d459ea65fb866962356c9db766f88696",
    "verified_classes": [
      "SalienceInversionError",
      "Segment",
      "RemovalLedger"
    ],
    "verified_functions": [
      "prune",
      "record"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SalienceInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
