DeepSeek Harness Autonomous Consciousness Plugin

Preface

DeepSeek Harness (DSH)’s plugin architecture allows developers to extend functionality on demand, but the question of when to wake up still relies on host-side scheduled tasks. Developers either write a scheduler on the host themselves—managing intervals, probabilities, sleep windows, and daily quotas—or they depend on a channel plugin’s timer, which couples the scheduling logic to a specific channel.

This article introduces dsh-plugin-autonomy, a plugin that extracts the “the host sets the rhythm, she decides the action” scheduling logic out of the host. She does not set her own alarms; instead, she rolls a die based on the average interval and jitter ratio the host configures. On the round she is woken outside a sleep window, she receives a self-check prompt marked as non-user-originated. She can speak, take action, or do nothing at all—and she explains her reasoning in her own words.

Plugin Overview

  • Name: dsh-plugin-autonomy
  • Maintainer: devil233-ui
  • Category: Workflow
  • Description: DSH Big Fat Fish autonomy plugin: external rhythm + probabilistic die-roll wake-up. She decides for herself whether to act or stay silent. Includes an intent ledger, decision log, and dashboard. Optionally integrates with selected Aurabot modules.

It solves two problems: first, it returns the “when to wake” control from “she sets her own alarm” back to “the host rolls the die on a rhythm”; second, it makes her decision-making process explicit through an intent ledger and decision log, making it easier to review and debug later.

Differences from dsh-proactive

dsh-proactive This plugin
Who decides when to wake She sets her own alarm (once/every/cron/file) Host rolls on an average interval + jitter
Probability Fires every time it’s scheduled Rolls against probability each time; can be adaptive based on time since last activity
Sleep window Quiet hours suppress delivery No dice rolls within sleep windows (self-scheduled wakes can be exempted)
Intent ledger None Two types: thoughts and agreements, with versioning and a state machine
Decision log One run per delivery One run per dice-roll hit, recording trigger / decision / reason / start-end time

The rhythm semantics are aligned with whalelife-plugin-autonomy: dice rolls, probability, adaptive multipliers, sleep windows (including cross-midnight and cross-week), intent ledger, decision log, and manual dashboard trigger—these behaviors correspond one-to-one. Upstream features such as allowSelfWake, timezone, motivation, requestId idempotency, the nine-state decision log, and the “no replay on restart” recovery semantics have also been carried over. The difference is that this plugin runs on the DSH host side, waking up any managed session via the agents service (cold sessions are restored first), rather than relying on a channel plugin’s timer.

Why Not an Aurabot Module

Because the two have different “hosts.”

  • Different target surface: This plugin wakes up any managed session—her own room, a private chat, a group chat—all it depends on is DSH’s agents and tools services. Aurabot’s beat is tied to the QQ gateway, group gate, and outbound governance. Making this into its module would mean the scheduling has to start and stop along with those components.
  • Dependencies are one-directional and optional: This plugin only borrows one thing from Aurabot—autonomy_say uses its outbound channel (and optionally borrows a system turn for a review round). Without Aurabot, those two features degrade gracefully while everything else works; conversely, Aurabot does not need this plugin.

So the division of labor is: scheduling, ledger, decision log, and dashboard stay here; speaking governance goes to Aurabot. If you want to run autonomy on a host without Aurabot, just install it as-is.

Optional Dependencies

Core functionality (rhythm, dice rolls, ledger, decision log, dashboard, and independent session waking) only depends on the DSH host itself and runs without any other plugins. The following two are optional; missing them only removes the corresponding capability:

  • Aurabot: Provides the outbound channel for autonomy_say (sending QQ private messages or group messages). The review round also borrows its system turn. Without it, autonomy_say simply returns “Aurabot is not available in this host, so nothing can be sent,” and the review falls back to a deterministic template.
  • MemoryConstellations (/api/recall): Before waking, queries a memory snippet using ledger keywords and splices it into the prompt. Off by default; only queries if a URL is configured. If nothing is found, the round proceeds without memory.

Installation

dsh plugin add <this-repo-path-or-package-name>

# Or install a prebuilt package (includes lib/, no local build needed)
dsh plugin --profile web add "https://github.com/devil233-ui/dsh-plugin-autonomy/releases/download/v0.1.0/dsh-plugin-autonomy-0.1.0.tgz"

The plugin declares its bundle via cordis.patch.yml; the host hot-loads it and it takes effect immediately—no restart required.

Configuration

Configuration lives at <DSH_HOME>/autonomy/config.json. It can be edited via the dashboard or by editing the file directly and refreshing.

Rhythm

