Skip to content

Commit 7f90c6f

Browse files
committed
fix: allow clean-checkout validation without profile
1 parent ccf1c07 commit 7f90c6f

2 files changed

Lines changed: 34 additions & 11 deletions

File tree

‎scripts/lib/validate-brand-visual-quality.js‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,20 @@ function buildBrandVisualQualityChecks(ctx) {
8080
}
8181

8282
const profileRoot = path.join(ACTIVE_DEVCODEX_ROOT, 'profile')
83-
for (const [file, needle] of [
84-
['01-项目信息.md', '77-Skill'],
85-
['04-测试规范.md', 'V97'],
86-
['06-功能清单.md', 'brand-visual-quality'],
87-
['07-用户文档与契约规范.md', '品牌视觉质量契约']
88-
]) {
89-
const target = path.join(profileRoot, file)
90-
if (!fs.existsSync(target) || !fs.readFileSync(target, 'utf8').includes(needle)) {
91-
err(`[V97] active Profile missing ${needle}: ${file}`)
83+
if (fs.existsSync(profileRoot)) {
84+
for (const [file, needle] of [
85+
['01-项目信息.md', '77-Skill'],
86+
['04-测试规范.md', 'V97'],
87+
['06-功能清单.md', 'brand-visual-quality'],
88+
['07-用户文档与契约规范.md', '品牌视觉质量契约']
89+
]) {
90+
const target = path.join(profileRoot, file)
91+
if (!fs.existsSync(target) || !fs.readFileSync(target, 'utf8').includes(needle)) {
92+
err(`[V97] active Profile missing ${needle}: ${file}`)
93+
}
9294
}
95+
} else {
96+
console.log('[V97] active Profile corpus unavailable — repository consumers remain authoritative')
9397
}
9498
console.log('[V97] brand visual quality, runtime transition and Profile release authority controls checked')
9599
}

‎scripts/test-brand-visual-quality.js‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
'use strict'
33

44
const assert = require('assert')
5-
const { classifyBrandVisualEvidence } = require('./lib/validate-brand-visual-quality')
5+
const fs = require('fs')
6+
const path = require('path')
7+
const {
8+
buildBrandVisualQualityChecks,
9+
classifyBrandVisualEvidence
10+
} = require('./lib/validate-brand-visual-quality')
611

712
const complete = {
813
masterLineage: true,
@@ -19,4 +24,18 @@ assert.strictEqual(classifyBrandVisualEvidence({ ...complete, blockerDetected: t
1924
assert.strictEqual(classifyBrandVisualEvidence({ ...complete, reviewerVerdict: 'rejected' }), 'rejected')
2025
assert.strictEqual(classifyBrandVisualEvidence({ ...complete, blockerDetected: true, blockerResetComplete: true, reviewerVerdict: 'accepted' }), 'accepted')
2126

22-
console.log('✓ brand visual quality positive, incomplete, rejected and blocker-reset fixtures passed')
27+
const root = path.resolve(__dirname, '..')
28+
const cleanCheckoutErrors = []
29+
const cleanCheckoutChecks = buildBrandVisualQualityChecks({
30+
ROOT: root,
31+
ACTIVE_DEVCODEX_ROOT: path.join(root, '.nonexistent-active-root'),
32+
fs,
33+
path,
34+
read: file => fs.readFileSync(file, 'utf8'),
35+
err: message => cleanCheckoutErrors.push(message),
36+
console: { log() {} }
37+
})
38+
cleanCheckoutChecks.checkV97()
39+
assert.deepStrictEqual(cleanCheckoutErrors, [], 'clean checkout without active Profile must use repository consumers')
40+
41+
console.log('✓ brand visual quality positive, incomplete, rejected, blocker-reset and clean-checkout fixtures passed')

0 commit comments

Comments
 (0)