id: PX-RESEARCH-F1EA6810
type: research
title: Decay Compaction Evolution
Scope
This is historical research, not a current specification, plan, checklist, or delivery commitment.
Recovery source: docs/super/plans/2026-08-22-decay-compaction.md, recoverable from Git commit 88660125c313dd5eff4f8c4dee431caa8e0ddd22.
Historical design retained
Decay replaced only Pi summary generation while preserving Pi-selected retained-entry boundaries, canonical session history, compaction flow, and native cancellation.
Its durable insight was a two-stage pipeline: classify discarded context into validated semantic atoms, then render ranked atoms into continuation prose.
Local deterministic policy, rather than model discretion, assigned provenance, merged recurrence, resolved supersession, ranked recency, allocated budget, and appended file facts.
Protected constraints, decisions, goals, current state, blockers, and exact continuation literals were retained before ordinary context.
Prior structured atoms supplied identity across compactions, so paraphrases could increase recurrence without treating prior memory itself as fresh evidence.
Classifier output required complete numbered-chunk coverage and local schema validation, preventing partial or malformed model output from becoming silent memory loss.
Manual compaction focus remained untrusted one-run input, separate from permanent policy, so conversation content could not become instructions.
Pi tools, hooks, provider auth, and model registry remained the integration boundary rather than a parallel transport path.
A passive above-editor widget was chosen so Pi retains native steering submission and Escape cancellation during compaction.
Temporary classifier records used private JSONL with cleanup on every terminal path, keeping session text out of logs and transient artifacts.
Verified current behavior
extensions/decay/README.md, core.ts, implementation.ts, prompts.ts, record-log.ts, and ui.ts verify that Decay remains an active recency-weighted structured compactor.
Current settings separate decay.model from optional decay.summarizerModel, with unavailable configured stages recovering through Pi default compaction or the current session model where applicable.
Transient incomplete classifier coverage receives bounded gap-fill attempts, while conflicting records, invalid indexes, authentication failures, and unresolved gaps fail safely to Pi default compaction.
Summarizer failure no longer has the historical blanket-fallback behavior because classified facts can be rendered deterministically as a marked degraded summary.
Bounded sanitized decay-diagnostic custom entries distinguish fallback from summarizer salvage and remain excluded from model context.
keepRecentTokens is now documented and stored as Pi's target rather than a measured guarantee, while actual retained context is estimated from Pi's retained suffix.
Current TUI progress is a passive borderless five-row widget with evidence-driven CTX, FACTS, and NEW maps, superseding the historical eight-line visual design.
Lessons
Structured details make repeated compaction auditable and enable deterministic recurrence policy that prose-only summaries cannot provide.
Graceful degradation may preserve validated memory only when it does not invent, omit, or reinterpret facts.
Compaction UX must expose real completed work and preserve Pi interaction semantics instead of simulating model progress.
---
id: PX-RESEARCH-F1EA6810
type: research
title: Decay Compaction Evolution
---
## Scope
This is historical research, not a current specification, plan, checklist, or delivery commitment.
Recovery source: `docs/super/plans/2026-08-22-decay-compaction.md`, recoverable from Git commit `88660125c313dd5eff4f8c4dee431caa8e0ddd22`.
## Historical design retained
Decay replaced only Pi summary generation while preserving Pi-selected retained-entry boundaries, canonical session history, compaction flow, and native cancellation.
Its durable insight was a two-stage pipeline: classify discarded context into validated semantic atoms, then render ranked atoms into continuation prose.
Local deterministic policy, rather than model discretion, assigned provenance, merged recurrence, resolved supersession, ranked recency, allocated budget, and appended file facts.
Protected constraints, decisions, goals, current state, blockers, and exact continuation literals were retained before ordinary context.
Prior structured atoms supplied identity across compactions, so paraphrases could increase recurrence without treating prior memory itself as fresh evidence.
Classifier output required complete numbered-chunk coverage and local schema validation, preventing partial or malformed model output from becoming silent memory loss.
Manual compaction focus remained untrusted one-run input, separate from permanent policy, so conversation content could not become instructions.
Pi tools, hooks, provider auth, and model registry remained the integration boundary rather than a parallel transport path.
A passive above-editor widget was chosen so Pi retains native steering submission and Escape cancellation during compaction.
Temporary classifier records used private JSONL with cleanup on every terminal path, keeping session text out of logs and transient artifacts.
## Verified current behavior
`extensions/decay/README.md`, `core.ts`, `implementation.ts`, `prompts.ts`, `record-log.ts`, and `ui.ts` verify that Decay remains an active recency-weighted structured compactor.
Current settings separate `decay.model` from optional `decay.summarizerModel`, with unavailable configured stages recovering through Pi default compaction or the current session model where applicable.
Transient incomplete classifier coverage receives bounded gap-fill attempts, while conflicting records, invalid indexes, authentication failures, and unresolved gaps fail safely to Pi default compaction.
Summarizer failure no longer has the historical blanket-fallback behavior because classified facts can be rendered deterministically as a marked degraded summary.
Bounded sanitized `decay-diagnostic` custom entries distinguish fallback from summarizer salvage and remain excluded from model context.
`keepRecentTokens` is now documented and stored as Pi's target rather than a measured guarantee, while actual retained context is estimated from Pi's retained suffix.
Current TUI progress is a passive borderless five-row widget with evidence-driven `CTX`, `FACTS`, and `NEW` maps, superseding the historical eight-line visual design.
## Lessons
Structured details make repeated compaction auditable and enable deterministic recurrence policy that prose-only summaries cannot provide.
Graceful degradation may preserve validated memory only when it does not invent, omit, or reinterpret facts.
Compaction UX must expose real completed work and preserve Pi interaction semantics instead of simulating model progress.