[整備] Polaris 運用設定: CLAUDE.md + Codex + グローバルルール + dream cron

- CLAUDE.md に Polaris ルール追加(全エージェント必読)
- .codex/instructions.md 更新(Codex 用ルール)
- ~/.claude/rules/polaris-gate.md(グローバルルール)
- launchd: com.miyabi.polaris.dream(毎日 03:00 に学び抽出)
- logs/ ディレクトリ作成

エージェントが自然に miyabi gate を使えるように設定完了。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
林 駿甫 (Shunsuke Hayashi) 2026-04-10 08:15:24 +09:00
parent a965bd3b62
commit b56728ba22
4 changed files with 101 additions and 44 deletions

View file

@ -1,49 +1,40 @@
# Codex Instructions for Polaris
## 必読ファイル
1. CLAUDE.mdルール
2. autorun/INDEX.mdPhase DAG
3. 該当 Phase の TASKS.md
## 最重要ルール: miyabi gate を使え
タスクを始める前に必ず:
1. `miyabi gate register --issue <N> --title "タスク名"`
2. `miyabi gate impact <task-id> --risk <level> --symbols <N>`
3. `miyabi gate assign <task-id> --agent codex --node macbook --files "変更ファイル"`
ファイルを編集した後:
4. `miyabi gate branch <task-id> feature/issue-<N>-<slug>`
5. `miyabi gate pr <task-id> <PR番号>`
6. `miyabi gate merge <task-id> <SHA>`
## 禁止
- assign せずにファイルを編集しないpre-commit hook が拒否する)
- 他のエージェントがロック中のファイルに触らない
- Issue なしで作業を始めない
## 確認
## 品質チェック(タスク完了前に必ず実行)
```bash
cargo test && cargo clippy --all-targets --all-features -- -D warnings
miyabi gate status # 全タスク
miyabi gate locks # ロック中ファイル
miyabi gate dispatchable # 実行可能タスク
miyabi gate dag # 依存関係
```
## コミットルール
## 品質
```bash
cargo test --all
cargo clippy --all-targets --all-features -- -D warnings
```
## コミット
日本語タグ形式: `[追加]`, `[修正]`, `[改善]`, `[整備]`, `[文書]`, `[検証]`, `[完了]`
## 禁止事項
- unsafe コード
- GATE バイパス
- テスト RED のまま完了宣言
- git push --force
## miyabi gate CLI
バイナリ: `target/release/miyabi` または `~/bin/miyabi-gate`
```bash
# タスク登録
miyabi gate register --issue 45 --title "タスク名"
# 状態確認
miyabi gate --format json status
# ロック獲得
miyabi gate assign task-001 --agent codex --node macbook --files "src/auth.rs"
# ブランチ記録
miyabi gate branch task-001 feature/issue-45-auth
# PR 記録
miyabi gate pr task-001 78
# merge 完了
miyabi gate merge task-001 a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
# ロック一覧
miyabi gate locks
# exit code: 0=成功, 1=GATE拒否, 2=入力エラー
```
Issue 番号を含める: `[修正] GATE 0 拒否 (#52)`

View file

