mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
# Conflicts: # .agents/notes/implemented/architecture/2026-07-10-after-call-compaction-pressure-and-overflow-recovery.i18n.yaml # .agents/notes/implemented/architecture/2026-07-10-after-call-compaction-pressure-and-overflow-recovery.md # .agents/notes/implemented/architecture/2026-07-10-after-call-compaction-pressure-and-overflow-recovery.zh.md # docs/cordis-catalog/events.md # docs/cordis-catalog/services.md # docs/event-producer-consumer.md # examples/headless-agent/tests/harness.ts # examples/repl-agent/cordis.yml # packages/compact/compact-basic/README.md # packages/compact/compact-basic/src/index.ts # packages/compact/compact-basic/tests/compact-basic.spec.ts # packages/compact/compact-basic/tests/loader-composition.spec.ts # packages/cordis/tool-cordis/src/api-catalog.ts # packages/llm/README.md # packages/llm/llm-deepseek/src/adapter.ts # packages/llm/llm-pi-ai/src/adapter.ts # packages/llm/llm/README.md # packages/llm/llm/src/index.ts # scripts/gen-cordis-catalog.ts # website/zh-CN/api/harness/events.md # website/zh-CN/api/harness/llm.md # website/zh-CN/api/harness/token-meter.md # website/zh-CN/guide/config.md
compact/ — compaction capability family
A compaction capability family (see capability seams): an abstract interface, a summarizing backend, a model-free tool-result pruning companion, and a deferred model-facing consumer. All product packages.
| Package | Role | ctx key |
|---|---|---|
compact/ |
Abstract compaction seam (interface + compact/* events + CompactionResult) |
ctx.compact |
compact-basic/ |
A backend: ctx.tokenMeter pressure + token-budget retention + llm.stream() summarization |
(registers ctx.compact) |
compact-tool-result-prune/ |
Optional model-free head/middle/tail rewriting before summary compaction | ctx.toolResultPrune |
tool-compact/ (deferred) |
Model-facing /compact tool over ctx.compact |
(registers on ctx.tools) |
The interface lives at compact/compact/, the backend at compact/compact-basic/, and deterministic pruning at compact/compact-tool-result-prune/. Unlike the bash seam, the interface depends on dsh-session and dsh-llm because its verbs are defined over a Session and its output uses ContentBlock. That deviation is recorded in the compaction capability-seam Agent Note. Token measurement remains a reusable LLM-family service; a template- or model-backed compactor can replace compact-basic without changing the meter, pruner, or callers.