Skip to content

fix(cli): wait --verify がワーカーのコミット前に検証して合格を返す #3430

Closed

Description

@Kewton

事象

2026-10-08 の orchestrate run で、commandmatedev wait commandmate-issue-3423 --instance claude --on-prompt human --verify が、ワーカーのコミット前の状態で検証し、exit 0 を返した。

  • Completed: commandmate-issue-3423 (basis=hook_stop)
  • 検証(trigger=wait)の開始: 2026-10-07T23:37:56.842Z(08:37:56 JST)
  • ワーカー(Claude Code、sonnet)のコミット: 08:38:32 JST(検証の開始の 36 秒後)
  • GATE work-evidence PASS (commits=0, uncommitted=5)。未コミットの変更を作業の証拠として認め、全ゲートが PASS した

今回はコミットされた内容が検証済みの内容と同じだったので害は無かった(オーケストレーターが verify --task でやり直して PASS)。ただ、検証の後にワーカーがさらに変更すれば、検証されていない変更が合格扱いになる。

見立て(未確認)

  • Claude Code が作業の途中で Stop を出した(ターンの途中終了、またはサブエージェントの Stop など)。wait はそれを完了(hook_stop)と読んだ
  • 契約は「コミットは 1 つにまとめる」と求めているのに、work-evidence は uncommitted>0 でも PASS にする

受入基準

  • 当日のサーバーログで、08:37:56 の直前の Stop が何だったかを特定する
  • 途中の Stop で検証が始まらないようにするか、commits=0 かつ uncommitted>0 の検証を合格にしない(どちらにするか決めて、テストで固定する)

分類

  • 原因の PR: 不明
  • 発見経路: orchestrate
  • 影響する経路: cli

Activity

  1. Kewton commented on Oct 8, 2026

    @Kewton
    OwnerAuthor

    orchestrate の run でワーカー(opus)が調査し、原因を特定しました(変更はなし)。Claude がバックグラウンドのテストの完了を待つためにターンを自分で閉じ(23:37:53 の Stop)、完了通知で次のターンが開いてからコミットした(23:38:32)。#2614(Antigravity)と同じ形です。直す場所は src/lib/hooks/sources/claude(Stop の時点で完了通知の無いバックグラウンドの作業を数え、self_resume_pending を付けて stopReportsSelfResume: true を宣言)で、契約の範囲外でした。当面の手当てとして、orchestrate の契約の雛形の success に requireCommit: true を足す案があります。

  2. Kewton commented on Oct 8, 2026

    @Kewton
    OwnerAuthor

    利用者の判断により、範囲を原因の層(src/lib/hooks/sources/claude)まで広げて 2 回目の作業を始めました。あわせて orchestrate の契約の雛形に requireCommit: true を足します。

  3. Kewton commented on Oct 8, 2026

    @Kewton
    OwnerAuthor

    PR #3448(develop マージ済み)で対応しました。Claude がバックグラウンドの作業を残してターンを閉じたとき、その Stop を自己再開(self_resume_pending)として報告し、wait は次の Stop まで待ちます。orchestrate の契約の雛形には requireCommit: true を足しました。本番サーバーへの反映は次の再ビルドから。残りは #3449 / #3450 / #3451 と Kewton/commandmate-skills#308 で追跡します。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions