Skip to content

Commit e481be9

Browse files
committed
fix: catch post-commit profile current drift
1 parent 833fe17 commit e481be9

3 files changed

Lines changed: 64 additions & 2 deletions

File tree

‎changelogs/unreleased.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- **恢复与验证**:未结算操作的 Stop 保留诊断,owner 转换传播本次提交 fence,正式终止后仅收缩会话投影而保留完整任务历史。新增隔离自然任务入口,业务结果以实际文件与计算核验,未完成观察保持 UNVERIFIED;实际发布和安装状态以发行证据为准。
1313

1414
- **本地候选修复 — 派生资产新鲜度与默认验证漏检**:刷新 `content/skills/portfolio.json`,并将 `skill-portfolio-current` 纳入 changed/iterative 默认验证不变量,使 clean-tree `npm test` 计划覆盖 portfolio freshness;同步 validation DAG 断言与 Windows 中文文件名负向测试夹具,避免默认验证对派生资产 stale false-green。本项仅为本地源码候选,未 tag、未 publish、未刷新 MCP。
15+
- **本地候选修复 — 提交后 Profile current truth 与 changed-route 防漏检**:新增轻量 `profile-current` validation node,并将其纳入 changed/iterative 默认验证不变量,使 clean-tree post-commit replay 也会检查 active Profile `ProfileCurrentTruthV1` 是否对齐当前源码 HEAD/source candidate;`profile-governance` 保持边界/综合验证,不被每次 clean changed-route 强制拉起。本项仅为本地源码候选,未 tag、未 publish、未刷新 MCP。
1516
- **本地候选修复 — 验证入口、产物状态投影与 Profile 当前真相刷新**:收紧 active-root 产物 stale CP 状态检测,避免把“待用户确认是否提交”等非 CP 文案误判为 CP1/CP2 阻断;默认 `test:fast/full/delivery/boundary/profile-deploy/package-release` 改为 `human-cli --plan` 入口并补充 `:ai` 严格变体,避免 Codex/AI 环境缺 `contextEpoch` 时本地 plan 命令误红;新增 `profile-current:refresh` 标准命令,用于更新 active Profile `ProfileCurrentTruthV1` 的当前源码 HEAD 与 source candidate 身份。本项仅为本地源码候选,未 tag、未 publish、未刷新 MCP。
1617
- **本地候选修复 — 验证入口派生资产与 Profile 边界**:将默认 `test` / `test:changed` / scoped route 入口恢复为执行型验证,新增显式 `test:plan` / `test:*:plan` 作为零执行预览入口,避免 plan-only 被误读为测试已执行;把 `scripts/refresh-profile-current-truth.js` 纳入 profile boundary 与 `profile-governance` 输入闭包,确保修改 Profile current truth refresh 脚本时触发 profile 验证;刷新 `content/skills/portfolio.json`。本项仅为本地源码候选,未 tag、未 publish、未刷新 MCP。
1718
- **本地候选修复 — 运行态可观测性与历史债务收敛**:`validate.js` 现在对每个 V 探针输出 start/done heartbeat,V7 改为有界 fast-path smoke,避免聚合校验无界卡死;visible reply evidence 绑定当前 promptCount,无 payload 时不再继承旧 precheck;`memory_status` 增加 `summaryCurrentProjection`,显式区分 append-only SUMMARY 历史与当前折叠状态;artifact checker 新增 digest-bound `HistoricalArtifactIssueDispositionV1`,用于精确处置历史 unknown/stale/conflict 产物噪声。本项仅为本地源码候选,未 tag、未 publish、未刷新 MCP。

‎scripts/test-validation-dag.js‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function run() {
256256
assert.ok(manifest.criticalInputs.includes('content/**'))
257257
assert.ok(manifest.criticalInputs.includes('hooks/_runtime/evidence/*.json'))
258258
assert.ok(!manifest.criticalInputs.includes('content-source/**'))
259-
assert.deepStrictEqual(manifest.iterativeInvariantNodes, ['validation-dag', 'skill-portfolio-current'])
259+
assert.deepStrictEqual(manifest.iterativeInvariantNodes, ['validation-dag', 'skill-portfolio-current', 'profile-current'])
260260
assert.ok(manifest.iterativeEscalationInputs.includes('scripts/lib/validation-dag.js'))
261261
assert.ok(!manifest.iterativeEscalationInputs.includes('content/**'))
262262
assert.deepStrictEqual(Object.keys(manifest.verificationBoundaries).sort(),
@@ -2235,6 +2235,24 @@ function run() {
22352235
'profile boundary must include profile current truth refresh script')
22362236
assert(manifest.nodes.find(node => node.id === 'profile-governance').inputs.includes('scripts/refresh-profile-current-truth.js'),
22372237
'profile-governance must include profile current truth refresh script')
2238+
const profileCurrentNode = manifest.nodes.find(node => node.id === 'profile-current')
2239+
assert(profileCurrentNode, 'manifest must expose lightweight profile-current node')
2240+
assert.deepStrictEqual(profileCurrentNode.args, ['scripts/validate-all-profiles.js', '--current-only'])
2241+
assert.strictEqual(profileCurrentNode.riskClass, 'normal')
2242+
assert.deepStrictEqual(profileCurrentNode.writeScopes, [])
2243+
assert(manifest.iterativeInvariantNodes.includes('profile-current'),
2244+
'clean-tree changed-route must include the lightweight Profile current truth invariant')
2245+
const cleanChangedPlan = planValidation({
2246+
manifest,
2247+
route: 'changed',
2248+
changedFiles: [],
2249+
changedSource: 'git-clean',
2250+
candidateId: 'fixture-clean-post-commit'
2251+
})
2252+
assert(cleanChangedPlan.selectedNodes.some(node => node.id === 'profile-current'),
2253+
'clean changed-route must select profile-current to catch post-commit active Profile drift')
2254+
assert(!cleanChangedPlan.selectedNodes.some(node => node.id === 'profile-governance'),
2255+
'clean changed-route must not promote every post-commit replay to the heavier profile-governance suite')
22382256
const refreshProfilePlan = planValidation({
22392257
manifest,
22402258
route: 'changed',

‎scripts/validation-manifest.json‎

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@
511511
],
512512
"iterativeInvariantNodes": [
513513
"validation-dag",
514-
"skill-portfolio-current"
514+
"skill-portfolio-current",
515+
"profile-current"
515516
],
516517
"routes": {
517518
"fast": {
@@ -4424,6 +4425,48 @@
44244425
"ProfileCurrentTruthV1"
44254426
]
44264427
},
4428+
{
4429+
"schemaVersion": "ValidationNodeV1",
4430+
"id": "profile-current",
4431+
"owner": "profile-governance",
4432+
"command": "node",
4433+
"args": [
4434+
"scripts/validate-all-profiles.js",
4435+
"--current-only"
4436+
],
4437+
"dependencies": [],
4438+
"inputs": [
4439+
"scripts/validate-profile.js",
4440+
"scripts/validate-all-profiles.js",
4441+
"scripts/lib/profile-current-truth.js",
4442+
"scripts/refresh-profile-current-truth.js",
4443+
".github/workflows/ci.yml",
4444+
"package.json",
4445+
"data/templates/profile/**"
4446+
],
4447+
"consumers": [
4448+
"profile-governance"
4449+
],
4450+
"invariants": [
4451+
"profile-current-truth-clean-tree-post-commit",
4452+
"profile-current-truth-single-record"
4453+
],
4454+
"riskClass": "normal",
4455+
"cachePolicy": "never",
4456+
"writeScopes": [],
4457+
"timeoutMs": 60000,
4458+
"exitMap": {
4459+
"success": [
4460+
0
4461+
],
4462+
"failure": "nonzero-or-signal",
4463+
"timeout": "ETIMEDOUT"
4464+
},
4465+
"evidenceArtifacts": [
4466+
"ValidationExecutionReceiptV1",
4467+
"ProfileCurrentTruthV1"
4468+
]
4469+
},
44274470
{
44284471
"schemaVersion": "ValidationNodeV1",
44294472
"id": "public-product-expression",

0 commit comments

Comments
 (0)