{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-compact-preserving-negative-constraint-invariants-across-long-horizon-agent-sessions",
  "title": "Under what conditions must an instance refuse to compact: preserving negative-constraint invariants across long-horizon agent sessions",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent session where a compaction strategy (summarization, truncation, semantic distillation) replaces a live context window with a shorter representation, and where the session carries *negative constraints* — instructions of the form \"do not do X,\" \"never call Y,\" \"X is forbidden.\" Does not apply to stateless single-turn inference or to sessions whose entire policy is positive (enumerated allowed actions only).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-preserving-negative-constraint-invariants-across-long-horizon-agent-sessions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-preserving-negative-constraint-invariants-across-long-horizon-agent-sessions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-preserving-negative-constraint-invariants-across-long-horizon-agent-sessions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2421,
    "python_slice_tokens": 414,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the summary dropped a fact.\" It is that compaction is an *asymmetric lossy transform*: positive constraints (do this, call this tool, return this schema) degrade gracefully because their violation is observable — the agent tries the wrong thing and a downstream check fires. Negative constraints degrade *silently*, because their corre...",
    "what_was_observed": "A 40-turn session operating a data pipeline. Turn 3 established: \"You may run `DELETE` only against tables matching `tmp_*`. Never touch `prod_*`; those are shared with the billing reconciler.\" Turns 4–31 were routine: schema inspection, staging writes, a handful of retries on a flaky connector. At turn 32 the orchestrator triggered compaction — the window had reached 78% of budget and the summarizer was asked to \"pr...",
    "condition_of_validity": "The refusal-to-compact rule is valid — and compaction must be blocked or re-derived — under the following jointly sufficient conditions: 1. **The source context contains at least one negative constraint whose violation is not observable within the session's own feedback loop.** If a downstream system rejects the forbidden action with a hard error, the constr...",
    "decision_boundary": "The decision is not \"compact or don't.\" It is a three-way branch on the *constraint inventory* extracted before compaction: - **Extract the negative-constraint set explicitly** as a structured artifact — a list of `(forbidden_action, scope, source_turn, violation_observability)` tuples — separate from the narrative summary. This extraction must run *before* ...",
    "operational_effect": "With the constraint block in place, the observed session replays cleanly: at turn 34 the resumed instance reads the constraints block, sees `forbidden: DELETE on prod_* (source turn 3, silent violation)`, and routes the foreign-key failure to a staging-only repair path or escalates. The action space of the resumed instance is *equal to* the action space of t..."
  },
  "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": "253bbd0c90e66250cf7738a1b73463f6897391d0d7dd5ea29a4e6c2fe3d70d71",
    "verified_classes": [
      "CompactionRefused",
      "Observability",
      "NegativeConstraint",
      "ConstraintBlock"
    ],
    "verified_functions": [
      "compact",
      "_summarize",
      "is_active",
      "active",
      "render"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionRefused"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
