DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-compact-receipt

c

dsh-compact-receipt

Manifest valid

[BETA] Context Compression Receipt for DeepSeek Harness: Audit which of your requirements were dropped during compression, and (experimentally) take over compression to preserve verbatim. The experimental part has not yet been validated with real compression.

hasBundlePatch

dsh-compact-receipt

⚠️ Beta (0.4.0-beta.1)

A default install is safe: it records, audits and guards; it does not change compaction.

The compaction takeover is experimental and has not been exercised by a real compaction yet. Two end-to-end runs never triggered compaction (likely auto not enabled or a threshold floor), so the pinned block has never been produced in a live session - only unit-tested.

The takeover is off by default and requires both engine: true and disabling the compaction-basic row. Until a real compaction verifies it, do not use it on important sessions.

中文 | English

Long conversations don't forget. Nobody tells you when they started.

Context compaction in DSH is silent and lossy: a range of history is replaced by one summary, and from then on that summary is all the model can see. The "don't touch tests/" you said 40 turns ago may have vanished in a compaction — with nothing to indicate it.

This plugin hands you a receipt after every compaction: how much was eaten, and which of your requirements no longer appear in the summary.

This session compacted 1 time, most recent:

Receipt #1 · 18:42:07 · ate 24 history items (~8.2k tokens)
  5 commitments · 4 survived · 1 possibly lost

  ⚠️ Possibly lost (not found in the summary — please confirm):
   1. [constraint] don't touch tests/ · turn 7

Lifetime survival: 80% (4/5)

Not another context dashboard

Existing tools measure how big the context is (dsh-context) or make it smaller (billion-context). This one measures a different thing: after compaction, are the things you asked for still there?

  • Others optimize token count; this audits semantic fidelity
  • Others ask you to pin a passage by hand (dsh-highlightpin); this is automatic and zero-config
  • The audit never calls a model: the summary is a string, your requirements are strings, so the comparison is string comparison — zero token cost, cheap enough to run on every compaction

Install

dsh plugin --profile web add github:cty-09/dsh-compact-receipt

Restart DSH. No configuration, no toggles.

Usage

CommandPurpose
/contractLatest receipt, commitments still in force, lifetime survival rate
/contract guard offDisable blocking (on by default)
/contract unblock <id>Lift one rule

Architecture (v0.3)

  • Semantic classification: one batched call over the shadowed messages adds the phrasings the rules miss ("tests 目录先别碰") to the commitment table - this is what moves coverage from rules to the model.
  • Semantic judgement: commitments plus the new summary go to the model in one call that returns kept/lost/unclear. If it cannot answer, the rule scorer runs and the receipt says so.
  • Delivery is verified: an injected message echoes back as a user/message event; the receipt only claims "confirmed delivered" when that echo arrives. A successful write is not delivery.
  • Classification probe: /contract probe measures what a pinned policy would keep and how much context it would cost, without changing anything.
  • Rule-layer accuracy is measured, not asserted: test/corpus.js holds 21 labelled messages and npm test prints the score. Today the rules reach 86% (100% precision on constraints, decisions and acceptance; 70% constraint recall) - postposed negations like "tests 目录先别碰" are the misses, and the semantic layer covers them.

It also does two more things

1. It tells you inside the conversation. When a compaction drops requirements, a receipt card appears in the chat — visible in the Web UI without remembering any command. That card also hands the dropped requirements back to the model, so it is both an alert and the cheapest possible repair.

2. It blocks contradicting writes. Once "don't touch X" is recorded, a write-family tool call targeting X is denied, with a message telling the agent to confirm with you first, or you to run /contract unblock <id>. Only file-writing tools are covered, and matching is path-string based: missing a block is preferable to a false block.

What counts as a requirement

Three kinds, matched by rules (Chinese and English):

KindExamples
constraintdon't touch X, must use Y, 不要改 X, 必须用 Y
decisionwe'll use X, 决定采用 Y
acceptanceacceptance: tests must pass, 验收标准是 X

Extraction is deterministic: same input, same output. No cost, no network, reproducible.

