nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:cty-09/dsh-compact-receipt
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
⚠️ 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
autonot 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: trueand disabling thecompaction-basicrow. 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)
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?
dsh-highlightpin); this is automatic and zero-configdsh plugin --profile web add github:cty-09/dsh-compact-receipt
Restart DSH. No configuration, no toggles.
| Command | Purpose |
|---|---|
/contract |
Latest receipt, commitments still in force, lifetime survival rate |
/contract guard off |
Disable blocking (on by default) |
/contract unblock <id> |
Lift one rule |
user/message event; the receipt
only claims "confirmed delivered" when that echo arrives. A successful write is not delivery./contract probe measures what a pinned policy would keep and how much
context it would cost, without changing anything.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.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.
Three kinds, matched by rules (Chinese and English):
| Kind | Examples |
|---|---|
| constraint | don't touch X, must use Y, 不要改 X, 必须用 Y |
| decision | we'll use X, 决定采用 Y |
| acceptance | acceptance: tests must pass, 验收标准是 X |
Extraction is deterministic: same input, same output. No cost, no network, reproducible.
This plugin does not pretend to be smarter than it is:
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.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.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.
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 withERR_MODULE_NOT_FOUNDon a user's machine. This plugin therefore usesctxonly.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: memory。