rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:hollowfyh/dsh-plugin-doctor
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
插件体检与自动修复。当某个插件行在加载时发生冲突(apply 抛错、服务重复注册、依赖缺失等),DSH 会把它标记为 failed 并让它停摆,但整个宿主继续运行。本插件周期扫描 Loader 树:
failed 行时,调用官方 pluginManager.setPluginEnabled(id, false) 持久化禁用该行(写入 profile 的 cordis.patch.yml 并触发热重组),让其余插件照常工作;$DSH_HOME/plugin-doctor/incidents.jsonl,整份报告写入 report.json;/doctor 斜杠命令,随时手动体检。cordis.patch.yml 里给本行加 config)- id: plugin-doctor
name: 'dsh-plugin-doctor'
config:
autoFix: true # 默认 true:自动禁用加载失败的行
scanDelayMs: 3000 # 启动后延迟首次扫描的毫秒数
watchIntervalMs: 12000 # 运行期扫描间隔(0 = 只在启动时扫描一次)
maxFixesPerBoot: 3 # 单次启动最多自动修复的行数
package.json 依赖;dsh-plugin-manager 与插件清单模块,以及只读行(readOnlyReason);HMR transactions cannot be nested)自动重试,最多 6 次;report.json 每次扫描重写:
{
"at": "…",
"total": 199,
"active": 174,
"failed": [{ "entryId": "…", "moduleName": "…", "readOnlyReason": null }],
"dormant": [],
"fixed": [{ "entryId": "…", "result": { "application": "applied", "changed": true } }],
"skipped": [{ "entryId": "…", "reason": "…" }],
"errors": []
}
dormant = 启用但没有任何存活 fiber 的行(常见于模块导入失败),仅报告、不自动处理。
node test/smoke.mjs:假上下文下的 4 个场景(正常禁用 / 临时冲突重试 / autoFix 关闭 / 修复上限)。test/broken-plugin.mjs:故意在 apply 抛错的测试插件,可通过 patch 的 insert 行临时装载,验证端到端自动修复(实测通过:失败行被禁用并写入 disabled: true)。pluginManager.listPlugins()(带 readOnlyReason 与 fiberPhase),拿不到时直读 ctx.loader.entries() 并按 fiber.state 映射阶段。pluginManager.setPluginEnabled(entryId, false) —— 官方开关 API,写入 profile 的 cordis.patch.yml 并触发 HMR 重组。AsyncLocalStorage 上下文,runExclusive 会以 "HMR transactions cannot be nested" 拒绝修复。因此修复调用包在 hmr.executing.exit(callback) 里(临时清空事务上下文);拿不到该字段时回退直接调用。此路径已在桌面实例实测通过。failed fiber,只在 dormant 里出现;被 dormant 记录的模块需要人工检查模块名/依赖。lib/index.js 宿主侧插件实现
cordis.patch.yml 本 bundle 的插入行
test/smoke.mjs 假上下文冒烟测试
test/broken-plugin.mjs 端到端故障注入插件 CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。