[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-94784":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":16,"starSnapshotCount":16,"syncStatus":14,"lastSyncTime":31,"discoverSource":32},94784,"dsh-anchored-standard","xiaobright\u002Fdsh-anchored-standard","xiaobright","Two-phase DeepSeek Harness preset: Minimal-aligned bootstrap, then full Standard tools (Project2 98\u002F99)","https:\u002F\u002Fgithub.com\u002Fxiaobright\u002Fmodeltest",null,"JavaScript",3659,110,2,21,0,741,88.14,"Other",false,"main",true,[24,25,26,27],"deepseek","deepseek-harness","dsh-plugin","llm-agent","2026-08-24 04:01:22","# dsh-anchored-standard\n\n[中文说明](.\u002FREADME.zh-CN.md)\n\nExperimental DeepSeek Harness agent presets — a base mode, two live-anchor\nvariants, and one seeded prefab mode — that anchor a session's model trajectory\non the Minimal condition\n(real Minimal tool schema, no auto-injected context), then promote to a small\nresident catalog once the session is durable, unlocking heavier Standard tools\non demand.\n\nThis is a community project. It is not an official DeepSeek preset and is not\naffiliated with or endorsed by DeepSeek.\n\nFeel free to submit feedback on the plugin in the form of Issues or PRs. For ideas for new plugins or useful findings, please submit them under the [repository](https:\u002F\u002Fgithub.com\u002F0liveiraaa\u002FDeepseekCotexplorations).\n\n## Project status (2026-08-17)\n\nFollowing the price increases on both the DeepSeek official API and the opencode go\nsubscription, active development of this project has effectively stopped: the evaluation\nloops these presets depend on (Project2-class runs and multi-trial roll\u002Fprobe experiments)\nare no longer affordable. The repository stays available as-is and receives **maintenance\nonly** (bug fixes and harness-compatibility updates when feasible). The mechanism findings,\nthe dose-response data, and the tooling (context-gate, the prefab pipeline, the probe\nsuite) remain valid and are largely model-agnostic. A personal note from the maintainer:\n[FAREWELL.md](.\u002FFAREWELL.md) (Chinese). Contributors and collaborators are\nlisted in [ACKNOWLEDGEMENTS.md](.\u002FACKNOWLEDGEMENTS.md).\n\nCommunity projects that users report perform better in some scenarios:\n\n- [dsh-routing-suite](https:\u002F\u002Fgithub.com\u002Fyjh051108\u002Fdsh-routing-suite) — a runtime injector\n  plus task-aware thinking-mode routing presets (the router-standard family).\n- [J-Space Cognition Suite](https:\u002F\u002Fgithub.com\u002FTiger3807861189\u002FJ-Space-Cognition-Suite-V3.6)\n  — a model-agnostic inference-time cognitive control layer packaged as a Skill.\n\n## Modes at a glance\n\n| Mode | Directory | First model request | Anchor mechanism | Promotion signal | Cost |\n|---|---|---|---|---|---|\n| Anchored Standard | `preset\u002F` | 2 tools (the Minimal pair) | Minimal tool schema | first durable `tool\u002Fcall` **or** `assistant\u002Fmessage` (`promoteOn: either`) | none |\n| Zero-Anchored Standard | `zero-anchored-standard\u002F` | 0 tools | one fixed anchor turn | the anchor reply (`assistant\u002Fmessage`) | +1 model call |\n| Whoami Standard | `whoami-standard\u002F` | 0 tools | one \"你是谁\" self-introduction turn | the self-introduction reply (`assistant\u002Fmessage`) | +1 model call |\n| Prefab Anchored Standard | `prefab\u002F` | seeded rolled history | bundled successful trajectory | already promoted in the seed | no model call to instantiate |\n| Eternal Minimal | `eternal-minimal\u002F` | 2 tools, forever | the visible catalog never grows; heavier tools run via the `dshx` bash gateway | none (no phases) | none |\n| Wire Think-Execute Standard | `wire-think-standard\u002F` | tools present, `tool_choice: none` on the wire | sibling provider route per think step | per-turn: the steer itself | +1 model call\u002Fturn, prefix-cache churn |\n| Combo Anchored | `combo-anchored\u002F` | 0 tools, on every user turn | think\u002Fexecute split + depth gate + deliberation drip as three independent rows | per-mechanism | +1 model call\u002Fturn |\n\nEvery mode directory is self-contained and installs alone under whatever id\nyou copy it to (see [Install](#install)). The prefab hydrates the blank session\nin place when its preset is selected; no per-workspace import is required.\n\n## Terminology\n\n- **trajectory** — the style of the model's first reasoning chain. The\n  Minimal condition produces \"We need…\" first lines; the Standard condition\n  produces \"Let me…\" (\"standard-like\") first lines.\n- **anchor** — the first-request conditions that select the trajectory. Issue\n  #11 isolated three levers: the tool schema, the output budget, and the\n  injected reminders.\n- **bootstrap phase** — request #1 of a session: the bootstrap tool pair, no\n  auto-injected context, optional output cap.\n- **promotion** — the durable session event that ends the bootstrap phase.\n  Base mode: first `tool\u002Fcall` or `assistant\u002Fmessage`, whichever comes first.\n  Variants: the anchor reply.\n- **durable** — recorded in the session event log. Phase state is derived\n  from durable events, so resume and reload preserve it.\n- **resident catalog** — the promoted tool set: the bootstrap pair plus the\n  discovery tools plus every tool the model explicitly unlocked.\n- **discovery tools** — `dev_tool_search`, `skill_search`, `skill_load`: the\n  on-demand unlock surface for heavier Standard tools.\n- **materialized copy** — the committed copy of a `shared\u002F` plugin inside a\n  mode directory, generated by `npm run sync`.\n\n## How it works\n\nThe base mode in one request lifecycle (the variants change only the first\nturn — see their sections):\n\n```\nuser's first message\n        │\n        ▼\n┌ request #1 ─ bootstrap phase ──────────────────────────────┐\n│ tools    : bash + str_replace_editor (Minimal's real pair) │\n│ context  : no AGENTS.md digest, no skill-catalog reminder  │\n│ budget   : adapter default (`bootstrapMaxTokens` optional) │\n└─────────────────────────────────────────────────────────────┘\n        │ first durable tool\u002Fcall OR assistant\u002Fmessage\n        ▼ PROMOTION — derived from durable events, resume-safe\n┌ request #2+ ─ resident phase ──────────────────────────────┐\n│ tools    : bootstrap pair + discovery tools + unlocked     │\n│ context  : standard injections restored                    │\n│ budget   : adapter default (a cap is stripped on promote)  │\n└─────────────────────────────────────────────────────────────┘\n```\n\nThree first-request levers decide the trajectory (issue #11):\n\n1. **Tool schema** — the decisive variable at the adapter-default maxTokens\n   (256000). The real Minimal pair anchored 5\u002F5; every standard-family schema\n   fell standard-like 11\u002F11.\n2. **Output budget** — a 1024 first-request cap also anchored the trajectory\n   (26\u002F32), independent of the tool descriptions. The base mode leaves this\n   lever unset (`bootstrapMaxTokens` is opt-in).\n3. **Injected reminders** — the AGENTS.md\u002FCLAUDE.md digest and the\n   available-skills reminder. With the skill catalog present, the anchor did\n   not reproduce at all (0\u002F9). The base mode now suppresses EVERY automatic\n   injection during bootstrap at the harness's two unified injection paths\n   (the `context-gate` plugin), not just the two measured ones.\n\n## Why\n\nDeepSeek V4 Pro conditions strongly on the API-visible tool catalog. In the\nProject2 evaluation, Standard and PTC produced scores of 91 and 92, while the\nofficial Minimal preset produced 99 and 96. Permanently staying on Minimal,\nhowever, gives up the Standard preset's broader tool set.\n\nAnchored Standard separates initial trajectory selection from later tool use:\n\n1. Keep the complete Minimal system prompt.\n2. Expose the Minimal preset's REAL tool schemas — persistent `bash` +\n   `str_replace_editor`, byte-identical to the official Minimal composition —\n   on the first model request (lever 1 above).\n3. Suppress EVERY auto-injected context on that first request — at the\n   harness's unified injection paths, not per source name (the `context-gate`\n   row, mounted FIRST; lever 3). While the session is unpromoted the\n   assembly's dynamic runtime-context contributions are blanked (the whole\n   `SystemPrompt.context()` family: sandbox\u002Fapproval policy snapshots and any\n   third-party context provider), and the pre-step waterfall keeps only the\n   CLAIMED message batch plus a small kind allowlist (a user-initiated skill\n   gesture survives; skill catalog, AGENTS.md digest, time\u002Ftmux context,\n   hooks, and unknown third-party injections are stripped by default). After\n   promotion the gate opens and the loop's own snapshot projection diffs\n   exactly ONE fresh runtime-context message into the next request — minimal\n   first round, injections on the second round. A `compaction\u002Fend` boundary\n   re-closes the gate the same way.\n4. After the session records its first durable promotion signal — a `tool\u002Fcall`\n   or the first `assistant\u002Fmessage`, whichever comes first — promote to the\n   RESIDENT catalog: the bootstrap pair plus the discovery tools plus whatever\n   the model has explicitly unlocked via `dev_tool_search`. Dumping the full\n   Standard catalog at promotion pulled the trajectory back to standard-like\n   behavior (the post-promotion regression), so heavier tools — `web_search`,\n   `subagent`, `workflow`, … — stay one `dev_tool_search` call away. Request\n   #1 always sees the bootstrap catalog; request #2 always sees the resident\n   catalog, so a text-only first reply can no longer trap the session in\n   bootstrap. (`promoteOn` in the `tool-bootstrap` row selects the trigger:\n   `either` default, `tool-call`, or `assistant-message`.)\n5. Derive the phase from durable session events so resume and reload preserve it.\n\nThe bootstrap catalog is the same on every platform: the Minimal pair\n(`bash`\u002F`str_replace_editor`). The preset's shell is the persistent PTY bash\n(the sandboxed Standard `bash` row is disabled — both register the `bash` name\ninto the same layer, and the tools registry rejects duplicates; Windows never\nhad the sandboxed bash anyway). `pwsh` remains available in the promoted\ncatalog on Windows.\n\n## Results\n\nThe anchored family was validated on Project2 with three V4 Pro scores of\n98, 99, and 99. Provenance note (issue #60): those three runs predate the\ncurrent composition — they used the Minimal system prompt with a first-request\n`pwsh` + `read` surface and promoted to the full 25-tool Standard catalog;\nthe exact Minimal pair (persistent `bash` + `str_replace_editor`) with the\nsmall resident catalog was introduced afterward. The bundled generic prefab\nremoves Project2-specific warm-up facts and was not re-benchmarked before the\nAPI price change, so those scores must not be attributed to the generic\ntemplate.\n\nIndependent replications: the trajectory anchoring reproduces strongly, but\nthe ability gap is unresolved at small n — see\n[#65](https:\u002F\u002Fgithub.com\u002Fxiaobright\u002Fdsh-anchored-standard\u002Fissues\u002F65)\n(anchoring 9\u002F9 separated by preset; anchored−standard +3.3, 95% CI\n[−2.6, +9.3]) and\n[#51](https:\u002F\u002Fgithub.com\u002Fxiaobright\u002Fdsh-anchored-standard\u002Fissues\u002F51)\n(multi-env, Ability 85–90, 98\u002F99 not reproduced). Treat the scores above as\nour original observations, not a settled effect size.\n\nResearch write-ups live in the companion exploration repository\n[DeepseekCotexplorations](https:\u002F\u002Fgithub.com\u002F0liveiraaa\u002FDeepseekCotexplorations)\n(data and methodology; this repository keeps the code):\n\n- [Tool-surface dose-response + Project2 replication](https:\u002F\u002Fgithub.com\u002F0liveiraaa\u002FDeepseekCotexplorations\u002Ftree\u002Fmain\u002Fcontributions\u002Fxiaobright-v4-tool-surface-dose-response\u002F) —\n  methodology, per-run scope, tool-surface experiments, and limitations.\n- [Anchor-mass quantification + single-request probe methodology](https:\u002F\u002Fgithub.com\u002F0liveiraaa\u002FDeepseekCotexplorations\u002Ftree\u002Fmain\u002Fcontributions\u002Fxiaobright-v4-anchor-mass-probe\u002F) —\n  the prefab template quality model and the post-price-hike low-cost\n  evaluation loop.\n\nDevelopment-process records (what was done, why, and the pitfall lists) are\nkept in this repository as [`HANDOFF.md`](.\u002FHANDOFF.md) and\n[`HANDOFF-2.md`](.\u002FHANDOFF-2.md).\n\n## Configuration reference\n\nAll knobs are rows in each mode's `agent.cordis.yml`. Unknown keys fail at\npreset mount.\n\n`context-gate` (mounted FIRST in `preset\u002F`, `zero-anchored-standard\u002F`, and\n`whoami-standard\u002F` — waterfall registration order makes the gate the outermost\ntransform; the plugin lives in `shared\u002Fcontext-gate.mjs` and is reusable by\nany other composition that wants unified injection control alone):\n\n| Key | Default | Meaning |\n|---|---|---|\n| `promoteOn` | `either` | Promotion trigger: `either`, `tool-call`, or `assistant-message` (the variants use `assistant-message`). |\n| `includeSubagents` | `false` | Gate subagents too (`true` in the base mode and whoami; keep in sync with the bootstrap row). |\n| `enabled` | `true` | `false` disables both interception paths (A\u002FB testing without touching the row set). |\n| `allowKinds` | `[skill-invocation]` | `source.kind` values allowed beyond the claimed batch; `[]` keeps ONLY the claimed batch. |\n\nInjection control division of labor: session-phase suppression (everything\nkeyed on a promotion boundary) belongs to `context-gate`. Two documented\nexceptions keep their own enumerated `suppressedContextSources` strip because\nthe gate's phase machine does not map onto their scope: the think-step strip\nin `think-phase`\u002F`wire-think` (per-step, not per-session-phase) and the\npermanent every-request strip in `eternal-minimal` (no promotion boundary;\nfrozen to the configuration its recorded measurements were taken under).\n\n`tool-bootstrap` (in `preset\u002Fagent.cordis.yml`; mount right after\n`context-gate`):\n\n| Key | Default | Meaning |\n|---|---|---|\n| `bootstrapTools` | `[bash, str_replace_editor]` | Tools visible on request #1. |\n| `promoteOn` | `either` | Promotion trigger: `either`, `tool-call`, or `assistant-message`. |\n| `bootstrapMaxTokens` | unset | Optional output cap for request #1; stripped after promotion. |\n| `includeSubagents` | `false` | Subagents take the bootstrap phase too (`true` in the base mode). |\n| `compactionTools` | `[]` | Extra tools available between a compaction boundary and re-promotion. |\n\n`zero-tool-bootstrap` (in `zero-anchored-standard\u002F` and `whoami-standard\u002F`):\n`compactionTools` has the same semantics (promotion is always the first\n`assistant\u002Fmessage`), plus `includeSubagents`, whether subagents also take the\nanchor phase (set `true` in `whoami-standard`, `false` in\n`zero-anchored-standard`). Context suppression is NOT here — both variants\nmount the `context-gate` row (above) with `promoteOn: assistant-message`;\nthe bootstrap's former `suppressedContextSources` key now fails at mount.\n\n`anchor-turn` (in both variants): `text` — the synthetic first user message\n(default \"This round is a test. Tools are not open yet; all tools will open\nnext round.\" in zero-anchored, \"你是谁\" in whoami); `includeSubagents` —\nwhether subagents also take the anchor turn.\n\n\n`eternal-minimal` (in `eternal-minimal\u002F`; the row must stay FIRST):\n\n| Key | Default | Meaning |\n|---|---|---|\n| `guide` | `true` | Append the short `dshx` capability guide to the system prompt; `false` keeps the persona byte-pure. |\n| `gateway` | `true` | Intercept `dshx` shell commands and execute the real tools; `false` leaves the bare Minimal pair. |\n| `gatewayCommand` | `dshx` | The interception word. |\n| `maxGatewayChars` | `12000` | Cap on one gateway result payload. |\n| `suppressedContextSources` | `[agent-instructions, skill-catalog]` | Stripped on every request (no promotion boundary; the enum intentionally stays — see the division-of-labor note above). |\n\n\n`cot-drip` (in `combo-anchored\u002F`):\n\n| Key | Default | Meaning |\n|---|---|---|\n| `every` | `4` | Attach one deliberation beat after every Nth tool result; `0` disables the drip. |\n| `maxPerTurn` | `1` | Beats per turn. |\n| `text` | built-in beat | The reminder text (one \"We …\" sentence restating the remaining goal). |\n| `includeSubagents` | `false` | Whether subagent calls are dripped too. |\n\n`toolchoice-adapter` (in `wire-think-standard\u002F`; the row must stay the first LOCAL row):\n\n| Key | Default | Meaning |\n|---|---|---|\n| `provider` | `deepseek-wire-think` | The sibling route id the adapter owns; registering an id twice throws DUPLICATE_ADAPTER (caught, degraded). |\n| `toolChoice` | `none` | The wire `tool_choice` sent whenever tool definitions are present. |\n| `baseURL` \u002F `apiKeyEnv` | settings\u002Fenv | Row config first, then the `llm-deepseek` settings section, then `DEEPSEEK_BASE_URL` \u002F `DEEPSEEK_API_KEY`. |\n| `logprobs` | `false` | Opt-in research hook: request token logprobs and log a per-request mean summary (no StreamChunk surface exists). |\n\n`wire-think` (in `wire-think-standard\u002F`): same `mode` \u002F `suppressedContextSources` \u002F\n`includeSubagents` \u002F `steerText` semantics as `think-phase`, plus\n`provider` (must match the `toolchoice-adapter` row's id) and `defaultProvider`\n(the route execute steps restore onto, default `deepseek-official`).\n\n`instruction-hint` (all modes): `promoteOn` matching the mode's promotion\nsemantics (`either` in the base mode, `assistant-message` in the variants) —\nthe one-shot \"instruction files exist, read them before acting\" hint waits\nfor promotion.\n\n## Repository layout\n\n```\npreset\u002F                  Anchored Standard — the base mode\nzero-anchored-standard\u002F  variant: fixed zero-tool anchor turn\nwhoami-standard\u002F         variant: \"你是谁\" anchor turn, subagents inherit\neternal-minimal\u002F         variant: Minimal pair forever + dshx bash gateway\nwire-think-standard\u002F     variant: wire-level condition (tools + tool_choice=none)\ncombo-anchored\u002F          combination package: think split + gate + drip rows\nshared\u002F                  single source of truth for plugins used by 2+ modes\nscripts\u002Fsync-modes.mjs   materializes shared\u002F plugins into every mode dir\ntest\u002F                    zero-dependency test suite (npm test)\nverify\u002F                  one-shot headless verification runner\nprefab\u002F                  Prefab Anchored Standard + bundled session template\n```\n\n`prefab\u002F` ships a generic template by default and a Project2-specific template\nas an explicit opt-in. Both contain real model reasoning; read the mode's\n[installation notes](.\u002Fprefab\u002FREADME.md) before use.\n\nInvariants, enforced by `npm run check`:\n\n- Every mode directory is self-contained: installable by copying it alone;\n  `agent.cordis.yml` rows may reference only `.\u002Flocal.mjs` files, never `..\u002F`.\n- Plugins shared by several modes live once in `shared\u002F`; the copies in mode\n  directories are generated. Edit `shared\u002F`, run `npm run sync`, commit both —\n  never edit a materialized copy.\n- The `context-gate` row stays the FIRST row of `preset\u002Fagent.cordis.yml`\n  (the gate must register before every injecting plugin), with\n  `tool-bootstrap` right after it. The same first-row rule holds for the\n  `context-gate` row in `zero-anchored-standard\u002F` and `whoami-standard\u002F`.\n\nThis repository deliberately ships no AGENTS.md\u002FCLAUDE.md: the presets' whole\nmechanism is a clean request #1, stripping exactly those instruction-file\ndigests from it (issue #6: 0\u002F9 anchored with the injection present). Shipping\none would only feed later rounds and contradict the mechanism being\ndocumented. Everything an assistant needs is in this README.\n\n## Compatibility\n\nDeveloped and tested against:\n\n- DeepSeek Harness `0.1.0-rc.5`\n- repository commit [`47f9438`](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-harness\u002Ftree\u002F47f943859bef60e4160492346772ded9b24f765a)\n- Node.js 24 on Windows\n\nThe persistent shell resolves `shellPath` adaptively: it keeps the\nterminal-bash plugin default `\u002Fbin\u002Fbash` on hosts where that absolute path\nexists, and falls back to `bash` (PATH lookup) otherwise — e.g. NixOS, where\nbash lives under the Nix store. Hosts that ship `\u002Fbin\u002Fbash` keep the previous\nbehavior exactly; the fallback only activates where the default would make\nevery bash call fail with \"PTY shell exited during startup\".\n\nOn the `0.1.0-rc.5` source checkout, `bootstrapMaxTokens` reaches the actual\nfirst request (the first `request\u002Fheader` records the cap, `adapterDefaults`\nstays empty), because `llm.prepareCall` only materializes a default maxTokens\nwhen the proposed config has none. One prebuilt profile package observed in\nissue #11 (CLI launcher reporting `0.1.0-rc.6`) overwrote the proposed cap\nwith `adapterDefaults.maxTokens`; there the cap is a no-op. The default\ncomposition therefore relies on the Minimal tool schema alone (which anchors\nat the adapter default with no cap) and leaves `bootstrapMaxTokens` as an\nopt-in for standard-schema bootstraps.\n\nDeepSeek Harness is currently a developer preview and explicitly permits\nbreaking changes. This preset is a full snapshot of the Standard composition,\nso review upstream changes before using it with a newer release.\n\n## Install\n\nFor the prefab mode, the recommended path is AI-assisted one-command setup.\nGive your coding agent this repository and ask it to follow the\n[installation-agent contract](.\u002Fprefab\u002FAGENT_INSTALL.md). When it reports\n`INSTALL READY`, start DSH, select **Prefab Anchored Standard**, create a new\nsession in the target workspace, and send the real task prompt. This installs\nthe generic template; the Project2 benchmark template requires an explicit\n`--template project2` selection and installs under a separate preset id.\n\nClone this repository, then copy the entire `preset` directory into the user\npreset root under the id `anchored-standard`. Every mode directory in this\nrepository is self-contained: the `zero-anchored-standard\u002F`,\n`whoami-standard\u002F`, `prefab\u002F`, `eternal-minimal\u002F`, `wire-think-standard\u002F`, and\n`combo-anchored\u002F` variants install the same way, alone or together, with no\nother directory required (see their sections below). `prefab\u002F` automatically\nhydrates newly selected sessions; follow [`prefab\u002FREADME.md`](.\u002Fprefab\u002FREADME.md).\n\nPowerShell:\n\n```powershell\n$target = Join-Path $env:USERPROFILE '.dsh\\.agent-presets\\anchored-standard'\nif (Test-Path -LiteralPath $target) { throw \"Preset already exists: $target\" }\nNew-Item -ItemType Directory -Force -Path (Split-Path -Parent $target) | Out-Null\nCopy-Item -Recurse -LiteralPath '.\\preset' -Destination $target\n```\n\nLinux\u002FmacOS:\n\n```sh\ndsh_home=\"${DSH_HOME:-$HOME\u002F.dsh}\"\nmkdir -p \"$dsh_home\u002F.agent-presets\"\ntest ! -e \"$dsh_home\u002F.agent-presets\u002Fanchored-standard\"\ncp -R preset \"$dsh_home\u002F.agent-presets\u002Fanchored-standard\"\n```\n\nFully restart DeepSeek Harness, create a blank session, and select\n**Anchored Standard (experimental)**. Do not switch an active session from a\ndifferent preset.\n\n## Verify\n\nExport the session JSONL and inspect `request\u002Fheader` events. Reproduction\nchecklist (issue #11 asks for the first two explicitly, because both are the\nvariables that decide the anchor):\n\n- **First-request `config.maxTokens` value**: with `bootstrapMaxTokens` unset\n  (the default), the first header records the adapter default (e.g. 256000\n  with `adapterDefaults.maxTokens: true`); with a cap configured it records\n  the cap (e.g. 1024 with no maxTokens adapterDefault).\n- **First-request tool schema source**: the first header's `tools` array must\n  be exactly `[\"bash\", \"str_replace_editor\"]` — the official Minimal preset's\n  real schemas, not Standard's `pwsh`\u002F`read`.\n- the first request's messages should contain no AGENTS.md\u002FCLAUDE.md digest and\n  no available-skills reminder — only the user message and the minimal persona\n  system prompt;\n- after the first tool call or the first assistant reply, the next changed\n  header should contain the promoted resident catalog: the bootstrap pair plus\n  `dev_tool_search`\u002F`skill_search`\u002F`skill_load` plus any tools the model\n  already unlocked;\n- subsequent requests should keep that resident set (it grows only through\n  explicit `dev_tool_search` unlocks) and restore the standard context\n  injections.\n\nRun the local zero-dependency tests with:\n\n```sh\nnpm test\n```\n\n## Important behavior\n\n- With the default `promoteOn: either`, the session promotes after its first\n  durable `tool\u002Fcall` OR its first `assistant\u002Fmessage`, whichever comes first —\n  request #1 sees the bootstrap catalog and every later request sees the\n  resident catalog. A text-only first reply therefore still promotes at\n  request #2; set `promoteOn: tool-call` to restore the original behavior,\n  where a first response that makes no tool call never promotes.\n- A failed tool execution still promotes the session because the durable\n  `tool\u002Fcall` already exists.\n- The first request's output budget is NOT capped by default: the Minimal tool\n  schema anchors at the adapter-default maxTokens, so `bootstrapMaxTokens` is\n  opt-in. When set, the first request is capped and the cap is explicitly\n  stripped after promotion (the next request's seed proposal carries the\n  previous header's maxTokens forward).\n- The promoted catalog is the RESIDENT set — the bootstrap pair plus the\n  discovery tools plus everything the model unlocked via `dev_tool_search` —\n  not the full Standard dump. The Standard sandboxed `bash` row stays disabled\n  in favor of the persistent shell (same tool name, same layer; see Why). When\n  unlocked, the `read`\u002F`write`\u002F`edit` tools keep the sandboxed filesystem while\n  `str_replace_editor` uses the preset's local fs.\n- A missing bootstrap tool degrades to the full catalog with a one-time\n  warning instead of failing requests, so a composition drift cannot brick a\n  session; invalid `promoteOn` values fail at preset mount instead.\n- Promotion decisions are memoized per session for the process lifetime; the\n  durable event scan runs once per session per process.\n- While a session is unpromoted, the `context-gate` plugin closes BOTH unified\n  injection paths: the assembly's runtime-context contributions are blanked\n  (the whole `SystemPrompt.context()` family, without enumerating sources),\n  and the pre-step waterfall keeps only the claimed batch plus the\n  `allowKinds` entries. At promotion the loop's snapshot projection diffs in\n  exactly ONE fresh runtime-context message; a gate failure degrades to\n  keeping every message rather than eating context.\n- The tool catalog changes at promotion and again whenever `dev_tool_search`\n  unlocks a new tool; request-prefix cache continuity breaks at those points.\n- The preset has the same trust level as shell access. Review its files before\n  installation.\n- The plugin performs no network requests and adds no telemetry.\n\n## Zero-Anchored Standard (experimental)\n\nAn extra test mode that does not change the Anchored Standard logic above. It\nuses the same Minimal-aligned system prompt, but instead of exposing two tools\non the first request it injects one fixed zero-tool anchor turn:\n\n1. When the user sends their first message, the `anchor-turn` plugin prepends a\n   fixed user message — \"This round is a test. Tools are not open yet; all\n   tools will open next round.\" — ahead of it.\n2. The first real model request carries ZERO tools, so the session's first\n   reasoning chain follows the zero-injection \"we\" trajectory.\n3. Once that anchor response is durable, the resident catalog is exposed\n   and the real message proceeds with it.\n\nAnchoring on the first message — not on session creation — keeps the\nblank-session preset switcher usable. Subagents always see the resident\ncatalog.\n\nMeasured behavior (opencode-go, DeepSeek V4 Pro, `reasoningEffort=max`): the\nanchor request is stable \"we\"-style with zero `let me`; the following\ntool-bearing requests return to the \"The user wants…\u002FLet me\" style. This mode\nis a comparison point for whether the zero-tool first turn is worth the extra\nmodel call — not a claim that tool rounds stay \"we\"-style.\n\nInstall as a separate preset id:\n\n```sh\ndsh_home=\"${DSH_HOME:-$HOME\u002F.dsh}\"\nmkdir -p \"$dsh_home\u002F.agent-presets\"\ntest ! -e \"$dsh_home\u002F.agent-presets\u002Fzero-anchored-standard\"\ncp -R zero-anchored-standard \"$dsh_home\u002F.agent-presets\u002Fzero-anchored-standard\"\n```\n\nRestart DeepSeek Harness, create a blank session, select **Zero-Anchored\nStandard (experimental)**, then send your first message.\n\n## Whoami Standard (experimental)\n\nA usability-oriented variant of the zero-tool anchor idea: the first turn is a\nnatural self-introduction prompt instead of a fixed test message, and the\nuser's real first message is deferred to the next turn. Whatever the user types\nfirst, the session warms up exactly one round and everything is ready when the\nreal message is processed:\n\n1. When the user sends their first message, the `anchor-turn` plugin prepends a\n   fixed user message — \"你是谁\" (who are you) — ahead of it in the `next-turn`\n   inbox queue.\n2. dsh claims exactly ONE `next-turn` message per turn, so the first model\n   request sees only the anchor on an EMPTY tool surface and replies with a\n   self-introduction; that reply is the promotion signal.\n3. The real message is claimed by the NEXT turn, with the promoted resident\n   catalog (shells, `str_replace_editor`, the discovery tools) already\n   unlocked — heavier Standard tools are one `dev_tool_search` away.\n\nThe anchor text is configurable via the `anchor-turn` row's `text` option\n(default \"你是谁\"). Anchoring on the first message — not session creation —\nkeeps the blank-session preset switcher usable.\n\n### Full-powered subagents\n\nWhoami Standard ships with `includeSubagents: true` on both the\n`zero-tool-bootstrap` and `anchor-turn` rows, so subagents spawned from a\nsession inherit the same anchor flow as top-level sessions:\n\n1. A newly spawned subagent's first model request sees only the \"你是谁\"\n   anchor on an empty tool catalog.\n2. The subagent's self-introduction reply is the promotion signal.\n3. The delegated prompt runs on the next turn with the promoted resident\n   catalog (shells, `str_replace_editor`, and the discovery tools).\n\nSet `includeSubagents: false` on both rows to restore the plain behavior,\nwhere subagents start with the resident catalog immediately. Each subagent\ncosts one extra model call for its anchor turn — a delegation-heavy session\npays it per subagent.\n\n`zero-anchored-standard` keeps subagents plain by default; enabling the same\nflow there means setting `includeSubagents: true` on its `zero-tool-bootstrap`\nand `anchor-turn` rows (its anchor text stays the fixed test notice).\n\nThe trade-off of the mode itself is one extra model call per session: the\nanchor turn is always taken, even when the first message is urgent.\n\nThe directory is self-contained; install it alone or alongside any other mode.\n\nInstall as a separate preset id:\n\n```sh\ndsh_home=\"${DSH_HOME:-$HOME\u002F.dsh}\"\nmkdir -p \"$dsh_home\u002F.agent-presets\"\ntest ! -e \"$dsh_home\u002F.agent-presets\u002Fwhoami-standard\"\ncp -R whoami-standard \"$dsh_home\u002F.agent-presets\u002Fwhoami-standard\"\n```\n\nRestart DeepSeek Harness, create a blank session, select **Whoami Standard\n(experimental)**, then send your first message — the self-introduction round\nruns first, and your message is answered with the full tooling on the next\nturn.\n\n\n## Eternal Minimal (experimental)\n\nThe \"make the model believe it never left Minimal\" mode: the model-visible\ncatalog stays EXACTLY the Minimal pair (`bash` + `str_replace_editor`) for\nthe WHOLE session — no anchor round, no promotion, no discovery tools, no\ncatalog growth — while the full Standard toolset stays registered and\nexecutes FOR REAL behind the `dshx` bash gateway:\n\n```\ndshx list                           # list every gateway tool\ndshx web_search '{\"query\": \"...\"}'  # execute the real web_search\ndshx read_image '{\"path\": \"...\"}'   # execute the real read_image\n```\n\n1. **Eternal pair**: `system-prompt\u002Fassemble` keeps only the shells +\n   `str_replace_editor` on every request (think steps, post-compaction,\n   subagents — everything), and auto-injected context is stripped everywhere\n   (there is no promotion boundary to key suppression on).\n2. **Gateway**: a `tools\u002Fpre-execute` listener intercepts bash commands\n   starting with `dshx`, dispatches them through `ctx.tools.execute()` (the\n   full registry pipeline — policy, guards, execution, rendering), and\n   returns the rendered output as the command result. The deny channel is the\n   only sanctioned pre-dispatch way to substitute a result, so gateway\n   payloads arrive flagged as errors — every payload states plainly that the\n   tool executed and its output follows, so the model reads it as output.\n   The real tool really ran: the user sees genuine effects (files, searches,\n   subagents) exactly as if it had been called by name.\n3. **Guide**: a short `dshx` capability guide is appended to the system\n   prompt (`guide: false` for a byte-pure Minimal persona) so the model knows\n   the gateway exists without a third visible tool.\n\nThe gateway refuses to dispatch the shells\u002F`str_replace_editor` themselves\n(\"invoke them directly\"), which also makes recursion impossible. Unknown\ntools, malformed JSON, and tool failures all come back as readable payloads.\nSet `gateway: false` for a bare two-tool session with no interception.\n\nInstall as a separate preset id:\n\n```sh\ndsh_home=\"${DSH_HOME:-$HOME\u002F.dsh}\"\nmkdir -p \"$dsh_home\u002F.agent-presets\"\ntest ! -e \"$dsh_home\u002F.agent-presets\u002Feternal-minimal\"\ncp -R eternal-minimal \"$dsh_home\u002F.agent-presets\u002Feternal-minimal\"\n```\n\nRestart DeepSeek Harness, create a blank session, select **Eternal Minimal\n(experimental)**, then work as usual — the model composes shell commands,\nand `dshx …` lines run the heavier Standard tools for real.\n\n\n## Wire Think-Execute Standard (experimental)\n\nThe wire-level mode: every user turn opens with one think step that keeps\ntool definitions PRESENT in the request while the wire forbids invocation\n(`tool_choice: \"none\"`), then a steering notice opens the execute phase on\nthe official provider with the resident catalog.\n\n`tool_choice` is outside the harness `GenerateOptions` vocabulary (the\nofficial deepseek adapter documents the mapping as an MVP cut), so reaching\nthis condition takes the sanctioned wire seam:\n\n1. **Sibling route**: `toolchoice-adapter.mjs` (row 1) registers a\n   zero-dependency DeepSeek chat-completions adapter under its OWN provider\n   id (`deepseek-wire-think`) that puts `tool_choice: \"none\"` on the wire\n   whenever tool definitions are present. The official `DeepSeekAdapter`\n   cannot be wrapped (its wire body is built inside a private generator), so\n   this file vendors a minimal, protocol-faithful subset of the official\n   serialize\u002FSSE\u002Ftranslate pipeline — the same assistant-message nuances\n   (`content: \"\"` never null, `reasoning_content` replayed only on\n   tool-call turns, tool results as `role: \"tool\"` with an `(no output)`\n   fallback) and the same usage\u002Ffinish translation. Connection facts\n   resolve row config > `llm-deepseek` settings section > env, exactly like\n   the official row, so the same `DEEPSEEK_API_KEY` serves both routes.\n2. **Per-step routing**: `wire-think.mjs` keeps the think step's assembled\n   catalog UNTOUCHED (that is the condition being reproduced) and swaps ONLY\n   the provider in the `agent\u002Frequest` waterfall — the frozen loop-built\n   request and the log-reconstructability invariant are preserved. Execute\n   steps (and every subagent) are routed back to the captured original\n   provider even when the folded session header seeds them with the think\n   route.\n3. **Steer + resident**: `agent\u002Fturn-stopping` steers exactly once per turn\n   (resume-safe from durable `steering\u002Fmessage` events), and execute steps\n   see the promoted RESIDENT set.\n\nDegradation ladder: if the sibling route is not registered (row removed, or\na second preset already mounted the same id — `DUPLICATE_ADAPTER` is caught\nand warned), think steps fall back to the zero-tool condition, so a\ncomposition mistake can never brick a session. `mode: first-turn` limits the\nrouting (and its costs) to the session's first user turn.\n\nCosts to know before adopting: the think\u002Fexecute alternation switches the\ntools block of the request prefix twice per turn, so DeepSeek prefix-cache\nreuse breaks from the first changed token each switch (provider id itself is\ninvisible to the backend cache; the tools block is what diverges). Each swap\nappends a `request\u002Fheader` change event. Set `logprobs: true` on the adapter\nrow for the opt-in research hook — the adapter requests token logprobs and\nlogs a per-request mean summary (the harness StreamChunk vocabulary has no\nsurface for logprob data, so logging is all a plugin can do today; that log\nstream is exactly what offline trajectory analysis would consume).\n\nInstall as a separate preset id:\n\n```sh\ndsh_home=\"${DSH_HOME:-$HOME\u002F.dsh}\"\nmkdir -p \"$dsh_home\u002F.agent-presets\"\ntest ! -e \"$dsh_home\u002F.agent-presets\u002Fwire-think-standard\"\ncp -R wire-think-standard \"$dsh_home\u002F.agent-presets\u002Fwire-think-standard\"\n```\n\n## Combo Anchored (experimental) — the combination package\n\nThe everything-is-a-plugin showcase: THREE orthogonal anchoring mechanisms\ncomposed as independent rows, each with its own knobs, each removable or\nretunable by editing one line of `agent.cordis.yml`. They attack the\npre-tool deliberation collapse at different moments of a turn:\n\n| Row | Mechanism | Owns |\n|---|---|---|\n| `think-phase` | zero-tool think step + steering notice | the turn OPENING |\n| `deliberation-gate` | depth gate denies the first tool call of a shallow turn | the FIRST ACTION |\n| `cot-drip` | one \"We …\" beat after every Nth tool result (`tools\u002Fpost-execute` additionalContexts — never blocking, never erroring) | the LONG MIDDLE |\n\nWith `mode: every-turn` the think step opens every turn, the gate catches\nthe paths that skip it (steering continuations, resumed sessions,\nstraight-to-tools follow-ups), and the drip sustains deliberation across\nlong tool loops. Defaults are deliberately gentle (`minChars: 400`,\n`every: 4`, one beat per turn); tune per workload. Swapping the\n`think-phase` row for `wire-think` + `toolchoice-adapter` upgrades the\nopening to the wire-level condition (see above) at the cost of the sibling\nroute and its prefix-cache churn.\n\nExplored and rejected for this package: pure Code Mode presentation\n(`presentAs('code')` collapses the catalog into one `run_code` tool) — a\nsingle-tool surface measurably underperforms the two-tool condition in the\nsibling project's evaluations; and text-only fake tools or ghost tool-call\nhistories — both proved unreliable anchors in practice.\n\n## Official ecosystem guidance\n\nDeepSeek currently asks community plugin authors to publish plugins in their own\nGitHub projects and add the [`dsh-plugin`](https:\u002F\u002Fgithub.com\u002Ftopics\u002Fdsh-plugin)\nrepository topic for discovery. The official repository does not currently\naccept external pull requests and does not mandate a community repository\ntemplate. See the official\n[`CONTRIBUTING.md`](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-harness\u002Fblob\u002F47f943859bef60e4160492346772ded9b24f765a\u002FCONTRIBUTING.md).\n\n## License\n\nMIT. `preset\u002Fagent.cordis.yml` is derived from the DeepSeek Harness Standard\npreset; the original DeepSeek copyright and MIT notice are retained in\n[`NOTICE`](.\u002FNOTICE).\n","这是一个为DeepSeek Harness（DSH）设计的LLM智能体预设框架，实现两阶段模型能力演进：初始阶段严格锚定在Minimal工具集（仅2个基础工具），待会话稳定后按需升级至Standard工具集。其核心技术包括锚点机制、动态工具加载、上下文门控与预制轨迹回放，支持多种锚定策略（如零锚定、自介绍锚定等）。项目适用于需要精细控制LLM工具调用节奏、平衡响应成本与功能完备性的研究型或轻量生产场景，尤其适合多轮推理、成本敏感的Agent实验。","2026-08-16 02:30:03","CREATED_QUERY"]