mergegate/autorun/sprint-1-today/TASKS.md
2026-04-10 14:50:57 +09:00

2.8 KiB
Raw Blame History

Sprint 1: 品質確定(今日)

Phase C + clippy 完了 → v1.0 タグ

1.1 verify_merge ラッパー (~50行)

  • crates/miyabi-core/src/protocol.rsverify_merge() を追加
    • 既存の get_pull_request() (github.rs) を呼ぶ
    • PullRequest.merge_commit_sha を取得
    • pr.state == "merged" を検証
    • SHA が 40hex であることを検証
    • tasks.json 更新: merge_commit + state → done
    • ロック解放
    • 後続タスク blocked → pending
  • CLI に miyabi gate verify-merge <task-id> サブコマンド追加
  • テスト: mock PullRequest で merged → done 遷移

1.2 escape hatch (~50行)

  • protocol.rsforce_unlock() 追加
    fn force_unlock(&self, task_id: &str, reason: &str, operator: &str) -> Result<()>
    
    • ロック即解放
    • event log に reason + operator を記録
    • state は変更しないimplementing のまま)
  • protocol.rsmanual_complete() 追加
    fn manual_complete(&self, task_id: &str, reason: &str, operator: &str) -> Result<()>
    
    • PR/merge なしで done に遷移
    • event log に reason + operator + "manual" を記録
    • CompletionMode::Manual として区別2026-04-10 実装反映)
  • CLI に miyabi gate force-unlock <task-id> --reason R --operator O 追加
  • CLI に miyabi gate manual-complete <task-id> --reason R --operator O 追加
  • テスト: force_unlock → ロック解放確認
  • テスト: manual_complete → done 遷移 + event 記録

1.3 E2E テスト (~100行)

  • crates/miyabi-core/src/protocol.rs の tests モジュールに E2E 追加(full_lifecycle_register_to_merged_releases_lock — マージ完了時は TaskState::Merged
    #[test]
    fn full_lifecycle_register_to_merged_releases_lock() {
        // register → impact → assign → branch → pr → merge(40hex)
        // assert: Merged, lock == None
    }
    
  • GATE 拒否テスト: issue=0 → GateError既存テスト群でカバー
  • GATE 拒否テスト: impact なしで assign → GateError既存
  • GATE 拒否テスト: HIGH risk + 承認なし → GateError既存
  • GATE 拒否テスト: ロック競合 → LockError既存
  • GATE 拒否テスト: 不正 SHA → GateError既存
  • escape hatch テスト: force_unlock + manual_complete

1.4 最終確認

  • cargo test --all → 全 GREEN
  • cargo clippy --all-targets --all-features -- -D warnings → ゼロエラー
  • cargo build --release → リリースビルド成功
  • npx gitnexus analyze --force → 再インデックス(必要時に手動)
  • git tag v1.0-dtp-complete(リリース判断後)
  • git push origin v1.0-dtp-complete
  • ~/bin/announce "Polaris v1.0 完成。全 GATE 実装済み。テスト GREEN。"