npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@linxin666/dsh-liangshen

v0.4.22

Published

LiangShen (梁神) agent preset plus its composer lever for the dsh web GUI. The host half declares the bundled preset to the harness's agent-preset registry at activation (declare = enabled), so the preset is selectable for new sessions without writing anyth

Readme

dsh-liangshen · Minimal LiangShen Persona & Programmatic Tool Transport for DeepSeek Harness (DSH)

English | 中文

An all-in-one plugin for DeepSeek Harness (DSH) Web GUI and desktop client: declares the built-in "LiangShen Mode" preset to the official agent-preset registry upon activation and offers a slot-machine lever toggle alongside the model selector in the blank conversation page. Keeps system prompts concise to a minimal persona with strict operational disciplines while workspace instructions arrive via user turns, and injects the request's live tool catalog from the first user message on. Tools operate under a unified presentation contract (defaulting to ptc: the wire collapses to the official run_code transport and every other tool is reached through the generated SDK; native keeps the assembled roster alone, and deployments without a code runtime fall back to the native surface with a one-time warning). On-demand tool-family paging holds matched families (by default ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*'], leaving all host builtins resident) out of both the wire and the generated SDK via registry-level restriction — announcing them as namespace summaries in the catalog — until tool_activate loads a namespace back, paired with a key fact register for long-horizon context retention.

Why

DeepSeek V4.1 Flash is post-trained against its native DSML tool-call surface, and the official scaffold comparison for code-agent benchmarks places a native minimal surface ahead of a programmatic (PTC) one (DeepSWE v1.1: 72.6% native minimal vs 67.6% PTC; Terminal-Bench 2.1: 90.6% vs 85.8%). Real engineering sessions, meanwhile, depend on MCP servers and plugins that a closed four-tool surface cannot reach, while a flat roster carrying every external schema buries the conversation under tool definitions.

