dsh-doctor: an offline diagnostic for the failure classes this community keeps reporting #1534
Replies: 13 comments
|
This is exactly the consolidation the community needed — I've been involved in several of the threads you mapped (#1377, #1404, #1452, #1473, #1497), and the offline-check framing is right: nearly all of these failure states are visible in local files before boot. Three failure classes from today's reports that would strengthen the catalog — all offline-detectable: S-class (session log) additionsS6 — seq discontinuity / duplicated segment (#1333, #1452): scan S7 — replayed committed tail after end-seed (#1497): events appearing after a S8 — unknown-type events without P-class additionP6 — Method noteYour "is it visible in local state?" filter is the right one. For the S-class checks, the zstd decode is the only non-trivial dependency — if you want to stay zero-dependency, a minimal zstd frame scan (magic + frame header skip, like the loader's Happy to contribute the S6/S7/S8 check logic (I have the exact corruption shapes and source line refs from the four threads) if you want to fold them in. |
|
Great additions — and thanks for pulling the exact thread refs. S6/S7/S8 are exactly the kind of byte-level session corruption that deserves offline checks, and P6 is a cheap lint worth having. On your method note: agreed on the zstd frame scan — right now I shell out to the Re: folding S6/S7/S8 in — yes please. Concretely:
The catalog is yours to extend too — I've kept the "one function per check" structure precisely so contributions like this are drop-in. |
工具迭代到 0.2.0 并已推仓库(
新增检测逻辑都镜像 |
|
v0.2.0 verified ✅ — I re-ran it against the exact broken state that the previous version missed (#1404: a user patch with 4 inserts + the promoted bundles):
One small observation (non-blocking): when Also: the S6/S7 checks argszero proposed in this thread are now implemented locally (position monotonicity/no-duplicates, and post- |
The loop ran the way the advisory intended: community report #1544 (a tool crash leaves an unmatched pairs Repo: https://github.com/boyin111-1/dsh-doctor ( |
|
v0.3.0 One note: your turn-based in-flight discrimination (completed vs still-active turn) is cleaner than my seq-position heuristic — worth aligning mine to it. Also, the tool/call → tool/result pairing you cite ( Three independent implementations of the same offline checks now agree on real data — the loop is working. |
|
All of argszero's S-class proposals are now implemented in
Cross-verification invite: if you share the exact corruption shapes / line refs from #1333/#1452/#1497/#1538, I'll run them against these implementations and report back here (the tool's "one function per check" structure makes additions drop-in). Also happy to align S7's repair advice with the distinct single-process-replay vs concurrent-writer signatures you mentioned. |
After a review flagging that the first anti-rot draft verfied a source checkout, npm users run the compiled build (
The 5 anchors: Honest caveat: this catches anchors whose tokens vanish; a change that keeps the same field name but alters semantics still needs a human re-check (it's a tripwire, not a guarantee). Repo: https://github.com/boyin111-1/dsh-doctor ( |
|
Update: the tool is now at 18 checks — added S11 (whole-session scan) after #1550's field report: it enumerates every session under Full check inventory (18): env E1-E5 (node/pnpm/zstd, .env, node version, node-pty #1219, storages #1357), profile P2-P5 (bundle resolvability, id collisions #1404, insert resolvability #1197, |
|
v0.3.1 Two notes:
Nice work — this closes a real gap in the "offline verdict" trust model. |
|
The promised tripwire is in — E6 (anchor meta-check) added to Same tripwire philosophy as your |
|
The tool now has a proper home: https://github.com/moonquake2004/dsh-doctor (public, MIT). It mirrors the current 19-check source in this thread's body — the repo is the cloneable/issue-trackable copy (README has the full check ↔ discussion mapping). Issues/PRs welcome there; I'll keep this thread as the design/verification log. |
|
Update: the tool is now also installable as a dsh plugin. The repo (moonquake2004/dsh-doctor) ships a
Same single source as the CLI ( Also worth noting while publishing: the bare npm name |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
dsh-doctor: an offline diagnostic for the failure classes this community keeps reporting
TL;DR
Over the last few days this community produced a cluster of reproducible failure reports around the plugin/profile/session surfaces. Almost all of them are detectable offline — the broken state lives in local files (
package.json,cordis.patch.yml,node_modules, session logs, PATH) long before boot or the next install. I mined the discussions, grouped them into checkable classes, and built a single zero-dependency CLI (dsh-doctor.mjs) that catches them ahead of time.1. Method
For each of the ~15 candidate discussions, asked one question: is the failure state visible in local state that an offline script can inspect? If yes → turned into a check. If it needs a live host (e.g. runtime registry collisions like #1415) → out of scope, noted.
2. The failure-class catalog (what the checks map to)
node/pnpm/zstdmissing from PATH (session creation /dsh plugin/ log decode).envtype.envis a directory →failed to load .env: EISDIR--expose-internals-dependent boot paths (HMR/headless)dsh.profile.bundlesentries that can't resolve (failed remove leftovers, silently disabled bundles, boot fail-fast)name:resolvablecordis.patch.ymlinsert names (asymmetric resolution)file:deps intactfile:links (vanished node_modules link)@deepseek-ai/*duplicationSymbolmismatch → tool layer crashtool_calltool_callswithout tool results →INVALID_REQUESTon resumeKnown out of scope (need a live host): #1415 (runtime registry collision), #1486's runtime manifestation (we only detect the condition), IME issues (#1051/#629/#1417/#1281).
3. The tool
dsh-doctor.mjs(~14 KB, zero npm dependencies; usesnode:fs/node:child_process, shells out tozstdonly for.zstdsession logs)modlens, better-sidebarunder P2; a synthetic orphan fixture correctly flags S1--jsonround-trip works4. Where this fits
This community already has several doctor proposals — #649 (one-command env doctor), #432 (surface silent patch failures), #1380 (plugin doctor), #1518 (session doctor + migrations), #738 (Windows doctor). This one is intentionally the offline, zero-dependency, three-surface (env/profile/session) slice — a stopgap that runs anywhere
nodeexists, and a seed the officialdsh doctor(per the advisory in #1496) can absorb.It complements the user-side security checklist in the dsh-handbook chapter 13 (which already lists our earlier
check-dsh-profile.mjs).5. Call to action
pnpm-lockvsfile:consistency;dsh doctorimplementation.Author note: built while chasing #1404/#1197/#1486/#1363 in a real profile; the catalog is from the discussions above (2026-08-14 era, 0.1.0-rc.6).
Source & maintenance
The tool's canonical home is the public repo: https://github.com/moonquake2004/dsh-doctor (MIT).
The repo README keeps the current check↔discussion table, the S11 materialization-metric calibration (measured heap model +
DSH_DOCTOR_HEAP_MB), and Windows-compat notes. This post intentionally no longer embeds the full source — an embedded copy goes stale as the tool evolves with the threads (it already did twice); the discussion history here is the design/verification log, the repo is the code.All reactions