|
29 | 29 | * V25~V27 ECR/RecordRouter/SCV 与 active-root 落点边界语义 |
30 | 30 | * V28 Support skills / progress / release verification sync(执行契约、测试路由、发布验证与进度强触发) |
31 | 31 | * V29 Hook visible reply / sticky project / intent expansion sync(Stop 三态、workspace profile 路径、意图扩展摘要) |
| 32 | + * V30~V34 规范资产漂移收敛(resume 顺序 / PC5 部署面 / audit-state / audit 收敛 / contributing 模板) |
32 | 33 | * |
33 | 34 | * Exit: 0=OK, 1=error, 2=warnings only |
34 | 35 | */ |
@@ -542,9 +543,10 @@ function checkV8() { |
542 | 543 | const codexRuntime = path.join(codexDir, 'hooks', '_runtime', 'lifecycle.cjs') |
543 | 544 | if (fs.existsSync(codexRuntime)) { |
544 | 545 | try { |
| 546 | + const probePrompt = `in ${path.basename(ROOT)}/ validate DevCodex Codex bootstrap` |
545 | 547 | const out = execSync('node ./.codex/hooks/_runtime/lifecycle.cjs', { |
546 | 548 | cwd: PARENT, |
547 | | - input: JSON.stringify({ hookEventName: 'UserPromptSubmit', prompt: 'validate DevCodex Codex bootstrap' }), |
| 549 | + input: JSON.stringify({ hookEventName: 'UserPromptSubmit', prompt: probePrompt }), |
548 | 550 | encoding: 'utf8', |
549 | 551 | stdio: ['pipe', 'pipe', 'pipe'] |
550 | 552 | }) |
@@ -1980,6 +1982,132 @@ function checkV29() { |
1980 | 1982 | console.log('[V29] Hook visible reply / sticky project / intent expansion sync checked') |
1981 | 1983 | } |
1982 | 1984 |
|
| 1985 | +function checkV30() { |
| 1986 | + const file = 'skills/routing/SKILL.md' |
| 1987 | + const content = read(path.join(ROOT, file)) |
| 1988 | + for (const needle of ['先读今日 tasks/YYYYMMDD.md', '再读 Agent SUMMARY.md']) { |
| 1989 | + if (!content.includes(needle)) { |
| 1990 | + err(`[V30] resume restore ordering drift in ${file}: missing "${needle}"`) |
| 1991 | + } |
| 1992 | + } |
| 1993 | + if (content.includes('RESTORE → 先读 Agent SUMMARY.md')) { |
| 1994 | + err(`[V30] legacy resume restore ordering remains in ${file}`) |
| 1995 | + } |
| 1996 | + console.log('[V30] resume restore ordering sync checked') |
| 1997 | +} |
| 1998 | + |
| 1999 | +function checkV31() { |
| 2000 | + const probes = [ |
| 2001 | + 'instructions/17-compliance.instructions.md', |
| 2002 | + 'prompts/precheck-status.prompt.md', |
| 2003 | + 'skills/audit-common/SKILL.md', |
| 2004 | + 'website/docs/specs/precheck-flow.md', |
| 2005 | + 'website/docs/specs/flowcharts.md' |
| 2006 | + ] |
| 2007 | + const required = ['.github/', '.claude/', 'AGENTS.md', '.agents/', '.codex/'] |
| 2008 | + const forbidden = ['.claude/.github/', '父链 `.claude/.github/`', '无父链 .claude/.github/'] |
| 2009 | + |
| 2010 | + for (const file of probes) { |
| 2011 | + const content = read(path.join(ROOT, file)) |
| 2012 | + for (const needle of required) { |
| 2013 | + if (!content.includes(needle)) { |
| 2014 | + err(`[V31] PC5 deployment surface drift in ${file}: missing "${needle}"`) |
| 2015 | + } |
| 2016 | + } |
| 2017 | + for (const needle of forbidden) { |
| 2018 | + if (content.includes(needle)) { |
| 2019 | + err(`[V31] legacy PC5 deployment wording remains in ${file}: "${needle}"`) |
| 2020 | + } |
| 2021 | + } |
| 2022 | + } |
| 2023 | + |
| 2024 | + const complianceContent = read(path.join(ROOT, 'instructions/17-compliance.instructions.md')) |
| 2025 | + if (!complianceContent.includes('### PC5 部署体状态(v1.11.0+,全模式基础项)')) { |
| 2026 | + err('[V31] PC5 section heading in instructions/17-compliance.instructions.md must be v1.11.0+') |
| 2027 | + } |
| 2028 | + |
| 2029 | + const auditCommonContent = read(path.join(ROOT, 'skills/audit-common/SKILL.md')) |
| 2030 | + if (!auditCommonContent.includes('【v1.11.0+ 父链部署体扫描】')) { |
| 2031 | + err('[V31] audit-common parent deployment heading must be v1.11.0+') |
| 2032 | + } |
| 2033 | + for (const needle of ['.claude/{instructions,skills,prompts,agents,hooks}/', '.github/{instructions,skills,prompts,agents,hooks}/']) { |
| 2034 | + if (!auditCommonContent.includes(needle)) { |
| 2035 | + err(`[V31] audit-common parent deployment scan missing "${needle}"`) |
| 2036 | + } |
| 2037 | + } |
| 2038 | + |
| 2039 | + console.log('[V31] PC5 deployment surface sync checked') |
| 2040 | +} |
| 2041 | + |
| 2042 | +function checkV32() { |
| 2043 | + const probes = [ |
| 2044 | + { |
| 2045 | + file: 'instructions/12-audit.instructions.md', |
| 2046 | + required: ['<audit-root>/.audit-state/<session-id>.json', '<audit-root>/.audit-state/*.json', '取值与 active-root 一致'], |
| 2047 | + forbidden: ['`.devcodex/.audit-state/<session-id>.json`', '扫描 `.audit-state/*.json`'] |
| 2048 | + }, |
| 2049 | + { |
| 2050 | + file: 'skills/audit-session/SKILL.md', |
| 2051 | + required: ['<audit-root>/.audit-state/<session-id>.json', '<audit-root>/.audit-state/', '<audit-root>/.audit-state/*.json'], |
| 2052 | + forbidden: ['在 .devcodex/.audit-state/<session-id>.json 持久化', '`.devcodex/.audit-state/` 目录由本 Skill 首次写入时创建', '扫描 `.devcodex/.audit-state/*.json`', '读取 `.devcodex/.audit-state/` 下所有 `.json`'] |
| 2053 | + } |
| 2054 | + ] |
| 2055 | + |
| 2056 | + for (const probe of probes) { |
| 2057 | + const content = read(path.join(ROOT, probe.file)) |
| 2058 | + for (const needle of probe.required) { |
| 2059 | + if (!content.includes(needle)) { |
| 2060 | + err(`[V32] audit-state active-root drift in ${probe.file}: missing "${needle}"`) |
| 2061 | + } |
| 2062 | + } |
| 2063 | + for (const needle of probe.forbidden) { |
| 2064 | + if (content.includes(needle)) { |
| 2065 | + err(`[V32] legacy audit-state wording remains in ${probe.file}: "${needle}"`) |
| 2066 | + } |
| 2067 | + } |
| 2068 | + } |
| 2069 | + |
| 2070 | + console.log('[V32] audit-state active-root sync checked') |
| 2071 | +} |
| 2072 | + |
| 2073 | +function checkV33() { |
| 2074 | + const probes = [ |
| 2075 | + 'instructions/16-report.instructions.md', |
| 2076 | + 'skills/report/SKILL.md', |
| 2077 | + 'prompts/report-audit.prompt.md' |
| 2078 | + ] |
| 2079 | + |
| 2080 | + for (const file of probes) { |
| 2081 | + const content = read(path.join(ROOT, file)) |
| 2082 | + if (!content.includes('连续 3 轮零发现')) { |
| 2083 | + err(`[V33] audit convergence wording drift in ${file}: missing "连续 3 轮零发现"`) |
| 2084 | + } |
| 2085 | + if (content.includes('R{N}+R{N+1}')) { |
| 2086 | + err(`[V33] legacy audit convergence wording remains in ${file}`) |
| 2087 | + } |
| 2088 | + } |
| 2089 | + |
| 2090 | + console.log('[V33] audit convergence wording sync checked') |
| 2091 | +} |
| 2092 | + |
| 2093 | +function checkV34() { |
| 2094 | + const file = 'prompts/contributing.prompt.md' |
| 2095 | + const content = read(path.join(ROOT, file)) |
| 2096 | + |
| 2097 | + for (const needle of ['<install-command>', '<dev-command>', '<test-command>', '若项目提供行为准则文件']) { |
| 2098 | + if (!content.includes(needle)) { |
| 2099 | + err(`[V34] contributing template missing generalized placeholder text: ${needle}`) |
| 2100 | + } |
| 2101 | + } |
| 2102 | + for (const needle of ['pnpm install', 'pnpm dev', 'pnpm test', 'pnpm test:unit', 'pnpm test:coverage', 'CODE_OF_CONDUCT.md']) { |
| 2103 | + if (content.includes(needle)) { |
| 2104 | + err(`[V34] contributing template still hardcodes project-specific text: ${needle}`) |
| 2105 | + } |
| 2106 | + } |
| 2107 | + |
| 2108 | + console.log('[V34] contributing template assumptions checked') |
| 2109 | +} |
| 2110 | + |
1983 | 2111 | function checkV7b() { |
1984 | 2112 | try { |
1985 | 2113 | execSync('node scripts/test-instruction-fallback-check.js', { cwd: ROOT, stdio: 'pipe', encoding: 'utf8' }) |
@@ -2020,6 +2148,11 @@ checkV26() |
2020 | 2148 | checkV27() |
2021 | 2149 | checkV28() |
2022 | 2150 | checkV29() |
| 2151 | +checkV30() |
| 2152 | +checkV31() |
| 2153 | +checkV32() |
| 2154 | +checkV33() |
| 2155 | +checkV34() |
2023 | 2156 |
|
2024 | 2157 | console.log('') |
2025 | 2158 | if (errors.length) { |
|
0 commit comments