@local/dsh-vcc
Deterministic, no-LLM conversation compaction (VCC) with lossless (#N) recall for DeepSeek Harness; adapted from pi-vcc (MIT). 适合需要压缩长会话历史以节省Token,同时保留无损上下文召回能力的用户。
Install
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:mpetruc/dsh-vccREADME
Read the full README ↗dsh-vcc
Deterministic, no-LLM conversation compaction for DeepSeek Harness, with lossless recall — adapted from pi-vcc's view-oriented compiler approach.
When a session grows past its window, instead of paying an LLM to compress the history, dsh-vcc compiles the conversation into a structured, stable summary:
- [Session Goal] / [Files And Changes] / [Commits] / [Outstanding Context] / [User Preferences] header sections, merged across compactions (dedup, cross-compaction file merge, volatile sections rebuilt fresh);
- a ranked brief transcript (
---separated) whose messages keep lossless(#N)references into the session log.
(#N) is the event seq — the same index vcc_recall searches — so
anything compaction drops stays one deterministic call away:
vcc_recall(query: "redis cache decision") → ranked, paged hits (#N)
vcc_recall(expand: [42]) → full untruncated content
vcc_recall(query: "#42:auth.ts") → drill into a file from an entry
vcc_recall(query: "#42:auth.ts:full") → all lines of that file content
vcc_recall(mode: "touched") → files worked on, with entry indices
vcc_recall(scope: "all") → also reach edited/retried branches
Also ships /vcc (preview the summary the next compaction would write, with no
mutation) and /vcc-recall (the tool as a human command).
Layout
| Path | Role |
|---|---|
index.js | DshVccCompactionEngine (default export) — extends the basic backend, overrides its summarize hook with the deterministic pipeline; registers the recall tool and commands. |
lib/dsh-adapter.js | DSH message → pi message shape (tool-call id→name correlation, reasoning policy). |
lib/session-source.js | Session events → message streams (lineage = live surface, all = full log). |
lib/engine-util.js | seq alignment for (#N) refs; previous-summary extraction. |
lib/drill-down-dsh.js | #N:path drill-down, re-rooted on session events. |
lib/recall-tool.js | vcc_recall tool + shared recall algorithm. |
lib/commands.js | /vcc and /vcc-recall human commands. |
src/ | The pi-vcc core pipeline compiled to ESM (MIT, see NOTICE): normalize, filter-noise, sections, rank, build-sections, summarize, search-entries, render-entries, format-recall, recall-scope, extract/*. |
cordis.patch.yml | Enables the engine inside the preset's compaction group and disables the preset's stock LLM backend. |
node_modules/@deepseek-ai/* | Symlink farm to the harness checkout packages the bundle imports at module-eval time (see below). |
How it works
- The bundle mounts one service row (
dsh-vcc) into the cordis agent preset'scompactiongroup and disables the preset's stockcompaction-basicrow in the same group. Preset sessions then resolvectx.compactiontoDshVccCompactionEngine— a subclass of the basic backend that keeps all of its machinery (threshold/overflow auto triggers, region selection,(maxTokens)shrink gate, retry backoff, durable session mutation,compaction/summaryevents) and replaces only thesummarizehook withcompileRankedfrom the ported pi-vcc core. - Alignment:
buildSummarizationInputhands the engine the exact messages it plans to shadow; messages are the durable surface objects, so an identity map (Mapbuilt fromsession.surface.nodes) recovers each message's event seq, fail-closed. The summary's(#N)refs andvcc_recall's indices are the same seqs — self-consistent by construction. - The compiled result is returned as
{ summary, rawOutput, provider: 'dsh-vcc', model: 'deterministic' }with nollmStreamCall— the non-LLM branch of the backend'sSummaryResult. An empty compile throws, so the backend treats it like a summarizer that produced nothing (retry/error path).
Install & verify
plugin_manager → install_bundle → target: /home/user1/dsh-compaction/dsh-vcc
install_bundlerecords@local/dsh-vcc: link:in the profile'spackage.jsonand appliescordis.patch.yml; no restart is needed on first install.- Confirm:
cordis_inspect_query(Host Config / Tool / Service), then run/vccin a cordis-preset session to see the live deterministic preview, and/compactto compact.vcc_recallthen answers questions about the shadowed history. - Replacing an already-installed version of the same package still needs a profile restart to load the new module generation.
Known scope (v1)
- Activates for the cordis preset only (the patch targets the
last-occurring rows in the composed profile).
standard/ptc/minimalpresets keep their stock compaction backend. - Deterministic by design: no LLM calls, no network, no nondeterminism — identical input always produces identical output.
- Only the current session is searchable; earlier sessions are not.
Attribution
dsh-vcc is a port of pi-vcc (MIT) — itself derived from pi-blackhole
(by k0valik, MIT) and invisible-continue (by monotykamary, MIT). The
compiled core under src/ is the pi-vcc pipeline (normalize, filter-noise,
build-sections, rank, summarize, extract/*, search/render/format-recall,
recall-scope) with only its load-messages/JSONL layer replaced by
lib/session-source.js and its drill-down re-rooted on session events. See
NOTICE for the full license texts.