Key Default Description
enabled true When disabled, no dice rolls occur; manual triggering still works
intervalMinutes 30 Average minutes between dice rolls
jitterRatio 0.1 Jitter ratio; actual wait = interval × (1 ± jitter). Set to 0.5 for the upstream “50%–150%” semantics
probability 0.2 Probability of waking on each dice roll
mode fixed fixed uses the base probability; adaptive adjusts based on time since last activity
adaptive.recentMinutes / recentMultiplier 20 / 0.15 Time since last activity below this is considered “just chatted”
adaptive.distantMinutes / distantMultiplier 360 / 1.5 Time since last activity above this is considered “neglected for a long time”
sleepWindows [] e.g. ["23:00-08:00"]; supports cross-midnight, multiple segments, and cross-week windows like "23:00-08:00@5-1" meaning “Friday 23:00 → Monday 08:00” (0=Sunday…6=Saturday)
timezone "" Timezone for window checks; empty uses the host’s timezone
allowSelfWake true Whether she is allowed to schedule her own wake-up via autonomy_schedule
selfWakeDuringSleep false Whether her self-scheduled wake-ups can fall inside a sleep window
maxRunsPerDay 20 Daily decision cap; 0 means unlimited
minIdleMinutes 0 If time since last activity is below this, skip the dice roll
sessions [] Target sessions; empty means all root sessions are managed
maxRuns / maxIntents 20 / 50 Number of records retained per session

Wake Target & Speaking

Key Default Description
wakeSession "" Wake target; when non-empty, dice rolls, ledger entries, and intent records only happen in this one session
wakeWorkspace / wakeTitle "" Workspace and title used by the dashboard’s “Create her session” button
speakTargets [] Destinations she’s allowed to speak to besides the owner’s private chat (group:<group-id>); empty = owner only
speakCooldownMinutes 3 Minimum interval between two messages in the same chat; 0 disables cooldown
outboxTtlMinutes 10 Maximum time a queued message (waiting for the other side to go quiet) is held; 0 = reject, never queue

Scoring & Prompting

Key Default Description
scoreEnabled true Score and sort the ledger before waking to decide which entries to surface
scoreThreshold 0.5 Entries below this score are not shown in the prompt (still open in the ledger)
moodEnabled true Read her mood to modulate what is surfaced this round (only affects threshold and candidate count, not rhythm)
recallSource off Memory recall source: off / http / aurabot
recallUrl "" URL for the http source; compatible with POST /api/recall (MemoryConstellations is one such service)
recallLimit / recallTimeoutMs / recallMaxChars 4 / 1200 / 600 Recall count, timeout, max characters spliced into the prompt
motivation "" Override the “decide what to do” opener text in the autonomy round; empty uses the built-in

Review

Key Default Description
reviewEnabled true Trigger a review once enough decisions have accumulated
reviewBatch / reviewMinGapMinutes 5 / 120 How many decisions to accumulate and minimum minutes since last review
reviewMaxInputTokens / reviewMaxOutputTokens 4096 / 512 Token budget for the review; overflow is trimmed from the oldest entry
reviewWriteMemory false Whether the review’s memory draft is written back to Aurabot’s memory module

Tools

She has five tools available in her session:

  • autonomy_schedule: get to check standby status; set to schedule a self-wake with at (YYYY-MM-DDTHH:MM) or in_minutes; cancel to revoke. Both set and cancel support version (stale versions are rejected) and requestId (duplicate submissions with the same id do not re-schedule). When allowSelfWake=false, set/cancel are always rejected.
  • autonomy_intents: list to view unfinished intents; remember to add one (kind=agreement requires due_at); revise to modify; complete / abandon to close (all require version to prevent overwrites).
  • autonomy_wishes: list to view diary wishes (with date and original path); drop to cross one off.
  • autonomy_say: { target, text } to send a message. target empty = send to owner’s private chat; group:<group-id> to pick a group. If it can’t be sent, when_free queues it and why can be specified.
  • autonomy_finish: End the current autonomy round with decision set to acted or no_action and a one-line reason. Only valid for an in-progress run; if not called, the round still closes and the decision is inferred from the event log.

Dashboard

Under Settings → Autonomy there is only a status line and an “Open Dashboard” button. The actual UI lives on a dedicated page (/dsh-autonomy):

  • Overview: Today’s decision count, unfinished intents, next dice roll, wake target; today’s decision stream.
  • Decision Log: All decisions across sessions, filterable by trigger method, result, and session; searchable by keywords in the reason; paginated.
  • Intent Ledger: Thoughts and agreements, with due dates, staleness, and pause status.
  • Wishes: Wishes made in the diary, with dates and original paths; can be manually added or crossed off.
  • Scheduling: Next dice roll, self-scheduled wakes, and a manual “Decide now” button.
  • Configuration: All the keys listed above; saving writes to disk immediately.

The dashboard uses /api/dsh-autonomy/{state,action,events,runs}; the frontend auto-refreshes via SSE.

Mood

Her mood is read from Aurabot’s mood module (ctx.get('aurabot').use('mood').state()) and only affects what is surfaced this round: below 40 the scoring threshold is +0.1 and the candidate cap is reduced to 2; above 75 the threshold is −0.05; in between, defaults apply. Dice rolls, intervals, sleep windows, and daily budgets are never touched. If the plugin is not installed or lacks a mood module, this adjustment is simply skipped. The mood value read each round is written into the decision log (e.g. mood 60/100 mellow).

Scoring & Candidates

