Skip to content

fix(fork): auto-rebase 發版途中不再失聯、過時的鎖會自動收,每次結果都寫進筆記 - #77

Merged
audichuang merged 2 commits into
developfrom
fork-chore/automation-notes-and-locks
Oct 26, 2026
Merged

audichuang merged 2 commits into
developfrom
fork-chore/automation-notes-and-locks

Conversation

@audichuang

Copy link
Copy Markdown
Owner

為什麼

10-25~10-26 的 fork commit 審查找到自動 rebase 流程的漏洞,加上使用者的要求:通知沒人會處理,自動化要把「建議」與「之前怎麼處理過」留在筆記裡,下一次排程自己照做。

改了什麼

orca-fork-auto-rebase

  • 第 6 步移動 develop 後不再馬上收鎖:PR 留 <!-- auto-rebase:develop-moved <sha> -->,PR 與 rebase/vNEW 留到第 7 步發版結束。發版途中死掉 → 六小時後 precheck 判定過期 → 第 0 步看到這則留言就接著發版(已推 tag 的直接等 release run)。發版本身失敗則收鎖並回報一次,不會每六小時重跑。
  • PR 改在第 1 步 rebase 完成後就開,第 2 步開始留心跳,長時間的本機閘門不會被判成過期。
  • verified/needs-human 的鎖:上游出了更新的 release,或 develop 基底已經是那一版時,precheck 放行,第 0 步備份後收鎖(使用者已照 verified 留言推了 develop、還沒發版的就接著發版),不再讓之後所有 rebase 都靜默跳過。
  • 每次 run(不論成敗)寫 resolution-history.md:每個衝突怎麼解、守它的測試、卡在哪;用掉的 known-resolutions.md 條目搬進去而不是刪掉。沒移動 develop 時,自己解出的衝突補成條目給下一次用。
  • 新條目類型「fork 自身問題」(沒有上游 sha):下一次 rebase 照它改;只改 fork 自己測試檔的修正免 mutation 證明。
  • 小修:ar-$RUN-olddev 先 pnpm install;指令範例改成 ${OLD_DEVELOP}:(zsh 修飾符)。

precheck.sh:GitHub API 失敗或上游 release tag 格式怪異時安靜跳過,不再每天發一次預檢錯誤通知。用假 git/gh 跑過 9 種情境,exit code 都符合預期。

orca-fork-canary:讀 resolution-history.md 找前例;會寫「fork 自身問題」條目;通知裡寫明已記進筆記、不需要使用者處理。

fork-notes.sh:push 其實成功、只是客戶端看到錯誤時,tip 等於自己剛寫的 commit → 當成成功,不再回 exit 2。用「真的推上去後回 1」的假 git 驗證:舊版 exit 2、新版 exit 0。

pty-connection-test-environment.test.ts:第一個 case 也只計算 restore 之後的觸發(canary 10-26 的建議)。把 clearTrackedRealTimers() 註解掉,兩個 case 都會紅。

FORK.md:PR 上的 dmg 也沒有 hardened runtime 與 team-id 檢查,只有 dryrun tag 會走到;筆記分支的內容。fork-release.yml:dryrun dmg artifact 保留 1 天。

驗證

  • pnpm run check:code-quality:changed v1.4.240:0 個新問題
  • 測試檔通過;mutation 確認仍會紅
  • precheck 情境測試、fork-notes.sh 模擬測試(上面)

🤖 Generated with Claude Code

audichuang and others added 2 commits October 26, 2026 08:01
… run in the notes

- Auto-rebase opens its PR right after the rebase so step 2 heartbeats, keeps the PR and
  rebase/* lock until the release ends (a run dying mid-release is resumed from a
  develop-moved marker), and retires a verified or needs-human lock once a newer upstream
  release lands instead of skipping every later release in silence.
- Every run writes resolution-history.md on fork-canary-notes; consumed entries move there
  instead of being deleted, and "fork-only" entries are applied by the next rebase.
- precheck: a GitHub API failure or an odd release tag skips quietly instead of alerting.
- fork-notes.sh: a push that landed despite a client error is a success, not exit 2.
- pty-connection-test-environment.test.ts: count timer firings only after restore.
- FORK.md: the PR dmg build skips the hardened runtime and team-id check too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The precheck let a new run start every hour while step 7 released from a verified PR
the user had pushed; a develop-moved comment now applies the 6 h stale rule, and the
canary treats it as in flight. Network failures in the precheck skip quietly, resumed
releases take vOLD and used entries from the PR body, and annotated tags compare ^{}.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@audichuang
audichuang merged commit 71d86e6 into develop Oct 26, 2026
26 of 28 checks passed
@audichuang
audichuang deleted the fork-chore/automation-notes-and-locks branch October 26, 2026 00:29
audichuang added a commit that referenced this pull request Oct 26, 2026
…ixes

fix(fork): /code-review 對 #77 的修正:步驟編號不再混淆、precheck 長時間失敗會警報
audichuang added a commit that referenced this pull request Oct 26, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 27, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 28, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 29, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Oct 30, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 2, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 3, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 4, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 5, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 5, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 6, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 7, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 8, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
audichuang added a commit that referenced this pull request Nov 8, 2026
Code review of #77:
- SKILL.md: "第 N 步" always names a `## N.` section, items are "第 N 點"; the jumps
  to section 8 say so, and the develop-moved comment carries the literal sha.
- precheck: API or network failures stay quiet until they last 6 h, then alert once a
  day; markers are read with the same jq startswith as the canary precheck.
- FORK.md: the next run releases a verified head the user already pushed.
- pty-connection-test-environment.test.ts: 50 ms timers so the timeout half still
  checks something when restore is slow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant