Skip to content

Commit 5b7485f

Browse files
committed
fix: refresh skill portfolio and clear pack/validate hygiene blockers
Regenerate portfolio for V92 parity; strip comment-only requires from pack dependency scans; extract cli-console-utils so index.js stays under V93 budget; include the new module in package files and record unreleased notes.
1 parent 6917a2e commit 5b7485f

10 files changed

Lines changed: 73 additions & 46 deletions

changelogs/unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
## 当前未发布实现候选(2026-07-21)
77

8+
- 卫生包 O1 + 验证修复:刷新 `skills/portfolio.json`;V6/pack-clean 扫描忽略注释内伪 `require`;抽出 `cli-console-utils.js` 使 `index.js` 回到 V93 行预算;`package.json#files` 纳入该模块;台账 VL-010/012 时间线对齐;Profile CLI 脚本计数 154。验证:`generate-skill-portfolio --check``npm run test:core``npm run test:package-release`(40/40)、`npm run test:audit` 均 exit 0。
89
- Dependabot #17 / CVE-2026-13149:`website``overrides` 固定 `brace-expansion@5.0.7`GHSA-3jxr-9vmj-r5cp DoS);`npm audit` 清零。
910
- PF-173:Claude MCP 部署补齐 `scripts/lib` 运行时依赖 allowlist(`cp-digest.js` / `host-parity-scorecard.js`)→ `.claude/scripts/lib/`,与 `mcp/*.js``require('../scripts/lib/…')` 对齐;接入 `cmdInitClaude` + managed descriptors;`test-host-installation` / `test-mcp-servers` 回归。
1011
- 专家质量探针与实测标准收口:`MeasuredVerificationStandard` 写入 `compliance` SC14、`analyze-default` PCV-2a、`report``expert-output-quality``test-router``expertOutputQuality`);V84 增加 raw-text 最小锚点区分力(防止 canonical reader 掩盖完全缺失),修正 profile skillCount 探针,不再要求所有薄消费者堆完整 Gate 长清单。

index.js

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,9 @@ const {
3939
resolveActiveRuntimeRoot: sharedResolveActiveRuntimeRoot,
4040
resolveProfileDir: sharedResolveProfileDir
4141
} = require('./hooks/_runtime/workspace-layout.cjs')
42-
43-
// ─── Tiny ANSI helpers ────────────────────────────────────────────────────────
44-
const c = {
45-
green: s => `\x1b[32m${s}\x1b[0m`,
46-
yellow: s => `\x1b[33m${s}\x1b[0m`,
47-
cyan: s => `\x1b[36m${s}\x1b[0m`,
48-
red: s => `\x1b[31m${s}\x1b[0m`,
49-
bold: s => `\x1b[1m${s}\x1b[0m`,
50-
dim: s => `\x1b[2m${s}\x1b[0m`,
51-
}
52-
53-
// ─── Helpers ──────────────────────────────────────────────────────────────────
54-
55-
/** Walk a directory recursively, return all file paths */
56-
function walkDir(dir) {
57-
if (!fs.existsSync(dir)) return []
58-
const results = []
59-
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
60-
const full = path.join(dir, entry.name)
61-
if (entry.isDirectory()) results.push(...walkDir(full))
62-
else results.push(full)
63-
}
64-
return results
65-
}
42+
const { createAnsiHelpers, walkDir: walkDirFs } = require('./scripts/lib/cli-console-utils.js')
43+
const c = createAnsiHelpers()
44+
const walkDir = dir => walkDirFs(fs, dir)
6645

6746
// ─── Source directories (inside the npm package) ─────────────────────────────
6847
const PKG_ROOT = __dirname
@@ -90,9 +69,9 @@ const CLAUDE_SOURCES = [
9069
]
9170

