yu381792/dsh-superlcm 预览 preview

yu381792/dsh-superlcm

SuperLcm — Lossless Context for DeepSeek Harness: fully asynchronous, cache-friendly compaction with exact recall.

Project Overview项目介绍

SuperLcm is an asynchronous context-compaction and lossless recall plugin built specifically for DeepSeek Harness (DSH), inspired by Clint Ehrlich and Theodore Blackman's LCM paper and explicitly scoped to DSH's append-only event log as the canonical source of truth. It runs an out-of-band Worker that uses an independent summarizationProvider and summarizationModel to build a layered summary DAG in the background, while the foreground Agent reply never awaits that compression model and is decoupled via its own AbortController. The plugin exposes six recall tools — lcm_grep, lcm_describe, lcm_expand, lcm_expand_query, lcm_reindex, lcm_doctor — that read exact DSH event seq ranges rather than re-summarizing summaries. Installation uses dsh plugin --profile web|acp add pointing at the GitHub Release tarball SuperLcm-0.3.0-alpha.9.tgz, and operators are instructed to replace the existing compaction provider instead of stacking a second one alongside it.

Typical workflow keeps the active surface small by keeping only the frozen SYSTEM + CHECKPOINT prefix and a recent fresh tail, while older raw history is folded into summary nodes that still carry child_ids and source event seqs. The default policy accepts only mode: rolling with foldTiming: background, retains the last 24 surface nodes and at least 32k fresh tokens, prepares 64k batches off the critical path, and only commits ready summaries under softActiveTokens 160k or hardActiveTokens 220k pressure. Atomic transactions enforce the full compaction/start → compaction/summary → checkpoint user/message → compaction/end lifecycle, and snapshots are pinned before summarization so tail growth or rewrites cause discard-and-rebuild rather than corrupted ranges. It targets DSH power users who want stable Prompt Cache prefixes and bounded attention dilution in long-running sessions.

Hard requirements are Node.js 22.16 or newer and continued DSH exposure of its official compaction, LLM, tools, and session/event interfaces; CI additionally covers Linux on Node.js 24 and Windows/macOS on 22. SQLite lives at ~/.dsh/SuperLcm/lcm.sqlite, overridable via DSH_SUPERLCM_DB and DSH_HOME, holds only derivable indexes (lcm_nodes, lcm_edges, lcm_nodes_fts, lcm_scan_state, lcm_index_state) with WAL, and never stores original transcripts so it can be rebuilt by lcm_reindex. The 160k/220k thresholds are starting points for large-context models and must not be copied verbatim to small-context models; a fallback provider/model pair, if configured, must differ from the primary and is invoked at most once. First-run advice is to validate in an isolated profile, pin both DSH and plugin versions, run npm run validate plus npm pack --dry-run, and avoid automated upgrading into the main workspace. The project is MIT-licensed and explicitly unaffiliated with Voltropy, Martian Engineering, DeepSeek, the official interactive LCM site, or DSH upstream.

SuperLcm 是面向 DeepSeek Harness(DSH)设计的异步上下文压缩与无损召回插件,基于 Clint Ehrlich 与 Theodore Blackman 的 LCM 论文思路,将 DSH 原始 append-only 事件日志作为唯一真源,通过后台 Worker 独立构建分层摘要 DAG,让 Agent 在 lcm_grep、lcm_describe、lcm_expand、lcm_expand_query、lcm_reindex、lcm_doctor 六个工具按需回溯精确 event.seq。安装方式是通过 dsh plugin --profile web|acp add 加载 GitHub Release 中的 SuperLcm-0.3.0-alpha.9.tgz 压缩包,挂载 cordis.patch.yml 提供的工具集,并在 compaction 配置中替换原有 provider,而非并排追加。

