3 永久原則
multi-tab collision の 恒久対策 — 2026-09-02 藤本さん directive の 永続化
2026-09-02 STEP 1660 の 事案 (私 の kakeya arc と 別 tab の NNUE opening book が 同 STEP 番号 を claim → git-mv rename で STEP 1662 に 訂正) を 直接根因として、 藤本さんが 出した directive:
「1 タブに付き、 新たなコミット&プッシュ空間を作る + 実装完了ごとに 単一 append-only notepad に 永久記録 + STEP 番号 collision の 恒久防止」
本 protocol は 3 原則 (A / B / C) で 構成され、 .githooks/ と scripts/ に 実装される 永続的 safety net。
ASTEP 番号 collision 事後検知
.githooks/commit-msg
commit-msg hook が commit message 冒頭行 の STEP N を抽出 → git log --all --grep で 既 commit hit を 検知 → collision なら abort。
Bypass (corrigendum / rename / amend 時のみ):
STEP_COLLISION_BYPASS=1 git commit ...
Origin = STEP 1660 事案。 scripts/claim-step.ts counter が git 実使用値と drift しても、 hook で 最終確認。
B1 tab = 1 worktree
scripts/tab-worktree.sh
新 tab は 独立した git worktree + branch を .claude/worktrees/step<N>-<slug>/ に生成。 STEP claim も自動化。
# 新 tab 起動 scripts/tab-worktree.sh open my_arc_slug cd .claude/worktrees/step<N>-my_arc_slug # 実装 + test + commit + push git push -u origin worktree-step<N>-my_arc_slug # 完了 (main worktree から) cd C:/Users/user/rei-aios scripts/tab-worktree.sh close my_arc_slug
.git/index race (shared lock file) は worktree 分離で 物理的解消。 git-atomic-commit.sh は 引き続き 併用推奨 (main worktree の 単独 commit 時用)。
CNotepad 永久 append-only log
docs/notepad/<YYYY-MM-DDTHH-MM>_STEP-<N>_<slug>.md
実装完了ごとに 1 file 追加。 上書き / 削除 禁止、 unique filename で multi-tab collision 不可能。 site mirror public/tools/notepad/entries/ は pre-commit hook Section 5 が auto-copy + manifest 再生成。
entry 内容 (rich self-contained record):
- STEP 番号 + slug + 一行 summary
- Timestamp (JST) + tab worktree + commit hash
- 主要 finding / evidence (5-10 行)
- Honest scope (主張しないこと / 前提)
- Failure mode (機械学習用 dataset)
- 上限なし 追加 section
参照:
- Local:
ls -t docs/notepad/*.md | head -5 - Site: /tools/notepad/ (client-side filter/search)
ⅣMEMORY.md hooks (inbox pattern) との併存
- notepad = 「何を何時作ったか (公開永久 log)」
- MEMORY.md hooks = 「なぜ / どう考えたか (private 内省 + inbox merger 経由の 累計統合)」
- 両方使う — notepad は 「引き当て可能な最小 record」、 hooks は 「why / correction 経緯 の 詳細」
Ⅴ関連 STEP
- STEP 1670 Tab Isolation Protocol v0.1 — per-tab sidecar 隔離 (data/tabs/<tab-id>/)
- STEP 1658 Stopping Condition v0.2 — worktree isolation 先行 実測
- STEP 1672 Notepad (index) — 原則 C の 現在の状態
Honest scope
- 本 protocol は 「事後検知 (A)」 + 「物理分離 (B)」 + 「append-only 記録 (C)」 の 3 層で multi-tab collision を 予防するが、 完全な 予防 ではない (bypass 経路 が 意図的に 存在、 legitimate follow-up 用)
- 原則 B の worktree isolation は heavy multi-file arc 向け。 light tab-scoped state は STEP 1670 sidecar (data/tabs/<tab-id>/) との 併用推奨
- 本 site page は 2026-09-03 STEP 1701 で retroactive 追加 (STEP 1672 本来 の site 未反映 gap fix)。 protocol 自体 は STEP 1672 land 済 (2026-09-02 commit 履歴 参照)
- 本 page 記載の cmd 例 は 実装当時の snapshot、 実際の cli は
scripts/tab-worktree.sh --helpと.githooks/commit-msgを 参照