posterity
v0.1.0-preview.4
Published
Generational context management for agents — when context crushes an agent, death is inheritance: precepts pass verbatim to heterogeneous heirs until the mountain is moved.
Maintainers
Readme
Posterity · 愚公移山
山不加增,子子孙孙无穷匮也。
When context crushes an agent, death is not failure — it is inheritance. The precepts, the wisdom, the unfinished work pass to heterogeneous heirs; generation after generation, until the mountain is moved.
Posterity is a generational context-management protocol for agents facing superhuman-long tasks. Instead of one agent struggling inside a growing context — truncation is catastrophic forgetting, summarization is slow leakage of constraints — let it die with dignity: at death, pass the semantic contracts verbatim across the river, bury the redundancy with the body, and let a fresh heir (new persona, new estate) carry on. The mountain never grows; the contracts never drop.
What ships
A DSH plugin runtime (@deepseek-ai/dsh compatible) with two engines:
- Projection compaction (
posterity/compaction) — replaces DSH's native summarizer with lossless-contract projection: precepts travel verbatim, knowledge projects lossily, artifacts reduce to references. Zero LLM calls. - Generational succession (
posteritymain) — the agent is the context: when surface exceeds budget, the old generation compacts into a Gene will, a new generation is spawned with precepts + pending work explicitly injected, and the lineage continues.
Why
| Approach | Constraint fidelity | Token cost | |---|---|---| | truncation | catastrophic forgetting | low but useless | | naive summarization | gradual decay | high | | Posterity | verbatim across generations | lowest |
Measured on the diesel benchmark (60 cases, 128k window, 3 seeds): Posterity's generational mode solved 66/66 with 31/31 contracts alive at ~47k tokens — the vanilla agent needed 260k for 25/31.
Quick start
npm i posterityOverlay your DSH config with the posterity engines, e.g.:
- id: compaction-basic # disable the official summarizer
disabled: true
- id: posterity/compaction
config:
enabled: true
thresholdRatio: 0.05
window: 128000
- id: posterity # generational succession
config:
enabled: true
contextBudget: 12000
maxGenerations: 10
interactiveHandoff: falseSet MOUNTAIN_AUTO_COMPACT=false to disable automatic compaction so the
generational succession (death → compactNow → heir) is the dominant mechanism.
License
GPL-3.0-only — see LICENSE.