@ -29,7 +29,7 @@
<!-- gitnexus:start -->
# GitNexus — Code Intelligence
This project is indexed by GitNexus as **miyabi-cli-standalone** (5689 symbols, 12438 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
This project is indexed by GitNexus as **miyabi-cli-standalone** (5691 symbols, 12441 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.

View file

@ -116,12 +116,72 @@ miyabi agent run coordinator --issue <番号>
---
## Polaris (DTP) — 確定的タスク実行プロトコル
このリポには Polaris が統合されている。全エージェントは以下のルールに従うこと。
### 必須: タスク作業前に miyabi gate を使う
```bash
# 1. タスク登録Issue 番号必須)
miyabi gate register --issue <N> --title "タスク名"
# 2. 影響分析を記録
miyabi gate impact <task-id> --risk <low|medium|high|critical> --symbols <N>
# 3. ファイルロックを獲得してから作業開始
miyabi gate assign <task-id> --agent <自分の名前> --node <マシン名> --files "変更するファイル"
# 4. ブランチを記録
miyabi gate branch <task-id> feature/issue-<N>-<slug>
# 5. PR を記録
miyabi gate pr <task-id> <PR番号>
# 6. merge を記録
miyabi gate merge <task-id> <merge-commit-sha>
```
### 禁止
- `miyabi gate assign` せずにファイルを編集する → pre-commit hook が拒否
- ロック中の他人のファイルに触る → CLI が拒否
- Issue なしでタスクを始める → GATE 0 が拒否
- HIGH/CRITICAL risk を承認なしで進める → GATE 3 が拒否
### 確認コマンド
```bash
miyabi gate status # タスク一覧
miyabi gate locks # ロック中ファイル
miyabi gate dag # 依存関係
miyabi gate dispatchable # 実行可能タスク
miyabi gate attach <task-id> # コンテキストアタッチメント表示
miyabi gate dream # 学び抽出
miyabi gate serve # Web ダッシュボード (localhost:4848)
```
### 緊急時
```bash
miyabi gate force-unlock <task-id> --reason "理由" --operator "名前"
miyabi gate manual-complete <task-id> --reason "理由" --operator "名前"
```
### バイナリ
- リリースビルド: `target/release/miyabi`
- PATH: `~/bin/miyabi-gate`
- ビルド: `cargo build --release`
---
**このファイルはClaude Codeが自動参照します。**
<!-- gitnexus:start -->
# GitNexus — Code Intelligence
This project is indexed by GitNexus as **miyabi-cli-standalone** (5689 symbols, 12438 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
This project is indexed by GitNexus as **miyabi-cli-standalone** (5691 symbols, 12441 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.

View file

@ -5,3 +5,9 @@
{"ts":"2026-04-09T21:49:02.984Z","agent":"codex","skill":"rust-development","task":"Fix GitHub Issues #56 and #57: gate exit code mapping and dependency-blocked assign behavior","result":"success","score":0.97,"notes":""}
{"ts":"2026-04-09T21:50:24.425Z","agent":"codex","skill":"rust-llm-pitfalls","task":"Fix GitHub Issues #54 and #55 in protocol.rs with approval and merge lock handling","result":"success","score":1,"notes":""}
{"ts":"2026-04-09T21:52:05.485Z","agent":"codex","skill":"rust-llm-pitfalls","task":"Issue #52/#53 修正: issue=0 拒否とブランチ名バリデーション実装","result":"success","score":0.95,"notes":""}
{"ts":"2026-04-09T22:28:02.343Z","agent":"codex","skill":"rust-llm-pitfalls","task":"Implement dream command for Deterministic Task Protocol and extract learnings from event logs","result":"success","score":1,"notes":""}
{"ts":"2026-04-09T22:30:25.557Z","agent":"codex","skill":"rust-llm-pitfalls","task":"attach_context 実装確認・検証: DTP 記憶アタッチメント (#58)","result":"success","score":0.96,"notes":""}
{"ts":"2026-04-09T22:42:43.479Z","agent":"codex","skill":"rust-development","task":"Build Polaris DTP web dashboard with miyabi gate serve and JSON endpoints","result":"success","score":0.96,"notes":""}
{"ts":"2026-04-09T22:50:35.069Z","agent":"codex","skill":"obsidian-knowledge","task":"Add Obsidian vault integration to dream and attach_context modules","result":"success","score":1,"notes":""}
{"ts":"2026-04-09T22:51:26.655Z","agent":"codex","skill":"polaris-ops","task":"theta cycle 統合確認: dream に自動記録 + 学び昇格 (#60)","result":"success","score":0.96,"notes":""}
{"ts":"2026-04-09T23:10:47.489Z","agent":"codex","skill":"polaris-ops","task":"verify_merge + escape hatch 実装","result":"success","score":0.95,"notes":""}