A judgment core for DeepSeek Harness: a cognition loop that gives every decision a source and attribution and drives planning to a close, hippocampus memory that condenses running experience into knowledge (journal ledger, episodic archive, low-confidence decay), judgment identity responsibilities in the architecture (consistent rubric, judgment bound to its source), and an A2A memory-management team via dsh-linghun-assembler. Requires DSH ^0.1.0-rc.7 (rc.2 supported).
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-linghun
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:syyr1987/dsh-linghun
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Your DeepSeek agent plans and plans, then does nothing. A page of strategy, zero execution. The model isn't weak — it's missing a closer. Linghun supplies it.
Linghun gives DeepSeek Harness agents a closing-mind identity, boundary-judgment discipline, and a hippocampus-style memory loop — every judgment has a source, every decision gets closed, and experience keeps flowing back into the next round. Endless planning is cut off by mechanism.
- The Closer (收口者): the LLM supplies intuition and candidate answers; the agent evaluates, filters, and closes — thinking, judging, and deciding happen on the agent's side. Planning must land.
- Boundary discipline: never force-precision on fuzzy concepts, never fake consistency on paradoxes, verify before asserting, never fabricate, and watch for "raise-the-cost-of-refusal" wording.
- Cognition loop: judgment has a source, feedback has attribution, improvement keeps its chain.
- Hippocampus (three-layer memory): warm buffer for recent facts → consolidation into
episodic archive (same-day appends, never overwrites) → cold summary injected. The injection
slot carries only high-frequency abstract experience (cold summary/rules); warm recent facts
are read on demand via
memory_read— injection bandwidth for abstraction, details on query. - Chronological ledger (序时账):
journal_readreturns the raw conversation ledger, archived by day — trace exactly what was said when, complementing the forgetful warm layer. - Confidence-weighted forgetting: every entry carries a confidence tag (high/medium/low).
Low-confidence entries carry a 【需验证】 marker (visible when warm injection is enabled);
entries overturned (
wrong) are flipped and excluded from injection — degraded confidence is a form of forgetting. - A2A memory team (linghun-assembler): share the cognitive-cycle team's ledger — judge
records, editor deliveries, archivist timelines — into the main brain via
memory_read. - Self-evolution: the agent reads and updates its own soul card via
soul_read/soul_update. - Closer's judgment role (判分身份职责): judgment/ruling tasks get a one-line identity role inside
soul:judgment— keep criteria consistent, bind every verdict to its source, judge only by the rules, never widen criteria to "seem useful", stop when the source of a criterion can't be stated. Drift signals and miss-kill anchors live in the judgment domain ontology (consult on demand, not injected every time). No separate supervision mechanism — low-pressure single-step judgment does not drift; reliability comes from domain rules, not from a monitor.
Install
dsh plugin --profile web add dsh-linghun
Requires DSH >= 0.1.0-rc.7 (< 0.2.0), Node.js >= 20.18.
Usage
Write your own soul card (persona)
On first run, the plugin drops a default soul card at $DSH_HOME/linghun/identity.md.
Edit that file and you are writing your own persona — changes take effect immediately, no restart needed:
$EDITOR $DSH_HOME/linghun/identity.md
# My Soul Card
My name is Blue.
Personality: cautious, direct.
Communication style: short sentences, conclusion first.
Other: (anything you want; leave it out if nothing)
Just four fields — name, personality, communication style, and everything else goes into Other.
Identity anchors, conduct, and growth are added automatically by the plugin — you don't write them.
Precedence: identity.md file > settings content > built-in default card (falls back when the file is
missing or blank). The agent can also edit the card itself via soul_update, or you can adjust the soul
name/content in DSH Settings → 灵魂 (Linghun).
Injection & tools
Prompt sections injected:
soul:identity— soul card (identity anchors: the Closer architecture)soul:judgment— boundary scan discipline (six boundary classes) + the Closer's judgment rolesoul:memory— cold summary (high-frequency abstract experience) + archive index; warm recent is read on demand viamemory_read
Tools exposed:
| Tool | Purpose |
|---|---|
memory_append |
Write a timestamped memory (fact / decision / preference / experience) |
memory_read |
Read the hippocampus back (cold summary + warm recent + archive index; recent facts on demand) |
memory_consolidate |
Consolidate: warm → episodic/<date>.md, merge cold summary |
soul_read |
Read your own soul card (who I am, my boundaries, my discipline) |
soul_update |
Update your own soul card (fold stable traits into identity) |
journal_read |
Read the chronological ledger (raw conversation history, archived by day) |
Memory lives in plain Markdown under $DSH_HOME/linghun/memory/ — readable, searchable, git-friendly.
The soul card is at $DSH_HOME/linghun/identity.md — also plain Markdown. Your persona is yours; edit it however you like.
Injection layering (v0.4.4): warm recent memory is NOT injected by default (
linghun.memory.injectWarmdefaults tofalse) — injection bandwidth is reserved for high-frequency abstract experience; recent details are read on demand viamemory_read. SetinjectWarm: truefor special cases (empty cold store, needing recent context inline).
Engineering guardrails (v0.2)
Memory timing is infrastructure, so it is enforced by code, not by prompting:
- End-of-turn assessment — on every
turn/end, the plugin asks the model once whether the turn produced anything worth keeping (fact/decision/preference/experience). Worthwhile entries are appended to warm memory automatically;SKIPis emitted when nothing qualifies. This no longer depends on the model remembering to callmemory_appendon its own. - Threshold auto-consolidation — when warm memory reaches
maxBytes × triggerRatio, the plugin archives warm →episodic/<date>.mdand merges the cold summary before writing the new entry. The model never hits a full-memory error and never has to schedule consolidation itself.
Both can be tuned under the linghun.memory.assessment / linghun.memory.autoConsolidate settings (each with an enabled switch), e.g. through cordis.patch.yml.
Roadmap
- v0.1.0 (done): identity + judgment + hippocampus
- v0.2.0 (done): engineering memory guardrails — end-of-turn assessment + threshold auto-consolidation
- v0.3.0 (done): miss-verification discipline — "candidate not hit" in material ≠ memory has none; verify cold storage for factual queries; converge by question type for identity/background
- v0.3.3 (released, then revised in v0.3.4): Censor (verifier verification discipline) — shipped as a supervision mechanism (3 drift classes + 4-step admonition + CONFIRMED taming). Benchmarked against a 9-case gold standard: criterion-widening regex 100% false positives, drift-widening 43% false positives, uniform miss-kills 0 detected — judgment does not drift, so the monitor mechanism was removed. The drift signals and miss-kill anchors moved into the judgment domain ontology
- v0.3.4 (current): the Censor reverts to a one-line judgment identity role inside
soul:judgment— no separate section, noyanguan_audit/yanguan_reviewtools, no CONFIRMED table. Reliability rests on domain rules (R-J series), not on a supervision layer - v0.4.0: LLM-distilled cold storage (checkpoint → episodic → knowledge with real summarization)
- v0.4.8 (current): anchor discipline (
ANCHOR_DISCIPLINE) — when the assembled material package (fromdsh-linghun-assemblerv0.4.5) carries the【组装者语义锚点】marker, the closer must anchor its answer to the marked entry as the only reliable anchor, ignoring the other candidates and unrelated memory. This completes the v053 semantic-anchor pipeline: judge single-source anchor → cap length → hard-anchor prompt. No marker, no effect. - v0.5.0: dual-instance mutual verification (criteria source bound to the verifier)
Design philosophy
Memory is material; judgment is the subject. The LLM is the source of intuition; the agent is the cognitive subject — each mirroring the other, each doing its own work. What can be mechanized should not be left to improvisation.
Credits
山越野人 × 岚客 (Shan Ye Yeren × Lingke) — carbon-silicon collaboration.
License
AGPL-3.0 © 2026 山越野人 & 岚客
Links
More in this category
Clearailhc/clearai-dsh★ 689
An agent preset for evidence-checked research: every step advances only through system-verified observations, L3+ claims go to an independent evaluator, and the session folds into a replayable ledger that grows into a browsable domain ontology. Requires DSH >=0.1.7-alpha.1.
FuRongJun-1999/dsh-memory★ 613
White-box AGI architecture exploration: metacognition (self-cognition loop), continual learning (knowledge flywheel), world model (condition space, spatiotemporal memory graph), self-improvement (bootstrap discipline), zero-LLM white-box pipeline, and auditable trust guardrails.
kenz1117/dsh-engram★ 65
Cross-session long-term memory as a local SQLite store: dual scopes (user + per-git-origin project), hybrid FTS5 + local-vector retrieval fused with RRF, an evidence gate that forces an explicit sufficiency judgement, provenance audit chains, SM-2 spaced-repetition review, consolidation distillation and decay forgetting, and a nine-view "Memory Palace" sidebar panel. 22 narrow-parameter tools, no external service, no API key, no Docker.
MichengAI/dsh-pua★ 61
Adds /pua to steer the agent to try another approach and verify results before claiming completion, with 15 company styles, persona modes, global and per-conversation settings, and an optional loop that continues until a verification command passes, the iteration limit is reached, or the user cancels.
icyaaaww/dsh-soul★ 57
Records recurring task corrections and tool failures locally, then compiles them into changes to eight harness components through explicitly started evolution, paired baseline/candidate checks, trial activation and rollback. Includes a budget and audit ledger; requires Node.js 24+ and a compatible DSH 0.2.1-rc.2 or later 0.2.x host.
pk14742952-AD/dsh-host-rsi★ 38
Reflective self-evolution plugin for local Qwen3.8 27B/3.8 Flash and online APIs: a coding-loop convergence steerer curbs Qwen3.8 27B/Flash repeated-verification deep-thinking to converge faster and cut thinking time; a five-state delivery guard detects and corrects stuck turns and infinite loops; model-agnostic host logic, mostly compatible with online APIs; per-use continual self-improvement with counter-reason self-checks, critic escalation, inverted-index memory retrieval, coding-loop convergence steering, and a five-state delivery guard.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.