Skip to content

Commit eb8eac3

Browse files
committed
fix: clarify ai validation entry guidance
1 parent e481be9 commit eb8eac3

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎changelogs/unreleased.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
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。
1515
- **本地候选修复 — 提交后 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。
16+
- **本地候选修复 — AI 验证入口 authority 提示收敛**:`run-validation` 在 Codex/AI 环境缺少 ContextRead epoch 或 source-message digest 时继续 fail-closed,但 `Next` 提示改为明确分流到 `npm run test:changed:plan`、绑定 task/context/source-message 的 `test:changed:ai`,或真实人类交互式终端 `npm test`;新增 validation DAG 断言锁住该错误投影,避免把 authority fail-closed 误判为源码测试失败或诱导绕过执行权限。本项仅为本地源码候选,未 tag、未 publish、未刷新 MCP。
1617
- **本地候选修复 — 验证入口、产物状态投影与 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。
1718
- **本地候选修复 — 验证入口派生资产与 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。
1819
- **本地候选修复 — 运行态可观测性与历史债务收敛**:`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/run-validation.js‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,14 @@ function detectedActorType(env = process.env) {
444444
return 'human-cli'
445445
}
446446

447+
function aiAuthorityEvidenceNextStep(reason) {
448+
const prefix = reason ? `${reason}; ` : ''
449+
return prefix +
450+
'choose the correct validation entry: for zero-execution local planning run `npm run test:changed:plan`; ' +
451+
'for AI execution run `npm run test:changed:ai` from a bound task and pass the current --context-epoch, --task-recovery-key and --source-message-digest; ' +
452+
'for direct local execution run `npm test` from a real interactive human terminal outside the AI host.'
453+
}
454+
447455
function resolveActorType(requested, env = process.env, options = {}) {
448456
const detected = detectedActorType(env)
449457
if (options.allowPlanOnlyDowngrade && requested === 'human-cli' && detected === 'ai-hook') {
@@ -594,7 +602,7 @@ function resolveValidationAuthorityContext({ actorType, options, activeRoot, env
594602
throw new ValidationDagError(
595603
'VALIDATION_AI_CONTEXT_EPOCH_REQUIRED',
596604
'AI validation planning requires the current ContextRead epoch',
597-
{ nextStep: 'Rebuild ContextRead, then pass its exact context epoch before generating a BudgetCard.' }
605+
{ nextStep: aiAuthorityEvidenceNextStep('Rebuild ContextRead, then pass its exact context epoch before generating a BudgetCard') }
598606
)
599607
}
600608

@@ -1851,7 +1859,7 @@ function createCliLease({ options, plan, candidate, actorType, authorityContext,
18511859
throw new ValidationDagError(
18521860
'VALIDATION_AI_CONFIRMATION_EVIDENCE_REQUIRED',
18531861
'AI validation execution requires the exact current user-confirmation message digest',
1854-
{ nextStep: 'Pass --source-message-digest for the message that confirmed this exact BudgetCard.' }
1862+
{ nextStep: aiAuthorityEvidenceNextStep('Pass --source-message-digest for the message that confirmed this exact BudgetCard') }
18551863
)
18561864
}
18571865
if (['trusted-ci', 'release-pipeline'].includes(actorType)) {
@@ -2640,6 +2648,7 @@ module.exports = {
26402648
compactPlan,
26412649
convergenceProjection,
26422650
createCliLease,
2651+
aiAuthorityEvidenceNextStep,
26432652
directActorIdentityEvidence,
26442653
detectedActorType,
26452654
envelope,

‎scripts/test-validation-dag.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,14 @@ function run() {
685685
activeRoot: tempRoot,
686686
env: { CODEX_THREAD_ID: 'fixture-thread' },
687687
readTaskState: () => ({ status: 'fresh', identity: { taskId: aiAuthority.taskRecoveryKey } })
688-
}), error => error instanceof ValidationDagError && error.code === 'VALIDATION_AI_CONTEXT_EPOCH_REQUIRED')
688+
}), error => {
689+
assert(error instanceof ValidationDagError)
690+
assert.strictEqual(error.code, 'VALIDATION_AI_CONTEXT_EPOCH_REQUIRED')
691+
assert.match(error.details.nextStep, /npm run test:changed:plan/)
692+
assert.match(error.details.nextStep, /npm run test:changed:ai/)
693+
assert.match(error.details.nextStep, /interactive human terminal/)
694+
return true
695+
})
689696
assert.throws(() => resolveValidationAuthorityContext({
690697
actorType: 'ai-hook',
691698
options: { contextEpoch: 'ctx-fixture-current', taskRecoveryKey: 'different-task' },

0 commit comments

Comments
 (0)