---
name: Stop hook auto-publish は source を commit しない (2026-05-06 確認)
description: ★★★★★ 永久原則. Stop hook (auto-publish.ts) は data + bundle (dist-renderer/assets/) のみ commit する仕様. src/renderer/ や scripts/ の source 変更は **手動 commit が必須**. 私が「Stop hook が次ターン終了時に commit + push します」 と複数回伝えたが事実誤認. user に「サイトが更新されない」 と気付かれて初めて発覚. 永久に繰り返してはならない誤り
type: feedback
originSessionId: 17aa1390-f94f-4592-91ee-1044c6bf1122
---
# Stop hook auto-publish は source を commit しない

## 永久原則

**Stop hook (`scripts/auto-publish.ts`) が自動 commit するのは以下のみ:**

- `data/` 配下の指定 JSON files (rei-stats / discovery / theory-chart/feed.json 等)
- `dist-renderer/assets/` の bundle artifacts (vite build 出力)
- `dist-renderer/data/` の mirror copies
- `dist-renderer/index.html` / `app.html`
- 一部の indexed file (formalize-templates.json, daily-banner.json 等)

**自動 commit されない (= 手動 commit 必須):**

- `src/renderer/` 配下の **全 source code** (App.tsx / components/ 全て / 新規 file)
- `src/aios/` / `src/axiom-os/` / `src/compiler/` 等の **全 source code**
- `scripts/` 配下の **全 builder script** (auto-publish.ts 自身も含む)
- `test/` 配下の test code
- 新規追加した builder の output JSON は staging list に追加しないと commit されない

## Why (理由)

**stage list 限定設計**: `auto-publish.ts` の `stageCandidates` 配列は data + bundle に限定されており、 source code は除外されている。 これは:

1. Source 変更は人間 review を経て commit すべき
2. Stop hook は data refresh / 自動再生成のためのもので、 「機能追加」 用途ではない
3. 大量の uncommitted source 変更を Stop hook が暗黙 commit すると、 review なしの code が GitHub に push される risk

→ 設計判断として正しい。 私の誤認は **私が auto-publish.ts の動作を確認せずに「Stop hook が commit + push します」 と楽観的に説明し続けた** こと。

## How to apply (永久原則)

### 私が「Stop hook が commit してくれる」 と発言する前に必ず確認:

```bash
# auto-publish.ts の stage list を read
grep -A 5 "stageCandidates" scripts/auto-publish.ts | head -30

# 改変した file が stage list に含まれるか確認
git status --short | grep -E "src/|scripts/|test/"
# ↑ ここに何か出ていたら手動 commit が必要
```

### user に Phase / commit 状態を説明する時の正しい言い回し:

❌ 不正確 (私の過去の誤り):
> 「Stop hook が次ターン終了時に commit + push してくれます」 (← source 変更があると false)

✅ 正確:
> 「Stop hook は data + bundle を commit します。 source 変更 (App.tsx / components/ / scripts/) は **手動 commit が必要**です。 commit してよろしいですか?」

### 新規 source file (component / builder) を作った時の checklist:

1. ✅ Build で構文確認 (`npx vite build` / `npx tsx <script>`)
2. ✅ stage list 確認 (`auto-publish.ts` の stageCandidates に含まれるか)
3. ⚠ もし source 改変があれば user に commit 確認:
   - 「commit してよろしいですか?」
   - approval 後 `git add <specific files>` + `git commit` + `git push`
4. ✅ Cloudflare Pages deploy 待ち (~1-2 分)
5. ✅ user に確認 URL を提供

### Source commit 時に stage する典型 file group

```bash
# Group 1: Source code (modified + new)
git add src/renderer/<modified>.tsx src/renderer/components/<new-folder>/

# Group 2: Scripts (modified + new)
git add scripts/<modified>.ts scripts/<new>.ts

# Group 3: Builder output (canonical + dist mirror)
git add data/<feature>/ dist-renderer/data/<feature>/

# Group 4: Bundle (vite build output)
git add dist-renderer/index.html dist-renderer/app.html dist-renderer/assets/
```

## 観察された symptom (この誤り起きるとこうなる)

- user が新 route の URL を開くと、 **既存 launcher (top page) が表示される**
- React Router fallback で route 不明扱い → launcher 表示
- 「本日の更新」 banner の date が 古いまま (= 古い bundle が deploy されている証拠)
- 新規 component file が working tree のみで GitHub に存在しない
- `git log -1` の commit が `Auto: site rebuild + stats refresh` 系で stop hook 自動 commit のみ

## 関連 memory

- `feedback_index_html_bundle_sync.md` — vite build と index.html の同期 issue (本 memory の sister)
- `project_uncommitted_files_policy.md` — auto-generated file policy (data 系は放置で OK)
- `feedback_critique_response_pattern.md` — 反射的「OK です」 系の自己警戒 (本 memory もこの一例)

## 2026-05-06 incident summary

- 私が Theory Chart Phase 2.2-FX + Realtime Observatory + 倫理的食観測 の 3 大変更を実装
- 各段階で「Stop hook が commit + push してくれます」 と user に複数回伝達
- user が `https://rei-aios.pages.dev/#/realtime` を確認 → launcher が表示される
- 私の誤認 reveal: source 変更は Stop hook では commit されない仕様だった
- 手動 git add + commit + push (commit 46f25d8b, 18 files / +1795 / -212) で deploy 完了
- 永久原則として本 memory 保存