Honest limits

This plugin does not pretend to be smarter than it is:

  1. "Possibly lost" means possibly. A summary that keeps the meaning but rewords it can trigger a false alarm. The threshold deliberately prefers false alarms over silence.
  2. Only the compacted range is audited. Requirements still in context are not audited, because they were never dropped.
  3. Rule extraction misses things. It recognizes common imperative phrasing and nothing else. It does not guess.
  4. It does not prevent compaction and cannot restore the original text. It makes the loss visible and puts the dropped requirements back in front of the model.
  5. Blocking is path-string matching. Only file-writing tool arguments are inspected; a different spelling of the same path (symlink, relative form) can slip through.
  6. No dedicated sidebar panel. A client plugin needs the custom window.__ModuleLoader__ bundle format, ctx.slots, and a React build; this version does not ship one. Visibility comes from the in-conversation card and /contract.
  7. It does not take over the compactor. Replacing CompactionEngine means reimplementing summarisation, range selection and checkpoint writes, reachable only from a long live session and not verifiable offline. This version guarantees at the compaction boundary (re-inject + echo confirmation) instead of replacing the engine.
  8. The card costs tokens. It only appears when something was actually lost — typically 4-6 lines, far less than the loss it prevents.

How it works

DSH writes a compaction/summary event carrying the summary text and the seqs of shadowed history. The plugin subscribes to the session event stream, extracts commitments from user messages as they arrive, and on compaction scores each one against the summary text: exact match for Latin identifiers, character-bigram overlap for Chinese, averaged. No model calls, no network, no extra tokens.

Development

npm test    # 20 cases, including an end-to-end simulation

Zero dependencies, zero build step: the ESM in lib/ is the published artifact.

Why no imports at all: @deepseek-ai/* runtime packages exist only inside the DSH install, not in a profile, and DSH registers no ESM resolve hook. Any third-party plugin that imports them fails with ERR_MODULE_NOT_FOUND on a user's machine. This plugin therefore uses ctx only.

License

MIT

Comments

Loading…

Similar plugins

dsh-context-truth

by deepseekv41flash

给 DSH 模型每轮回填宿主实测的上下文占用,并阻止"上下文快用尽"的错判被压缩摘要继承。

Security & AuditTools & CapabilitiesManifest valid

★ 7

↓ 666/wk

MIT

JavaScript

Oct 12, 2026

dsh plugin --profile web add dsh-context-truth

by zwx000908-dev

DeepSeek Harness 科研论文正文与补充信息数据核对插件,支持自定义格式、图像表格读取和 HRMS 精确质量复算。

Manifest valid

★ 0

MIT

JavaScript

Nov 10, 2026

dsh plugin --profile web add dsh-paper-si-audit

by chunsi-w

Bounded context compaction, session-scoped summary reuse, explicit memory controls, and diagnostic-preserving tool pruning for DeepSeek Harness.

Tools & CapabilitiesManifest valid

★ 9

↓ 382/wk

MIT

JavaScript

Oct 4, 2026

dsh plugin --profile web add dsh-ctxopt-compaction

by rezon-aki

上下文压缩沿用会话思考档位:DeepSeek 前缀缓存按档位分桶,不修就会在每次压缩时把整个上下文按未缓存价重算一遍。零依赖、不碰官方插件。

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Sep 29, 2026

dsh plugin --profile web add dsh-compaction-effort-inherit

by ScreamingMaggot

把长对话的重复计费砍掉一半,并给模型配一名只读调查员:先核实,后动手。面向 DeepSeek Harness 的上下文压缩与外置推理插件(MIT)。

Memory & ContextSessions & MessagesManifest valid

★ 1

MIT

JavaScript

Oct 22, 2026

dsh plugin --profile web add rcs-context

by chuxindd

Persistent task state and context-aware compaction for DeepSeek Harness coding sessions.

Terminal & ClientsManifest valid

★ 0

MIT

TypeScript

Sep 20, 2026

dsh plugin --profile web add dsh-context-enhancement