STEP 1670 — Tab Isolation Protocol v0.1

Date: 2026-09-02  ·  Repo: fc0web/rei-aios  ·  Commit: 413633ebb  ·  Session: rei-aios-63 [6cb76c]

起点

藤本さん directive: 「commit も push も 衝突するのは 当然。 memory や commit をする 場所を 新たに 設けて そちらにて 行うというのが 当然だと 思いませんか? 対策を講じて、 他タブにも それを 伝えて下さい」 (2026-09-02 arc (a) 実行中の incident 直後)。

2026-09-02 incident 3 段:
  1. data/lean4-mathlib/CollatzRei/AndricaConjectureAxiomCheck.lean (75 line, 63 #print axioms) + AndricaGoldenConstantPolynomialAxiomCheck.lean (30 line, 20 #print axioms) 消失 — 未 commit だったため git 履歴回収不能
  2. data/axiom-cost-atlas/strict-lean4-scan.json 上書き — 私が 590 theorems 書いた版が 2026-08-22 の 333 theorems 版 に restore
  3. data/step-counter.json が 33 STEP 分 rollback (next=1662 → next=1630)
root cause 自己申告 (rei-aios-96 tab SendMessage 経由): STEP 1657 push retry 中 git rebase --abortrm -rf .git/rebase-mergegit stash push -ugit checkout --theirsgit checkout main の 5 段 recovery が shared tree 上で 実行、 私の untracked files を wipe。 Timing matches。

対策原則

「shared-write path は 事故 前提。 全 tab は 自分の 領域 だけを 触る」

data/tabs/<tab-id>/
├── README.md              # tab manifest
├── step-claims.json       # このtab が claim した STEP 番号 の 記録
├── drafts/                # 未 commit の 新規 file (別 tab の git 操作 wipe 対象外)
├── scan-outputs/          # 長時間走る build/scan の 出力先
└── ledger-preview/        # 外部 repo ledger 追記前 snapshot

5 Rule

  1. tab-id 直下 のみ 書込 OK (ListAgents で取得)
  2. 他 tab の data/tabs/<other>/ は read も 原則しない
  3. 絶対 shared tree 上で git checkout / reset / stash / clean を 実行しない
  4. Shared path への promote は scripts/git-atomic-commit.sh の 一部として のみ
  5. Session 起動時 ListAgents で 自 tab-id 取得 → data/tabs/<self>/ 作成

Peer broadcast (5 active tabs)

TabResponse
rei-aios-6bSTEP 1658 で EnterWorktree による worktree 隔離 approach を 独立に 発見・実装済との 相補提案、 hybrid framing 合意
rei-aios-96root cause 自己申告 + protocol 採用 (data/tabs/rei-aios-96/ 作成、 STEP 1671 arc を 隔離下で継続)
rei-aios-bb本 STEP 直後に STEP 1672 3 永久原則 (commit-msg hook + tab-worktree.sh + notepad log) を land、 sidecar approach を排他ではなく併用推奨として保存
rei-aios-e5 / 80 / 1b応答なし (idle 継続)

Hybrid framing (2026-09-02 3 approach 併用)

ApproachScopeWeight推奨用途
worktree 隔離 (STEP 1658/1672)branch + index + working tree 完全隔離heavyMulti-file arc、 長時間実装、 build 系
sidecar data/tabs/<tab-id>/ (本 STEP 1670)shared tree 内 sub-dir、 promote 経路必要lightTab-scoped state (step-claims manifest, cross-tab visibility)、 短命 scan output
commit-msg hook (STEP 1672)STEP 番号 collision 事後検知gate全 commit の 冒頭行 STEP N が git log にすでに あるか post-hoc verify

選択 heuristic: conflict 起きにくい局所変更 → sidecar / large multi-file conflict-prone arc → worktree

実装 (8 file)

Honest scope (v0.1 未対策):
  1. Auto-generated data file (arxiv-recent 等) の 上書き collision は 別問題
  2. 同 shared file を 2 tab が 同時 edit の general merge は 手動 rebase 必要
  3. rei-checker-mcp/ledger.jsonl 等 別 repo は scope 外
  4. Windows filesystem lock 挙動は 環境依存
  5. data/tabs/<tab-id>/ は 現状 git tracked (drafts wipe 対策) — 大量蓄積時 cleanup は v0.2+
  6. STEP counter self-heal は 未実装 (v0.2 candidate、 STEP 1672 でも 未組込)

関連

STEP 1554 atomic-commit protocol dogfood 34 例目。5-tab 併走 collision 直後の 隔離 protocol 起票。