nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:jlnkx5200-beep/dsh-task-checkpoint-guard
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Durable task checkpoints and safe, bounded recovery for DeepSeek Harness agents.
English | 简体中文 | GitHub repository
Status: v0.2.1 (2026-11-04). Developed and tested against DSH 0.2.1-rc.3 on Windows 11 with Node.js 24.21.0. v0.2.1 awaits local memory capture before prompt assembly so the first prompt sees the just-received user message. The package declares the accepted DSH range in
engines.dsh; other versions are not claimed as tested. The optional memory subsystem is off by default and does not change v0.1.0 checkpoint/recovery behavior. Released under the MIT License.
DSH agents can lose the thread when a long-running task is interrupted by a network failure, a provider timeout, a 5xx service error, or a process restart. The conversation log preserves history, but a restarted agent still needs a compact, structured account of what it was doing: the objective, current step, completed tools, uncertain tool outcomes, todos, and the last visible results.
dsh-task-checkpoint-guard records that account locally, classifies recoverable transport failures, optionally waits for a bounded readiness probe, and re-arms an existing DSH goal only when it is safe to continue. It never saves hidden chain-of-thought and never uploads task records.
v0.2.0 adds an optional hierarchical memory curator: it can separate L0 goals and constraints from L1 core questions/concepts, L2 prerequisites, and L3 details; maintain a concept dependency graph; and inject a bounded, prerequisite-aware context before explanations. The feature defaults to memoryEnabled: false. When disabled, no memory tools or prompt sections are registered and the v0.1.0 checkpoint schema and recovery behavior remain unchanged.
fsync, and rename; retains <file>.previous as the previous valid copy.NETWORK, TIMEOUT, SERVICE, AUTH_OR_REQUEST, ABORTED, and UNKNOWN failures.off — checkpoint only (default);probe — bounded HTTP(S) readiness probe before re-arming the goal;deferred — explicit opt-in delay without an outbound probe.ctx.sessionQuery service when it is available.When explicitly enabled:
VERIFIED.memory_capture, memory_search, concept_graph,
concept_status, memory_update, and memory_delete when the public tool
registry is present.See the v0.2.0 design and testing status.
VERIFIED state.flowchart TD
A[Human task / Goal] --> B[DSH session events]
B --> C[Checkpoint state machine]
C --> D[(JSON + Markdown + pointer<br/>atomic write + .previous)]
B --> E{Failure classified}
E -- auth / abort / max-tokens / partial --> F[Keep checkpoint<br/>no automatic resume]
E -- network / timeout / service --> G{recoveryMode}
G -- off --> F
G -- probe --> H[Bounded readiness probe]
G -- deferred --> I[One configured delay]
H -- not ready / 401 / 403 --> F
H -- ready --> J[Re-read live goal<br/>compare-and-set resume]
I --> J
J --> K[Inject structured recovery context]
K --> L[Goal-round driver queues next round]
L --> M[Exact-duplicate tool guard<br/>first resumed turn]
M --> N[Inspect durable state<br/>continue unfinished work]
The checkpoint writer and recovery loop are serialized per session. Recovery rechecks agent liveness, idle state, pending inbox, goal revision, goal phase, activation, and round budget immediately before resuming. If a human message arrives, the in-flight readiness wait is aborted and the plugin does not resume.
See docs/architecture.md for the full lifecycle and event/API details.
^22.19.0 or >=24.0.0 (the DSH runtime range declared by DSH 0.2.1-rc.3).engines.dsh in package.json. Locally tested with 0.2.1-rc.3.agents, sessions.goals + goal-round-driver for automatic goal continuation;credentials for authenticated probes;sessionQuery for replaying events that happened before the plugin mounted or between a stale checkpoint and the live log;tools and systemPrompt for the opt-in v0.2.0 memory tools and curated prompt section. If either registry is absent, checkpointing/recovery still loads and memory tools/context degrade to unavailable; memoryEnabled remains off by default.Build the release tarball from this repository:
npm pack
Install it into the DSH profile you actually use:
dsh plugin --profile <profile> add ./dsh-task-checkpoint-guard-0.2.1.tgz
For a source checkout, install the directory directly:
dsh plugin --profile <profile> add ./dsh-task-checkpoint-guard
Confirm the composed profile contains the bundle row:
dsh --profile <profile> --dump-config
Start the profile normally (for the standard Web profile, dsh web is also valid):
dsh --profile <profile>
The default checkpoint directory is $DSH_HOME/task-checkpoints (or %USERPROFILE%\.dsh\task-checkpoints when DSH_HOME is not set).
After a task has run, inspect the local files:
Get-ChildItem "$HOME\.dsh\task-checkpoints" -Recurse
Get-Content "$HOME\.dsh\task-checkpoints\tasks\<task-id>.md"
On POSIX shells:
find "${DSH_HOME:-$HOME/.dsh}/task-checkpoints" -maxdepth 3 -type f
dsh plugin --profile <profile> remove dsh-task-checkpoint-guard
Uninstalling the plugin does not delete checkpoint files. Remove the checkpoint directory manually only when you no longer need the records.
The bundle starts with safe defaults: recoveryMode: off, local checkpointing enabled, and the exact-duplicate guard limited to a resumed turn. To override the bundle row, edit the profile's cordis.patch.yml and restate the complete configuration you want (a later patch replaces the whole row config):
- id: task-checkpoint-guard
name: dsh-task-checkpoint-guard
config:
checkpointRoot: ~/.dsh/task-checkpoints
recoveryMode: probe
probeUrl: https://api.example.test/v1/models
probeMethod: GET
probeAuth: bearer
credentialRef: EXAMPLE_API_KEY
probeExpectedStatuses: [200]
probeTimeoutMs: 5000
maxProbeAttempts: 5
initialProbeDelayMs: 1000
maxProbeDelayMs: 30000
jitterRatio: 0.2
maxAutoResumes: 3
providerFilter: null
duplicateToolPolicy: deny-on-recovery
maxToolHistory: 80
maxToolResultChars: 2000
maxToolArgumentChars: 1000
maxRecoveryContextChars: 16000
persistDebounceMs: 100
reconstructFromSessionQuery: true
memoryEnabled: false
memoryScopeId: default-user
maxMemoryRecords: 500
maxMemoryConcepts: 300
maxMemoryHistoryVersions: 20
maxMemoryAuditEntries: 200
maxMemoryRecordChars: 2000
maxMemoryContextChars: 6000
maxMemoryContextTokens: 1200
https://api.example.test and EXAMPLE_API_KEY are placeholders. Use the readiness endpoint and credential reference that match your deployment. A credential reference names a secret held by DSH's credentials service; the value is never written to a checkpoint.
Full parameter semantics and security notes: docs/configuration.md.
- id: task-checkpoint-guard
name: dsh-task-checkpoint-guard
config:
recoveryMode: off
memoryEnabled: true
memoryRoot: ~/.dsh/task-memory
memoryScopeId: default-user
maxMemoryRecords: 500
maxMemoryConcepts: 300
maxMemoryContextChars: 6000
maxMemoryContextTokens: 1200
Adding memoryRoot while memoryEnabled is false is rejected rather than
silently ignored. Memory files are not checkpoint files and are not required
for v0.1.0 recovery.
Checkpoint only:
- id: task-checkpoint-guard
name: dsh-task-checkpoint-guard
config:
recoveryMode: off
Automatic recovery with a readiness probe:
- id: task-checkpoint-guard
name: dsh-task-checkpoint-guard
config:
recoveryMode: probe
probeUrl: https://your-provider.example/v1/models
probeAuth: bearer
credentialRef: YOUR_PROVIDER_API_KEY
providerFilter: your-provider
duplicateToolPolicy: deny-on-recovery
Deferred recovery (explicitly allows an automatic model retry after a delay without proving connectivity):
- id: task-checkpoint-guard
name: dsh-task-checkpoint-guard
config:
recoveryMode: deferred
initialProbeDelayMs: 5000
maxAutoResumes: 1
This example uses a scratch directory and only reads or creates harmless local files.
Start a DSH session in a scratch directory.
Give the agent a goal such as:
Create ./checkpoint-demo/stages/a.txt, then ./checkpoint-demo/stages/b.txt.
Verify both files and summarize their contents. Do not touch anything outside
./checkpoint-demo.
The agent may call todo_write, create the directory, and write the files. Each turn/tool event updates a checkpoint under $DSH_HOME/task-checkpoints.
Inspect the Markdown checkpoint. It contains the original objective, goal revision, todos, current step, completed tool calls, recent visible results, and the recovery policy. It does not contain reasoning text.
To exercise recovery safely, use a disposable DSH profile and a loopback probe endpoint. Do not intentionally break your normal provider credentials or network.
After recovery, the injected context tells the model which tool calls already completed, which outcomes are unknown, and which todo items remain. The first resumed turn refuses an exact replay of a completed tool call when duplicateToolPolicy: deny-on-recovery.
More troubleshooting: docs/troubleshooting.md.
memoryRoot with the same sensitivity as session history.Authorization header to the configured probe endpoint and are never written to state or logs.0600 is requested for checkpoint files. On Windows, effective access is controlled by the directory ACL; protect $DSH_HOME.| Surface | Status |
|---|---|
DSH 0.2.1-rc.3 |
Tested locally: Cordis loader smoke, public API integration tests, real ToolRuntime schema registration/execution, clean-profile install/uninstall smoke |
Other DSH versions in engines.dsh |
Accepted by the range but not tested |
| Memory curation | Deterministic tests A–L pass; real-model pilot completed (4 cases, baseline 1/4 vs guarded 4/4 under rubric v2); single-run pilot, not statistically validated |
| Node.js 24.21.0 on Windows 11 | Tested locally |
| Node.js 22.19 / other operating systems | CI matrix is configured; not yet claimed as locally verified |
| DSH private APIs / private plugin source | Not used. See docs/architecture.md |
Automatic continuation additionally depends on the host mounting @deepseek-ai/dsh-goal and @deepseek-ai/dsh-goal-round-driver. If the driver is absent, checkpoints and context injection still work, but a new model round may not be scheduled.
Common cases:
checkpointRoot and permissions.off; verify recoveryMode, probeUrl, agent goal phase/activation, and pending-tool status.<file>.previous and then a task-file scan. Preserve the directory for diagnostics.Full guide: docs/troubleshooting.md.
Planned, not implemented:
npm test
npm run check
npm run pack:check
npm run test:semantic:dry-run
The semantic dry run prints and saves the exact prompts for the real-model
pilot. Running npm run test:semantic requires public DSH_EVAL_* API
credentials and is never part of plugin startup. See
docs/semantic-acceptance.md for the rubric and
claim boundary.
To run the optional real-loader smoke test, point DSH_CHECKOUT at a DSH source checkout:
$env:DSH_CHECKOUT = (Resolve-Path '..\deepseek-harness').Path
npm test
See CONTRIBUTING.md.
This project is released under the MIT License. Copyright (c) 2026 jlnkx5200-beep. See LICENSE for the full text.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: agent、ai-agent、memory。