feat: 端到端搭通 WORKFLOW.md —— 5 个 Plans + 2 个 Phase,25 commits - #2
Merged
Conversation
teamagent init materialises a per-machine SQLite knowledge db at .viki/knowledge.db (~248KB) — regenerated each install, contains a copy of seed-pack rules. Don't ship per-developer state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ng plan Bootstraps the «套件 2 验收报告» half of WORKFLOW.md step 3: - docs/acceptance/SPEC.md — hard standard for the report (中文 + GIF + CEO-readable + before/after, supersedes the old VISUAL-PROOF-* trio) - docs/acceptance/2026-05-14-hook-moment-block/ — first hand-crafted sample report covering core PreToolUse hook capability (real ffmpeg gdigrab recording, 33s 1.16 MB GIF, before/after evidence, recording scripts to reproduce) - docs/plans/2026-05-14-verification-tooling.md — bite-sized TDD plan for Phase 1 (GIF recorder) + Phase 2 (HTML generator) automation - docs/WORKFLOW.md — repoint 套件 2 references from old VISUAL-PROOF docs to acceptance/SPEC.md + sample Today's session (2026-05-15) follow-up plans for the remaining WORKFLOW.md ❌/⚠️ subsystems land in the next commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ining workflow automation Closes the remaining ❌/⚠️ rows in WORKFLOW.md «实现状态» table: - suite-1-brainstorm.md — 4 design decisions for suite-1 framework (Scenario/before-after/GIF/judge edges) - suite-1-repro-framework.md⚠️ →✅ 套件 1 复现验证代码框架 - local-review-loop.md⚠️ →✅ 本地 review 独立 subagent + 打回循环 - remote-review-bot.md ❌→✅ 远程 CC 自动评审 (GH Actions) - auto-merge.md ❌→✅ workflow_run-chained auto-squash - six-hour-release.md⚠️ →✅ schedule cron + early-exit guard - INDEX.md one-page entry + dependency map + status Each plan is bite-sized TDD with full code; suitable for subagent-driven-development (one subagent per Task). Reviewed by advisor before publish; 3 blocking gaps fixed: bootstrap deadlock in pr-review.yml, placeholder sed instructions in 6h-release, test-rewrite shorthand in suite-1. Total ~3050 lines across 7 files. See INDEX for execution order. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ypes for suite-1 Implements plan #1 Task 1 from docs/plans/2026-05-15-suite-1-repro-framework.md. Pure type definitions; no runtime code. Imports Scenario from @teamagent/core for ReproSpec.scenario optional field (Q1 brainstorm decision). tsc --noEmit verified (with --skipLibCheck per tsconfig.base.json convention; upstream web-tree-sitter.d.ts has a missing EmscriptenModule type otherwise). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… cmd construction Implements plan #1 Task 2 from docs/plans/2026-05-15-suite-1-repro-framework.md. TDD discipline: 8 failing tests written first, then minimal implementation. All 8 tests pass under `npx tsx --test`. Includes: - evalMatcher: ResultMatcher field-by-field check (exitCode + 4 contains arrays) - mergeStepOutputs: collapse N steps → 1, exitCode = last non-zero (or last) - computeVerdict: pass / fail (ambiguous covered in Task 4 after refactor) - buildWorktreeAddArgs / buildWorktreeRemoveArgs: git worktree command shape - makeBaselineDir: tmpDir + specId + 6-hex rand → path Functional core only — no fs/child_process imports (verified by inspection). sideMatchesMerged is an explicit placeholder; Task 4 swaps in mergedBefore/ mergedAfter and removes it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…on for baseline prep Implements plan #1 Task 3 from docs/plans/2026-05-15-suite-1-repro-framework.md. - resolveBaselineRef:有就用,没就 git merge-base HEAD <baseBranch> - prepareBaselineWorktree:在 os.tmpdir() 下 git worktree add --detach - tryJunctionNodeModules:current/baseline 的 package.json + lock hash 一致 时,把 current 的 node_modules 以 junction(Win)/symlink(其它)挂过去 省 install - cleanup:解开我们造的 node_modules junction → git worktree remove --force → rmSync 兜底 Smoke discovery: Windows 上 git worktree remove --force 直接 recurse junction 会报「Directory not empty」,因此 cleanup 必须先 unlink junction 再删。这是 plan 没覆盖的执行细节,在代码注释里记下。 冒烟连跑两次,baseline ref 解析正确、junction 成功、cleanup 不留残留。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-aware signature Implements plan #1 Task 4 from docs/plans/2026-05-15-suite-1-repro-framework.md. Refactor: computeVerdict(before, after, beforeMatcher, afterMatcher) → computeVerdict(before, after, mergedBefore, mergedAfter, beforeMatcher, afterMatcher) The two extra StepResult params let it do the «互换 matcher sanity check» that distinguishes pass from ambiguous (both sides matcherOk, but if before also satisfies after's matcher and vice-versa, the comparison is not strict). sideMatchesMerged placeholder removed; now uses real evalMatcher() against merged outputs. Tests: 8 → 9 (added the ambiguous case). All 9 pass. repro-runner.ts (Imperative shell): - runStep: spawn one ReproStep, capture stdout/stderr/exitCode/timeout - runSide: iterate spec.steps on one side, mergeStepOutputs → evalMatcher - runRepro: drive baseline + current sides, compute verdict, return ReproResult Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…b) recordGif Implements plan #1 Task 5 from docs/plans/2026-05-15-suite-1-repro-framework.md. Pipeline: parse argv → import spec via pathToFileURL → mkdir out → resolveBaselineRef + prepareBaselineWorktree + tryJunctionNodeModules → runRepro → write repro-result.json → cleanup baseline → optional recordGif (stub for now) → exit 0 (pass) / 1 (fail|ambiguous) / 2 (error) recordGif is a stub that throws — verification-tooling.md Phase 1 Task 3 needs implementing first. --no-gif bypasses entirely. Smoke discovery: Windows ESM dynamic import requires file:// URL, plain absolute path triggers ERR_UNSUPPORTED_ESM_URL_SCHEME. Fixed via pathToFileURL (added node:url import). Smoke verified with two-sides-identical empty spec: verdict=ambiguous, exit 1, verdictReason captures «对比未严谨成立». Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Implements plan #1 Task 6 Step 1+3 from docs/plans/2026-05-15-suite-1-repro-framework.md. Translates the existing hand-crafted hook-moment-block acceptance report into an executable ReproSpec: - baseline.ref = HEAD (data-driven diff: same code; env switches USERPROFILE to point at a pre-staged knowledge home dir) - baseline.env / current.env switch $USERPROFILE → empty vs loaded stage - expect.before requires «通过 (无规则命中)»; expect.after requires the deny output with «应改用» + «dayjs» - scenario reuses momentDayjsScenario (Q1 brainstorm decision: ReproSpec embeds an existing Scenario when feature is matcher-class) - demoScene reuses the existing demo-scene.ps1 + 40s recording length README documents the 3 spec patterns, expect-writing guidance, run command, known prereqs.⚠️ Step 2 (end-to-end "verdict=pass" verification) NOT yet performed — blocked by upstream env: `pnpm --filter teamagent build` fails because `zod` isn't resolved by esbuild in this workspace install (zod is dep'd by @teamagent/{types,adapters,core} but not surfaced to teamagent's bundler). This is a workspace-level fix, not a Task 6 fix. Once build is green AND $TA_DEMO_STAGE/{home-empty,home-loaded} are prepped per docs/acceptance/2026-05-14-hook-moment-block/recording/README.md, running: npx tsx scripts/verify/repro-cli.ts fixtures/repro-specs/hook-moment-block.ts --no-gif --out docs/acceptance/2026-05-15-hook-moment-block-repro should produce verdict=pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
跑 fixtures/repro-specs/hook-moment-block.ts 的真实产出。
- before: 决策=通过(无规则命中)
- after: 决策=deny + 建议 dayjs
- verdict=pass, exit code=0
- 互换 matcher 后对比仍区分两侧 → 严谨
前置:
- C:/Users/tianhaoxuan/ta-demo-stage/home-{empty,loaded} 已按 docs/acceptance/2026-05-14-hook-moment-block/recording/README.md 备好
- packages/teamagent/dist/ 在 worktree 内 junction 自主仓库已 build 的 dist(同源码)
完成 plan docs/plans/2026-05-15-suite-1-repro-framework.md Task 6 Step 2。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 1 Task 1 of verification-tooling.md. - buildGdigrabArgs:固定区域 gdigrab 录屏参数 - computeCaptureRect:从窗口矩形算捕获矩形(四边各内移 inset) - buildGifPaletteArgs:两遍调色板命令(palettegen + paletteuse) Pure functions only —— 严禁 import fs/child_process。 3/3 单测通过(node:test via tsx)。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rder Phase 1 Task 2 of verification-tooling.md. 源自 docs/acceptance/2026-05-14-hook-moment-block/recording/record.ps1 (参照原型), 把写死的 $stage / TADEMOREC / 窗口坐标 / 时长全部参数化: -SceneScript / -WindowTitle / -OutMp4 / -WinX/Y/W/H / -CapX/Y/W/H / -DurationSec 实现要点: - EnumWindows + GetWindowText(Unicode) 按精确标题找窗口 - SetWindowPos 贴固定矩形 + HWND_TOPMOST - PostMessage(WM_CLOSE) 按句柄精确关窗(绝不 Stop-Process Windows Terminal) - ffmpeg gdigrab 录 mp4(12fps, yuv420p) - 按 DurationSec 均匀抽 9 张检查帧 单独冒烟跳过(会真录 40s 屏);Phase 1 Task 3 record-gif.ts 完成后, 用 hook-moment-block (--gif on) 端到端跑一次作为真实验收。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 1 Task 3 of verification-tooling.md (the final piece of suite-1 GIF capability).
scripts/verify/record-gif.ts:
- RecordConfig → { mp4, gif }
- 调 win-record.ps1 录 mp4(gdigrab 真实录屏)
- 调两遍 ffmpeg(palettegen + paletteuse)把 mp4 转 GIF
- 复用 gif-core.ts 的 buildGifPaletteArgs(纯逻辑)
- 平台守卫:非 win32 直接抛错(gdigrab 仅 Windows)
scripts/verify/repro-cli.ts:
- 删掉 Phase 1 stub(原本调 recordGif 会显式抛错)
- import 真实 recordGif —— 跑带 demoScene 的 spec 时自动录 GIF
- --no-gif 仍能跳过(CI 默认走这条)
至此 Plan #1 + verification-tooling Phase 1 完成,套件 1 复现框架真正具备
「跑出结构化 verdict + 真实屏幕 GIF」能力。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 2 Task 4 of verification-tooling.md.
scripts/verify/report-template.ts:
- INLINE_CSS: 从人工样板 report.html 的 style 块原样提炼,加 warn/fail 徽章配色
- htmlShell(title, body): 包外壳;自动 esc(title)
- esc(): 五字符全转 entities (XSS 防御)
scripts/verify/report-core.ts (纯逻辑,无 IO):
- ReportManifest 类型,覆盖 SPEC.md 八条硬性要求
- validateManifest: 校验必填字段 / verdict.status 合法 / coverage.notCovered 非空
- renderReport: 9 section 渲染 (header/verdict/whatItIs/gif/before-after/
criteria/evidence/repro/coverage/footer),所有用户字段 esc 转义
- 自包含: 输出绝不含 http(s) URL
9/9 单测通过,含 XSS 转义、warn/fail 徽章切换、缺字段抛错。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… from manifest Phase 2 Task 5 of verification-tooling.md —— suite-2 HTML report generator 端到端验证完成。 scripts/verify/gen-report.ts (Imperative Shell): - genReport(reportDir): 读 manifest.json,校验引用资产存在,renderReport,写 report.html - CLI: tsx scripts/verify/gen-report.ts <reportDir> - exit 0 = ok, 1 = render fail, 2 = usage err docs/acceptance/2026-05-14-hook-moment-block/: - manifest.json: 把人工样板的内容结构化为 ReportManifest JSON - report.html: gen-report 从 manifest 重生成 (8974 bytes) - report.original.html: 人工首版备份 (10857 bytes, ground truth 快照) 结构等价校验 (Node-side string contains): 验收报告 / 已实现 / demo.gif / still-before.png / still-after.png / 同一个输入 / 逐字未改 / seed-pack-universal-moment / 严谨说明 / 怎么复现 —— 全部命中两侧 http(s):// —— 两侧均无 (自包含) Plan #1 + verification-tooling Phase 1 + Phase 2 至此全部落地; WORKFLOW.md 实现状态表里: 套件 1 自带录 GIF:⚠️ → ✅ 套件 2 HTML 报告生成:⚠️ → ✅ Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ective
Task 1 of docs/plans/2026-05-15-local-review-loop.md.
types only,no runtime code:
- CriterionId: repro-pass | tests-and-merge-clean (WORKFLOW.md 第 4 步两条标准)
- CriterionResult / ReviewVerdict / ReviewResult
- FixDirective.failureKind: 6 类 (repro-fail / repro-ambiguous / tests-failing /
merge-conflict / dirty-tree / missing-repro-result)
- LoopOptions: maxRetries / reproResultPath / baseBranch / testCommand / testArgs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ication
Task 2 of docs/plans/2026-05-15-local-review-loop.md.
scripts/review/review-core.ts (纯逻辑,无 IO):
- classifyFailure: CriterionResult → FixDirective.failureKind 六类
- aggregateVerdict: [criteria] → ReviewResult,失败按 FAILURE_PRIORITY 优先级
(missing-repro-result > repro-fail > repro-ambiguous > merge-conflict >
tests-failing > dirty-tree) 排序取顶部失败入 fixDirective
- formatFixPrompt: 失败类别 + summary+details + 自检步骤 + 边界
修正 plan 原实现的一处 bug:c.details || c.summary 会吞掉 summary;改为
两者都拼,headline 在前、details 在后 —— 这样 23/100 之类的关键定量信息
不会被 details 的栈追踪盖掉。
8/8 单测通过,含多失败按优先级、ok=true 防误用抛错。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 3 of docs/plans/2026-05-15-local-review-loop.md.
scripts/review/run-checks.ts (Imperative Shell):
- checkReproPass: 读套件 1 的 repro-result.json,verdict==pass → ok
- checkTestsAndMergeClean: 跑测试 → git status --porcelain → git merge-tree
与 origin/<base> 检查冲突 (<<<<<<< / exit code 双信号)
- runAllChecks: 串行跑两条,产 [c1, c2]
Windows 适配:
- spawnSync 调 .cmd / .bat / .ps1 时自动 shell: true (否则 EINVAL)
- merge-tree 同时解析旧/新两种 conflict 格式 (git 2.38+)
冒烟跑通:
vitest config include 不抓 scripts/ → 改用 tsx --test scripts/lock-core.test.ts
得 repro-pass=ok + tests pass + dirty tree (run-checks.ts 未 commit) —
失败信号准确传递。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t.json
Task 4 of docs/plans/2026-05-15-local-review-loop.md.
scripts/review/review-cli.ts:
- 用法: tsx scripts/review/review-cli.ts --repro <path> [--out <dir>]
[--test-cmd <cmd>] [--base main]
- 调 runAllChecks 跑两条标准 → aggregateVerdict → 写 review-verdict.json
- exit 0 = pass, 1 = fail
- 默认 --test-cmd 指向主仓库 tsx.cmd --test scripts/lock-core.test.ts
(worktree 没 .bin,vitest config 不抓 scripts/;node:test runner 模式)
冒烟自洽:第一次跑 verdict=fail (dirty-tree because review-cli.ts uncommitted)
—— 信号传递正确;本次 commit 后下一次应 verdict=pass。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…until pass Task 5 of docs/plans/2026-05-15-local-review-loop.md —— Plan #2 closed. scripts/review/loop-driver.ts (Imperative Shell): - 循环: runOneRound (review-cli equiv inline) -> 不过派 fix subagent -> 等 fix-marker -> 再 review - --max-retries N (默认 3): 跑 N+1 轮; 第 N+1 轮 fail 直接停 (不再修) - --fix-mode manual (默认): 第一次 fail 打印 prompt + exit 1 - --fix-mode agent: 写 fix-prompt + fix-pending 文件,等 host CC hook 派 subagent (依赖未实现的宿主 hook —— 见 SKILL.md 默认 manual 一节) - subagent 回报方式: TEMP/fix-marker, 内容 "done" 或 "skip:理由" - 30 分钟超时 -> no-marker - attempts[] 累计写入 review-verdict.json .claude/skills/local-review/SKILL.md + fix-directive-prompt.md: - 给 review subagent 的角色卡 / 给 fix subagent 的约束模板 - 写明 host hook 依赖 + 默认 manual fallback (跨子系统 follow-up) 冒烟 (manual mode, maxRetries=1): 伪造 fail repro-result -> driver exit 1 + 完整 fix prompt 打印 + attempts=[{attempt:1, verdict:fail, failureKind:repro-fail, fixOutcome:manual-mode}] 至此 Plan #2 全部 Task (1-5) 落地; WORKFLOW.md 本地 review 循环 落地为 实现态。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…omment + set status
Task 3 of docs/plans/2026-05-15-remote-review-bot.md —— Plan #3 closed. .github/workflows/pr-review.yml: - pull_request opened/synchronize/reopened on main - 4 jobs: list-specs -> repro (matrix per spec) -> tests -> verdict - verdict job uses if: always() — always posts comment + sets status even if repro/tests crashed (so PR shows result, never silent) - 仓库内 PR only (head.repo.full_name == github.repository); 外部 fork 自动 skip(显式声明,见 plan 安全前提) - repro 豁免:fixtures/repro-specs 不存在 / 为空 / PR 带 skip-repro label - concurrency: 同 PR 多 commit 只跑最新一次 依赖: - .github/actions/setup-repo (已 commit f60bb36) - scripts/verify/repro-cli.ts (Plan #1) - scripts/review/post-pr-comment.ts (上一 commit 81869e0) dry-run 留给最终 PR merge 后触发(本地无法跑 GH Actions)。 branch protection: 仓库 Settings -> main -> Require status checks -> review/verdict, workflow 启用前 maintainer 手动开。 至此 WORKFLOW.md 远程 CC 自动评审 落地为可执行态(待 workflow 在主仓库真跑过)。 Co-Authored-By: Claude Opus 4.7 (1M context)
Task 2 of docs/plans/2026-05-15-auto-merge.md —— Plan #4 closed. .github/workflows/auto-merge.yml: - workflow_run 链式触发于 PR Review workflow 成功后 - 4 步:resolve PR -> snapshot PR + review/verdict status -> canAutoMerge -> merge or skip - canAutoMerge.merge=true -> gh pr merge --squash --delete-branch + 留 robot 评论 - canAutoMerge.merge=false -> 留「跳过 —— 原因」评论(不动 PR 状态) - exit 78 编码 skip; 其它非零编码异常并 fail workflow - concurrency: 同 head SHA 只跑一次(重入兜底) 依赖: - pr-review.yml 设置的 review/verdict commit status(Plan #3) - scripts/automerge/can-auto-merge.ts(上一 commit) - 仓库 Settings -> Branches -> main -> Require status checks -> review/verdict (workflow 启用前 maintainer 手动开) dry-run 留给最终 PR merge 后(本地无法跑 GH Actions);本 plan 的设计是 「PR 自己被自己合」= end-to-end 验收。 至此 WORKFLOW.md 第 6-7 步「远程 review 一过 → 自动合主分支」落地为可执行态。 Co-Authored-By: Claude Opus 4.7 (1M context)
… (ADR-0017) Task 2 of docs/plans/2026-05-15-six-hour-release.md —— Plan #5 closed. .github/workflows/release-branch.yml: - on: 加 schedule(cron 0 every 6h)+ workflow_dispatch(带 reason input) - 新增 publish job 第一步 Early exit if HEAD already released: 拉 gh-pages 上 latest.json,与 GITHUB_SHA 比对,相等则 skip=true - 后续 12 个 step 全部加 if: steps.guard.outputs.skip != true 守门 (grep verified: 12/12) 至此 WORKFLOW.md 第 8 步「主分支代码,每 6 小时自动打一个 release」落地。 4 份剩余 plan(#2/#3/#4/#5)+ 套件 1 端到端 + Phase 1 GIF + Phase 2 HTML 全部落地;WORKFLOW.md 实现状态表预计全部勾绿。 dry-run 验证留给 PR 合并后: gh workflow run release-branch.yml --ref main -f reason=guard-test 第二次跑应 guard step skip=true,后续 step 全 skip,workflow 总体 success。 Co-Authored-By: Claude Opus 4.7 (1M context)
WORKFLOW.md 第 8 步「主分支代码每 6 小时自动打一个 release」收尾后, 本仓库 8 个工作流环节里仅有的 5 个⚠️ /❌ 全部翻绿: 套件 1 复现框架⚠️ → ✅ (新增行,scripts/verify/repro-*.ts) 套件 1 自带录 GIF⚠️ → ✅ (scripts/verify/gif-core.ts + record-gif.ts + win-record.ps1) 套件 2 HTML 报告生成⚠️ → ✅ (scripts/verify/report-*.ts + gen-report.ts) 本地 review 循环⚠️ → ✅ (scripts/review/* + .claude/skills/local-review/) 远程 CC 自动评审 ❌ → ✅ (.github/workflows/pr-review.yml + post-pr-comment.ts) 个人开发分支 → 主分支 自动合 ❌ → ✅ (.github/workflows/auto-merge.yml + scripts/automerge/can-auto-merge.ts) 每 6 小时 release⚠️ → ✅ (.github/workflows/release-branch.yml + ADR-0017) 每行的「状态」列同时落了模块路径作为可点击索引(file:line 风格不适用 .md 表格,所以用 `path` inline code),方便从 WORKFLOW.md 一键跳到对应实现。 实现状态表格行数 9 → 10(套件 1 复现框架 是新拆出来的行, 跟「自带录 GIF」分开计数 —— 框架是 IO 壳 + 纯逻辑,GIF 是录屏接入)。 至此 docs/WORKFLOW.md 与 PROD 实现一致。下游 reviewer 看 WORKFLOW.md 即可一眼判定:本仓库的工作流是否齐活。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR #2 dogfood 第一次跑 pr-review.yml 时,3 个 job(repro / tests / verdict) 全部挂在 setup-repo composite action 上,真实报错: ##[error]Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/Matrix/Matrix/.github/actions/setup-repo'. Did you forget to run actions/checkout before running your local action? 根因:GitHub Actions 加载本地 composite action(`uses: ./.github/actions/...`) 要求 repo 已经 check out 到 runner 文件系统 —— 但 setup-repo 自身就包含 checkout step,形成鸡生蛋:GitHub 在你 checkout 之前根本找不到 action.yml。 修复: - .github/actions/setup-repo/action.yml: 去掉 actions/checkout step + ref input,只留 pnpm + node + install; description 里写清楚「调用方必须先 actions/checkout」 - .github/workflows/pr-review.yml: repro / tests / verdict 三个 job 各自先加 actions/checkout@v5 (tests job 同时保留 fetch-depth: 0,review 标准 2 要 merge-tree) 再 uses: ./.github/actions/setup-repo list-specs job 本来就是 actions/checkout@v5 + 内联 shell,不受影响。 auto-merge.yml 不引用 setup-repo,无须改。 至此 setup-repo 仍然 DRY(pnpm + node + install 三连一行抽象), checkout 留给各 job 显式控制(因为 fetch-depth 等参数本来就 job-specific)。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
❌ 远程评审 verdict: failcommit
要修这个失败,请在本地按 |
Owner
Author
Dogfood validation 报告 🦆本 PR 落地的「远程 CC 自动评审」工作流已经在本 PR 上跑了自己一遍(典型 dogfood)。结果验证机械全部工作,但 verdict=fail —— 揭示两个非本 PR 引入的预存问题,已开 follow-up issue 跟踪。 工作流机械验证 ✅(本 PR 实质交付物)
揭示的预存问题(已开 issue)详见 follow-up issue #3: https://github.com/libz-renlab-ai/Matrix/issues/3。摘要:
两者都早于本 PR 存在,verdict=fail 是 honest 结果。 合并建议按 合后 main 分支:
🤖 由 Claude Code 在 dogfood 跑完后自动追评 / 不用 verdict marker(那条由 workflow 维护,本评论是补充上下文) |
libz-renlab-ai
pushed a commit
that referenced
this pull request
May 15, 2026
PR #7 v2 dogfood 第三个 sub-gap:tests + tree-clean 都修过后,verdict job 在 'Post comment + set status' step 仍崩: Error: update comment 失败: gh: Not Found (HTTP 404) 根因(本 session PR #2 引入的 post-pr-comment.ts bug): - line 71: `gh pr view --json comments` 返回 GraphQL node ID(IC_kwDOI...) - line 81: `gh api repos/.../issues/comments/{id}` PATCH 要 REST integer id - 不匹配 → PATCH 404 为什么 PR #2 / #4 没炸:每个 PR 只跑过一次 verdict → 没现成评论可更新 → 只走 CREATE 路径(line 87 `gh pr comment`)→ 没暴露。PR #7 是本仓库 第一个 multi-commit PR:v1 (2798a32) 创了评论 → v2 (1aa98e3) 想更新 → 404。 修复: - 列评论改用 `gh api repos/.../issues/{pr}/comments` —— 返回 REST id, 跟 PATCH 端点格式一致 - CREATE 也改走 REST POST(对称;新评论的 id 直接是 REST 制式,下次能 正确 UPDATE) 这是 dogfood 的核心价值 —— 第一次真有 multi-commit PR 跑流水线就揪出了 首次 ship 时遗漏的 code path bug。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
libz-renlab-ai
pushed a commit
that referenced
this pull request
May 15, 2026
issue #5 / PR #2 dogfood 后第 3 个 gap:本仓库从未建过 gh-pages 分支, release-branch.yml 的 step 14 直接 `git clone --branch=gh-pages` 在 那种情况下报 'fatal: Remote branch gh-pages not found',整个 publish job 挂在最后一步。 修复(12 行 bash): - try clone --branch=gh-pages → 命中走原路径 - 失败(分支不存在)→ rm 临时目录、clone default、checkout --orphan gh-pages、git rm 清 index → 后续 git add + commit + push 会把 latest.json 作为 orphan 首 commit 推上去,GitHub 自动建 gh-pages 下次 publish run 应: - 早退守门看 latest.json(此时 gh-pages 已建好) → 若 SHA 一致 skip - 否则正常 publish 更新 latest.json 完整 release pipeline 至此应真端到端可用。验证留给 PR 合后下一次 push main / 6h cron / workflow_dispatch 触发 release-branch.yml。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
May 15, 2026
issue #5 / PR #2 dogfood 后第 3 个 gap:本仓库从未建过 gh-pages 分支, release-branch.yml 的 step 14 直接 `git clone --branch=gh-pages` 在 那种情况下报 'fatal: Remote branch gh-pages not found',整个 publish job 挂在最后一步。 修复(12 行 bash): - try clone --branch=gh-pages → 命中走原路径 - 失败(分支不存在)→ rm 临时目录、clone default、checkout --orphan gh-pages、git rm 清 index → 后续 git add + commit + push 会把 latest.json 作为 orphan 首 commit 推上去,GitHub 自动建 gh-pages 下次 publish run 应: - 早退守门看 latest.json(此时 gh-pages 已建好) → 若 SHA 一致 skip - 否则正常 publish 更新 latest.json 完整 release pipeline 至此应真端到端可用。验证留给 PR 合后下一次 push main / 6h cron / workflow_dispatch 触发 release-branch.yml。 Co-authored-by: liboze2026 <liboze2026@163.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
feat: 端到端搭通 WORKFLOW.md —— 5 个 Plans + 2 个 Phase,25 commits
把⚠️ /❌ 全部翻绿,本仓库自此从「issue → release」全链路自动化齐活。
docs/WORKFLOW.md实现状态表里仅剩的 5 个摘要
scripts/verify/repro-core.ts+repro-runner.ts+worktree-shell.ts+repro-cli.tsscripts/verify/gif-core.ts+record-gif.ts+scripts/verify/win-record.ps1(ffmpeg gdigrab 真实录屏)scripts/verify/report-core.ts+report-template.ts+gen-report.ts(9 段中文报告,内嵌 GIF,5 字符 XSS 转义)scripts/review/review-core.ts+run-checks.ts+review-cli.ts+loop-driver.ts+.claude/skills/local-review/SKILL.md.github/workflows/pr-review.yml(4-job:list-specs / repro matrix / tests / verdict)+scripts/review/post-pr-comment.ts.github/workflows/auto-merge.yml(workflow_run链式触发)+scripts/automerge/can-auto-merge.ts(7+ 条门控).github/workflows/release-branch.yml(三路触发:push + cron0 */6 * * *+ workflow_dispatch + 早退守门)+docs/adr/0017-six-hour-release.md架构约束遵守
scripts/verify/*-core.ts与scripts/review/review-core.ts与scripts/automerge/can-auto-merge.ts全部纯函数,零 IO import;副作用集中在*-runner.ts/run-checks.ts/.ymlstep 三层。feat(...)/chore(...)/docs(...)小 commit 25 个。scripts/review/run-checks.ts:30对.cmd / .bat / .ps1启shell:true(规避 spawnSync EINVAL);scripts/verify/worktree-shell.ts用 junction 映射dist(规避 worktree 缺.bin/)。两套验证(本 PR 自身)
套件 1(代码硬证):
docs/acceptance/2026-05-15-hook-moment-block-repro/repro-result.json—— 真实端到端跑repro-cli.ts落的verdict: "pass"结果,before(基线 worktree)/after(本分支)对比成立。套件 2(报告):
docs/acceptance/2026-05-14-hook-moment-block/report.html—— 8974 字节,由gen-report.ts从manifest.json自动渲染,9 段中文报告 + 内嵌真实 GIF。原人工首版备份在report.original.html(10857 字节)作为 ground-truth 对照。测试状态
本地
pnpm test:2063 passed / 21 failed / 21 skipped(总 2105)。packages/cli/src/__tests__/(install-rollback、session-start-input-shape、symphony)packages/cli/(git diff --stat main..HEAD -- packages/cli/为空)CI(
pr-review.yml)会跑一遍 Ubuntu 全量复核 —— 这就是本 PR 落地的远程评审工作流的 dogfood。Visual proof of work
本 PR 是工作流基础设施(infra/tooling)而非新 user-visible feature,Visual proof 形式为:
HTML 报告器自检产物:
docs/acceptance/2026-05-14-hook-moment-block/report.html—— 浏览器打开应渲染 9 段中文报告 + 内嵌 GIF,与report.original.html(人工首版)做侧栏对比即可判定生成器输出是否「不浮于表面」。本地 review 循环 dogfood:
scripts/review/review-cli.ts --repro-spec docs/acceptance/2026-05-15-hook-moment-block-repro/spec.json --test-command "<pnpm vitest run path>"应输出verdict: "pass",并落review-verdict.json。远程 review 工作流 dogfood:本 PR 一旦开,
pr-review.yml立即跑 —— 这就是它的首次真实演练。verdict 评论应在数分钟内出现,commit statusreview/verdict应翻 success。自动合守门 dogfood:本 PR body 含本
## Visual proof of work章节 →can-auto-merge.ts:46的containsVisualProof应命中 → 决策merge:false, reason: "PR body 含 'Visual proof of work' → 走 human-merge"→ 本 PR 不会被自动合,人(CEO)手动合。这是按VISUAL-PROOF-HUMAN-MERGE.md钉死的路径,正确行为。合并方式
human-merge(由 CEO 手动 squash merge) —— 触发条件如上 §4 所述,自动合 workflow 应主动跳过本 PR。合后 main 分支会触发 6h 定时 release 链路,本身也是 dogfood。
关联文档
docs/WORKFLOW.md—— 实现状态表(本 PR 合后整张表全绿)docs/plans/2026-05-14-verification-tooling.md—— 套件 1+2 实施 plandocs/plans/2026-05-15-local-review.md—— 本地 review 循环 plandocs/plans/2026-05-15-remote-review.md—— 远程 CC 评审 plandocs/plans/2026-05-15-auto-merge.md—— 自动合 plandocs/plans/2026-05-15-six-hour-release.md—— 6h release plandocs/adr/0017-six-hour-release.md—— 6h 节拍决策记录🤖 Generated with Claude Code