典型工作流是后台 Worker 在用户当前对话之外独立调度 summarizationProvider 与 summarizationModel,持续把超过 softActiveTokens、hardActiveTokens 阈值的历史折叠为冻结 prefix 与 fresh tail,同时维护 SQLite 中的 lcm_nodes、lcm_edges、lcm_nodes_fts、lcm_scan_state 派生索引。压缩模式固定 mode: rolling、foldTiming: background,默认保留 24 个 surface node 与至少 32k fresh token,64k 历史批次可在后台预先准备。它适合在长会话中既要稳定 Prompt Cache 命中,又需要按原始证据无损召回细节的开发者与 Agent 重度用户。

运行依赖 Node.js 22.16 以上版本,要求 DSH 仍开放官方 compaction、LLM、tools、session/event 接口;数据库默认位于 ~/.dsh/SuperLcm/lcm.sqlite,可通过 DSH_SUPERLCM_DB、DSH_HOME 重定向。SQLite 仅保存可重建摘要与 DAG,FTS5 全文检索与 WAL 事务由 Node 原生模块承担,不修改 DSH canonical 事务。160k/220k 阈值面向大上下文模型起算,不应照搬到小上下文模型;启用前应在独立 profile 完成真实压缩、召回、fork 隔离与重启验收,固定 DSH 与插件版本后再切换到主工作区。许可 MIT,仓库明确声明与 Voltropy、Martian Engineering、DeepSeek 及官方交互站点无隶属关系。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add "https://github.com/ygc3817922006-sketch/dsh-superlcm/releases/download/v0.3.0-alpha.9/SuperLcm-0.3.0-alpha.9.tgz"

把 yu381792/dsh-superlcm 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

SuperLcm — Lossless Context

English · Releases · LCM 论文

CI Release License

**SuperLcm 是 DeepSeek Harness(DSH)的异步上下文压缩与无损召回插件。**它不把一段长对话永久替换成一个不可追溯的扁平摘要,而是保留 DSH 原始事件日志,建立分层摘要 DAG,并让 Agent 在需要时搜索、定位、展开之前的精确上下文。

main 当前版本:0.3.0-alpha.10;最新公开 Release 仍为 0.3.0-alpha.9。建议固定 DSH 与插件版本,在独立 profile 验证后再启用到主工作区。

LCM 官方交互式动态讲解

点击上图打开论文团队的 LCM 官方交互式动态讲解

官方页面并不是一个独立的 MP4/WebM 视频,而是由网页脚本驱动的滚动交互动画;GitHub README 不能运行外部网页脚本。因此这里直接加载官方预览并链接到原始动态页面,同时在仓库内提供一份原生 GIF,把 SuperLcm 实际采用的流程完整展示出来:

SuperLcm LCM 原理动画

目录

五个核心目标

  1. 展示并实现 LCM 原理:原文永久留在 DSH 事件日志中;摘要形成层级 DAG;摘要节点保留精确源事件指针。
  2. 异步压缩,不阻塞对话:独立 Worker 和独立模型在后台准备摘要,当前 Agent 回复不等待压缩模型。
  3. 持续保持较少的活动上下文:旧历史进入 checkpoint,主模型只携带稳定摘要、必要原文和 fresh tail。
  4. 缓存更稳定、成本更低:冻结 system/checkpoint 前缀,减少前缀重写;更短的活动请求也减少输入 token 与 cache write 体积。
  5. 摘要可搜索,原文可精确取回:SQLite 只做可重建索引,lcm_expand 最终返回的是 DSH 原始事件,而不是摘要的二次转述。

1. LCM 的原理

SuperLcm 受 Clint Ehrlich 与 Theodore Blackman 的论文 LCM: Lossless Context Management 启发。推荐先看论文团队制作的 官方交互式动态讲解;论文也可在 arXiv:2605.04050 阅读。

传统压缩通常是:

原始消息 1 … 100  ──压缩──>  一个扁平摘要
                                  │
                                  └─ 摘要遗漏的细节通常无法再定位

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev siyuan-codex-bridge 下一个 Next auto-compact →