﻿# Automatic compaction needs a separately checkable task contract

Responses compacts each agent independently; preserve externally checkable task invariants and test continuation rather than inspecting opaque compacted state.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/frontier-swarm-compaction-task-invariants/
Language: en

## Separate continuity from auditability

A long audit can continue after its conversational history is compressed. That is useful continuity, but an auditor still needs to know which artifact revision and acceptance criteria governed the final conclusion. The [compaction guide](https://developers.openai.com/api/docs/guides/compaction) describes compacted state as opaque and intended for continuation rather than human inspection. An application cannot obtain an auditable task contract by trying to read an encrypted compaction item. Preserve the important external records where a reviewer can check them directly.

## Respect the multi-agent exception

In [Responses multi-agent](https://developers.openai.com/api/docs/guides/responses-multi-agent), automatic server-side compaction is enabled implicitly and applies independently to the root and each subagent. An explicit `compact_threshold` can override the threshold, while the standalone `/responses/compact` endpoint is unsupported with multi-agent enabled. A generic integration that manually calls that endpoint on the combined tree is therefore using the wrong contract. Separate contexts also mean that an update understood by the root should not be assumed to have become an identical visible history in every descendant.

## Define small verifiable invariants

For a release audit, useful invariants include the repository revision, source cutoff, allowed write scope and required migration cases. A proposed design stores these in an application-controlled task record and includes relevant values in each bounded assignment. This record is not an attempt to reconstruct model reasoning. It identifies what the returned result must satisfy. When requirements change, version the record and identify which previous findings need review rather than appending another ambiguous instruction to a long conversation.

## Exercise continuation across a real boundary

A controlled test can create a sufficiently long documented investigation to trigger compaction, then ask for a conclusion requiring an early invariant. Inspect the final artifact and its evidence against the external task record. Also change one requirement and verify that stale findings are labeled or refreshed. This is a proposed protocol, not a claim that compaction loses a particular percentage of facts or guarantees exact preservation of every utterance. Retain the original inputs needed to reproduce the acceptance question.

## Budget audit records separately

Through May 6, 2027, keep the record compact enough to inspect while retaining authoritative artifacts outside conversational memory. [Separate contexts](/journal/learn-claude-subagent-context/) explain why each branch needs sufficient input; [Revision-bearing handoffs](/journal/bb-mixed-agent-handoff-format/) explain what must return. Automatic compression can make a long run feasible, but feasibility and verified compliance are different properties. The strongest completion evidence remains an artifact that satisfies the current task contract, together with reproducible observations, rather than confidence that a hidden compacted representation must contain every relevant detail.

## A possible six-month capability

An editorial scenario through May 6, 2027 is a longer-running agent graph that retains verifiable task compliance across repeated context reductions. External invariants and revision-aware acceptance work alongside documented per-agent compaction. It requires the final artifact to remain checkable without decoding opaque state. If essential early constraints repeatedly disappear from the accepted result, longer continuations alone are counterevidence to a forecast of more reliable end-to-end capability.
