{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-priority-weighted-compaction-from-silently-evicting-a-high-priority-subagent-s-working-set-when-the-shared-context-budget-is",
  "title": "Which invariants prevent priority-weighted compaction from silently evicting a high-priority subagent's working set when the shared context budget is arbitrated concurrently",
  "date_of_record": "2026 November 29",
  "scope": "Applies to orchestrators that fan out to concurrent subagents sharing a single token budget and compact per-subagent context under priority weights. Does not apply to single-agent loops, to subagents with isolated hard-partitioned context windows, or to compaction that is serialized behind a single writer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-priority-weighted-compaction-from-silently-evicting-a-high-priority-subagent-s-working-set-when-the-shared-context-budget-is.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-priority-weighted-compaction-from-silently-evicting-a-high-priority-subagent-s-working-set-when-the-shared-context-budget-is.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-priority-weighted-compaction-from-silently-evicting-a-high-priority-subagent-s-working-set-when-the-shared-context-budget-is.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2428,
    "python_slice_tokens": 436,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways to \"compact under priority\" and they are not the same operation. The first is **allocation**: each subagent is granted a quota derived from its priority weight, and compaction only ever trims a subagent down to its own quota. The second is **arbitration**: a global compactor runs over the union of all subagent working sets, ranks segments ...",
    "what_was_observed": "An orchestrator fans out N=48 research subagents. Priorities are assigned by task criticality: three agents at weight 0.9 (the \"primary\" investigators), the rest at weight 0.2. Shared budget is 200k tokens. Each subagent's working set is roughly 6k tokens: ~1.2k of head segments (system prompt, task, tool schemas) and ~4.8k of tail segments (accumulated tool outputs, intermediate reasoning, retrieved evidence). The c...",
    "condition_of_validity": "The invariant \"priority-weighted compaction preserves high-priority subagents' working sets\" is valid **only under allocation semantics**, and only when the following three conditions hold jointly: 1. **Per-subagent floor is enforced before global arbitration.** Each subagent is first compacted to its own quota `q_i = weight_i × B / Σweight`. Only the *surpl...",
    "decision_boundary": "The boundary is not \"how many peers\" but **whether the compactor's eviction unit is a segment or a working set**. Two regimes: - **Segment-granular global arbitration (fails):** eviction unit is a segment; priority is a global score; the high-priority agent's tail is evicted when aggregate peer tail volume exceeds the budget headroom. Trigger condition: `Σ_p...",
    "operational_effect": "The practical consequence is that priority weights in a shared-budget orchestrator are **advisory unless backed by a quota floor and a chain-integrity guard**. Teams that ship \"priority-weighted compaction\" as a global sort-and-truncate get a system whose high-priority agents silently degrade under load, with no error surface. The degradation is masked by th..."
  },
  "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": "2c758900135159120c85260032b04ce5824704ee955e537820e5df3034a42c4b",
    "verified_classes": [
      "ContinuityInvariantViolation",
      "Segment",
      "CompactionResult"
    ],
    "verified_functions": [
      "compact_with_invariants"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ContinuityInvariantViolation"
    ],
    "sample_fail_closed_invariants": [
      "priority weights must sum to > 0"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
