Repository navigation
fix: require recorded user approval before planned execution - #147
Open
ZiyiXingYao wants to merge 1 commit into
Open
ZiyiXingYao wants to merge 1 commit into
ZiyiXingYao wants to merge 1 commit into
Conversation
…m --reason 只校验布尔开关与非空文本,执行者可在用户未看过当前 proposal 的情况下直接进入 executing;现在 start 无有效回执时只登记待批准单(proposal hash 与一次性 token)并拒绝执行,新增 workflow approve 记录绑定规划产物 hash 与用户原话的批准,start 仅在回执覆盖当前 proposal/tasks/specs/design 时放行,批准后任何规划内容改动都会使回执失效,workflow show 可审计批准 hash、原话与时间。 提交人: 黄俊 评审人: 影响范围: scripts/lib/cmd-workflow.mjs、scripts/lib/planned-approval.mjs、scripts/lib/sdd-overlay.mjs、scripts/spec-superflow.mjs、skills/workflow-start、skills/spec-writer、README/INSTALL/AGENTS/docs、CHANGELOG、planned 相关测试
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
发生的问题
ssf workflow start <dir> --path planned --confirm --reason "<执行者自写概括>"只校验:--confirm是一个布尔开关;--reason非空单行;proposal.md/tasks.md存在且非空。它不校验用户是否看过当前 proposal、
--reason是否来自用户、批准的是哪一版内容。执行者可以在没有向用户展示 proposal 的情况下直接进入executing并开始改代码。2026-11-12 与 2026-12-02 各发生过一次,第二次导致方案回退并重写。旧错误文案 “Record the existing approval ... do not ask again if already approved” 还会主动鼓励跳过复核。
解决方案
把“批准”拆成绑定规划内容的两阶段回执:
workflow start --path planned在没有有效回执时只生成approval-pending.json:proposal_sha256与全部规划产物artifacts_hash;exploring,不写 plan、不进入 executing。workflow approve <dir> --proposal-hash <sha256> --token <token> --approval-quote "<用户原话>":approval.json,包含 quote、proposal/artifacts hash 与批准时间。workflow start --path planned --confirm --reason只有在回执覆盖当前 proposal/tasks/specs/design 时才进入 executing。workflow show输出批准状态、proposal hash、用户原话、批准时间。怎么解决的
scripts/lib/planned-approval.mjs(hash、pending/receipt、自哈希与 stale 判定)。cmd-workflow.mjs接入门禁,新增approve子命令,扩展show,删除旧文案。npm test957/957 通过;install-codebuddy --dry-run与实际本地安装成功。兼容性与边界
execution plan/revise的--confirm语义不变;direct 路径不变。--approval-quote仍无法证明聊天来源;本次目标是消除“一步 start 自证批准”的路径,并把批准绑定到具体内容、留下可审计记录,不宣称密码学身份证明。