fix(brief): 把 no-mistakes 的完成判据钉到管线产出的 PR,而不是裸提交 - #10
Merged
Merged
Conversation
Owner
Author
CI result for head 5b0b2a9Not all checks are green. One check has no verdict:
This is a known CI flake tracked separately as |
The no-mistakes Definition of done opened by declaring the task complete at
commit time and asking for `done: {summary}`, so workers read a commit as
delivery and stopped without ever running the pipeline; three tasks were
chased for it in one day. The block now opens by naming the pipeline's PR as
the only completion, says outright that a commit, a clean branch, or "ready
for the run" is not completion, makes running the pipeline the worker's own
step, states the first-run doctor/init step, requires the PR URL, head, and
CI result on completion, and keeps the completion claim as the last status
line. direct-PR and local-only keep their own distinct signals.
tests/fm-brief.test.sh pins the new no-mistakes wording, the absent
commit-is-complete sentence, and the mode separation.
…e no-mistakes completion claim
onyx-space
force-pushed
the
fm/fm-brief-bare-done-without-pipeline
branch
from
September 11, 2026 22:09
5b0b2a9 to
0a8ba27
Compare
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.
摘要
治本:
mode=no-mistakes的 worker 反复把"已提交"当成"已完成" —— 当天一天内就抓到 3 次:fm-brief-pr-discipline(runs_on_current_branch: 0)、glitter-pr-ci-status(报告里写"等/no-mistakes开 PR"就收尾了)、pi-remote-catalog-freshness-gate-local-fix("fix committed on branch … ready for the run"就声明 done)。三次都是只提交、没跑管线、没开 PR,每次都要 MAIN 花一轮去追。队列里本来就有这条(
fm-brief-bare-done-without-pipeline):worker brief 需要把"什么才算完成"钉死,不要指望 worker 自己记住。本 PR 让
bin/fm-brief.sh生成的 ship brief 在mode=no-mistakes下无法再被误读为"提交即完成"。该 brief 的 Definition of done 由单一 ownerbin/fm-dod-lib.sh渲染,普通 ship brief 与 promoted scout 两条交付路径共用同一份契约。改了什么
bin/fm-dod-lib.sh里mode=no-mistakes的 Definition of done:把管线 push 并开出的 PR写为完成信号,明确写出 commit / 干净分支 / "ready for the run" 都不是完成;唯一完成声明钉死为done: PR {url} checks green,且必须是状态日志的最后一行。/no-mistakes斜杠写法);同一分支已有 run 时禁止再起第二个 run;run 进行中收到 firstmate 的技能投递只当作催办(reattach + poll);因"已 run 在跑"被拒时改为跟随管线自己的 status,而不是报 blocked;补充首次运行的no-mistakes doctor/no-mistakes init步骤。direct-PR契约的措辞改为 "Do NOT start the no-mistakes pipeline"。AGENTS.md记录bin/fm-dod-lib.sh是各 delivery mode Definition of done 的单一 owner;tests/fm-brief.test.sh与tests/fm-task-delivery.test.sh钉住新的完成信号、其唯一 claim 形态、以及与 direct-PR / local-only 的隔离。风险评估
✅ 低:改动只重写 worker 面向的契约文本(单一 owner
bin/fm-dod-lib.sh,并同步AGENTS.md)及其回归断言,不触碰任何可执行逻辑;已验证每一种 mode 生成的 brief 都渲染出预期契约,且没有消费方回归。验证
在隔离的临时 home 里搭起真实的 firstmate 脚本,端到端驱动改过的 Definition of done:用真实的
bin/fm-brief.sh生成 no-mistakes / direct-PR / local-only 三种 brief;直接从bin/fm-dod-lib.sh渲染fm_dod_block并与生成的 brief 逐字 diff(一致);跑真实的bin/fm-promote.shpromotion 路径并 diff 它产出给 promoted worker 的 ship-instructions(一致);两个聚焦套件(tests/fm-brief.test.sh、tests/fm-task-delivery.test.sh)通过。证据是 evidence 目录里粘贴的真实命令输出。4 个场景中 3 个现场驱动通过,1 个如实记为未驱动:
mode=no-mistakes的 worker 只提交、不开管线 PR 时不判完成:生成的 Definition of done 把管线 PR 写成完成信号,并明确 commit 不是完成harness-adapters;promoted-scout 交付文本同样如此未驱动那条的原因:本仓没有"拒绝第二次/非所有者启动"的运行时守卫 ——
bin/fm-nm-run-lib.sh里的 run 归属判定是只读的,真正的拒绝发生在外部no-mistakesCLI,本步骤无法在仓内执行。下方
English折叠里是以上叙述的英文原文;再往下的证据块与Pipeline段是机器输出(日志转录、自检报告),按原文保留。English
## Intent治本:
mode=no-mistakes的 worker 反复把"已提交"当成"已完成"——今天一天内就抓到 3 次:fm-brief-pr-discipline(runs_on_current_branch: 0)、glitter-pr-ci-status(报告里写"等 /no-mistakes 开 PR"就收尾了)、pi-remote-catalog-freshness-gate-local-fix("fix committed on branch … ready for the run"就声明 done)。三次都是只提交、没跑管线、没开 PR,每次都要 MAIN 花一轮去追。队列里本来就有这条(
fm-brief-bare-done-without-pipeline):worker brief 需要把"什么才算完成"钉死,不要指望 worker 自己记住。What Changed
mode=no-mistakesdefinition of done inbin/fm-dod-lib.sh: the pipeline-pushed PR is now named as the completion signal, a commit/clean branch/"ready for the run" is explicitly stated not to be one, and the single completion claim is pinned todone: PR {url} checks greenas the last line of the status log./no-mistakesslash form removed), forbids starting a second validation run while one is active on the branch, treats a mid-run firstmate skill delivery as a nudge to reattach and poll, routes an already-active-run refusal to the pipeline's own status instead of a blocked report, and adds the first-runno-mistakes doctor/no-mistakes initstep. The direct-PR contract wording becomes "Do NOT start the no-mistakes pipeline".AGENTS.mdrecordsbin/fm-dod-lib.shas the single owner of delivery-mode definitions of done, andtests/fm-brief.test.shplustests/fm-task-delivery.test.shpin the new completion signal, its single claim shape, and the separation from the direct-PR and local-only modes.Risk Assessment
✅ Low: The change only rewrites worker-facing contract prose (single owner bin/fm-dod-lib.sh, aligned AGENTS.md) plus its regression pins, touches no executable logic, and I verified the emitted briefs for every mode render the intended contract with no consumer regressions.
Testing
I stood up the real firstmate scripts in isolated temp homes and drove the changed Definition of done end to end: generated the no-mistakes, direct-PR, and local-only briefs with the real bin/fm-brief.sh, rendered fm_dod_block directly from bin/fm-dod-lib.sh and diffed it against the generated brief (identical), ran the real bin/fm-promote.sh promotion path and diffed its ship-instructions DoD against the brief (identical), and fed the prescribed completion line through the real bin/fm-crew-state.sh reader, which classified the pinneddone: PR <url> checks green(and the same claim with head and CI appended) as done while a commit-only claim stayed working. Targeted tests for the brief, the promotion delivery path, and the crew-state reader all pass. The only scenario I could not drive is the actual refusal of a second or non-owning start, which lives in the external no-mistakes CLI rather than in this repo; it is reported untested as a residual. Overall the pinned-completion intent is demonstrated on the real generated and delivered artifacts.Evidence: Generated no-mistakes Definition of done (real bin/fm-brief.sh output)
Source: Generated no-mistakes Definition of done (real bin/fm-brief.sh output)
Evidence: Generated direct-PR Definition of done (real bin/fm-brief.sh output)
Source: Generated direct-PR Definition of done (real bin/fm-brief.sh output)
Evidence: Generated local-only Definition of done (real bin/fm-brief.sh output)
Source: Generated local-only Definition of done (real bin/fm-brief.sh output)
Evidence: Promoted no-mistakes worker DoD from real bin/fm-promote.sh (ship-instructions.md)
Source: Promoted no-mistakes worker DoD from real bin/fm-promote.sh (ship-instructions.md)
Evidence: Direct fm_dod_block output for all three modes (single owner in bin/fm-dod-lib.sh)
Source: Direct fm_dod_block output for all three modes (single owner in bin/fm-dod-lib.sh)
Evidence: Real bin/fm-crew-state.sh classification of pinned, pinned+head+CI, and commit-only claims
Source: Real bin/fm-crew-state.sh classification of pinned, pinned+head+CI, and commit-only claims
Evidence: Generated-brief surface checks: harness-agnostic start, no leakage into other modes, anti-duplication rules
Source: Generated-brief surface checks: harness-agnostic start, no leakage into other modes, anti-duplication rules
Evidence: Targeted test run: tests/fm-brief.test.sh
Source: Targeted test run: tests/fm-brief.test.sh
Evidence: Targeted test run: tests/fm-task-delivery.test.sh
Source: Targeted test run: tests/fm-task-delivery.test.sh
Evidence: Targeted test run: tests/fm-crew-state.test.sh
Source: Targeted test run: tests/fm-crew-state.test.sh
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
FM_HOME=<tmp> ./bin/fm-brief.sh live-no-mistakes some-proj --mode no-mistakes (real generated brief)FM_HOME=<tmp> ./bin/fm-brief.sh live-direct-PR some-proj --mode direct-PR (real generated brief)FM_HOME=<tmp> ./bin/fm-brief.sh live-local-only some-proj --mode local-only (real generated brief). ./bin/fm-dod-lib.sh && fm_dod_block <mode> <id> for all three modes, diffed against the generated brief DoDFM_HOME=<tmp> FM_STATE_OVERRIDE=<tmp>/state ./bin/fm-promote.sh live-promote-nm --mode no-mistakes --yolo off (real promotion), diffed ship-instructions.md DoD against the brief DoDreal bin/fm-crew-state.sh classification drive over three status lines:done: PR https://... checks green, that claim plus head and CI appended, anddone: fix committed on branch fm/feat-ci, ready for the runbash tests/fm-brief.test.sh(targeted; drives real bin/fm-brief.sh; newtest_no_mistakes_completion_is_a_pr_not_a_commitpassed)bash tests/fm-task-delivery.test.sh(drives real bin/fm-promote.sh + bin/fm-brief.sh and compares both DoD blocks)bash tests/fm-crew-state.test.sh(drives real bin/fm-crew-state.sh;ok - ci-ready status log beats monitoring run)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.