dsh-bili-scroll
c1overzz
DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Wang-Lin-Chang/dsh-anchor
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Long-running sessions without limits. Every high-entropy tool action gets a pre-committed intent and immediate reconciliation; the anchor tree on disk is the session's source of truth. Crash the process, rescan the tree, adopt, continue — nothing is lost.
中文版见 README.zh-CN.md。
The mainstream answers to "long-running tasks" rely on two things: context compression (loses precision) and memory retrieval (loses consistency). Real incident history says otherwise: the main cause of failure is never "forgetting" — it is actions landing on wrong assumptions about the environment (uncontrolled side effects: corrupted code, killed wrong processes, leaked state).
dsh-anchor takes a different path: don't remember the past, lock down the future.
Before every action: intent (what I will do) + pre (environment fingerprint) = pre-commit
After every action: post (actual result) reconciled immediately → OK / DIVERGED
Not for: short conversations of three to five steps — the sampling discipline (minimum gap 7) anchor cost would be wasted.
Mounted on official extension points, zero intrusion:
| Official seam | Our mount |
|---|---|
tools/pre-execute (pre-action waterfall) |
anchorOpen: write intent + pre fingerprint |
tools/post-execute (post-action, before result materialization) |
anchorClose: environment reconciliation + verdict |
Reconcile against the environment, not self-reports: for write/edit-class actions, reconciliation reads the disk to verify the real content (expected = the target content declared by parameters, measured = the actual bytes on disk) — the tool claiming success doesn't count; the anchor checks the environment.
Sampling discipline (measured-verdict hardened):
Anchor tree anatomy:
session-anchors/
├── 00027-write#27/ # one action = one anchor directory
│ ├── intent.json # pre-commit: action name + expected fingerprint
│ ├── pre.json # pre-action environment fingerprint (+ recorded process pids)
│ ├── post.json # post-action measurement
│ └── verdict # OK / DIVERGED (verdict at the moment)
└── ...
# Install (git source, pinned tag)
dsh plugin --profile <name> add "github:Wang-Lin-Chang/dsh-anchor#v0.2.2"
Then mount it in the profile's cordis.patch.yml:
# cordis.patch.yml
- insert:
- name: 'dsh-anchor'
config:
anchorRoot: 'C:\path\to\session-anchors' # anchor tree root (source of truth)
minGap: 7 # sampling gap discipline (default 7)
After restart the plugin is on duty: every high-entropy tool action gets an anchor and immediate reconciliation. Cold start automatically scans the anchor tree for adoption adjudication.
import { apply } from 'dsh-anchor'
const service = apply(ctx, { anchorRoot: './data/session-anchors' })
service.report() // tree scan report (last complete anchor / dirty site / fingerprint chain)
service.adoptState // cold-start adoption verdict (clean/dirty/contaminated/fresh)
All tests live in npm test (37 assertions green). Measured environment: Windows 11 Pro · Node 25.8.
| Suite | Verifies | Assertions |
|---|---|---|
| sampling | Sampling discipline (high-entropy lock / gap 7 / panic feedback / recovery) | 10 |
| plugin-anchor | Official seam mounting + environment reconciliation + no interception + cold start | 12 |
| plugin-adopt | Real process kill -9 → cross-process adoption → continued run with consistent terminal state | 7 |
| plugin-blind | Double-blind external pollution (independent process corrupts the environment, plugin unaware) | 8 |
Real-machine duty record (anchor tree excerpt from a real DSH instance):
00027-write#27 DIVERGED ← write to a read-only file blocked by EACCES; reconciliation read the disk and caught it on the spot
00028-pwsh#28 OK ← only 1 step since the last anchor, yet anchored = panic triggered (discipline overridden)
00029/30/31-read OK ← panic-mode low-entropy all-anchor ×3, each OK advances recovery
(reads after this: zero anchors) ← 3 OK steps recovered → low-entropy runs free again, zero false alarms
| dsh-witness | dsh-anchor | |
|---|---|---|
| Granularity | Task (one task one directory, five-state adoption) | Action (one action one anchor, verdict reconciliation) |
| Governs | Background task lifecycle | Session/agent long-running action supervision |
| Shared core | AnchorCore four primitives (open/close/recover/adopt) | The same core |
A task is just a "big action", an action is just a "small task" — both packages share one philosophy: the filesystem is the source of truth.
write/edit/create_file (reads the disk to verify); other tools use fallback reconciliation (checks for abnormal self-reports only). Extending the reconciler by tool type is the planned path.npm test # 37 assertions: sampling 10 + plugin-anchor 12 + plugin-adopt 7 + plugin-blind 8
Requires: Node ≥ 22.5 (no dependency beyond node:sqlite, measured on 25.8), Windows PowerShell 5.1 (real-machine verification environment).
Apache-2.0
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。