Before waking, all unfinished intents across the entire ledger are aggregated and scored/sorted by a pure function: 0.4×urgency + 0.3×freshness + 0.2×source + 0.1×commitment. Urgency looks at the distance between dueAt/preferredAt and now; freshness measures text overlap with the most recently closed intents and recent decision reasons; source distinguishes owner / conversation / self; commitment checks whether it’s an agreement, a self-schedule, or just a thought. The top three entries that pass the threshold (scoreThreshold) go into the prompt; the rest remain open but are not surfaced this round.

Entries that keep being surfaced but never acted upon accumulate staleness (+0.5 per miss); at 2 they are paused for 7 days. If she actually acts (acted), the staleness resets to zero.

Review

Once reviewBatch decisions have accumulated and at least reviewMinGapMinutes have passed since the last review, the scheduler runs a review during idle time: it compiles the decisions and intents from that period into a one-page journal entry, appended to <dataDir>/journal/<date>.md. This round borrows Aurabot’s system turn (noTools: true); without it, it falls back to a deterministic template. It does not modify any session’s wake schedule.

Memory Recall

Before waking, she can use ledger keywords to query a memory snippet and splice it into the prompt. Three sources:

  • off: no query;
  • http: POST to recallUrl; any service compatible with /api/recall works (MemoryConstellations is one);
  • aurabot: directly queries Aurabot’s memory module (recallAsync); no URL needed.

If nothing is found, the round proceeds without memory—no blocking of the wake-up. With off, no request is even sent.

Speaking & Outbox Queue

autonomy_say has three gates: the owner’s private chat always passes; only groups listed in speakTargets are allowed; if the target chat has an unanswered message from someone else, or the same chat is still in cooldown, it’s rejected. If rejected, when_free can queue the message, and the scheduler will retry on each scan cycle once the other side goes quiet. Messages exceeding outboxTtlMinutes are discarded. Actual delivery goes through Aurabot’s outbound channel, and its own allowlist, dry-run, and master switch still apply.

Diary Wishes to Ledger

The diary module (Aurabot’s local-diary) writes entries daily, but nobody follows up afterward. Wishes sit in the wishes array of modules-data/local-diary/index.json. The scripts/sync-diary-wishes.mjs script records them into the plugin’s wishes list (<dataDir>/wishes.json)—parallel to the intent ledger but not a to-do list: wishes may be big, long-running, or even unattainable, so they have no deadlines, no closure tracking, and are not counted on the to-do pipeline. Each entry carries the diary date and original path, so she can look back and read the original text if she wants.

This script has zero impact on users who don’t have Aurabot installed: it is not loaded with the plugin, no script or hook calls it, and the entire code only does import { readFileSync } from 'node:fs' with all three paths required. In other words, it is simply a standalone utility—“run it manually or via cron when you’re using Aurabot’s diary module.” Without a diary index file, it can’t even start.

node scripts/sync-diary-wishes.mjs \
  --url http://127.0.0.1:3301 \
  --session session-xxxxxxxx-.... \
  --diary /path/to/aurabot/modules-data/local-diary/index.json \
  [--dry-run] [--days N]

All three positional values must be provided explicitly (the script has no default paths): --session is the wakeSession from config, --url is the dashboard address, and --diary is the diary index file. You can also use the environment variables AUTONOMY_URL / AUTONOMY_SESSION_ID / DIARY_INDEX; CLI arguments take priority.

  • Deduplication: after normalization (full-width to half-width, stripping whitespace and punctuation), if one string contains the other, they’re considered the same thing. Both open and closed ledger entries participate in the comparison.
  • Writes go through the dashboard API POST /api/dsh-autonomy/action?session=<wakeSession> with body {type:'intent-create', text, kind:'thought'}—it does not modify state.json directly, to avoid being overwritten by the host’s in-memory state.
  • Cron example (crontab, all three parameters as above): 45 23 * * * AUTONOMY_URL=http://127.0.0.1:3301 /usr/bin/node <repo>/scripts/sync-diary-wishes.mjs --session <wakeSession> --diary <index.json> >> /var/log/diary-wishes.log 2>&1.

Use Cases & Caveats

Suitable for scenarios requiring “the host controls the rhythm, she decides the action”—for example, if you want her to wake up randomly within fixed time windows rather than setting her own alarms. The plugin runs with the current dsh process’s permissions; review the source code and license before installing. It does not depend on any channel plugin, but optionally integrates with Aurabot or other /api/recall-compatible services to enhance outbound and memory capabilities.

Summary

Returning the “when to wake” control from “she sets her own alarm” back to “the host rolls the die on a rhythm,” and making her decision-making process explicit through an intent ledger and decision log—this is the core value of dsh-plugin-autonomy. If you want to build a controllable yet observable autonomy system on DSH, check the catalog page and GitHub repository for more details.

  • Catalog: https://www.skillhub.cn/plugins/devil233-ui/dsh-plugin-autonomy
  • GitHub: https://github.com/devil233-ui/dsh-plugin-autonomy
羽毛球分组比赛记分
小程序二维码

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

Xiaoye