Lsc-91-69/dsh-brain-compaction ↗★ 2
dsh-brain-compaction
人脑式上下文压缩逻辑 — DeepSeek Harness 上下文压缩统一协同层: 集成 dsh-argp / dsh-compaction-instant / dsh-headroom / dsh-sgme / dsh-memory-vault / dsh-mcp-lens / dsh-context-doctor,提供统一配置、工具协调与验证机制。适配 DSH 0.1.5。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Lsc-91-69/dsh-brain-compaction说明文档
阅读完整 README ↗重启 dsh web(dsh web 停掉再起, 或使用 GUI 的重启控件)
**从源码目录安装:**
```sh
git clone https://github.com/Lsc-91-69/dsh-brain-compaction
dsh plugin --profile web add "file:"
## 配置矩阵
| 参数 | 层 | 调整方式 |
|---|---|---|
| 引擎选择(argp/instant/headroom) | 组合 | `cordis.patch.yml`(改 disabled,重启);0.1.5 下仅 argp 可用 |
| argp maxPasses / recencyGuard | 组合 | 行 `config`(本插件的 patch 默认 256/10) |
| instant thresholdRatio/retainTurns/retainTokens/auto/checkpointCap | 运行时 | 统一面板 / settings `compaction-instant`(0.1.5 下该插件暂不可用) |
| headroom 压缩开关/阈值/代理参数 | 运行时 | 统一面板(headroom 启用后)/ settings `headroom` |
| 本插件 selfTestAfterBoot / verifyDetail | 运行时 | 统一面板 / settings `brain-compaction`(0.1.5:`ctx.settings.installSection`) |
| sgme baseUrl/agentKey/…(网关) | 组合 | 行 `config` + 环境变量(patch 注释) |
| vault injectLimit/recallLimit | 组合 | 行 `config`(默认 8/10) |
| mcp-lens servers/allowTools/denyTools | 组合 | 行 `config`(默认空, fail-closed) |
| context-doctor defaultCwd/cacheTtlMs | 组合 | 其自身 patch |