diff --git a/.codex/instructions.md b/.codex/instructions.md index 9667e64..769ffc7 100644 --- a/.codex/instructions.md +++ b/.codex/instructions.md @@ -1,49 +1,40 @@ # Codex Instructions for Polaris -## 必読ファイル -1. CLAUDE.md(ルール) -2. autorun/INDEX.md(Phase DAG) -3. 該当 Phase の TASKS.md +## 最重要ルール: miyabi gate を使え + +タスクを始める前に必ず: +1. `miyabi gate register --issue --title "タスク名"` +2. `miyabi gate impact --risk --symbols ` +3. `miyabi gate assign --agent codex --node macbook --files "変更ファイル"` + +ファイルを編集した後: +4. `miyabi gate branch feature/issue--` +5. `miyabi gate pr ` +6. `miyabi gate merge ` + +## 禁止 + +- 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)` diff --git a/AGENTS.md b/AGENTS.md index 5210b78..562172f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,7 +29,7 @@ # 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. diff --git a/CLAUDE.md b/CLAUDE.md index a92abd1..6c5b302 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -116,12 +116,72 @@ miyabi agent run coordinator --issue <番号> --- +## Polaris (DTP) — 確定的タスク実行プロトコル + +このリポには Polaris が統合されている。全エージェントは以下のルールに従うこと。 + +### 必須: タスク作業前に miyabi gate を使う + +```bash +# 1. タスク登録(Issue 番号必須) +miyabi gate register --issue --title "タスク名" + +# 2. 影響分析を記録 +miyabi gate impact --risk --symbols + +# 3. ファイルロックを獲得してから作業開始 +miyabi gate assign --agent <自分の名前> --node <マシン名> --files "変更するファイル" + +# 4. ブランチを記録 +miyabi gate branch feature/issue-- + +# 5. PR を記録 +miyabi gate pr + +# 6. merge を記録 +miyabi gate merge +``` + +### 禁止 + +- `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 # コンテキストアタッチメント表示 +miyabi gate dream # 学び抽出 +miyabi gate serve # Web ダッシュボード (localhost:4848) +``` + +### 緊急時 + +```bash +miyabi gate force-unlock --reason "理由" --operator "名前" +miyabi gate manual-complete --reason "理由" --operator "名前" +``` + +### バイナリ + +- リリースビルド: `target/release/miyabi` +- PATH: `~/bin/miyabi-gate` +- ビルド: `cargo build --release` + +--- + **このファイルはClaude Codeが自動参照します。** # 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. diff --git a/skills/self-improving-skills/skill-runs.jsonl b/skills/self-improving-skills/skill-runs.jsonl index 0386f49..82d0212 100644 --- a/skills/self-improving-skills/skill-runs.jsonl +++ b/skills/self-improving-skills/skill-runs.jsonl @@ -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":""}