Lines 121-161javascript
121 if (!actual || !expected) return false;
123 return expected.split('&&').every((part) => {
124 const expectedPart = normalizeVerificationCommand(part);
125 if (!expectedPart) return true;
126 if (actual.includes(expectedPart)) return true;
127 // 包管理器别名归一化:pnpm test = npm test = bun test = yarn test
128 const actualNorm = normalizePackageManager(actual);
129 const expectedNorm = normalizePackageManager(expectedPart);
130 if (actualNorm.includes(expectedNorm)) return true;
131 // npm test is an acceptable broader reproduction for node --test based methods.
132 if (expectedPart.startsWith('node --test') && actualNorm.includes('<PM> test')) return true;
137// ─── doctor ────────────────────────────────────────────
138// 全面健康检查:一致性 + 孤儿引用 + 循环依赖 + 僵尸 Intent
140// 每种 issue 类型的修复提示——给 Agent 行动化建议
142 intent_map_unreadable: '检查 .loom/v{N}/04_INTENT_MAP.json 是否合法 JSON(jsonlint.com 或 node -e "JSON.parse(require(\'fs\').readFileSync(\'04_INTENT_MAP.json\'))")',
143 intent_map_missing: '运行 loom init 或 loom activate architect 产出 04_INTENT_MAP.json',
MediumDynamic Require
Package source references dynamic require/import behavior.
cli/src/diagnostics.jsView on unpkg · L141 144 intent_map_template: '运行 loom activate architect,Architect 填充真实 Intent Map 后删除 _meta._template 标记',
145 intent_map_invalid: '按报错信息修正 04_INTENT_MAP.json 里对应字段(补 title / 加长 acceptance / 填必填字段)',
146 completed_no_record: '在 .loom/v{N}/verifications/ 下补验证记录,或运行 loom verify pass {id} --summary "..."',
147 in_progress_no_record: '运行 loom verify pass {id} --summary "..." 写入验证记录,或 loom intent update {id} --status pending 回退',
148 orphan_philosophy_ref: '检查 04_INTENT_MAP.json 里 {id} 的 philosophy_anchors,移除或修正不存在的哲学文件引用',
149 orphan_dependency: '检查 04_INTENT_MAP.json 里 {id} 的 depends_on,移除或修正不存在的 Intent ID',
150 cycle: '打破循环:把循环链中某个 Intent 的 depends_on 里去掉前驱,或拆成更小的 Intent',
151 zombie: '检查 {id} 是否还需要——不需要就 loom intent update {id} --status completed 或 blocked',
152 completed_depends_blocked: '检查依赖 {dep} 为什么 blocked——解决阻塞或把 {id} 回退到 in_progress',
153 test_script_missing: '在 package.json 里加 test 脚本,或修正 verification_method 指向实际存在的测试命令',
154 verification_method_unverified: '运行 loom verify pass {id} --summary "..." --reproduction-command "..." 覆盖声明的验证方式',
155 verification_method_drift: '验证记录的 reproduction_command 要覆盖 verification_method 声明的命令(支持 npm/pnpm/bun 互相等价)',
156 inspiration_source: '在哲学文档的"灵感来源"章节填入至少 3 个源(- **源名** — 理由。来源:URL 或 file:// 或 local:./path)',
157 part_decomposition: '在哲学文档加"实现部分清单"章节,按 PART_DECOMPOSITION.md 拆解实现部分(- **部分名** 格式)',
161 * 给 issue 补 fix_hint——把 {id} {dep} 等占位符替换成实际值。