[codex] 补齐 sync pass 执行契约#6
Merged
Merged
Conversation
wlvh
force-pushed
the
codex/sync-pass-execution-contract
branch
13 times, most recently
from
May 3, 2026 06:59
79210d1 to
47b70a6
Compare
wlvh
force-pushed
the
codex/sync-pass-execution-contract
branch
from
May 3, 2026 08:03
47b70a6 to
476b4a5
Compare
wlvh
marked this pull request as ready for review
May 3, 2026 08:07
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.
背景 & 目标(Why)
本 PR 收紧
scripts/OPERATIONS.md中 4 个 Sync Agent Pass 的执行指引。问题来自执行 agent 视角复核:外部顺序合理,但每个 pass prompt 单独复制给新对话时,必须明确先读取.coding_workflow/diffs/产物,并分清脚本生成的 PR body 结构真相源和手写执行语义。目标是让
pr_body_skeleton.md承担 sentinel、表头、Repo Facts headings 等结构真相源,让每个 PASS prompt 直接携带 skeleton 看不出来的执行规则;删除共享§2.0,避免用户每次新开对话时还要额外记忆或复制公共段落。实现方案(How)
PR_BODY.md的恢复路径。.coding_workflow/diffs/agent_workorder.md是给执行 agent 的本轮工单和机器信号,用户不阅读也不影响启动下一步。§2.0 共用执行契约:## 2只保留一行复制说明,执行时只复制对应 PASS code block。PR_BODY.md初始化动作只保留在“必须读取”清单,避免共用规则和步骤清单重复。完成后块:聊天回报只保留普通 sync 闭环和是否留下待判断;adopted / rejected / downstream 详情以Full Document Reconcile为准。Full Document Reconcile在每个 PASS prompt 内解释为PR_BODY.md的文档语义对账表;PR 提交 agent 以PR_BODY.md和 final gate 为准,不再依赖 PASS 4 聊天摘要。ready_for_next_pass、Sync Pass Status/pass_handoffs、PASS_STATUS_COLUMNS、pass status 渲染函数和 final gate 状态检查全部移除。Full Document Reconcileskeleton 的所有语义列默认待补充,不再预填none/待判断,要求 agent 显式判断后再改成具体内容、none或待判断。Full Document Reconcile每行 5 个语义列全为待补充,并禁止旧的none/ 默认待判断组合回归。待补充残留和 template residue;待判断允许保留给 reviewer 和用户判断。Full Document Reconcile审 pass evidence / propagation,不再要求 pass status ready。README.md的 Workflow Docs Sync 维护说明同步改为Full Document Reconcile/Remaining Human Decisions交接模型,避免工具维护文档继续指向旧状态表。.coding_workflow/diffs/installation_status.md和.coding_workflow/diffs/full_reconcile_report.md,对应信息保留在sync_state.json和 PR body auto 区。前置条件 / 必须读取 / 只允许修改 / 必须填写 / 停止条件 / 完成后。pr_body_skeleton测试负责结构常量;每个 PASS prompt 自包含测试负责确认§2.0已删除且 guardrails / owned docs 不漂移;新增 final gate 测试覆盖待补充拦截和待判断放行。README.md的 sync 工具维护边界:本 PR 不改写下游项目会继承的AGENTS.md/TESTING.md模板。class-1 template/missing、class-2 upstream、class-3 code/test/behavior drift,并要求每个 PASS 在Full Document Reconcile的 evidence 列显式覆盖三类;未发现也必须写none。find统计测试文件行数、grep扫测试函数 / 类、git log --since='3 months ago' -- tests/看近期热改;命令只是示例,agent 必须按项目等价工具改写并把实际命令写入 evidence。变更范围(What)
来自
git diff --name-only origin/main...HEAD:README.mdFull Document Reconcile/Remaining Human Decisions。scripts/OPERATIONS.mdscripts/sync_coding_workflow.pypass_handoffs/Sync Pass Status/ready_for_next_pass相关渲染和 final gate 检查;保留Full Document Reconcile,将其语义列默认值统一为待补充,把 final gate 占位符扫描收窄到 agent-owned sections,并删除两个重复 scratch markdown 生成、精简 stdout / workorder。scripts/sync_pr_review_system.mdFull Document Reconcile的 per-pass evidence、downstream impact 和 propagation。tests/test_sync_coding_workflow.pytest_pr_body_skeleton_renders_sync_constants、test_each_pass_prompt_contains_common_execution_rules和 final gate 占位符测试;删除旧 pass status 测试,改由 skeleton / PASS prompt / final gate 分别守住结构、执行规则和机械门,并锁住 Full Document Reconcile 默认行不预填语义判断;锁住三类漂移定义、PASS 3 示例命令和 PASS 4 class-3 追溯 literal。文档同步
受影响文档:
README.mdscripts/OPERATIONS.mdscripts/sync_pr_review_system.md未修改:
AGENTS.mdTESTING.mdPR_Checklist.mdarchitecture.mdcapability_contract.jsoninteract.mddocs/business_user_guide.md说明:
README.md、scripts/OPERATIONS.md和scripts/sync_pr_review_system.md。architecture.md、capability_contract.json、interact.md和docs/business_user_guide.md是目标项目继承的模板 / 样本文档;本 PR 不改变下游项目能力边界或用户可见行为,因此不改这些模板。README.md的“代码项目核心文档 / Workflow Docs Sync”已明确:开发 sync 工具时,工具自身说明、实现文件清单和回归测试说明落在README.md和scripts/下;这些要求不写入下游项目会继承的AGENTS.md/TESTING.md/PR_Checklist.md模板。测试证据
Review / 修复记录
scripts/OPERATIONS.md:统一固定读取顺序,明确 PASS 1 拥有 Repo Facts Map、PASS 2 contract/interact 锚点、PASS 3 只改 TESTING.md 策略、PASS 4 反向闭合边界。scripts/OPERATIONS.mdscripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyAGENTS.md/TESTING.md不应进入本 PR。AGENTS.md/TESTING.md改动,只保留scripts/OPERATIONS.md和 drift test。README.md,git diff --name-only origin/main...HEAD§2.0重复了pr_body_skeleton.md已自动生成的 sentinel、表头和 Repo Facts headings;drift test 也把结构真相源和手写语义合同混在一起。§2.0为 skeleton 看不出来的执行规则;新增 skeleton 渲染测试,原 drift test 改为只守OPERATIONS.md手写语义和 owned docs。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.py§2.0;必须降低用户心智成本。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.py§2.0会形成第二阅读入口,增加用户心智负担。§2.0 共用执行契约,## 2只保留复制说明;测试断言该 heading 不再出现,并继续检查每个 PASS prompt 自带 guardrails 和 owned docs。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyPR_BODY.md初始化规则同时出现在“共用执行规则”和“必须读取”里。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyFull Document Reconcile已承载 adopted / rejected / downstream 详情,完成后块再要求回报文件、PR body sections 和 downstream 会形成第二事实源。完成后块统一收敛为普通 sync 成功确认、失败停住且不手修 auto 区、只回报是否留下待判断;测试断言旧聊天复述项不回归,并要求详情以Full Document Reconcile为准。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyFull Document Reconcile术语没有自解释;测试中 reconcile 列名仍是硬编码字符串。PR_BODY.md和 final gate 为准,不以 PASS 4 聊天摘要为事实源;每个 PASS prompt 内解释Full Document Reconcile是文档语义对账表;测试从FULL_RECONCILE_COLUMNS常量反查 agent 需填写列。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyAGENTS.md,容易和 pass owned docs 边界冲突。agent_workorder.md是给执行 agent 的工单和机器信号,用户不阅读也不影响启动下一步;每个 PASS 保留稳定整体目标,并测试断言旧整体任务句不回归。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyready_for_next_pass是 agent 自填弱信号,pass_handoffs与Full Document Reconcile重复;新增代码只应在显著降低 agent 心智负担时保留。Full Document Reconcile成为 pass 事实源,final gate 只守 sentinel / auto / blocking status /待补充/ template residue,待判断交给 reviewer;同步 reviewer prompt 和 README。README.md,scripts/sync_coding_workflow.py,scripts/sync_pr_review_system.md,scripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyFull Document Reconcileskeleton 默认预填none/待判断,等于替 agent 做语义判断。待补充;final gate 继续拦待补充,测试显式写入待判断来验证语义不确定项仍可留给 reviewer。scripts/sync_coding_workflow.py,tests/test_sync_coding_workflow.pyinstallation_status.md/full_reconcile_report.md生成逻辑;stdout 收敛为短提示并直接给出 commit-pinned runbook URL;workorder 只保留本轮文件处理清单和 pinned OPERATIONS URL;测试断言旧文件、旧 stdout 和旧 workorder 段落不回归。scripts/sync_coding_workflow.py,tests/test_sync_coding_workflow.py待补充,同时禁止旧的 `待补充Full Document Reconcileevidence 列按class-1 template/missing、class-2 upstream、class-3 code/test/behavior drift三段填写;未发现必须写none。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyfind/grep/git log --since='3 months ago' -- tests/的机械信号菜单,并要求不通用时改写为项目等价命令、把实际命令写入 evidence。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.pyclass-1/2/3标签本身可能不够自解释,agent 能推断但不够稳定。scripts/OPERATIONS.md,tests/test_sync_coding_workflow.py最终自检
codex/sync-pass-execution-contractorigin/main新建分支git diff --name-only origin/main...HEAD反向核对变更范围TESTING.md运行回归测试PR_BODY.md仅用于更新 GitHub PR body,不纳入提交