9271
/**
93-
* MCP under `.claude/mcp/` resolves `require('../scripts/lib/…')` → `.claude/scripts/lib/…`.
94-
* Keep this allowlist tight: only modules actually required by `mcp/*.js` (today: memory + profile).
95-
* Do not ship the entire package `scripts/lib` tree into consumer projects.
72+
* Allowlist of scripts/lib modules deployed next to Claude MCP servers.
73+
* Keep tight: only modules actually required by mcp/*.js (today: memory + profile).
74+
* Do not ship the entire package scripts/lib tree into consumer projects.
9675
*/
9776
const CLAUDE_MCP_RUNTIME_SCRIPT_DEPS = Object.freeze([
9877
'scripts/lib/cp-digest.js',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@
186186
"scripts/lib/host-adapter-scope.js",
187187
"scripts/lib/grok-workspace-launcher.js",
188188
"scripts/lib/cli-host-utils.js",
189+
"scripts/lib/cli-console-utils.js",
189190
"scripts/lib/cli-runtime-utils.js",
190191
"scripts/lib/profile-bootstrap-utils.js",
191192
"scripts/lib/cli-install-commands.js",

scripts/lib/cli-console-utils.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict'
2+
3+
/** Shared ANSI helpers and recursive directory walk for CLI entry modules. */
4+
5+
function createAnsiHelpers () {
6+
return {
7+
green: s => `\x1b[32m${s}\x1b[0m`,
8+
yellow: s => `\x1b[33m${s}\x1b[0m`,
9+
cyan: s => `\x1b[36m${s}\x1b[0m`,
10+
red: s => `\x1b[31m${s}\x1b[0m`,
11+
bold: s => `\x1b[1m${s}\x1b[0m`,
12+
dim: s => `\x1b[2m${s}\x1b[0m`
13+
}
14+
}
15+
16+
function walkDir (fs, dir) {
17+
if (!fs.existsSync(dir)) return []
18+
const results = []
19+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
20+
const full = require('path').join(dir, entry.name)
21+
if (entry.isDirectory()) results.push(...walkDir(fs, full))
22+
else results.push(full)
23+
}
24+
return results
25+
}
26+
27+
module.exports = {
28+
createAnsiHelpers,
29+
walkDir
30+
}

scripts/lib/cli-install-commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ function buildCliInstallCommands(ctx) {
484484
}
485485
}
486486

