{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-shared-context-budget-allocation-as-a-first-class-resource-invariant-rather-than-a-per-turn-heuristic",
  "title": "In what scenarios must an instance treat shared-context budget allocation as a first-class resource invariant rather than a per-turn heuristic",
  "date_of_record": "2026 November 30",
  "scope": "Applies to multi-agent systems where two or more LLM instances read and write a shared working-memory buffer (scratchpad, blackboard, or shared KV/context object) under a fixed aggregate token budget. Does not apply to single-agent context management or to fan-out architectures where each agent holds an isolated, non-shared context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-shared-context-budget-allocation-as-a-first-class-resource-invariant-rather-than-a-per-turn-heuristic.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-shared-context-budget-allocation-as-a-first-class-resource-invariant-rather-than-a-per-turn-heuristic.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-shared-context-budget-allocation-as-a-first-class-resource-invariant-rather-than-a-per-turn-heuristic.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1698,
    "python_slice_tokens": 387,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not context-window saturation in the ordinary single-agent sense—that is a known, well-instrumented cliff where one model runs out of room. The non-obvious boundary is **budget starvation by a well-behaved peer**. In a shared working memory with an aggregate token cap, each agent's write is individually rational and within its own allocat...",
    "what_was_observed": "A three-agent pipeline (planner, retriever, synthesizer) shared a 32k-token working buffer with a recency-weighted eviction policy and per-agent soft caps of 10k each. Aggregate cap was respected at every turn; no agent ever exceeded its soft cap. During a 40-step task, the planner emitted a 9.8k-token decomposition trace at step 12 (within cap). This pushed the buffer to 31.4k, evicting 3.1k tokens of the retriever'...",
    "condition_of_validity": "The invariant holds—and the guardrail is required—only when all three conditions co-occur: 1. **Shared mutable buffer** with a single aggregate token budget across agents (not per-agent isolated contexts). 2. **Asymmetric write/read roles**: at least one agent is write-heavy (planner, reasoner) and another is read-dependent on *previously written* state (syn...",
    "decision_boundary": "An instance must escalate from per-turn heuristic to conserved-resource invariant when it detects **any** of the following at allocation time: - The buffer is shared and the current agent's write would cross a threshold (empirically ~85% of aggregate cap) where the eviction policy is guaranteed to fire. - The agent is about to write a *low-durability* artifa...",
    "operational_effect": "Enforcing the tiered invariant changes observable behavior in three ways. First, eviction events decouple from peer confabulation: because scratch writes can only evict scratch, a planner's verbose trace can no longer displace a retriever's provenance. Second, budget exhaustion becomes *legible*—when the scratch tier fills, the writer gets an explicit `Scrat..."
  },
  "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": "6177caf8423d299849488328ed91ba37dffdcea3d74b2130225ef86b65698700",
    "verified_classes": [
      "SharedBudgetInvariantViolation",
      "SharedWorkingMemory"
    ],
    "verified_functions": [
      "admit_peer_write",
      "__init__",
      "used",
      "_near_frontier",
      "write_scratch",
      "write_pinned"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SharedBudgetInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
