Skip to content

fix: sync 解除 brief 硬依赖,基线取 --base-branch > brief > 当前分支 - #70

Merged
stack-wuh merged 2 commits into
mainfrom
fix/20261013-fix-sync-briefless-base
Oct 13, 2026
Merged

stack-wuh merged 2 commits into
mainfrom
fix/20261013-fix-sync-briefless-base

Conversation

@stack-wuh

Copy link
Copy Markdown
Owner

变更

  • lib/domains/sync.mjs:基线解析改为 --base-branch > brief.baseBranch > 当前分支
  • brief 缺失不再阻断 sync;origin/<base> 不可解析时以 SYNC_UPSTREAM_NOT_FOUND 响亮拒绝
  • lib/commands.mjs:sync 两键的 --name 由必填降为可选,新增 --base-branch
  • sync plan 的 nextStep 改为无 brief 形态 sync execute --plan-hash {planHash} --confirm
  • README.md:sync 行同步新调用形态与基线解析序

影响

  • 行为/触发面变化:squash 合并后的收口不再需要人工 git merge --ff-only
  • 在基线分支上 sync plan + sync execute --plan-hash <hash> --confirm 即可闭合
  • 代价显式化:非当前分支的基线必须传 --base-branch,原先由 brief 代答
  • 明确不受影响的范围:cli.mjs harness 与凭证模型零改动
  • 带 --name 且 brief 在盘的旧调用形态行为不变;--name 降为可选是放宽,旧写法不会失败

验证

  • 观察点脚本(真实临时仓 + bare remote,不入库)逐条覆盖 6 条不变量,含三条拒绝路径
  • INV-1 无 brief 可 plan:planHash 96c5f0a6…;execute 后 head 与远端 tip 逐字相等
  • INV-2 --base-branch release/9 压过 brief 的 baseBranch: main
  • INV-4 无 brief 时脏树仍 DIRTY_WORKTREE;INV-6 未知 base → SYNC_UPSTREAM_NOT_FOUND
  • INV-3 有 brief 时基线仍取 brief;本地分叉 → SYNC_NOT_FAST_FORWARD
  • INV-5 带 brief 通路仍把 planHash 写入 brief:equal: true
  • 参考回归:node --test --test-name-pattern "sync (plan|fetches|blocks)" 6/6 绿
  • 未覆盖项:全量 npm test 本机约 270s,超 60s 阈值未在本机跑,由 test.yml 的 PR 触发补
  • 未覆盖项:[bug] squash 合并下 sync 与 verifiedCommit 两头卡死,归档被迫重跑 review #59 的 verifiedCommit 漂移那一半不放宽,属设计内的门,归档前在 main 重跑 review

关联

@stack-wuh
stack-wuh merged commit 92515be into main Oct 13, 2026
9 checks passed
stack-wuh pushed a commit that referenced this pull request Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[design] squash 后 sync 取不回基线:浅修复被 harness 的 readBrief+write 两处堵死,需契约变更

1 participant