LiangShen mode therefore keeps the whole session on one presentation, chosen by the presentation key. The shipped default is ptc: the wire collapses to the single run_code transport and every other tool is reached from inside the program through the generated SDK — the cheapest static context, though the official scaffold comparison ranks that surface below the native one (the native surface leads PTC on DeepSWE v1.1 and Terminal-Bench 2.1: 72.6 against 67.6 and 90.6 against 85.8) — while native (the assembled roster alone, no program transport) remains the one-line opt-in. An older profile that still names the removed both presentation is refused outright: the SDK dropped the mode, this preset ships no compatibility mapping, and the migration path is to pick ptc or native. The anchoring part (the system prompt) stays a compact persona with an action-triggered working discipline; the capability part is announced from the first user message on as a durable skill-catalog-style injection that names exactly the tools the request opens. Without paging, a LiangShen session's system prompt reaches 104,945 characters, with PTC's interface ToolArgsMap block taking 73,675 characters (about 70% — led by task_board_* at ~5.6k tokens, browser_* at ~3k, and squads_* plus squad_* at ~2.2k). High-fan-out tool families matched by the paging patterns (default ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*'], while every host builtin stays resident) are therefore announced as namespace summaries and stay off the wire — and, under ptc, out of the generated SDK, because the page is applied to the registry a program dispatches against — until tool_activate, keeping the static schema surface small. The mode makes no overcommitment of benchmark superiority; it guarantees that the declared surface and the request's own wire never disagree.

How it works

  1. minimal-prompt narrows every assembled prompt to the persona section — the one-line persona, the mode's standing working discipline (close a repeated hypothesis after two reasoning passes and call an inspection tool instead of speculating; think only about the next concrete operation rather than pre-rehearsing code; emit multiple tool calls concurrently in a single turn for independent inspections; treat shell processes as ephemeral with no directory persistence across calls and use compound commands or explicit workdir for subdirectories; verify against actual tool output during execution; YAGNI and PDCA; no redundant comments), and one appended orientation line, Your working directory is <cwd>. read from the session header — so the harness identity, web-surface, tool-guidance, file-reference, and structured-output sections do not reach the model by default; plan mode's plan:policy is kept, because that section is the only thing that enforces plan mode (its exit tool stays registered in every mode);
  2. AGENTS.md-style workspace instructions reach the model through instructionSource: by default (host) the preset appends no section of its own and leaves the harness's own delivery of those instructions untouched, so they arrive as its user-role messages — one persistent baseline plus incremental additions, replacements, and removals as directories are touched; under system-prompt they join the system prompt itself: at assembly time minimal-prompt reads the harness's baseline chain ($DSH_HOME/AGENTS.md, then AGENTS.md / CLAUDE.md and their .local overlays from the project root down to the session cwd) and appends the content as one workspace-instructions section after the stable prefix, under a byte budget that omits broadest files first and truncates the most specific last; the read happens on every assembly, so file edits propagate without durable messages, and the harness's own agent-instructions injections are dropped instead of duplicating the prompt. Subdirectory dynamic rules will subsequently support registered file tools (including str_replace_editor) and run_code sub-calls reaching target directories; arbitrary bash or program code is not parsed, and automatic discovery of file accesses performed directly within shell commands is not guaranteed;
  3. the wire keeps one presentation for the entire session, selected by presentation: ptc (the default) collapses the wire to run_code with every other tool reached through the generated SDK, and native carries the assembled native roster; ptc needs a mounted code runtime — without one no PTC executor can be mounted, so the session simply runs the native surface. The legacy ptcPresentation key maps onto ptc/native with a deprecation warning, and the retired anchorTools first-turn narrowing no longer engages — setting it warns;
  4. tool-catalog appends the tool list as a durable user message after the user's message, preserving complete input and output key parameter semantics (descriptionMaxLength: 200 caps only the one-line summaries). The plugin carries a hand-written one-line summary for each host builtin this preset mounts: a curated tool renders that line whole, so a length cut never slices off the sentence that says what the tool is for, and descriptionMaxLength remains the fallback for every tool the table does not name. It names exactly the tools the current request opens — the native roster, or the SDK-reachable projection under ptc — and, under tool paging, adds one-line summaries for the namespaces whose tools are held back. Under ptc the summaries name namespaces that are genuinely unreachable — neither listed in the request's tools:sdk section nor callable from inside a run_code program — until tool_activate; It republishes only when that surface changes or the published copy left the visible surface (a compaction, a resume);
  5. on-demand tool-family paging ships on (pagedToolPatterns: ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*']): the MCP bridge and the six mounted plugin tool families stay off the wire, out of the generated SDK, and unreachable to run_code dispatches — announced as one-line namespace summaries in the catalog — while every host builtin (shell, filesystem/read/write/edit/str_replace_editor, glob/grep, background jobs, skill, ask_user_question, todo_write, web_search, subagent delegation, plan, goal, fact_register, tool_activate, and MCP resource readers) stays resident. Each pattern's literal head determines how patternNamespace derives the namespace: a head ending in __ is an MCP bridge and takes the first __-delimited segment of the remaining tool name (mcp__codegraph__codegraph_explore -> codegraph); any other head names a plugin family literally with at most one trailing _ dropped (task_board_* -> task_board, squad* -> squad, grouping squads_* and squad_member_* under one namespace). Calling tool_activate({ namespace }) brings that namespace back from the next request on; at most three paged namespaces stay active simultaneously (maxActiveNamespaces, default 3), refreshing recency on activation or on any non-errored call into an active namespace and evicting the least recently used back to summary when a fourth is activated, with activation state replayed from the durable session event stream across compactions and resumes; optional idleReclaimSteps (default 0 = off) expires a namespace with no successful activation or call for N steps, but the expiry applies only at an application point — the next tool_activate activation or a compaction/end compaction boundary — moments the request's prefix rebuilds anyway, so reclaim adds no prefix-cache rebuild; until then the namespace stays resident and reachable, and any successful call refreshes its recency and cancels the expiry;
  6. a minimal working-context line — plan-mode state, active paged namespaces, in-progress todos, and the key-fact register — is injected at the tail of the latest message only when its sources are readable, keeping current state inside the model's local attention window; runtime contexts (the sandbox and approval snapshots) and the skill catalog flow as in Standard mode;
  7. the catalog groups the tools of an activated paged family under a namespace (activated): heading instead of scattering one family's tools through the alphabetical list, while every non-paged tool keeps its flat entry;
  8. maxResidentTokens (default 8000) estimates the always-on-wire surface and warns once when it is crossed, naming the heaviest tools and pagedToolPatterns as the remedy. The threshold was re-estimated for V4.1 (its KV cache is a quarter of V4-Flash's, so the same schema load occupies a quarter of the sparse-index slots and the budget moved from 6000 to 8000), still calibrated above the shipped roster so only real growth trips it. The guard never truncates: silently dropping a tool the session needs would trade a measurable context cost for an unmeasurable capability loss.
  9. a key-fact register (fact_register) lets the model pin a hard user constraint, a confirmed decision, or a failed path as one short line; the register is folded from the durable event stream and rides the [Working Context: ...] line — the surface that lands inside the guaranteed local attention window every step — as the counter to V4.1's long-session forgetting. Both wire shapes feed that one fold: ptc records the call as a tool/ptc-dispatch (object arguments, own isError), native as a tool/call (JSON-string arguments), and a dispatch that reported an error is never applied.

Security model

This mode operates strictly within the official host security architecture and complies with sandbox policies:

  • Host sandbox constraints: All file tools — the natively presented Standard file tools and any file operation a run_code program dispatches through the SDK — are subject to host file sandbox policies, inheriting the current session's sandbox level (e.g., danger-full-access or workspace-restricted/read-only). Bare local filesystem access does not exist (no dsh-fs-local mount); all reads and writes across workspaces are guarded by host policy.
  • Standard shell on both platforms: the preset mounts the upstream standard Stdio shell stack on every host, mirroring the builtin Standard preset. POSIX mounts bash (@deepseek-ai/dsh-tool-bash); win32 mounts pwsh (@deepseek-ai/dsh-tool-pwsh). Each platform exposes exactly one shell tool (bash on POSIX, pwsh on win32), featuring active-voice description title cards and deterministic exit codes. The preset ships no shell implementation of its own.
  • Code runtime sandbox: run_code programs execute within an isolated worker thread context, with access to system resources strictly bounded by the SDK's exposed tools.

The lever

The browser half adds a slot-machine lever to the composer tool row, immediately left of the model selector, on the new-session screen, and the settings card marks this mode's own entry with a mark drawing that same lever — one knob, one arm, one pivot foot, painted in the current text color so it follows the active theme:

  • pull the lever down — drag it, click it, or press it with the keyboard — and the session about to start composes LiangShen mode; a landed pull plays the jackpot burst (flash, shockwave, sparks, and a banner reading 梁神模式 over classical Chinese, binary, and Morse lines);

  • pull the lever down — drag it, click it, or press it with the keyboard — and the session about to start composes LiangShen mode; a landed pull plays the jackpot burst (flash, shockwave, sparks, and a banner reading 梁神模式 over classical Chinese, binary, and Morse lines);

  • push it up and the preset you were on before comes back — with nothing remembered yet, that is the deployment default;

  • the arm always reports the session's real preset, so a reload shows the true state, and the lever renders only while the session is still blank — in a session that has started, the host refuses to recompose, and the row disappears from the composer entirely;

  • a refused switch prints the host's reason under the lever and never plays the burst, and prefers-reduced-motion keeps the state change while dropping the animation.

The lever drives the session's preset through the agent-preset Remote namespace the browser session is already authenticated for, so it needs no additional permissions. It acts on the preset only while the session is blank, which is exactly the new-session screen it renders on.

Preset configuration

The preset-local plugins are configured in agent.cordis.yml:

| Key | Default | Behavior | | --- | --- | --- | | keepPlanPolicy | true | Keep plan mode's plan:policy section in the otherwise one-line system prompt. Set false for the strict one-line surface, which leaves plan mode with no policy text behind it. | | keepSections | [] | Additional prompt section names merged into the fail-closed allowlist, for example ['mnemon:strategy', 'mnemon:routing']. The empty default preserves the existing selection byte for byte. Every entry must be a non-empty string; a configured name absent from an assembly emits a one-time visible warning instead of silently doing nothing. | | instructionSource | host | Where workspace instructions reach the model. host (the default) appends no section of its own and leaves the harness's agent-instructions injection untouched, so the instructions arrive as the harness's own user-role messages: one persistent baseline plus incremental additions, replacements, and removals as directories are touched; system-prompt reads the AGENTS.md-style chain at assembly time and appends it to the system prompt (the harness's own injections are dropped); hint replaces the first injection with a one-time non-imperative reference-file hint and drops later ones. | | instructionMaxBytes | 65536 | Byte budget for the rendered workspace-instructions section, used only in system-prompt mode: broadest files are omitted first, the most specific file is truncated last. | | descriptionMaxLength | 200 | Cap for one tool's one-line summary in the injected catalog, applied to every tool the curated table does not name. A curated host builtin renders its hand-written line whole. Complete key parameter semantics remain fully preserved. | | presentation | ptc | Wire presentation for the whole session. ptc (the shipped default) collapses the wire to run_code with every other tool reached through the generated SDK; native keeps the assembled native roster. The settings overlay writes the value into the composition: the official @deepseek-ai/dsh-tool-executor-ptc row stays mounted for ptc and is disabled for native, so that row IS the wire (0.2.2 retired the per-scope agent.ctx.tools.presentAs declaration). A deployment with no PTC runtime keeps the native surface. The removed both mode is not accepted: an old profile naming it fails registration, so migrate the key to ptc or native. | | pagedToolPatterns | ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*'] | On-demand gentle paging ships on: each entry is a non-empty literal head without * ending in one trailing * (a bare * is rejected). Matching MCP and plugin tools stay off the wire and out of the generated SDK until activated via tool_activate({ namespace }), appearing in the catalog as one-line namespace summaries while all host builtins stay resident. A head ending in __ derives the namespace from the first __ segment of the remainder (MCP server); any other head drops at most one trailing _ (task_board_* -> task_board, squad* -> squad). At most three paged namespaces stay active at once (maxActiveNamespaces, default 3, integer >= 1), with LRU recency and active state replayed from the durable event stream. | | idleReclaimSteps | 0 | Deferred idle-reclaim threshold in steps (integer >= 0), written to the tool-catalog, tool-activate, and working-context rows from one source like pagedToolPatterns. 0 (the factory value) keeps activations resident until LRU eviction; a positive N expires a namespace with no successful activation or call for N steps, and the expiry applies only at the next activation or compaction boundary — moments the prefix cache rebuilds anyway, so no extra rebuild is paid; until then the namespace stays resident and reachable, and any call refreshes it. The expiry replays from the durable event stream too (step/start counts steps); a log without step evidence never reclaims. | | maxResidentTokens | 8000 | Estimated-token ceiling for the always-on-wire surface (the serialized schemas at roughly four characters per token), re-estimated for V4.1's compressed KV cache and still calibrated above the shipped roster so it flags real growth rather than the factory configuration. Crossing it warns once, names the heaviest tools, and points at pagedToolPatterns; it never truncates the roster. | | ptcPresentation | (retired) | Legacy alias: true maps to presentation: 'ptc' and false to 'native', both with a deprecation warning. | | anchorTools | (retired) | First-turn anchor narrowing is removed; setting this key warns and no longer narrows the wire. |

Install

# Option 1: family bundle (recommended)
dsh plugin --profile web add @linxin666/dsh-web-all@latest

# Option 2: standalone
dsh plugin --profile web add @linxin666/dsh-liangshen@latest

# Pick ONE of the two: the bundle and the standalone @linxin666/dsh-liangshen
# both mount this preset. If you switch between them, remove the other first:
dsh plugin --profile web remove @linxin666/dsh-liangshen

Fully restart dsh web, open a NEW empty session, and pick "梁神模式" as the preset. The plugin declares the preset from its own bundled files at activation and releases the declaration when the plugin (or its row) unloads; nothing is written into ~/.dsh/.agent-presets, and an upgrade takes effect on the next start.

Verify

Export the session JSONL and inspect request/header:

  • with instructionSource: host the first header's system should be exactly the persona block (the minimal persona, the working-discipline list, and the workspace line Your working directory is <cwd>.) plus plan mode's policy while plan mode is on — while the AGENTS.md chain arrives as the harness's own user-role message; under instructionSource: system-prompt the system carries one extra workspace-instructions section instead;
  • every header keeps the same presentation for the whole session: under the default presentation: 'ptc' the wire collapses to run_code, and no turn boundary ever re-expands it;
  • the admitted messages hold one plugin-sourced message from liangshen-tool-catalog after the user message, naming the resident host builtins the request opens by argument signature while paged MCP servers and plugin families (browser, task_board, team, squad, ui, ssh) appear as one-line summaries under <inactive_namespaces>;
  • under ptc an unactivated namespace is absent from the request's tools:sdk section and cannot be called from inside a run_code program — from the FIRST request on, not one request later;
  • after tool_activate({ namespace }) succeeds (for example "codegraph", "task_board", or "squad"), that namespace's tools join the wire and the generated SDK from the next request under a namespace (activated): heading, and no more than three paged namespaces stay active at once (activating a fourth evicts the least recently used back to summary);
  • with idleReclaimSteps enabled, an idle-expired namespace returns to the <inactive_namespaces> summary at the next activation or compaction boundary (exactly the LRU-eviction state), and the tool_activate result names the namespaces reclaimed alongside that activation; with the default 0 every item above is byte-identical;
  • after a compaction the catalog is republished once as a replacement list, paged activations are rebuilt from the durable event stream, and the presentation mode is unchanged;
  • file writes obey the host file sandbox policy — there is no bare local-filesystem bypass.

Real session validation conditions and benchmark evaluation

When validating mode behavior and evaluating performance, verification tiers must be strictly distinguished:

  1. Real inference probe ≠ Mode integration pass ≠ Statistical improvement:
    • Real inference probe: Verifies only transport connectivity and minimal model response capability to specific formats (e.g. using a headless probe to verify output parsing); a single successful probe demonstrates absence of blockers, but never that mode integration has succeeded.
    • Mode integration pass: Requires full session verification of complete headers, the configured presentation behavior, paged activation and eviction, SDK parameter semantics under run_code, and sandbox policy enforcement.
    • Statistical improvement: Must be evaluated across multiple comparative benchmark rounds in an isolated environment with recorded fixed routes and source hashes, evaluating task completion rate, tool failure rate, rule violation rate, human intervention frequency, and time/token costs. Single or few smoke runs do not constitute evidence of performance improvement.
  2. Behaviour probes: four small deterministic environments live in tools/probes/, one per behaviour this mode is meant to have — taking the strictest reading of an under-specified rule, spending a per-cycle quota on checks that cannot fail, letting a low-priority backlog run to escalation, and planning a call budget until nothing is left to submit. Each ships an oracle (grade.mjs) and two scripted policies (strategies.mjs); node tools/probe-selftest.mjs drives both through the same environment and fails unless the good policy passes, the bad one fails, and the named metric moves, so a probe that cannot discriminate is caught for free before any model is charged. The corpus is tools/tasks/liangshen-v41-probes.json, whose tasks carry from (a directory plus support files, materialised into the task workspace) and metrics (the same program shape as check, printing one JSON object of behavioural numbers that the report aggregates into its own per-group table beside the pass rate). Pass a route to a probe run with --route provider/model[/effort]; the default stays the fixed route so an aggregated comparison still reads one route per report.
  3. Benchmark tooling: the isolated runner is packages/dsh-liangshen/tools/benchmark-live-run.mjs. It materializes the evaluated preset into a temporary directory and declares it from the run's own agent-preset registry through a variant patch, redirects session persistence into the run directory, and records a baseline (repository commit, shipped preset hash, DSH version, fixed route, task revision) with every run. The candidate matrix isolates the persona and the presentation strategy: B (shipped defaults), P (candidate persona), N (candidate persona, full native roster throughout), and M (the bundle's official Minimal preset, an external reference rather than a single-factor arm); the retired both presentation arm left with the SDK mode it measured. Run one smoke case with node tools/benchmark-live-run.mjs --variant B, or the bounded matrix over the seed corpus with node tools/benchmark-live-run.mjs --tasks tools/tasks/liangshen-v41-flash.json --groups B,P,N,M --repeat 3 --max-sessions 60 --budget-cny 10 --prices tools/prices/deepseek-flash.json; aggregate the run records in a results directory with node tools/benchmark-report.mjs .benchmark-results, which reports per-group success rates with Wilson intervals, paired per-task deltas with confidence intervals, token totals, cost in the price book's currency, model tool errors and transport failures separately, research calls and the inspections preceding the first write, infrastructure failures separately, and the recorded baseline. Cost is CNY because the route bills in CNY, and tools/prices/deepseek-flash.json carries the published off-peak row: a peak-hour run costs double what the book records. A budget the run cannot price is refused rather than silently disarmed. A tool result whose error carries a WEB_* code counts as a transport failure, so a workspace that could not reach a host never reads as a model that guessed. Smoke runs validate the protocol and the cost estimate; they are not evidence of a general coding gain.

