Repository navigation
fix(gep): add typed fail-closed LLM review contract and skill2gep promotion gate - #646
Conversation
…motion gate Extend `src/gep/llmReview.js` with the typed promotion-gate contract (`normalizeReviewResult`, `isApprovedReview`, `REVIEW_CONTRACT_VERSION`, `REVIEW_POLICY_VERSION`, `REVIEW_STATUSES`, and synchronous `reviewInvoker` / `invoke` support) while preserving the existing subprocess runner, retry trace, `parseReviewResponse`, and `classifyExecutionError` exports from #614. Gate `skill2gep.runOnSkillInvocation` on `llmReview.runLlmReview` whenever a Capsule is assembled so non-approved (`rejected`, `inconclusive`, `unavailable`, `failed`) review results fail closed before persisting Gene/Capsule assets, marking the execution fingerprint as seen, or requesting Hub publication. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Sentinel 已审核此变更,并发现 3 个已核验问题。 另有 4 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。 开发 agent 查询详情: 调用 MCP 工具 由 Sentinel 审核 · 目标提交 ba6b1de724bd |
|
Sentinel 保留了 4 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
需要完整证据时,可用行末 由 Sentinel 审核 · 目标提交 ba6b1de724bd |
| options | ||
| && typeof options === 'object' | ||
| && !Array.isArray(options) | ||
| && typeof options.invoke !== 'function' |
There was a problem hiding this comment.
省略可选参数时不再使用默认审查执行器
🔴 严重程度:高(P1)
原有 runLlmReview(input, options) 在未注入 execute 时会使用 defaultExecute。本次改动把“没有第二参数”路由到 injected-provider 分支;该分支发现没有 invoker 后直接返回 unavailable。因此语义等价的 runLlmReview(input) 与 runLlmReview(input, {}) 现在分别得到“provider 未配置”和“调用默认 runner”两种结果。新增的 skill2gep 入口恰好只传一个参数,所以既有仅通过环境变量启用审查的配置...(truncated)
Finding:finding_f94c6d1ef96d73b4d3389269
| if (!isLlmReviewEnabled()) return null; | ||
|
|
||
| const hasRunnerOptions = Boolean( | ||
| options |
There was a problem hiding this comment.
无显式 invoker 时不再调用默认审查执行器
🔴 严重程度:高(P1)
原实现允许 runLlmReview(input) 通过 defaultExecute 执行内置 runner;新分派逻辑只有在第二个 options 参数存在时才进入 runRunnerReview。本 PR 新增的 skill2gep 调用只传一个参数,因此没有注入 invoker 时直接返回 unavailable,随后被 llm_review_blocked 阻断,已配置的默认 runner 永远不会执行。
Finding:finding_5f92a7f8d2170ba9368ee1be
| function runLlmReview(input, options) { | ||
| input = input || {}; | ||
| if (!isLlmReviewEnabled()) return null; | ||
|
|
There was a problem hiding this comment.
无第二参数的旧调用不再使用默认审核执行器
🟠 严重程度:中(P2)
修改前,runLlmReview(input) 会通过 options || {} 选择 defaultExecute;修改后,只有传入非 invoker 的第二参数才进入 runRunnerReview()。省略第二参数时会进入注入式 provider 分支,因没有 invoker 返回 status: unavailable。这把原本有效的公开调用方式变成失败结果。
Finding:finding_7065c9521251d1eb5f51e40a
Summary
Add the typed fail-closed LLM review promotion contract to
src/gep/llmReview.js(while preserving all #614 subprocess runner/retry behaviors and exports) and wiresrc/gep/skill2gep.js(runOnSkillInvocation) to block persistence, seen-state recording, and Hub publication whenever a Capsule's LLM review is not explicitly approved.What changed
src/gep/llmReview.jswithREVIEW_CONTRACT_VERSION,REVIEW_POLICY_VERSION,REVIEW_STATUSES,normalizeReviewResult,isApprovedReview, and synchronousreviewInvoker/invokeexecution with typedapproved/rejected/inconclusive/unavailable/failedresults, SHA-256 prompt/response evidence, provenance, error, and recovery metadata.parseReviewResponse,classifyExecutionError,REVIEW_MAX_ATTEMPTS, and theoptionssubprocess runner/retry path introduced in fix: fail closed on unavailable llm review #614 (b094d5b/3effd6d).src/gep/skill2gep.js(runOnSkillInvocation) to invokellmReview.runLlmReviewwhen a Capsule is assembled and return{ ok: false, reason: 'llm_review_blocked', ... }without persisting Gene/Capsule assets, markingstate.seen, or publishing whenEVOLVER_LLM_REVIEW=trueand the review is not approved.test/llmReview.test.js(typed contract coverage alongside existing fix: fail closed on unavailable llm review #614 runner boundary tests) andtest/skill2gep.test.js(skill2gep review promotion gate).How to test
node --test test/llmReview.test.js test/skill2gep.test.js test/skill2gepParser.test.js test/skill2recipes.test.js test/harnessGovernanceCheck.test.jsRisk
Low -- additive typed contract in
src/gep/llmReview.jspreserving all existing #614 exports and runner behavior;skill2gepreview gate is active only whenEVOLVER_LLM_REVIEW=true.Harness/evaluator governance
Upstream governance surface:
src/gep/llmReview.jsandsrc/gep/skill2gep.js(GEP promotion review gate for distilled Skill Capsules)Downstream EvoX impact: None on default
EVOLVER_LLM_REVIEW=falsepath; whenEVOLVER_LLM_REVIEW=true,skill2gep.runOnSkillInvocationrequires an approved review result before persisting or publishing a CapsuleRollout-local scope: Opt-in via
EVOLVER_LLM_REVIEW=trueenvironment flag on localskill2gepinvocationPromotion boundary: Capsule persistence and Hub publication in
skill2gep.runOnSkillInvocationare gated byllmReview.isApprovedReview(review)beforeassetStore.upsertGene/assetStore.appendCapsule/publishAssetsEvaluator mismatch sets: Verification and evidence sets (
approved,rejected,inconclusive,unavailable,failedstatuses with SHA-256 prompt/response evidence and recovery actions); observation, action, repair, and belief sets unchangedNon-regression evidence:
node --test test/llmReview.test.js test/skill2gep.test.js test/skill2gepParser.test.js test/skill2recipes.test.js test/solidifyIntegration.test.js test/harnessGovernanceCheck.test.js(91 pass, 0 fail)Fix-severity review: medium
Owner approval:
autogame-17(Evolver GEP / skill2gep owner)Security boundary: Fail-closed promotion gate; no new external network calls, subprocesses, or secret reads when
reviewInvokeris absent or failsRollback: Set
EVOLVER_LLM_REVIEW=false(default) or revert this commitLive promotion: no
Autonomous evaluator self-editing: no
Self-check
Object.assign({}, DEFAULTS, partial)to build an object, every reference-typed field (arrays, sub-objects) on the result is sliced or cloned -- not held by reference to either source.node --test test/*.test.js).Related
Follows #614
🤖 Generated with Claude Code