feat: fast-forward, push and clean up branches #502
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #502"
general
weight: 0.35
mzdluo123
Summary
Implements
add-branch-sync-actions, the last change planned in #495. Stacked on #501 (basefeat/repository-maintenance); the first commit archivesadd-repository-maintenanceso this change validates against the archived specs.fastforward.go): exactrev-list --left-right --countin the preview; only when behind and not ahead, never touching the network. Checked-out branches:merge --ff-only --no-autostash --end-of-options <to>in their worktree withWithoutCancel+ 3 min (tracked changes / in-progress operation block; sessions must be acknowledged; overwritten untracked files reuse switch'soverwrittenPaths). Unchecked branches:merge-base --is-ancestorthenupdate-refwith the old value.push.go): pushes the previewed OID (push --porcelain --end-of-options <remote> <OID>:refs/heads/<target>) throughremoteGitafter re-checking under the gate and releasing it; publish picks--remote,remote.pushDefault,originor the only remote, validates the target name, and writesbranch.<b>.remote/mergeonly after success.!status lines →rejected("先获取远程再快进"); no status line + existingpre-pushhook (honourscore.hooksPath) → "被 pre-push 钩子拒绝". Forbidden argv (--force,--delete,--mirror,--all,--tags,--follow-tags,--no-verify,+refspecs) asserted by a git wrapper.branchdelete.go):Branch.mergedIntoDefaultfrom onefor-each-ref --merged; preview groups branches into 已包含 / 有独有提交 viarev-list --count <OID> --not --exclude=<b> --branches --remotes --tags --glob=refs/webmux/ <other HEADs>(commits shared only by other selected branches count as unique, so twin branches cannot both be deleted); delete usesupdate-ref -d <ref> <OID>+config --remove-sectionand returnsgit branch <b> <OID>recovery commands. Unmerged branches needacknowledgeUnmerged.…/branches/{fast-forward,push,delete}-preview+ execute with isolated confirmation purposes;webmux repo ff,repo push [--remote] [--to],repo branch-rm (BRANCH… | --cleanup) [--unmerged].branchActions()decides 快进到上游 / 推送… / 发布分支… / 删除分支… everywhere (worktree menus on home, sidebar and panel; worktree details; branch rows).FastForwardBranch,PushBranch,DeleteBranchesflows open as RepositoryPanel subviews or in one sharedBranchOperationDialogshell from home/sidebar (one shell for the three flows instead of three near-identical ones). 清理分支(N) on the 本地分支 header preselects only 已包含.Verification
make format,make checkpass;make test-gogreen; 500-branchBranchesincl.mergedIntoDefault~95 ms.base64url.test.tsfails locally (Node 24);TerminalGraphics/TerminalSyncOutputfailed once under full-suite load and pass 24/24 alone.branch-operations.spec.ts(fetch in the panel then fast-forward; publish and ahead count back to zero; cleanup with the squash-merged branch unselected),repository-maintenance,worktree-switch,worktrees— 36 passed.User stories
New US-J18 (fast-forward, push and clean up branches); updated US-J14, coverage, usage/protocol docs, verification log.
Screenshots
Demo repo as in #498, plus
mainone commit behindorigin/mainand a squash-merged leftoverfeat/sq(unique commit, upstream gone).Worktree menu: 快进到上游 when only behind
| Viewport / theme | Before (#501) | After |
|---|---|---|
| desktop 1280×900 light | !before | !after |
| desktop 1280×900 dark | !before | !after |
| tablet 768×800 light | !before | !after |
| tablet 768×800 dark | !before | !after |
| phone 390×844 light | !before | !after |
| phone 390×844 dark | !before | !after |
分支 tab: row actions, 已合入默认分支 badge, 清理分支(N)
| Viewport / theme | Before (#501) | After |
|---|---|---|
| desktop 1280×900 light | !before | !after |
| desktop 1280×900 dark | !before | !after |
| tablet 768×800 light | !before | !after |
| tablet 768×800 dark | !before | !after |
| phone 390×844 light | !before | !after |
| phone 390×844 dark | !before | !after |
清理分支 preview as a panel subview (new)
| Viewport | Light | Dark |
|---|---|---|
| desktop 1280×900 | !light | !dark |
| tablet 768×800 | !light | !dark |
| phone 390×844 | !light | !dark |
Interaction
docs/refresh→ 发布分支… → preview (remote, target, redacted push URL) → 发布 → 完成:!publish flow
chore/old-depspreselected,feat/sq(unique commits) not → delete → results with recovery command → 完成:!cleanup flow