Configuration

| Key | Default | Behavior | | --- | --- | --- | | enabled | true | Master switch: when false, the preset is not declared and the announcement does not run. | | announceToAgent | false | Opt-in: when true, a system-prompt section announces the plugin. Off by default so agent system prompts stay clean. | | presentation | ptc | Wire presentation of the preset this plugin declares. The value is written into the tool-catalog row and drives the composition: the @deepseek-ai/dsh-tool-executor-ptc row it enables IS the wire, so ptc collapses it to run_code and native keeps the roster, and the catalog text describes the surface that composition produces. A change re-declares the preset as soon as the Host commits it, so the next session picks it up; a session that already started keeps the composition it declared. The removed both mode is rejected at registration — migrate an old profile to ptc or native. | | dispatcher | true | Identity switch: when true (the shipped default), the declared preset appends the dispatcher rules section after the persona — complexity triage (L0/L1 direct; L2 split into L2-Clear, which plans briefly then executes, and L2-Governed, which runs the clarification interview and a plan approval), a shared task board that is bookkeeping rather than a second dispatcher (the R0.5 compatibility gate was deleted upstream at 0.72.0 once a new harness removed the legacy Agent Teams runtime entirely, so its criterion can only ever answer absent; the generation-independent board contract survives as a standing paragraph), an interview before planning on an L2-Governed task, the Lead & Dispatch identity with its three execution topologies (Lead-Core, Hybrid, Fan-out) chosen by coupling against parallel ROI, the R9 plan pipeline (plan mode is the user's switch: inside it the plan is explored, written, and submitted through exit_plan_mode; outside it the dispatcher plans and then executes), delegation with layer-by-layer review and acceptance, and task tracking in todo_write — then a local English supplement with the interview additions, one rule that keeps the task board a tracking surface rather than a dispatch path, and one that keeps a pinned fact an anchor rather than current state. The block is maintained in this repository: it was re-extracted on 2026-10-18 and re-synced on 2026-11-02 against 0.55.0, again on 2026-11-03 against 0.56.0 plus that package's unreleased Agent Teams pass, and again on 2026-11-13 against 0.72.0 (twenty-three anti-patterns; the R0.5 gate deleted and its board contract kept as a standing paragraph; the L2-Clear / L2-Governed split plus [Execution Economy]'s stop-after-two-steps-without-progress brake in R0; G4 now searches external prior art (GitHub docs/repos, official docs, research papers, specs) instead of asking the user; the R1 execution topologies; the Lead & Dispatch identity; R2's Harness 0.2.2 note that an explicit route may still be limited to the parent route; R8 restated against the planned direct execution R1 authorizes; R6's fix-and-reverify duty on a Lead-Core or Hybrid core; R2's three allowlist states; R8's withdrawn empty-allowlist fallback; R6's record-backed re-dispatch count, non-penalized hand_back and a UI evidence gate narrowed to regression-risk changes (pure copy, logic-only and additive work need none; with no reliable Before, an After plus a note suffices); R7's per-turn sweep and clause deletion test; R5's [Limits] rule that every cap states what it bounds, in what unit, the cap, and whether it accumulates, plus the [Compact Delta Brief] default; R0's impact-not-effort stop; the standing subagent contract, report protocol and coordinator-only tool list; and R9, adapted so plan mode stays the user's switch—this deployment mounts no enter_plan_mode row, and the dispatcher never asks the user for it); the text is written one decision sentence per rule (upstream's compact register, which took the block from about 35,000 to about 22,200 characters while every correction and addition stayed), corrections are applied in place rather than appended as a contradicting second copy, DISPATCHER_RULES_PROVENANCE records every correction and every addition along with the upstream commit it came from, DISPATCHER_RULES_PROVENANCE.omissions records the two upstream entries this preset deliberately does not carry, because each names a tool it does not mount (the dispatch_ledger tool and the enter_plan_mode/leave_plan_mode rows), DISPATCHER_RULES_PROVENANCE.removals records the R0.5 gate upstream deleted and this block dropped with it, and node tools/check-dispatcher-rules.mjs reports drift against an installed copy of the origin package. Switching it off returns the session to the bare persona with its working discipline. It is orthogonal to presentation: presentation decides the tool surface, dispatcher decides the identity and the process discipline. | | pagedToolPatterns | '' | On-demand tool families ("On-demand tool families" text field in the plugin settings card): comma-separated prefix patterns, each a non-empty literal head without * ending in one trailing * (for example mcp__*, browser_*, task_board_*). parsePagedToolPatterns trims entries, skips empty segments, and writes the parsed array into the declared preset's tool-catalog, tool-activate, and working-context rows together (all three replay the session event log against pagedToolPatterns, so keeping one shared list prevents catalog eviction, tool_activate admission, and the rendered working-context line from diverging and stranding a withheld namespace). Leaving the field empty or resetting it writes no override and inherits the preset's shipped seven-pattern list (['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*']); in the settings card, any malformed entry holds the draft unwritten, and on the Host any malformed string is ignored in favor of the shipped list. | | idleReclaimSteps | 0 | Idle reclaim steps (the "Idle reclaim steps" numeric field in the plugin settings card): a non-negative integer written through the overlay into the declared preset's tool-catalog, tool-activate, and working-context rows together (all three replay the session log against the same threshold, so one shared value keeps the catalog's restriction, tool_activate's admission, and the working-context projection from diverging about which namespaces are still active). 0, empty, or reset inherits the factory no-reclaim behavior; a negative or fractional draft stays unwritten in the settings card, and the Host schema rejects it with min(0). Reclaim is deferred: expiry applies only at the next activation or compaction boundary, adding no prefix-cache rebuild. |

All fields are editable in the web settings surface (plugin config) or through the profile patch (dsh plugin / cordis.patch.yml). Under the 0.1.7 settings contract a plugin's own Config IS its settings page: the Host serves one form per profile entry (the entry id liangshen, or the aggregate's generated web-ui-liangshen row) and every field is declared volatile(), so a write is committed into the running plugin instead of remounting its row. The preset-shaping fields (presentation, dispatcher, pagedToolPatterns, and idleReclaimSteps) then reach a session through the declaration: the plugin applies the committed values to the composition rows of presets/liangshen/agent.cordis.yml and re-declares the preset, so the settings surface — not the bundled file — is what the operator's sessions actually run. A row or key the composition does not carry is never invented: the overlay only narrows the shipped configuration. A change applies to sessions created after it; a session that already started keeps the composition it declared, because the registry refuses to recompose a started conversation.

Behavior and limits

  • The system prompt is stable for the whole session: the persona block (persona, working discipline, workspace directory), plus plan mode's policy while plan mode is on, plus the workspace-instructions section in system-prompt mode. Nothing is appended after a tool call, and no output-token cap is applied;
  • In system-prompt mode the workspace-instructions section is re-read at every assembly, so instruction-file edits propagate on the next request without a durable message; the section renders last, after the stable prefix, so the cache prefix stays intact. Subdirectory dynamic rules will subsequently support registered file tools (including str_replace_editor) and run_code sub-calls reaching target directories; arbitrary bash or program code is not parsed, and automatic discovery of file accesses performed directly within shell commands is not guaranteed;
  • The wire keeps one presentation for the entire session with no turn-boundary transition: ptc (default) collapses the wire to the single run_code with every other tool reached through the generated SDK, and native carries the assembled roster;
  • The injected catalog is durable: it is written once per session, plus one replacement when the tool surface changes (a paged activation, a presentation change) or a compaction shadows the published copy, and it stays in the history for later requests;
  • A step whose prompt assembly was not observed injects nothing — the catalog is never guessed from a stale view;
  • A composition exposing none of the accepted persona section names (deployment:persona-prefix, deployment:persona, persona) keeps the assembled prompt and warns once instead of sending an empty system prompt;
  • Plan mode is supported through its plan:policy section; with keepPlanPolicy: false the mode keeps its tool but loses the policy text that enforces it;
  • Paged tools (default patterns ['mcp__*', 'browser_*', 'task_board_*', 'team_*', 'squad*', 'ui_*', 'ssh_*'], while every host builtin stays resident) stay off the wire until the model activates their namespace through tool_activate({ namespace }) (an MCP server name under __-headed patterns, or the pattern head minus at most one trailing _ for plugin families); at most three paged namespaces stay active at once, refreshing recency on activation or tool call and evicting the least recently used one back to its summary when a fourth is activated, with activation state rebuilt from the durable event stream after compactions and resumes. Under ptc the page also restricts the scope's tool registry, so an unactivated namespace is absent from tools:sdk and unreachable from inside a run_code program too; optional idleReclaimSteps (default 0 = off) enables deferred idle reclaim: a namespace with no successful activation or call for N steps expires but is removed only at the next activation or compaction boundary, adding no prefix-cache rebuild; it stays resident and reachable until then, a successful call refreshes it, and expiry and reclaim replay from the durable event stream alike;
  • The working-context line is injected only when its sources (plan-mode state, active paged namespaces, in-progress todos) are readable, and omitted otherwise;
  • Tool results are pruned once they exceed 4096 characters, keeping a 2048-character head and a 1024-character tail (guarding the sparse-index slots while preserving the error tail and exit code), so oversized outputs do not crowd the context;
  • run_code needs a mounted PTC runtime (the shipped web and headless compositions mount @deepseek-ai/dsh-ptc-runtime-node as the ptc-runtime row); without one no PTC executor can be mounted, so the session runs the native surface;
  • The spawn delegation row enables child-model selection (modelSelection: true with modelDiscovery: true), so the settings page's subagent model-selection toggle is honored under this preset: the model sees provider / model / reasoning_effort on subagent and the list_subagent_models discovery tool, and an explicit route is checked against the Session's allowed list (without a recorded policy the effective route falls back to the parent's); the row also keeps the pre-split spelling modelSelectionSettings: true, because the SDK pinned in devDependencies reads only that key while the harness checkout this repository runs against no longer declares it, and each generation reads the key it knows while the other stays inert;
  • Exactly one delegation row in a composition scope may enable discovery. The upstream modelDiscovery flag registers list_subagent_models under a fixed tool name in the scope the row composes into, and the registry refuses a second registration of that name in one scope, so a second discovery owner fails the whole session instead of adding a second opt-in. The fork row therefore ships without it (as the builtin Standard, PTC, and Cordis presets ship it, which leave the route fields off there too), and the composition test counts the discovery owners structurally;
  • The subagent-routes row is the child-route guard. Once a Session recorded an allowed-route list, every delegation the row polices must resolve to an authorized route: an explicit provider/model pair on subagent, or the caller's own route on subagent_fork, whose inherited route is checked precisely because the tool cannot choose one. A refusal names the routes that would work; a route named on an inherit-only tool is refused as an override attempt; and a tool mounted without route fields is policed through the route its child would inherit instead of being asked for a pair no call could satisfy. The guard fails open on every fact it cannot read (no recorded policy, no session registry, no registry probe), so a Host that cannot answer keeps the harness's own delegation behavior, and enabled: false on the row turns it off entirely;
  • The dispatch-guard row is the execution-time counterpart of the coordinator rules. A delegated caller is refused ask_user_question, create_goal, update_goal and exit_plan_mode with DELEGATED_CALLER (the other three names on its frozen list are not mounted in this deployment, and stay listed so the rule survives a roster change), and it is refused a pure-sleep bash / pwsh / win_bash wait while it still has a running child — ACTIVE_CHILD_SLEEP_FORBIDDEN — because the completion notification, not a timer, is what ends that turn. A compound command that does real work and any run_in_background call are left alone. The row registers through ctx.tools.guard() alone, so the tool declaration surface does not move and a cache-prefix provider never rebuilds because of it; it fails open on every fact it cannot read (no guard seam, no session lineage, no live root set, no child listing), so a Host that cannot answer keeps the harness's own behavior, and enabled: false on the row turns it off entirely;
  • The roster does not publish the workflow tool, while the workflow engine stays mounted for ralph;
  • The shell mounts the upstream standard Stdio stack, registering bash on POSIX and pwsh on win32 — each host mounts exactly one shell tool, featuring concise description title cards and deterministic exit codes;
  • The file tools inherit the host file sandbox (no bare dsh-fs-local filesystem);
  • The preset carries the same trust level as shell access — review presets/liangshen/ before installing;
  • The plugin makes no network requests and adds no telemetry;
  • Do not switch presets mid-conversation;
  • Requires DSH 0.2.3-alpha.2+ (preset mechanism, the system-prompt/assemble waterfall, the persona prefix schema, and the PTC presentation API).

License

Plugin body Apache-2.0 (zhu1090093659). presets/liangshen/agent.cordis.yml derives from the DeepSeek Harness builtin Minimal, Standard, and PTC presets (MIT) — copyright and license notices are kept in the preset's NOTICE.