dev-manager-tauri/src-tauri/resources/onboarding/.claude/hooks/blueprint-gate.cjs
lanrtop 1672b071e4
All checks were successful
Push & PR Check / check (push) Successful in 51s
Push & PR Check / check (pull_request) Successful in 51s
feat(onboarding/upgrade-channel): 全托管文件升级通道 + 批量重分发(U1)
三档升级语义落地:envoy.md/blueprint-gate.cjs 切全托管
(内容不一致即覆盖,CRLF 归一化防抖动),文件头加托管声明;
verify_onboarding 第 7 项「lefthook 检查段齐全」从内嵌模板自省
键集合,零硬编码;MCP apply_onboarding_pack 缺省 project_id
时批量分发全部已登记项目,替代 batch_apply.py 手摇脚本。

Rules-Applied: R06,R07

Feature-Confirmed: true
2026-07-15 14:20:22 +09:00

33 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env node
// 由炼境托管:重跑接入包会用最新模板覆盖本文件,请勿在此做项目定制。
// 蓝图门控pre-commit 检查未关闭的 🔵 任务卡warn onlyexit 0不阻断提交
const fs = require('fs');
const path = require('path');
const modulesDir = path.join(process.cwd(), '.blueprint', 'modules');
if (!fs.existsSync(modulesDir)) {
process.exit(0);
}
const unclosed = [];
for (const file of fs.readdirSync(modulesDir).filter(f => f.endsWith('.md'))) {
const content = fs.readFileSync(path.join(modulesDir, file), 'utf8');
for (const line of content.split('\n')) {
if (line.startsWith('### 🔵')) {
unclosed.push({ file, title: line.replace(/^###\s*🔵\s*/, '').trim() });
}
}
}
if (unclosed.length > 0) {
process.stderr.write('\n⚠ 蓝图门控:发现未关闭任务卡\n');
for (const { file, title } of unclosed) {
process.stderr.write(` 🔵 ${title}${file}\n`);
}
process.stderr.write('\n 已完成 → 改为 ✅;仍进行中 → 属预期,可忽略本提示。\n\n');
}
process.exit(0);