Preface¶
DSH (DeepSeek Harness) is an agent development platform by DeepSeek, where everything is a plugin. When reviewing science exam problems, common pain points include scattered questions, difficulty organizing by knowledge points, and unstructured review notes. Existing mistake-book apps on the market typically only support manual entry and struggle to integrate with DSH’s model capabilities. The mason233hello/dsh-wrongbook plugin targets this scenario: it records mistakes in Markdown/LaTeX, provides directory management by subject and knowledge point, and leverages DSH’s model capabilities to generate variant problems.
Plugin Positioning¶
This is a mistake-recording and review tool for science study scenarios, categorized under “Memory.” It is maintained by Mason233Hello and licensed under MIT. It does not provide a standalone UI; instead, it plugs into DSH’s plugin system, appearing as a book icon in the left sidebar. Clicking it fills the central main area, and the interface follows DSH’s light/dark theme.
Adding a Mistake¶
Creating a new mistake entry requires six fields:
- Subject
- Tags (knowledge points)
- Problem name
- Problem statement
- Answer
- Error cause
The problem statement, answer, and error cause are all stored in Markdown format, supporting $...$ inline math and $$...$$ block math. The editor supports toggling between “Edit / Preview” modes and provides shortcut buttons for bold, italic, formulas, and more. The answer is hidden by default and must be clicked to expand.
Reviewing Mistakes¶
Upon entering the mistake page, the last review time is displayed at the top. The answer is hidden by default; clicking “Click to show answer” expands it. The first expansion automatically records a review session, and you can also manually “Mark as reviewed.” On the right side of the page, the subject, tags, added time, last review time, review count, and recommendation record are displayed.
Organizing Mistakes¶
The left side of the main area shows a two-level directory: “Subject → Tag,” while the right side lists the corresponding problems. Keyword search is supported, covering problem name, problem body, answer, and error cause. Problems are sorted in reverse chronological order by creation time. Drag-to-reorder is not supported, preventing manual ordering from breaking the directory structure. New problems are immediately reflected in the directory counts.
Good Problem Recommendations (AI)¶
Clicking the “Good Problem Recommendations” button causes the plugin to read the current problem’s “statement + error cause,” call DSH’s default model, and generate 2–3 variant problems on the same knowledge point with slightly higher difficulty, each accompanied by a complete solution.
Above the generate button, the model name, provider, and reasoning effort level used for this request are displayed, avoiding the “not sure who answered” situation. The recommendation is a one-time action: the result is saved to the problem record, and each problem is generated only once. After generation, the button becomes a “View” entry point—clicking it opens a modal to review the problems and answers without leaving the current problem page. If generation fails, no record is written; you can lower the reasoning effort and retry.
Installation¶
Install from a local directory (recommended)¶
git clone https://github.com/Mason233Hello/dsh-wrongbook.git
Then in DSH, open “Plugin Manager → Install Bundle” and select the newly cloned directory (or enter file:/absolute/path/dsh-wrongbook). After installation, DSH must be restarted once: host-side modules are loaded only once per process, and without a restart, the old code will continue to run.
Manual installation (non-desktop)¶
The CLI version of DSH can mount it directly into a profile:
cd "$DSH_HOME/profiles/web"
pnpm add file:/absolute/path/dsh-wrongbook
Then add the package name @local/dsh-wrongbook to the dsh.profile.bundles array in package.json and restart.
The desktop version’s
node_modulesis managed by the App on a per-generation basis. Direct modifications will be overwritten—please use the Plugin Manager instead.
Data Storage¶
All mistakes are stored in a single JSON document:
$DSH_HOME/wrongbook/questions.json # defaults to ~/.dsh/wrongbook/questions.json
The path can be overridden via the DSH_WRONGBOOK_FILE environment variable. Writes use a “temp file + rename” strategy, so the original file will never be corrupted. If the file is corrupted, it is automatically renamed to a backup as questions.json.corrupt-<timestamp>, and the app starts with an empty book. Backing up or migrating requires copying just this one file.
UI state (currently viewed problem, subject/tag filters, search term) is stored in the browser’s localStorage and bound to the host instance: after a DSH restart, it automatically returns to the directory home page.
Environment Variables¶
| Variable | Description |
|---|---|
DSH_WRONGBOOK_FILE |
Overrides the data file path |
DSH_WRONGBOOK_MAX_OUTPUT_TOKENS |
Sets a max_tokens cap for recommendation requests; by default not set, inheriting the same model budget as a regular session |
Technical Implementation¶
The Host layer (index.js) handles JSON storage, browser RPC, and model calls. RPC routes are registered directly on ctx.webServer with the prefix /x-wrongbook. Authentication calls ctx.connection.admit(), using the same Host/Origin validation + browser session as /api. The wire format is the standard Connection RPC envelope; the Client side still uses connection.rpc.call().
In the current version, ctx.connection.rpc.handle() is unavailable: it internally reads owner.webServer, which is rejected by the Cordis injection guard. When a custom channel is needed, register routes manually as described above.
Loading and recommendation are decoupled: hello only returns the mistake list and a model route (without resolving the adapter), so the book opens instantly; model capabilities (name, reasoning level) are resolved in the background via a separate model call (10s timeout). Failure only affects the right-side recommendation card.
Model calls come from ctx.agentDefaultModel, reasoning level from ctx.llm.resolveModelInfo(), and generation from ctx.llm.stream(). Completeness is judged while streaming: as soon as a complete JSON (≥2 problems) appears in the stream, the stream is closed early, preventing reasoning-heavy models from exhausting their budget on internal thinking and truncating the output.
The rendering layer reuses the host’s MarkdownText primitive (GFM + $...$ / $$...$$ + KaTeX). Note that it is a React.memo component—at runtime it is an object, not a function—so availability checks via typeof === 'function' will not work.
The Client layer (client.js) registers the main panel (key wrongbook) and the sidebar.panellist entry. Locale strings live in locale/*.json, styles use the wqb- prefix, and only --dsw-alias-* / --dsw-radius-* theme tokens are used.
Known Limitations¶
- Recommendation results are stored per problem (“once per problem”) with no “Regenerate” entry point (this is intentional to avoid repetitive, drill-style repeated calls).
- The directory does not support custom sorting, and tags do not support renaming (renaming is equivalent to creating a new tag).
- This is a personal-use plugin with no CI or end-to-end tests; verification relies on host route behavior tests plus manual regression in a real DSH instance.
Use Cases¶
Ideal for students and teachers who need to systematically organize science exam mistakes, review by knowledge point, and leverage AI to generate variant problems. The plugin depends on DSH’s locale, webServer, connection, and llm services. The recommendation feature requires an available default model (agentDefaultModel has a value and llm can resolve it). If the model is unavailable, only the right-side recommendation card degrades; the mistake book itself remains fully functional.
Ecosystem Context¶
DSH’s philosophy is “everything is a plugin.” The community directory is an independent site with no official affiliation to DeepSeek or High-Flyer. This plugin is maintained by Mason233Hello; see the DSH Community Directory and GitHub for details.