
Security News
PHP Foundation Says Chainguard Broke Security Embargo Ahead of Emergency Patches
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.
dsh-context-mode-compaction
Advanced tools
Lossless checkpoint strategy for DeepSeek Harness: keeps the full conversation transcript and archives tool output to the context-mode knowledge base
English | 中文
A lossless checkpoint strategy for DeepSeek Harness.
DSH's shipped compaction asks a model to retell the conversation in eight fixed sections. Tool output has no section of its own, so it survives only as whatever prose the summarizer happened to write — in practice most of what was actually said is gone. This package replaces that strategy with one that rebuilds the conversation from the events themselves.
It is a drop-in dsh-compaction-basic engine. It runs the shipped summarizer
first and unmodified, then appends two sections below its output.
| Source | What survives | Detail |
|---|---|---|
user/message | whole message | A message over 1,000 chars keeps its first and last 500; the middle is archived and reachable. |
assistant/message | head + tail | First and last 200 chars; the middle is archived. Messages under 400 chars are kept whole. |
tool/result | an index line only | Never copied. One line names the tool, its size, and where its output lives. |
Every clipped or dropped region leaves a pointer naming the source to search
and the seq it came from, so the checkpoint says which event lost detail
rather than merely that an archive exists.
Harness-injected blocks (<active_memory>, <current_runtime_context>,
<system-reminder>, skill catalogs, prior checkpoints) are discarded: they are
not conversation and would otherwise crowd out the real turns.
## Conversation Transcript
## [user 6925]
重启并压缩了
## [assistant 7319]
⏵ 固化回归测试 在你重启期间,我把这次的验证固化成永久回归测试…
## [tool read seq 7321, 2242 chars → search `session/<id>/finding`]
## Archive Index
The raw transcript of this span was archived to the context-mode knowledge
base before it was condensed, so detail the summary above omits is still
retrievable with `ctx_search`. Scope each query to one layer by `source`:
- `source: "session/<id>/constraint"` — user messages: requirements, decisions, limits
- `source: "session/<id>/finding"` — tool results and stated conclusions
- `source: "session/<id>/narrative"` — assistant reasoning and plans
This package is the strategy. It works on its own, but the archive index it writes only resolves if you also run the archiver, which lives in the companion package:
npm install dsh-context-mode dsh-context-mode-compaction
Then point the preset's compaction row at this package:
npx dsh-context-mode-compaction
That rewrites exactly one field — the name of the compaction-basic row
inside the preset's compaction group — leaving every other line, comment, and
!!js expression byte-for-byte intact. It backs the file up first.
npx dsh-context-mode-compaction --check # report what would change
npx dsh-context-mode-compaction --revert # restore the previous row
Restart DSH after wiring.
A preset row whose name is a bare package specifier resolves from the
harness base, not from the profile that installed the package. A
user-installed package is therefore invisible to such a row, and DSH marks the
whole preset broken. Rows whose name is relative resolve against the preset's
own directory instead — a base your installed copy can actually reach. The
script computes that relative path for you.
^22.19 || >=24@deepseek-ai/dsh-compaction-basic ^0.1.5-rc.2 (peer)@deepseek-ai/cordis ^4.0.2 (peer)A checkpoint's own text can never verify itself: the summarizing model copies whatever it is shown, so a marker quoted back from an earlier transcript is indistinguishable from one the engine wrote. Check the durable session log instead.
node scripts/verify-checkpoint.mjs <session-id>
It reads the compaction/summary events and structurally inspects what the
engine wrote — the transcript's own ## [user …] / ## [tool …] entry syntax,
which only the renderer emits, and archive sources anchored as the summary's
final heading. VERDICT: the lossless strategy is live and exit 0 mean it
ran.
npm run verify # build + smoke + wrapping + manual-range regressions
verify covers the two failure modes this engine has actually hit:
static [Service.invoke]
is replaced by a new function object, so a #private field cannot survive and
a WeakMap keyed on this can lose its key. repro-range.mjs pins this.compactNow path. DSH routes automatic pressure and overflow
through compactRegion(), but /compact calls compactSurfaceRegion()
directly and never touches it. A range captured only in compactRegion is
therefore absent for every manual compaction, which produced checkpoints with
an index pointing at a transcript that was never written.
repro-manual-range.mjs pins the recovery: the summarizer's input messages
are projections of the shadowed events, cached per surface node, so matching
them back by identity recovers the span exactly.MIT
FAQs
Lossless checkpoint strategy for DeepSeek Harness: keeps the full conversation transcript and archives tool output to the context-mode knowledge base
The npm package dsh-context-mode-compaction receives a total of 11 weekly downloads. As such, dsh-context-mode-compaction popularity was classified as not popular.
We found that dsh-context-mode-compaction demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.

Threat Research
/Security News
A supply chain attack compromised LiteLLM 1.107.0 on PyPI and Docker, spreading malware that steals cloud credentials, developer secrets, and AI provider keys.