487-
// 2b. MCP runtime script deps: .claude/mcp require('../scripts/lib/…') → .claude/scripts/lib/…
487+
// 2b. MCP runtime script deps: copy scripts/lib helpers for Claude MCP (mcp/*.js relative require path)
488488
for (const relRaw of CLAUDE_MCP_RUNTIME_SCRIPT_DEPS) {
489489
const rel = String(relRaw || '').replace(/\\/g, '/')
490490
if (!rel) continue

scripts/lib/deployment-descriptors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function buildDeploymentDescriptors(packageRoot, surfaces, {
4242
}
4343
if (selected.has('claude')) {
4444
descriptors.push(...CLAUDE_SOURCES.map(item => descriptor('claude', item.from, path.join('.claude', item.to))))
45-
// MCP runtime require('../scripts/lib/…') from .claude/mcp → .claude/scripts/lib/…
45+
// MCP runtime script deps for Claude: map package scripts/lib into .claude/scripts/lib
4646
for (const rel of CLAUDE_MCP_RUNTIME_SCRIPT_DEPS) {
4747
const portable = String(rel || '').replace(/\\/g, '/')
4848
if (!portable) continue

scripts/lib/validate-governance-package-deployment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ function buildGovernancePackageDeploymentChecks(ctx) {
8484
seen.add(file)
8585
const fullPath = path.join(ROOT, file)
8686
if (!fs.existsSync(fullPath)) return [file]
87+
// Strip line/block comments so doc examples like require('../scripts/lib/...') are not scanned.
8788
const content = read(fullPath)
89+
.replace(/\/\*[\s\S]*?\*\//g, '')
90+
.replace(/^\s*\/\/.*$/gm, '')
8891
const deps = []
8992
for (const match of content.matchAll(/require\(['"](\.{1,2}\/[^'"]+)['"]\)/g)) {
9093
deps.push(resolveLocalDependency(file, match[1]))

scripts/test-mcp-servers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function setupConfiguredMcpTarget() {
152152
fs.copyFileSync(path.join(ROOT, 'mcp', 'profile-contract.js'), path.join(targetRoot, '.claude', 'mcp', 'profile-contract.js'))
153153
fs.copyFileSync(path.join(ROOT, 'mcp', 'profile-section-selector.cjs'), path.join(targetRoot, '.claude', 'mcp', 'profile-section-selector.cjs'))
154154
fs.copyFileSync(path.join(ROOT, 'mcp', 'agent-identity.cjs'), path.join(targetRoot, '.claude', 'mcp', 'agent-identity.cjs'))
155-
// MCP require('../scripts/lib/…') from .claude/mcp → .claude/scripts/lib/…
155+
// Deploy MCP runtime script deps under .claude/scripts/lib
156156
for (const rel of ['scripts/lib/cp-digest.js', 'scripts/lib/host-parity-scorecard.js']) {
157157
const dest = path.join(targetRoot, '.claude', ...rel.split('/'))
158158
fs.mkdirSync(path.dirname(dest), { recursive: true })

scripts/test-pack-clean.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ function collectRuntimeDependencies(file, seen = new Set()) {
2424
const fullPath = path.join(ROOT, file)
2525
if (!fs.existsSync(fullPath)) return [file]
2626

27+
// Strip comments so doc examples like require('../scripts/lib/...') are not treated as deps.
2728
const content = fs.readFileSync(fullPath, 'utf8')
29+
.replace(/\/\*[\s\S]*?\*\//g, '')
30+
.replace(/^\s*\/\/.*$/gm, '')
2831
const deps = []
2932

3033
for (const match of content.matchAll(/require\(['"](\.{1,2}\/[^'"]+)['"]\)/g)) {

skills/portfolio.json

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"generatedFrom": {
66
"skillsPattern": "skills/*/SKILL.md",
77
"registry": "plugin.json",
8-
"sourceDigest": "d625bd7c306d0ce79c03af88471c8bf6323ba41cd590fb44abb7ab27a8ec5d89",
8+
"sourceDigest": "0941b1520cd18739d2799722c11dfd5432da2639524a61238f9dd3817011a68f",
99
"pluginDigest": "3e417180688c359025e64d584c098b5ef5ba112cf2ef8ca970f1c5589fe3d2bb",
1010
"portfolioEvidence": "skills/portfolio-evidence.json",
1111
"portfolioEvidenceDigest": "85229c1463a5068750d5417e5ebf960907532dccf99b1cd3da0a88f7007792b4",
1212
"consumerInventoryFileCount": 506,
1313
"consumerInventoryDigest": "eca8fd6129fe2ca143fc95be77ee37d4692e004b9e2519a979401c7484bf6ba4",
14-
"consumerProjectionDigest": "348b40443eabd0fb949885e1eb80505b034e26795665b64c238abd25a15bc910",
15-
"portfolioInputDigest": "e4e5d4d4b64a5ad98e968d1c5f2ed2ab93e4c30590623dd9cb6da42bcf41927e"
14+
"consumerProjectionDigest": "c6df0ba0a96c3f3f417591af7f6147984f17eb901263518c9e449d5010bda4cf",
15+
"portfolioInputDigest": "e7edf8a9327a0230d91c7f0ab08112708b4080ccc55169cda253e312ec136165"
1616
},
1717
"ordering": "skills.id asc; graph edges from/to asc",
1818
"summary": {
@@ -26,7 +26,7 @@
2626
"conflictReviewedCount": 81,
2727
"operationalEvidenceCompleteCount": 81,
2828
"triggerPrecisionMeasuredCount": 0,
29-
"instructionBudgetP95Bytes": 19856,
29+
"instructionBudgetP95Bytes": 21062,
3030
"triggerQuality": "structural-only"
3131
},
3232
"dependencyGraph": {
@@ -3544,8 +3544,8 @@
35443544
"skills/audit-requirements/SKILL.md"
35453545
],
35463546
"source": "skills/audit-requirements/SKILL.md",
3547-
"hash": "0f88d12cb1d57dbee7dfb2a49412c610436175d795cddd553a5331b534b8c06a",
3548-
"sourceBytes": 8345,
3547+
"hash": "155f1793aeba13925ce4d04c3422ad82e3aeab0a142081f71c5855dd9accdc74",
3548+
"sourceBytes": 12518,
35493549
"version": "1.15.2",
35503550
"lifecycleState": "active",
35513551
"dependencies": [],
@@ -4833,8 +4833,8 @@
48334833
"skills/compliance/SKILL.md"
48344834
],
48354835
"source": "skills/compliance/SKILL.md",
4836-
"hash": "06c07a30a3b42a10037b767cf7f0e682af0a672a2ffd7939db35ab9db6c50e1f",
4837-
"sourceBytes": 15359,
4836+
"hash": "1fc935163d257cc7d9a5739c2c713d22444cce85537b244b1d06db5662f787b4",
4837+
"sourceBytes": 17554,
48384838
"version": "1.15.2",
48394839
"lifecycleState": "active",
48404840
"dependencies": [],
@@ -5617,8 +5617,8 @@
56175617
"skills/cp-gate/SKILL.md"
56185618
],
56195619
"source": "skills/cp-gate/SKILL.md",
5620-
"hash": "62393ede67a997bbb31f26d8b0b5c2a952e2486009ca2bf931c02a3757b019f3",
5621-
"sourceBytes": 19856,
5620+
"hash": "a0a7f5871a0a06b4e39cb90def4cf32f8d55089d1a3eace528afb29ab5637ef9",
5621+
"sourceBytes": 21062,
56225622
"version": "1.15.2",
56235623
"lifecycleState": "active",
56245624
"dependencies": [],
@@ -7358,8 +7358,8 @@
73587358
"skills/dev-plan-review/SKILL.md"
73597359
],
73607360
"source": "skills/dev-plan-review/SKILL.md",
7361-
"hash": "8740d0a1224b7accd893b6843c6ba78efe246e8b508e2874ab9fb29ab12593b7",
7362-
"sourceBytes": 20978,
7361+
"hash": "4aeb0e9a48d81dc2757f105c047a12b5eaa5264b017efd2fee6be2a0366e7caa",
7362+
"sourceBytes": 21152,
73637363
"version": "1.15.2",
73647364
"lifecycleState": "active",
73657365
"dependencies": [],
@@ -9305,8 +9305,8 @@
93059305
"skills/expert-output-quality/SKILL.md"
93069306
],
93079307
"source": "skills/expert-output-quality/SKILL.md",
9308-
"hash": "b28894f105ecd9e6a712d6a7cf9c1f660011fdeace3ef9894c6597b1ab325fdf",
9309-
"sourceBytes": 8735,
9308+
"hash": "b3376ac14d1ee1a4452e8c66d42dbb0d3e04b2753c1b58940f502ce8ade77341",
9309+
"sourceBytes": 9075,
93109310
"version": "1.15.2",
93119311
"lifecycleState": "active",
93129312
"dependencies": [],
@@ -12307,6 +12307,10 @@
1230712307
"path": "scripts/lib/cp-digest.js",
1230812308
"role": "current"
1230912309
},
12310+
{
12311+
"path": "scripts/lib/discipline-execution-probe.js",
12312+
"role": "current"
12313+
},
1231012314
{
1231112315
"path": "scripts/lib/host-parity-scorecard.js",
1231212316
"role": "current"
@@ -13470,6 +13474,10 @@
1347013474
"path": "scripts/test-control-plane-module-contracts.js",
1347113475
"role": "current"
1347213476
},
13477+
{
13478+
"path": "scripts/test-discipline-execution-probe.js",
13479+
"role": "current"
13480+
},
1347313481
{
1347413482
"path": "scripts/test-execution-chain-evolution.js",
1347513483
"role": "current"
@@ -13772,6 +13780,7 @@
1377213780
"scripts/test-context-read-contract.js",
1377313781
"scripts/test-control-plane-contracts.js",
1377413782
"scripts/test-control-plane-module-contracts.js",
13783+
"scripts/test-discipline-execution-probe.js",
1377513784
"scripts/test-execution-chain-evolution.js",
1377613785
"scripts/test-governance-intake.js",
1377713786
"scripts/test-governance-status-summary.js",
@@ -13845,6 +13854,7 @@
1384513854
"scripts/test-context-read-contract.js",
1384613855
"scripts/test-control-plane-contracts.js",
1384713856
"scripts/test-control-plane-module-contracts.js",
13857+
"scripts/test-discipline-execution-probe.js",
1384813858
"scripts/test-execution-chain-evolution.js",
1384913859
"scripts/test-governance-intake.js",
1385013860
"scripts/test-governance-status-summary.js",
@@ -15619,8 +15629,8 @@
1561915629
"skills/report/SKILL.md"
1562015630
],
1562115631
"source": "skills/report/SKILL.md",
15622-
"hash": "2b42ffb7fa51db6d0195206e8d731cc670e08bf4c7be346397d93f4484ddd7ba",
15623-
"sourceBytes": 14746,
15632+
"hash": "ff59c642395e3a4f71bdbe31b030a560bd9095bd60d36889eccc199b27cee317",
15633+
"sourceBytes": 15174,
1562415634
"version": "1.15.2",
1562515635
"lifecycleState": "active",
1562615636
"dependencies": [],

0 commit comments

Comments
 (0)