Repository navigation
v0.6.0 — Independent extension preview for Pi 1.3.0, 1.2.0 and 1.1.0
Pre-releasePi Context Compaction v0.6.0 supplies an ordinary extension for unmodified official Pi 1.3.0, 1.2.0 and 1.1.0.
Install this release's extension package (a fixed package tag) from your terminal, then restart Pi:
pi install git:github.com/youxi-huang/pi-context-compaction@extension-v0.6.0Start a new persistent text session and run /compaction-doctor to check it without calling a model. Source tag v0.6.0 selects the development monorepo, not the package. To follow later previews instead, install the moving extension-preview branch in place of the tag and update only this package with pi update --extension git:github.com/youxi-huang/pi-context-compaction@extension-preview. A plain pi update updates Pi itself.
This pre-release supports manual /compact and Pi's threshold compaction after completed text turns, source-linked history retrieval and explicit disk-confirmed failure recovery. In the sessions it handles, overflow recovery still requires explicit /compact, and background cache warming is paused. Sessions it never protected and cannot check, such as ones with native checkpoints, images or another Pi version, are left to Pi without a failure marker. Other checkpoint formats, parent-history grants, attachments, concurrent writers and Windows are outside its verified scope.
Ordinary Agent retries after transient provider failures are supported, including partial-response connection drops. Existing retry-related blocks and text-only context-overflow failures can use explicit /compact recovery when sufficient completed source history exists. Arbitrary context edits and unfinished tool-call omissions remain unsupported.
Optional preparation has two arms, both disabled by default: A prepares with the configured writer; B merges data-only work notes from the session model. A validated candidate can commit its covered prefix without a writer call while every later original stays verbatim. B carries covered user messages in full and falls back to the configured writer when they do not fit. Every writer call is journaled, including cancelled or discarded preparation and unknown usage. These are experimental paths; real-provider pause, total cost, cache behavior and recovery benefits remain unproven.
Validation: this publication run passed 88 stock-Pi package and lifecycle checks on official Pi 1.3.0, 1.2.0 and 1.1.0 and the full default-settings scenario suite on Pi 1.3.0 with strict acceptance and no performance exceptions or known gaps. Scenario evidence is bound to this exact package and source commit; the 50 ms request-overhead target and checkpoint-growth bound are required checks. Focused, security and frozen evaluator checks also remain required on final main. Services are synthetic and loopback only; no real-provider quality, latency or interactive TUI claim is made.
Source commit: 86dbbdc. Preview runtime: stock-preview+src.64965b134b6fdc64. Resident runtime keeps its v0.3.0 fingerprint.
Usage and recovery · Validation
Changes
v0.6.0 is the footprint milestone's offline delivery, in the independent preview only. Three opt-in mechanisms ship behind their own switches, every one off by default: deterministic reversible reductions (previewReduction) replace consumed and superseded tool results in the request's projection with one line each while the session file stays untouched; labelled historical excerpts (previewExcerpts) answer an identifier the prompt names from compacted entries without touching the cached prefix; and derived summary renderings (previewRendering) fold repeated lineage and old failed paths while the stored checkpoint bytes never change. The bench gains a token-overhead report with required cache-write and page-back columns, candidate wiring and the P4 fixture. On the offline loopback the reduction cut the writer's input 46.8 percent with zero of 216 probe outcomes changed, and the lineage fold cut the rendered summary 36.7 percent at 40 checkpoints; real-provider savings, recovery and cache behavior are unmeasured, each provider bench is a separately budgeted step, and the writer instruction and sources repair inherited from v0.5.3 still await their qualifying bench. The resident runtime, its build fingerprint, the checkpoint schema, the frozen fixtures and the evaluation pin are unchanged.
Added
- When the independent preview's note writer leaves at most five facts without sources, and that is the candidate's only fault against the note schema, the writer gets one repair request that names those facts beside the entries they may cite: the active requests and other user messages in full, excerpts of the entries the rest of the note cites, and the uncovered entries by their opening words. The answer may add sources only; each fact's text, quote and supersedes stay as written, and the whole note is checked again, so an invented ID or a quote the cited entries do not contain still blocks. The extension never supplies an ID itself. This is the compaction's one repair under
noteRepair, shared with the quotation and size repairs, and like them it runs without reasoning. /compaction-statusreports the first candidate refused on the note schema underlastWriter.schema: facts without sources by section, and whether the note fails the schema for another reason too. A repair that ran reportsrepairKind: "sources". Both are counts; no fact text or ID is reported.- Behind a new
previewReductionswitch, off by default, the independent preview's request projection replaces two kinds of tool results with one line each — an earlier read of a file that was read again later, and a consumed result after which a later turn completed — naming the tool, its target, the first line of its result and the record ID, whichcontext_historyreads back in full. The reduction is a pure function of the session records, recomputed on every request and never stored: the session file is untouched, the same records always produce the same bytes, appending turns never un-reduces an entry, and the writer's prefix and the main model's context reduce identically, so both share one cached prefix. User messages, assistant text, checkpoint summaries, error results and the sole evidence cited by a committed fact are never reduced; tool calls stay paired; a checkpoint written over a reduced view is byte-identical to one written without it; a failed compaction blocks exactly as before. An invalid switch value disables the feature without touching requests./compaction-statusreports content-free counts underreduction. - Behind a new
previewExcerptsswitch, off by default, when the user's prompt names an identifier-shaped term that only compacted or reduced entries hold, the request ending with that prompt gains one short original excerpt at its end, labelled as historical evidence with its record ID and role, never as an instruction. At most two excerpts of at most 200 estimated tokens each are appended within the request limit, a deterministic secret filter withholds a matching record entirely and names only its ID, nothing enters the session file, and every earlier message is reused unchanged, so the provider's cached prefix is untouched./compaction-statusreports counts underexcerpts, including excerpts appended and excerpts no answer cited. context_historyresults statereadTokens, the estimated cost of reading each hit in full, and mark hits whose entries are already in context (a reduced entry is unmarked, since only its one line is).readacceptsdetail: "low"for a bounded opening with the full cost stated;fullremains the default and returns what it did before.- Behind a new
previewRenderingswitch, off by default, the summary the model sees is derived from the stored note and lineage by a pure function while the stored checkpoint rendering stays byte for byte; the recovery guards accept and require that same derivation, so a tampered rendering is still refused, and with the switch off behavior is byte-identical to before. Three candidates are selectable one at a time for measurement: failed paths and reasons whose sources precede the previous checkpoint fold to one line with their source IDs; repeated lineage state lines fold with guidance rendered once and every anchor kept; and each fact can show the roles of the records it cites, computed from the records, never claimed by the note. An invalid switch value disables the feature without touching requests./compaction-statusreports the active candidates underrendering.
Changed
- The independent preview's writer instruction says that every fact in every section, next steps included, cites the entries that support it, whether or not it carries a quote, and that a next step cites the request or recorded progress it continues without claiming the step is done. The in-task handover asks the same of its continuation step. In the v0.5.3 relay bench, each refused GPT-6 Luna note examined held next steps with text alone. The resident runtime, its build fingerprint, the checkpoint schema and the evaluation pin are unchanged.
Fixed
/compaction-statusreportedsent.effort: mediumfor every GPT-6 Luna writer request. Since Pi 1.3.0, models that change effort mid-conversation receive a fixedreasoning.effortofmediumand the requested level in aconfiguration_updateinput item.sent.effortnow reports that item's level, andsent.fixedEffortthe fixed one.
Maintenance
- The preview bench records each attempt's schema counts and sums them per cut and overall under
schemaRefusals, and counts sources repairs beside quotation and size repairs. The stock-Pi scenarios addsources-repair-refusedandsources-repair-commits. - The preview bench's relay can measure another catalog model under the ID the relay serves it as, with
--relay-modeland--relay-id, for exampledeepseek/deepseek-flashserved as a self-hosteddsv41f-xp. The catalog's API, compatibility settings, level map and prices stay, so the limits use its prices; without the flags the relay measuresopenai/gpt-6-lunaas before. - CI skips its full pipeline for a change that touches nothing but Markdown under
docs/or the repository root.CHANGELOG.mdanddocs/context-memory/extension-preview.mdstill run everything, because release preparation reads the first and the package README is built from the second, and the publication workflow re-verifies every release on its tag as before. context-memory-ops.mjsexits 3 instead of 1 at the fingerprint gate, so a caller can tell a held fingerprint from a failed check, and the operations runbook maps each change type to its narrowest command.- The preview bench reports token overhead per run, cut and source-size tier in
summary.json: writer tokens and note size against the records they replace, retrieval usage by operation, usage from refused, crashed, declined and discarded work read from the call journal, calls with missing usage reports counted underusageMissingrather than deflating totals, provider cache writes as a required column that reads "not reported" when no call reported any, and one net column that charges page-back reads against the saving.--session-settingsand--controllabel a candidate run and its control; the loopback provider reports deterministic usage so every column has offline figures. - The preview evaluation set gains the P4 fixture under its own fixtures version and manifest: sessions with repeated file reads and long consumed tool results between checkpoints, with gold answers inside entries a reduction would replace. P1 to P3, the frozen F-series and the evaluation pin are byte-identical.
- The bench's
--session-settingsnow writes the named preview switches into every unit'spi-context-memory.jsonand records them underunitSettingsbeside the label; an unknown name or value stops the run before any unit starts, and without the flag units keep the package's defaults as before. Compaction and probe rows carry/compaction-status's content-freereductionandexcerptscounts, and probe excerpt tokens are charged as page-back in the overhead report.