dsh-compaction-guard
Manifest validCompaction integrity for DeepSeek Harness — constraints from the compacted range are verified against the summary; what the agent was told to remember and silently forgot is reported loudly
dsh-compaction-guard
Compaction integrity for DeepSeek Harness (dsh).
Long sessions compact; the compacted range takes constraints with it — "never
commit to main", "必须先跑测试" — and the agent silently forgets rules it was
told to keep. This plugin watches compaction/summary session events: it
extracts directive lines from the user-authored events being shadowed,
verifies each against the summary (verbatim, whitespace-normalized, or
in substance — a coverage threshold on content words), and reports every
constraint the agent just forgot — console plus a durable JSONL ledger.
Pinned constraints from config are verified on every compaction. Zero LLM
calls in the trust path.
Family channel #9: read / write / do / call / leave-behind / egress / told / running / remembered — what the agent forgets.
Why now (checked 2026-10-17)
The awesome list has 209 memory plugins and an entire compaction package
family in dsh itself — and not one verifies that constraints survive
compaction. Memory plugins add recall; this audits loss. The
compaction/summary event even ships shadowedSeqs (exactly what was
compact away) — the integrity check is deterministic by construction.
How it works
compaction/summary event
├── shadowedSeqs → session.eventAt(seq) → user/message directive lines
├── pinned constraints from config (always verified)
├── verify against the summary text:
│ verbatim (whitespace-normalized substring) → kept
│ content-word coverage ≥ threshold (default 0.6) → kept
│ otherwise → LOST (reported + ledgered)
└── ledger: .dsh-compaction-guard/ledger.jsonl (CI-consumable)
Honest limitation, on purpose: word coverage tracks words, not meaning — a summary that rewords "run the tests" as "execute the checks" with no shared vocabulary counts as lost (conservative direction: false alarm, not silent loss). Synonym-aware matching would need embeddings or an LLM, which is exactly what this family refuses to put in the trust path.
Install
dsh plugin --profile default add github:zhengqiuyang/dsh-compaction-guard
Prebuilt lib/ ships in the repo — no build step, no allowBuilds.
Configure
- id: dsh-compaction-guard
name: dsh-compaction-guard
config:
pinned: ["Never force-push to main"] # always verified, verbatim
coverage: 0.6
ledgerPath: .dsh-compaction-guard/ledger.jsonl
Develop
npm install && npm test
Roadmap
reinjectmode: steer the lost constraints back into the session after compaction (default stays observe — auto-injection deserves live testing first)- Post-compaction reassertion listener (a constraint restated after the summary also counts as survived)
- Turn-boundary constraints (task briefs in the first turn pinned per-turn)
Kill criteria
If dsh ships first-party compaction-integrity verification, this freezes at its last working version with a postmortem here.
Comments
Loading…
Similar plugins
by paulalesius
Long-term memory for DeepSeek Harness agents: automatic recall each turn, a retain/recall/reflect tool, standing rules, and visibility you scope to the whole bank, a preset, or a session.
★ 3
NOASSERTION
JavaScript
Oct 15, 2026
dsh plugin --profile web add dsh-plugin-hindsight-advancedby yoza10635
Guarded context compaction for DeepSeek Harness (dsh): the LLM proposes, deterministic guards dispose — eager per-atom shrink (extract/summary/false under verbatim guards) + lazy reference-graph evict
★ 11
↓ 732/wk
MIT
TypeScript
Oct 17, 2026
dsh plugin --profile web add dsh-argpKeeps DSH agents from forgetting your requirements during long tasks. It saves important conditions and completion evidence locally, brings them back after context compaction or session resume, and st
★ 0
Apache-2.0
TypeScript
dsh plugin --profile web add dsh-completion-guardby menotbobbybrown
Persistent long-term memory for DeepSeek Harness: a JSON store of typed entries (fact, preference, entity, rule, episodic) exposed as the memory_remember and memory_recall agent tools, with recall ran
★ 0
MIT
TypeScript
Sep 8, 2026
dsh plugin --profile web add @modelnorth/dsh-plugin-memoryby john-walks-slow
Context compaction for DeepSeek Harness: mind_map and clear_mind agent tools turn selected history into self-written checkpoints, with auditable GUI tombstones and proactive threshold reminders.
★ 4
↓ 446/wk
MIT
TypeScript
Oct 13, 2026
dsh plugin --profile web add dsh-clear-mindby zhengqiuyang
Signed chain-of-custody for DeepSeek Harness sessions — hash-chained, ed25519-signed records of what the agent actually did, commits bound into the chain
★ 0
MIT
JavaScript
Oct 12, 2026
dsh plugin --profile web add dsh-attest-chain