DSH Hub

scd13150/dsh-cognition

dsh-cognition

BundleWorkflow0 GitHub stars· updated 2026-08-15

A project memory for your DeepSeek Harness agent - constrain / observe / remember / verify, built on DSH native primitives.

Install

npx @deepseek-ai/dsh plugin --profile web add github:scd13150/dsh-cognition

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-cognition DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/dsh-cognition.svg)](https://dshhub.dev/plugins/dsh-cognition)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from scd13150/dsh-cognition, cleaned of badges and images.

DSNLE — A project memory for your DSH agent

DSNLE gives your DeepSeek Harness agent a memory of your project.

New tasks start with what you already did: edits from similar past tasks surface as precedents, out-of-scope edits get blocked, and knowledge keeps accumulating across sessions — enforced by DSH's native mechanisms (per-tool gates, kernel-level version guards, the skills knowledge layer, session event sourcing), not by prompt tricks.

Honest status: a research prototype with a working implementation — 47 real-repo fixes verified by upstream test suites, a gold-free 20-task continuous run (20/20), 245 deterministic regression assertions — and openly documented boundaries (docs/research/).

中文


Quick start(3 steps)

Requires: Node.js ≥ 22 + a running DeepSeek Harness.

git clone https://github.com/scd13150/dsh-cognition.git && cd dsnle
node install-dsnle.mjs --set-default    # creates the dsnle preset and makes it DSH's default (backs up your config)

Then restart DSH (or open a new session) — the new session should show:

  • nle_suggest / nle_focus / nle_mutate / nle_select / nle_guard … in your tools
  • nle-learned-* and nle-reflections in your skill catalog

Verify: run nle_check (no args) in the new session — ok: true means installed.

Other install modes / uninstall / troubleshooting

  • Keep your global default untouched: omit --set-default, then set the default preset in DSH settings (agent-presets → default), or pick dsnle per session
  • Inject into an existing preset: node install-dsnle.mjs --into <preset-id> (backs up agent.cordis.yml)
  • Dry-run any command with --dry-run
  • Uninstall: delete ~/.dsh/.agent-presets/dsnle/ (+ restore settings.yaml.bak-* if you changed the default); injected mode: restore agent.cordis.yml.bak-*
  • No tools in a new session? The session must use the dsnle preset (check settings); running sessions never pick up new presets — always open a fresh session

怎么工作

每个任务走一条可审计的 ritual 链(强制,乱序改码会被 deny):

nle_suggest(定位检索)→ nle_focus(锁 scope)→ [nle_impact(高影响声明)]→ 编辑
→ [nle_reorient(证据推翻 scope)]→ nle_select(对账收尾)→ nle_guard(总闸)
机制DSH 原生落点
约束强制链 + scope 锁 + shell 绕行防护 + 版本守卫tools/pre-execute 瀑布、fs/edit-intent 内核版本守卫
观测内容哈希 cell + CON 码(CON200/404/405/422)+ 真相对账tools/result 冻结结果、fs 意图观测
记忆learned(关键词→文件,置信度/衰减/跨项目提升)+ precedent(历史会话先例)+ git 共改/churn/rollbackskills provider、sessionQuery 会话检索
可靠契约门(声明 vs 真相)、guard 总闸、状态防篡改、反射观测事件溯源日志、tokenMeter 成本报告

完整工具说明:调用 nle_suggest 等工具的 schema 即自带描述;机制规格见 docs/research/DSH_NLE_SPEC.md

语义通道(可选)

语义检索(embedding 重排)是可选增强,不启用时自动降级为 BM25 + 符号/先例/共改检索,主链路不受影响。

启用:运行独立 helper 进程(transformers.js 首次运行自动下载模型,~90MB,缓存于 HF 缓存目录):

node nle-semantic/server.mjs --spool <工作区>/.nle-semantic
  • 模型:Xenova/all-MiniLM-L6-v2(quantized),384 维,不随本仓库分发,由 transformers.js 自动下载或从 HF 缓存复用
  • 离线环境:预先在有网机器跑一次 node nle-semantic/server.mjs --selfcheck 生成缓存再迁移;或干脆不用语义通道
  • 自检:node nle-semantic/server.mjs --selfcheck{"ok":true,"dim":384}

Related plugins