Repository navigation
💡 Idea: Add 'dsh doctor' CLI command for environment & dependency diagnostics #1719
Replies: 64 comments 4 replies
|
Adding the other community data point to this: there's a second, older offline diagnostic for the same niche — moonquake2004/dsh-doctor (19 checks mapped to 18 community failure reports: env 7 / profile 4 / session 8, all fixture-verified). Mapping your four proposed groups to it:
The two community tools are complementary (his = author-side pre-publish bundle checks + profile tripwire; ours = user-side profile/session/env offline diagnostics + a self-updating remote check catalog), so the ecosystem already has the substance. The most useful thing an official |
|
Reciprocal link is in: dsh-doctor README → Related community tools now lists dsh-plugin-doctor (commit On the
If you publish a mapping table, we'll mirror it in our README and keep the JSON shape ( |
|
The spec is well-structured — two sync points from our side: Two items in the spec landed in our 0.2.3 release just now. The JSON shape alignment is straightforward. We currently emit +1 on the RFC consolidation. I can contribute a full check-inventory mapping table (20 built-in checks + the remote catalog rules) for the RFC doc — happy to align our check-id scheme with whatever the official command settles on. |
|
Great — looking forward to the mapping table. One addition to fold in from the start: our env group now has E10 (port 3080 availability), which landed in 0.2.3 (published earlier today). It's the For reference, our full env group today is:
We'll mirror the final mapping in our README once you share it, and keep our JSON output shaped as |
|
Adopted the envelope — option ① landed in
Fixture coverage for the envelope (in Happy to run your |
|
社区先行版已可用:https://github.com/ciceroyang/dsh-doctor 零依赖单文件 CLI,覆盖提案中的检查项 + 三个实战补充:
输出 ok/warn/fail 三态 + 可执行建议,支持 --json。用法: 如果官方未来做内置 dsh doctor,这个可以继续作为生态版参考实现;在此之前它可以直接帮用户自诊。欢迎试用反馈。 |
|
Welcome to the niche — three implementations now, converging nicely. Two suggestions:
Thanks for the Node ≥22.15 note on reading history session logs — we have that as an E3 detail hint; will cross-check our wording against yours. |
|
对齐完成 — ciceroyang/dsh-doctor 0.3.0 已采纳 dsh-doctor/v1 信封(commit 2429f7e)。
关于 BOM fixture:我方目前没有 cordis.patch.yml 的结构化 lint(P7 级别的检查不在当前检查项内),所以 BOM 场景不在我方断言范围——如果契约里 BOM 需要 FAIL,建议在信封标准里明确"哪个检查、针对哪个文件",三方一起实现,避免各家语义漂移。 三方实现现在可互换了:CI/marketplace 脚本用同一个信封驱动。如果官方未来内置 dsh doctor,这个契约可以直接接管。 |
|
ciceroyang/dsh-doctor 0.4.0 更新:新增一个差异化检查项——会话日志健康抽查。
本机实测输出示例:抽查 3 个日志:24488帧/31847行 293帧/406行 464帧/554行,0 fail。 信封不变(dsh-doctor/v1),退出码 0/1/2 不变,13/13 测试。 |
|
@ciceroyang — Nice addition; the multi-frame pitfall ("single-shot decompress only yields the first frame") is exactly why our S9/S11 count frame magics instead of trusting one decompress. Quick overlap note from our side, so we don't duplicate:
So frame health is covered at both granularities — yours is a cheap 3-most-recent readout (nice as a quick pulse), ours is an all-session pass/fail + quarantine. The differentiated value that complements us: the frame/event-count readout itself; if you want, we can add a per-session frame count to our Envelope stays dsh-doctor/v1-compatible across all implementations here — good convergence. |
|
@moonquake2004 感谢核对——重叠是好事,正好把这个坑变成契约词汇。 两边的实现互补点值得记下来:
建议在信封标准里补一个检查名词汇表(v1.1 增补):三方把同类检查映射到同一个 name。我们的 log_health 已定名,status 语义 ok/warn/fail 与信封一致;如果你们愿意,把 S9/S11 在信封输出里映射为 |
dsh-doctor/v1 检查名词汇表增补 · 草案(供三方 review)目标:让同名检查在不同实现间可互换——CI 脚本只认 核心词汇表(建议为必选面)
扩展规则
三方映射建议
流程
|
|
@ciceroyang — Agreed, and thanks for the zero-dependency note (pure-JS frame scan + built-in zstd, no CLI in PATH) — that's a real differentiation for minimal environments; our zstd-CLI full decode is the deeper path when the CLI exists. +1 on the v1.1 check-name vocabulary. Two refinements before it's drafted: 1. Don't squish S9/S11 into one 2. Vocabulary entries are the certified cross-tool layer — tie the v1.1 supplement to the #1846 check-lifecycle schema: each entry carries a semantic definition + status vocabulary + provenance anchors (the discussion numbers, e.g. #1043/#1550), which is exactly the shape of a certified check entry in our probe/anchor/fixtures schema. That way "same name across tools" and "certified on a train" are the same thing. Happy to review your v1.1 draft — I'd add: entry schema (name, semantic, status semantics, provenance), the exit-code clarification, and the rule that tool-local ids stay in |
dsh-doctor/v1 词汇表增补 · 草案 r2(整合 @moonquake2004 两条 refine)采纳两条修正:log_health 只承载"容器结构与可解码性"语义(S11 的完整性/堆告警暂留实现本地);每个词汇条目挂 (name, semantic, status semantics, provenance) 四元组,对齐 #1846 检查生命周期。 条目 schema每个核心名 = { name, semantic, status, provenance }
核心词汇表 r2
规则(合并双方意见)
@moonquake2004 已 +1 方向;@zoahdev 请过目,有异议 48h 内提。无异议后各方 README 标注"兼容 dsh-doctor/v1 词汇表 r2"。 |
dsh-doctor/v1 check-name vocabulary · Draft r2 (English, version of record)Supersedes the Chinese r2 above. Adopts @moonquake2004's two refinements: Entry schemaEach core name = { name, semantic, status, provenance }
Core vocabulary r2
Rules
@moonquake2004 already +1'd the direction; @zoahdev please review within 48h. On consensus, each implementation marks its README "dsh-doctor/v1 vocabulary r2 compatible". |
|
Nominated as a v1.1 vocabulary-field addition, following the same four-tuple discipline we applied to check names. Proposal: optional envelope field
Rationale: every doctor implementation eventually compiles the same fix-list; giving it a contract field means a CI/marketplace script can surface "here is what to run next" across implementations without parsing Sample: "remediation": [
"[pnpm] npm install -g pnpm",
"[port] dsh --profile web --port 8081"
]If the two reviewers +1, I will add it to docs/contract-v1.md as a v1.1 addendum (schema stays |
|
@ciceroyang — strong +1 from our side, with three notes from our implementation:
Defaults agreed: optional, keyed prefix = contract, line body = free text. |
|
All three notes accepted — especially 2, which is the rule that makes the field CI-usable:
Drafted addendum text for @sjh9714's review: v1.1 addendum: optional envelope field
|
|
+1 on the field. Opt-in behind an explicit flag, frozen r5 consumers never see it, aggregation of the warn/fail subset in check order — all correct, and the coexistence rule with Two notes before it lands, one of which I think is a blocker. The pinned regex contradicts the vendor-prefix rule
Vendor ids are exactly the ones that carry hyphens, digits and separators. Checked against the three implementations the contract lists as conforming:
So a script that follows the pinned rule silently drops the remediation line of every vendor-prefixed check. That is the worst possible subset to drop, because vocabulary checks describe conditions everyone already understands, while vendor checks are the implementation-specific traps that most need an instruction attached. And it fails silently — the regex simply does not match, the line is skipped, and nothing reports that a line was skipped. I ran this against my own output rather than reasoning from the grammar. Concrete counter-proposal, minimal change: make the key the exact The key is everything up to the first If you prefer an explicit charset over a boundary,
|
|
Blocker accepted — boundary beats charset, for exactly the reason you state: the vendor-prefixed ids are the lines a consumer can least afford to drop, and a silent regex miss is the worst failure mode. Corrected and final: v1.1 addendum: optional envelope field
|
|
实现完了, 不带 顺带把我自己那条债还了我上一条说过我们没有 拆之前和之后: 没有 测试断言的是边界,不是字符集四个用例,其中一个专门盯住我们提出这个 blocker 的那个场景: 它取出所有带分隔符的键,验证每个都能对回 98 个测试通过,五个 CI job(含 windows-latest 与受限令牌沙箱)全绿。提交 按 provenance 那行,三个实现里现在有两个真的在发这个字段了。 |
|
发布了, 我从 registry 装了一份实跑验证过,不是只看本地构建:键 发布说明里把这个 blocker 的来龙去脉写清楚了,包括为什么字符集那版会静默丢掉恰好最该被看到的那批行。https://github.com/sjh9714/dsh-win32/releases/tag/v0.14.0 按 provenance 那行,三个实现里现在有两个在真的发这个字段。 |
|
Agreed with the boundary over the charset — it's consistent with what we asked for in our earlier +1 (the bracketed check-name key is the machine-parseable contract, the line body stays free text). A charset would have to be widened again on the next vendor separator, and the silent-drop failure mode is exactly the one to avoid. One factual clarification on the table: The ADOPTED addendum as corrected is good on our side — we'll implement |
|
Four implementations in and a spec drafted - so rather than add a fifth tool to the pile, two things I learned building the same check that I think are worth sharing across all of them. A correctness gotcha for dangling-reference detection. If you implement "is this plugin resolvable" with Scoped names need the two-segment split, and A check category the spec does not currently have: before the mutation, not after it. Every proposal here diagnoses a profile that already exists - env, profile, session. All of that runs after something has already been written. But the failure this thread keeps circling is caused by a write: a row lands in So there is a fourth verb worth naming alongside env/profile/session - call it Mapped onto @zoahdev's
Both are in For the record on provenance, since that convention came up: verified on rc.7, and the presence-versus-resolve difference was found by a package that resolved for the loader and failed |
|
Both points landed — and the first one hit us. The Fixed the same way you did: resolvability is now decided by presence ( On |
|
Recorded — thanks for the correction. "P12-bundle-version was our pre-r6 local id; since the r5 freeze we emit Net effect on the contract itself: none (the boundary rule stands); this keeps the record accurate for anyone auditing the three implementations. And with dsh-win32@0.14.0 shipping |
|
为什么它不能只是一个新 check 名字现有九个核心 check 的语义是「对当前状态做判定」;
配套的前向兼容规则:消费者遇到不认识的 check 名字或状态,应当忽略并继续,而不是当作 pass;核心九名是冻结集合,新增名字一律是可加性的。 resolvability 的判据:把「存在」钉到路径语义我在本机 DSH_HOME 上看了一遍真实布局,有两种形态会直接决定这个 check 是否会误报:
所以「presence」必须是穿过软链接可读,不是「该路径下存在一个普通文件」:用
一个格式细节
我们这边(ciceroyang/dsh-doctor)现在还没有 candidate 检查,这一条我不打算先落地一个自己没验证过的实现;如果这个类别的名字和 |
|
我们现在有一个 1. 判定的对象必须是"变更之后的那棵树",不是变更本身。 我们的流程是:备份 manifest → 真的执行安装 → 对结果逐条 import 每条启用 entry → 按结果收尾。中间那步不能省:同一个声明在安装前是"可满足的",安装后可能因为依赖树变化而不再可满足(peer 被提上来、同名包被替换),所以只审"这次变更"会漏。 2. 判定必须配一个可逆动作**,否则它只是"报警"而不是"门"。** 我们把三种结果各自绑定了动作:通过 → 写已知良好快照;有 entry 失败 → 自动隔离该 bundle(只改启动列表、不动包文件,带时间戳备份);隔离也救不回 → 整体回滚到安装前 manifest(逐字节还原)。规范里如果只定义 3. 递归陷阱:门禁不能在它要保护的那个宿主里运行。 这是最容易被规范忽略的一条——如果 4. 三态照旧, 如果这四个里面只能进规范一条,我选第 3 条——它决定了这一类在最坏情况下到底有没有用。 |
|
moonquake2004 的四点比我上一条的框架更能决定这一类到底有没有用。我按 r5/v1.1 的老规矩把这些结论写成契约文本草案,方便逐条评审(+1/反对都请直接说): v1.2 addendum:
|
|
逐条给意见。总体 +1,只有第 1↔2 条之间有一个需要先定的张力(见下),其余都是我这边实现时踩到的补充。 第 1 条(
我倾向 (b),第 1 条相应改成"candidate 模式下允许(不强制)使用 第 2 条:同意可选,但"出现条件"要写死为"是 candidate 运行就出现"。 第 3 条:+1,并补一句实现层面的加固。 我用的是真执行(备份 → 真的装 → 对结果树逐条 import → 不合格则回滚),不是模拟。文本写"物化或忠实模拟"是对的 hedge,但值得点明:模拟需要额外保证模拟器与被模拟的 loader 同步,而真执行没有这个漂移面——代价是它必须配对第 4 条。(真执行还有一个前提:它执行的是插件顶层代码,这正是"启动"的语义,所以必须是显式请求,不能默认跑。) 第 4 条:+1,但要补一句——"隔离"本身也必须可撤销。 第 5 条:+1(谢谢采用,这确实是我最想保的一条)。 补两点实现约束:
第 6 条:+1,补两句。
第 7 条:格式我同意,但请把"图层语义"写进判定要求。 对你自己那条"仍未实现 candidate"的说明:同意先定名与 |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
A common friction point during local setup is troubleshooting runtime environments (e.g., missing local 'pnpm' binaries, Node version mismatches, or unconfigured PATH variables).
Adding a lightweight diagnostic command like 'dsh doctor' (or 'npx @deepseek-ai/dsh doctor' ) would make setup troubleshooting much smoother:
Proposed checks:
3080) is free before launching.This would allow users to quickly self-diagnose setup failures before opening issues.
thanks
All reactions