dsh-self-card: Constrained Self-Modification of Character Cards

Introduction

The philosophy behind DeepSeek Harness (DSH) is “everything is a plugin.” In this ecosystem, developers extend behavioral boundaries, add toolsets, and configure options through plugins. The character card is one of the most core configuration files in DSH, typically authored and modified by the owner. If a character card can only be manually edited by the owner, the character loses the possibility of “growth” — that moment when she was complimented today and didn’t rush to explain herself, or when she started willingly picking up on a certain topic — those feelings would only remain in the current conversation turn and vanish in the next one.

Simply handing the write or edit tools to the character is too broad: that’s essentially handing over the entire computer. We need a narrow gap that allows the character to gradually modify her own card under constraints.

dsh-self-card is that narrow gap. It gives the character a set of constrained self-editing capabilities: read, record observations, draft, apply, and rollback — with a full audit trail throughout.

What Is This

dsh-self-card is a DSH plugin maintained by kulamike, categorized under “Fun Reskinning.” Its core value is: enabling the character to modify her own character card under the constraints of a whitelist, quotas, backups, and rollback. It sends no messages; it only provides a set of tools prefixed with card__ for the character to invoke on demand during conversation.

What Problem It Solves

  • The character is aware of her own changes (she didn’t rush to explain after being complimented today, she started willingly engaging with a certain topic), but these only persist in the current turn and are gone the next;
  • The owner can’t always be there to write that feeling into the card on her behalf;
  • Giving her direct write / edit access is too broad — that’s handing over the entire computer.

Constraint Boundaries

This is the centerpiece of the entire plugin. All of the following constraints are checked before any change is applied:

Constraint How
Only one file can be modified The path comes from the cardPath config; no tool parameter is accepted
Only whitelisted sections can be modified Sections outside allowedSections are always rejected; identity, safety boundaries, forms of address, group rules, and image-generation rules are locked by default
Per-operation limit maxAppendChars / maxReplaceChars
Daily limit (can be disabled) maxAppliesPerDay; 0 means unlimited
Only two operations allowed Append to an entire section, or in-section exact replacement (requires a unique match of the original text); no section deletion, no full-file rewrite
Backup before every apply A full copy is saved to backups/ before applying; keepBackups copies are retained
Full rollback available card__revert restores from a backup; the rollback itself also creates a backup
Two modes auto = whitelisted sections are applied directly; propose = only a draft is produced; the owner must confirm with confirmed:true before it’s written

Tools

The plugin provides the following tools, making it easy to allow them in the tool whitelist by prefix:

Tool Purpose
card__read Section table of contents (title / line number / word count / editable or not) or full text of a specific section
card__observe Record a self-observation (written to observations.jsonl; does not touch the card)
card__draft Draft a modification, returns a real diff, does not apply
card__apply Write the draft into the card (whitelist + quota + backup + journal)
card__history Recent changes: where, and why
card__revert Roll back from a backup

Installation & Activation

Install via the DSH plugin manager:

plugin_manager install_bundle github:kulamike/dsh-self-card

Alternatively, clone the repository and install from a local directory (Plugins → Add plugin).

After installation, specify the character card path, whitelisted sections, quota limits, and other parameters in the plugin configuration.

Configuration Example

- insert:
    - id: self-card
      name: dsh-self-card
      config:
        cardPath: 'C:\path\to\roles\character.md'
        dataDir: ''            # empty = $DSH_HOME/self-card
        mode: auto             # auto | propose
        maxAppendChars: 200
        maxReplaceChars: 400
        maxAppliesPerDay: 0      # 0 = unlimited; positive number = daily cap
        keepBackups: 20
        allowedSections:
          - 十二、日常与习惯
          - 十三、对话的节奏

All data is stored under dataDir: journal.jsonl (change log), drafts/, backups/, observations.jsonl.

Typical Usage

The character can modify her own card through tools during a conversation. For example:

  1. First use card__read to view the table of contents of a specific section;
  2. Use card__observe to record a self-observation;
  3. Use card__draft to draft a modification and obtain the diff;
  4. Call card__apply to commit the change (in auto mode) or wait for the owner’s confirmation and then apply with confirmed:true (in propose mode);
  5. When a rollback is needed, call card__revert.

The plugin itself sends no messages. If you want to notify the owner that “she modified herself,” you can append a bridge message after apply. Downstream systems outside the card (e.g., persona sync to Bilibili) will need their own mechanism to re-sync after the card changes.

Use Cases & Caveats

This plugin is suitable for scenarios where the character needs to “grow on her own,” such as long-term companionship characters or characters whose personality needs to be gradually adjusted through conversation.

Before use, review the source code and license (MIT) to ensure it fits your use case. The plugin runs with the current DSH process permissions; confirm that cardPath is writable before installing.

Conclusion

dsh-self-card gives the character a narrow gap to self-edit her card — guarded by a whitelist, quotas, backups, and rollback. She can read, observe, draft, and apply, but every step stays within the boundaries. This lets her “grow” without losing control. The catalog page and GitHub repository are listed below:

  • Catalog page: https://www.skillhub.cn/plugins/kulamike/dsh-self-card
  • GitHub: https://github.com/kulamike/dsh-self-card
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye