---
name: project-ci-workflows-rei-pl-ssh-fix-2026-06-18
description: GitHub Actions 3 workflows (META-DB Auto Sync / Daily Impossibility Equations / Smoke Test) の rei-pl private repo SSH access fail + git push race condition 修復、 既存 working pattern 適用
metadata: 
  node_type: memory
  type: project
  originSessionId: 5d28ae7c-687d-4389-8e5e-c7bd64100573
---

# GitHub Actions 3 workflows fix — rei-pl SSH + git race condition (2026-06-18)

藤本さん報告 「META-DB v3.0 Auto Sync + Daily Impossibility Equations workflow run failure」 を受けて gh CLI で log audit + root cause 特定 + 3 workflow 修復。

## Root cause 1: npm install during rei-pl SSH access fail

`package.json` の devDependencies に `"rei-pl": "github:fc0web/rei-pl"` (private repo) があり、 GitHub Actions runner は SSH key を持たないため `npm install --no-save tsx typescript` (rei-pl は直接使わないのに) が dependency tree resolution 時に rei-pl の git clone を試みて `Permission denied (publickey)` で fail。

### 影響 workflow:

| Workflow | 過去 fail history |
|----------|-------------------|
| META-DB v3.0 Auto Sync | 2026-06-17 23:27 UTC fail + 過去 daily |
| Daily Impossibility Equations | 2026-06-17 19:53 UTC fail + 過去 daily |
| Smoke Test (Live Deploy) | 2026-06-01 / 06-08 / 06-15 weekly fail |

### 既存 working precedent:

- `.github/workflows/rei-learning-cycle.yml` (disabled_manually だが pattern 正しい)
- `.github/workflows/test.yml` (working)

両 workflow が `Remove git-based dependency before install` step を持つ:

```yaml
- name: Remove git-based dependency
  run: npm pkg delete devDependencies.rei-pl

- name: Install dependencies
  run: npm install
```

### Fix (3 workflow に同 pattern 適用):

```yaml
- name: Remove git-based rei-pl dependency
  run: npm pkg delete devDependencies.rei-pl

- name: Install tsx  (or "minimal deps", per workflow)
  run: npm install --no-save tsx typescript
```

## Root cause 2: META-DB auto-sync git push race condition

私の Paper 167 publish の連続 commit と META-DB workflow の自動 commit が race し、 workflow の `git push origin main` が `! [rejected] main -> main (fetch first)` で fail。

### Fix:

META-DB workflow の commit + push step に `git pull --rebase origin main || true` を追加:

```yaml
git commit -m "..."
git pull --rebase origin main || true
git push origin main
```

## Verification (post-fix manual re-run)

- **Daily Impossibility Equations** (run 27726943998): ★ **SUCCESS** in ~31 sec
- **META-DB v3.0 Auto Sync** (run 27726942750 = npm fixed, but git race still): ❌ fail → race fix (commit `ad0394f1`) → manual re-run 27727036335: ★ **SUCCESS**
- **Smoke Test**: 次 Monday cron (2026-06-23 21:00 UTC / 06:00 JST 2026-06-24) で verify pending

## Commit log

| commit | 内容 |
|--------|------|
| `43e2d48d` | fix(ci): add 'npm pkg delete devDependencies.rei-pl' to 3 workflows (metadb-sync + daily-impossibility + smoke-test) |
| `ad0394f1` | fix(ci): add git pull --rebase before push in metadb-auto-sync to avoid race-condition rejects |
| `e7e2e4c8` | push 完了 (rebase 適用後) — Daily Impossibility と私の commit が race していたため stash + rebase + push の recovery |

## 不変保持

- `Rei Learning Cycle` workflow は依然 `disabled_manually` (藤本さん判断保留)、 本 fix は影響なし
- `Rei-AIOS Tests` も依然 `disabled_manually`、 本 fix は影響なし
- rei-pl private repo の SSH key は GitHub Actions に 投入せず (security policy preserve)
- 本 fix で消える機能なし、 添加のみの非破壊修正

## ★ 後の builder への signal

将来 「GitHub Actions workflow X が npm install で fail」 report が来た時:

```
1. gh run view {run_id} --log-failed で error 詳細確認
2. "Permission denied (publickey)" + "rei-pl" 出現 → 本 incident と同 root cause
3. 該当 workflow の "Install" step の前に
     - name: Remove git-based rei-pl dependency
       run: npm pkg delete devDependencies.rei-pl
   を追加
4. commit + push で fix
5. gh workflow run {workflow.yml} で manual re-run trigger
6. gh run view --json status,conclusion で verify
```

将来 「workflow が git push で rejected fail」:

```
1. gh run view で "! [rejected]" + "fetch first" 確認 → race condition
2. workflow の commit + push step に
     git pull --rebase origin main || true
   を push 前に追加
```

## 関連 memory

- [[project-buddy-stall-fix-2026-06-17-18]] (同日の `Rei Learning Cycle` disabled_manually 判明 incident、 本 fix とは独立だが 「workflow disable / 停止 / fail」 family の lesson)
- [[project-paper167-publish-paper164-pattern5-incident-2026-06-18]] (同日の race condition 起因の私の連続 push が META-DB workflow と race した root cause source)
