akslcw/dsh-negative-ledger
dsh-negative-ledger
dsh-negative-ledger is a community DeepSeek Harness plugin. Read the repository README before installing.
Install
npx @deepseek-ai/dsh plugin --profile <name> add @akslcw/dsh-negative-ledgerRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-negative-ledger)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from akslcw/dsh-negative-ledger, cleaned of badges and images.
dsh-negative-ledger
A negative-knowledge ledger for coding agents. It records only disproven paths — failed commands, missing files, rejected approaches, unavailable APIs — together with the evidence behind each conclusion and the conditions under which a retry becomes legitimate. When the evidence changes, the conclusion is invalidated automatically.
What it is not
- Not memory: no positive knowledge, no semantic recall.
- Not a cache: it stores conclusions, not tool results.
- Not a bug regression tracker: it covers any tool call and file read, not just fix attempts.
The core loop
- A tool call fails (non-zero exit,
FS_NOT_FOUND, …) → a negative fact is recorded with outcome witnesses (exit code, error code) and precondition witnesses (file state from DSH'sfs/observed). - The next identical attempt matches the fact's fingerprint (normalized command + cwd, or file path).
- While every precondition witness is unchanged, the attempt is warned (
warnmode) or denied (blockmode). - Any precondition change marks the fact stale — the reminder is withdrawn and the retry is allowed. A successful retry marks it resolved.
The differentiation: a DSH-native, evidence-bound persistent negative-memory gate — failure conclusions activate and revoke themselves with the environmental evidence, and stay transactionally consistent across concurrent agents.
Quick start — one-command install
dsh plugin --profile <name> add @akslcw/dsh-negative-ledger
Installs the package and activates its bundle layer: the shipped cordis.patch.yml (declared by the dsh.bundle manifest) mounts the ledger policy with production defaults — sqlite backend, warn mode, .ledger directory, default TTLs. Verify without booting, then boot:
dsh --profile <name> --dump-config # the "@akslcw/dsh-negative-ledger" layer and its negative-ledger row
dsh --profile <name> # boot
Remove: dsh plugin --profile <name> remove @akslcw/dsh-negative-ledger. A clean-environment end-to-end smoke (add → layer → headless warn + sqlite ledger → remove → profile still boots) is powershell -File smoke/plugin-add-smoke.ps1.
pnpm 11 note: pnpm ≥11 turns "ignored build scripts" into a hard error and fails the
addwithERR_PNPM_IGNORED_BUILDS: better-sqlite3. better-sqlite3 ships official prebuilds, so the ignored script is harmless — no compilation happens. In the profile directory runpnpm config set --location project strict-dep-builds false, then re-run theadd. (Allowing the build instead would compile better-sqlite3 from source and require a C++ toolchain.)
In-checkout hacking (engine and CLI only, no DSH composition):
node src/cli.ts --dir .ledger stats
node demos/run-demos.ts # S1 command dedup, S2 missing-file dedup, S3 evidence-change invalidation
node smoke/real-mount.ts # real-mount smoke inside a deepseek-harness checkout
Requires Node ^22.19.0 || >=24.0.0 (aligned with the official DSH engines range).
CLI
node src/cli.ts [--dir <path>] [--backend sqlite|jsonl] <list | show <id> | stale | stats>
The backend flag wins; otherwise the directory is auto-detected (ledger.db → sqlite, ledger.jsonl → jsonl); with neither present the primary sqlite backend is used.
…
