Introduction

The plugin ecosystem of DeepSeek Harness (DSH) splits extension points into independent bundles. When connecting long-term memory to agents, the core problem isn’t just “can it remember,” but where the records come from, who can promote them, which scopes are available, when they expire, and whether they can be revoked.

dsh-governed-memory is an optional governance-oriented long-term memory bundle for DSH. It constrains capture, promote, revoke, and retrieval within the same set of local registry rules, reducing the space for unrestricted model-side writes and retrieval injection.

What is this

dsh-governed-memory is a DSH plugin bundle maintained by haoyuan-sjtu, licensed under MIT.

It contributes a Cordis host plugin and adds a patch layer for DSH via its own cordis.patch.yml. The current package version is 0.1.0-beta.2 and requires Node >=22.19.

It targets trusted host plugins within the same DSH process and does not provide browser UI, HTTP endpoints, CLI commands, or model tools.

Core Features

Record Write and Promotion

The plugin does not register capture or promotion tools callable by the model. Trusted host callers can perform the following actions:

  • capture(): Candidate records are always written to quarantine.
  • promote(): Requires a trusted host caller, explicit approval, and verified A/B evidence.
  • revoke(): Causes subsequent retrieval to reject the record.

Records are stored in an atomic JSON registry. This version uses 0600 permissions and atomic rename writes.

Retrieval Admission

The plugin mounts an agent/pre-step waterfall listener. It calls next() first, then reads the registry; it only appends a user message from the plugin if the registry selects one or more records.

Retrieval only accepts records that satisfy the following conditions simultaneously:

  • Promoted
  • In scope
  • Privacy allowed
  • Not expired and not due for review
  • No conflicts
  • Relevant
  • Satisfies token budget

Scope Limits

Technical Preview only supports local and project scopes. It rejects user and team configurations until the host provides identity, membership, and shared storage authorization.

Installation and Enablement

To install into the web profile, execute:

dsh plugin --profile web add https://github.com/haoyuan-sjtu/Deepseek-Harness-Lifelong-Agent.git

Restart the profile after installation is complete.

The same package can also be installed into the headless profile:

dsh plugin --profile headless add https://github.com/haoyuan-sjtu/Deepseek-Harness-Lifelong-Agent.git

If you need to replace the complete config object, you can do so via the profile or home cordis.patch.yml.

Typical Usage

Upon startup, the registry is exposed as ctx.governedMemory for use by trusted host plugins within the same DSH process.

await ctx.governedMemory.capture(candidate, 'admin-ui')
await ctx.governedMemory.promote(candidate.id, true, 'admin-ui')
await ctx.governedMemory.revoke(candidate.id, 'admin-ui')

The first call writes the candidate record to quarantine; the second promotes the record on explicit approval; the third causes subsequent retrieval to reject the record.

Candidate records need to include the following fields:

  • id
  • text
  • scope
  • privacy
  • canonicalKey
  • tags
  • evidence
  • ISO-8601 createdAt / reviewBy / expiresAt
  • confidence (0 to 1)
  • maxTokens (positive number)

Local Validation

Execute the following for the checkout:

npm run check
npm pack --dry-run

These two steps are used to check the source code and the packaging results.

Use Cases and Notes

This plugin is suitable for plugin developers who need controlled long-term memory governance in a local, single-process DSH environment. It turns off the write entry point on the model side, leaving promotion and revocation to trusted host callers, facilitating control over the content entering the prompt based on scope, privacy, validity period, and token budget.

Pay attention to the following before use:

  • This is a Technical Preview, not a complete shared team solution.
  • This version does not provide backup deletion, multi-process locks, or shared team access semantics.
  • Clean profile installation tests for each DSH release, representative C0–C3 evaluation suites, backup deletion verification, or shared authorization have not been completed.
  • Do not store credentials, original private transcripts, or materials that cannot safely enter the model prompt.
  • The plugin runs within the DSH process and accesses the local registry and plugin context with the permissions of that DSH process; you should check the source code and the MIT license before installing.

Conclusion

The value of dsh-governed-memory lies in converging long-term memory from “model-writable at any time” to “trusted host approval, scope-limited, revocable, and retrieval-admission controlled”. The current version is suitable for use as a governance baseline for local DSH plugins.

Directory Page: The dsh-governed-memory entry in the DSH Community Directory
GitHub: https://github.com/haoyuan-sjtu/Deepseek-Harness-Lifelong-Agent