diff --git a/deploy/check-deploy-drift.mjs b/deploy/check-deploy-drift.mjs index 9bae176..adfc624 100644 --- a/deploy/check-deploy-drift.mjs +++ b/deploy/check-deploy-drift.mjs @@ -238,7 +238,15 @@ function checkHost(spec) { if (!existsSync(repoDir)) return fail('仓库插件目录存在', repoDir), result; if (!existsSync(linkPath)) return fail('已部署(current 存在)', `未部署:${linkPath}`), result; - // ① 内容:快照 vs 仓库(四个宿主同一套) + // ① 内容:快照 vs **仓库工作区当前内容**(四个宿主同一套) + // + // ★ 比的是工作区**当前**内容,不是 git HEAD —— 仓库脏(未提交的改动)时 + // 这条判据照样会绿。实证(2026-09-14):`pool.mjs` 里有一行未提交的 + // `let missingSessionCount = 0;`(模块顶层、无人读),被 17:20 那次 + // 「从脏工作区做的」快照原样带进了生产,而这条判据当时报的是「逐字节一致」 + // —— 工作区与快照确实一致,只是两者都不等于 HEAD。判据没错,是它的**量纲** + // 只覆盖「仓库→快照」这一跳,覆盖不到「HEAD→工作区」那一跳。 + // 想连那一跳一起判,得单独比 `git diff --stat`,别指望这一条。 const d = diffTrees(collectFiles(repoDir), collectFiles(linkPath)); const { runtimeDrift, docDrift } = diffSummary(d); if (runtimeDrift === 0) { @@ -567,7 +575,7 @@ function main() { for (const c of layout) console.log(` ${c.ok ? '通过' : '失败'} ${c.name}${c.note ? ' — ' + c.note : ''}`); const stale = results.filter(r => r.stale); console.log(`\n 结论:${stale.length === 0 ? '四个宿主都在跑当前代码' : `${stale.length} 个宿主需要重新部署/重启`}`); - for (const r of stale) console.log(` ✗ ${r.host}:node deploy/redeploy-plugin.sh ${r.host}`); + for (const r of stale) console.log(` ✗ ${r.host}:bash deploy/redeploy-plugin.sh ${r.host}`); } process.exit(results.some(r => r.stale) || layoutBad.length ? 1 : 0); }