Skip to content

fix(#1013-followup): loop-state.md 散文誤記修正 — review phase の hard_stop_eligible を false に修正 - #1045

Merged
squne121 merged 4 commits into
mainfrom
worktree-issue-1040-loop-state-review-hard-stop-prose
Jun 20, 2026
Merged

squne121 merged 4 commits into
mainfrom
worktree-issue-1040-loop-state-review-hard-stop-prose

Conversation

@squne121

@squne121 squne121 commented Jun 20, 2026 •

Copy link
Copy Markdown
Owner

概要

loop-state.md 散文中の hard_stop_eligible == true 例示から review phase を除外し、直上の phase table との整合性を回復する。

本 PR は Issue #1040 を close する(Closes #1040)。

変更内容

変更ファイル: .claude/skills/issue-refinement-loop/references/loop-state.md のみ(Allowed Paths 内)

散文の修正箇所(91〜96 行目付近):

  • 修正前: review, post_rewrite_check, decide_next_action の 3 phase を hard_stop_eligible == true の例示として列挙していた
  • 修正後: review を除外し、post_rewrite_check と decide_next_action の 2 phase のみを列挙。さらに review phase が明示的に hard-stop eligible ではなく、decide_next_loop_action.py を呼ばずに VERDICT で直接ルーティングすることを散文に追記

背景

PR #1030(Issue #1013: phase gate 追加)のマージ後、レビュアーが phase table との矛盾を指摘した。

  • phase table: review | continue_investigation | false(正確)
  • 散文: review が hard_stop_eligible == true 相当として誤記(誤り)

runtime 動作への影響はないが、loop-state.md は orchestrator 向け契約文書であり、誤記の放置は将来の実装で誤った hard stop を再導入するリスクがある。

セーフティクレームマトリクス

項目 内容
Claim docs-only prose 修正。runtime 動作への影響なし
Implemented loop-state.md 散文中の hard_stop_eligible == true 例示から review を削除
Not controlled なし(散文修正のみ。runtime logic・phase gate・allowlist は変更しない)
Evidence diff 参照(変更ファイル 1 件、prose のみ)
Follow-up なし

スキーマ変更適用性

変更対象の loop-state.md は orchestrator 向け参照文書であり、機械読み取りされる JSON/YAML スキーマではない。今回の変更は散文誤記の修正のみで、スキーマ consumer への影響はない(not_schema_change)。

検証結果

全 AC を worktree 内で検証済み:

AC 検証コマンド 結果
AC1 rg "is .post_rewrite_check. or" pass(review が削除されたテキストが存在)
AC2 rg "review.*continue_investigation.*false" pass(phase table 変更なし)
AC3 rg "post_rewrite_check. or.*decide_next_action" pass(正しい prose が存在)
AC4 rg "NOT call.*decide_next_loop_action" pass(review phase の明示あり)
AC5 pnpm typecheck / pnpm test pass(67 test files, 898 tests passed)

Allowed Paths 準拠

変更ファイル: .claude/skills/issue-refinement-loop/references/loop-state.md のみ(contract の Allowed Paths 内)

@github-actions

github-actions Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1045/

The preview will be removed when this PR is closed.

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR レビュー判定 — review_subagent

LOOP_VERDICT_V2:
  verdict: APPROVE
  merge_ready: true
  reviewed_head_sha: "3610587750a4629fe4f3c8842c6d5e470ec2ff41"
  reviewed_base_sha: "9eb6f6158dd8097f8ab5c7391c8811cb2da116b2"

  required_auto_actions: []

  blockers: []

  allowed_paths_gate:
    schema: ALLOWED_PATHS_GATE_RESULT_V1
    producer_role: review_subagent
    worker_report_used_as_canonical: false
    expected_contract_fingerprint:
      source_kind: issue_comment
      source_id: "https://github.com/squne121/loop-protocol/issues/1040#issuecomment-4758323641"
      allowed_paths:
        - ".claude/skills/issue-refinement-loop/references/loop-state.md"
    status: ok
    changed_files:
      - ".claude/skills/issue-refinement-loop/references/loop-state.md"
    violations: []
    determination: "PR の実変更ファイルは merge base (9eb6f61) から head (3610587) の git diff --name-only で独立計算。1 ファイルのみで Allowed Paths と完全一致。"

  ac_verification:
    - id: AC1
      status: pass
      method: "rg 'is .post_rewrite_check. or' on PR branch file"
      evidence: "散文 l.91: 'phase is `post_rewrite_check` or `decide_next_action`' が存在する"
    - id: AC2
      status: pass
      method: "rg 'review.*continue_investigation.*false' on PR branch file"
      evidence: "phase table l.79: '| `review` | `continue_investigation` | false |' は変更なし"
    - id: AC3
      status: pass
      method: "rg 'post_rewrite_check. or.*decide_next_action' + 旧テキスト否定検証"
      evidence: "旧テキスト 'phase is `review`, `post_rewrite_check`, or `decide_next_action`' は完全削除済み。l.91 に正しい列挙のみ存在"
    - id: AC4
      status: pass
      method: "rg 'NOT call.*decide_next_loop_action' on PR branch file"
      evidence: "l.94: 'route it directly by `VERDICT` without invoking `decide_next_loop_action.py`' が存在。追加で l.78, l.151 にも 'do NOT call `decide_next_loop_action.py`' の記述がある"
    - id: AC5
      status: pass
      method: "worker 実行 + PR 本文検証結果参照"
      evidence: "pnpm typecheck pass / pnpm test 67 test files 898 tests passed (PR 本文記載・worker report)"
      note: "docs-only 変更のため test suite への影響なし。runtime_verification_applicability: not_applicable"

  notes: >
    diff は 8 行のみの最小変更。散文から 'review,' を削除し、review phase が explicitly not
    hard-stop eligible である旨の補足文を追記している。phase table は変更なし。
    Allowed Paths 外への変更は merge base からの独立計算により確認なし。
    Contract Snapshot (body_sha256: sha256:0f8f6f38...) は
    issue-comment-4758323641 として binding 確認済み。
    self-authored PR のため --comment のみ使用。

@squne121

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES。
ただし、差分内容そのものは承認相当です。ブロッカーは実装・文書セマンティクスではなく、現時点で PR が Draft かつ Check Japanese Content が失敗している点です。PR #1045 は open / draft 状態で、対象は #1040 を close する docs-only 修正です。

確認結果

#1040 の契約は .claude/skills/issue-refinement-loop/references/loop-state.md だけを Allowed Paths とする docs-only 修正で、目的は review phase を hard_stop_eligible == true の例示から外すことです。PR #1045 の差分はその 1 ファイルだけで、旧文の review, post_rewrite_check, or decide_next_action を、post_rewrite_check or decide_next_action に直し、さらに review phase では decide_next_loop_action.py を呼ばず VERDICT に基づいて処理する旨を追記しています。

この修正は #1013 / #1030 で入った phase gate の実装と整合します。現在の build_refinement_phase_state.py では review phase の hard_stop_eligible は False、post_rewrite_check と decide_next_action は True です。

参照文書間の整合も概ね取れています。loop-state.md の phase table では review | continue_investigation | false であり、追加された散文も review を hard-stop eligible から明示的に除外しています。scope-signal-guard.md 側でも review は hard_stop_eligible: false、post_rewrite_check / decide_next_action だけが true です。

ブロッカー

B1: CI が赤い。マージ不可。
head SHA 3610587... の workflow run は ci が success ですが、Check Japanese Content が failure です。失敗ジョブは PR Body Japanese Check で、失敗ステップは Check PR body Japanese ratio です。

GitHub の required status checks は、要求されている場合、successful / skipped / neutral でなければ保護ブランチへ merge できません。したがって、この check が required なら形式的にも merge blocker です。required でなくても、プロジェクトの PR 品質ゲートとしては無視しない方がよいです。([GitHub Docs]1)

修正方針はコード差分ではなく PR本文の日本語比率修正です。hard_stop_eligible などの識別子は code span のまま維持しつつ、英語見出し・英語説明・長い英語文を日本語に寄せて再実行してください。

B2: Draft のまま。
現状 draft PR なので、CI を直した後に ready for review 化する必要があります。これはコード品質問題ではなくプロセス問題です。

非ブロッカーだが直す価値あり

loop-state.md の table には、preflight の effect として proceed to investigation/review とあります。一方、scope-signal-guard.md では investigation/web_research/review です。今回の #1040 は hard-stop prose 1 箇所修正が主目的なのでブロックはしませんが、同一 Allowed Path 内で品質を上げるなら、investigation/web_research/review に揃えるのが安全です。

外部仕様面では、こうした phase contract は prose だけに置くと drift しやすいです。JSON Schema は properties だけでは未定義プロパティを禁止せず、必須性も required で明示する必要があります。将来 ISSUE_REFINEMENT_PHASE_STATE_V1 をより堅くするなら、required と additionalProperties: false 相当の機械検証を追加するのが妥当です。([JSON Schema]2)

また python-jsonschema は iter_errors() で複数の validation error を列挙できます。将来 ISSUE_REFINEMENT_ROUTER_ERROR_V1 の missing_fields / unexpected_fields を精密化するなら、単発 validate() だけで止めず、iter_errors() ベースで構造化する方が運用ログの品質は上がります。今回 PR のスコープには入れないでください。([jsonschema]3)

投稿するならこのレビューコメント

## PR Review: REQUEST_CHANGES

差分内容は #1040 の契約に対して妥当です。`loop-state.md` の hard-stop prose から `review` phase を除外し、`post_rewrite_check` / `decide_next_action` のみを `hard_stop_eligible == true` とする修正は、#1013 / #1030 の phase gate 実装と整合しています。

ただし、現時点では merge_ready ではありません。

### Blocker

- `Check Japanese Content` が failure
  - failed job: `PR Body Japanese Check`
  - failed step: `Check PR body Japanese ratio`
  - 対応: PR body の英語比率を下げ、再実行すること

### Non-blocking

- `loop-state.md` の preflight effect が `investigation/review` のままなので、`scope-signal-guard.md` と合わせるなら `investigation/web_research/review` に揃えるとよい。ただし #1040 の主 AC ではないため、この PR の必須修正にはしない。

結論: CI failure 解消後に ready for review 化すれば merge 可。

実装差分への追加修正は不要です。PR本文の日本語チェックを通して、Draft を外してから merge 判断でよいです。

@squne121
squne121 marked this pull request as ready for review June 20, 2026 14:30

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2

schema: LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "26fd70addf72418c658e195ca279a81e011d29dd"
merge_ready: false
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "UNSTABLE"

blockers:
  - id: B1
    kind: safety_claim_matrix_missing
    mechanical: false
    description: >
      変更ファイルが .claude/skills/** に該当するため safety-sensitive 判定。
      PR 本文に Safety Claim Matrix セクションが存在しない。
      docs-only 変更であり runtime 影響はないが、
      safety-claim-gate.md のルール上 .claude/skills/** への変更は
      Safety Claim Matrix 必須。
      追記内容例: "Claim: docs-only prose fix / Implemented: prose のみ / Not controlled: なし / Evidence: diff 参照 / Follow-up: なし"
  - id: B2
    kind: schema_change_applicability_missing
    mechanical: false
    description: >
      PR 本文に Schema Change Applicability セクションが存在しない。
      loop-state.md は orchestrator 向け契約文書であり、
      散文の変更が schema consumer に影響しないことを
      "not_schema_change" として明示する必要がある。

required_auto_actions: []

auto_fix_applied: []

follow_up_issue_requests: []

allowed_paths_gate:
  schema: ALLOWED_PATHS_GATE_RESULT_V1
  producer_role: review_subagent
  worker_report_used_as_canonical: false
  status: ok
  expected_contract_fingerprint: "sha256:0f8f6f38f79f23dcdeba6e7159a3ad5a5e8b5c4b6299fdc953944a0c1f410933"
  contract_source_kind: issue_comment
  contract_source_id: "https://github.com/squne121/loop-protocol/issues/1040#issuecomment-4758323641"
  changed_files:
    - ".claude/skills/issue-refinement-loop/references/loop-state.md"
  allowed_paths:
    - ".claude/skills/issue-refinement-loop/references/loop-state.md"
  violations: []
  notes: >
    changed files 1 件すべて Allowed Paths 内に収まっている。
    contract fingerprint は issue body sha256 と一致確認済み。

ac_verification:
  producer_role: review_subagent
  results:
    - id: AC1
      status: pass
      evidence: >
        git show FETCH_HEAD で line 92 に
        "hard_stop_eligible == true (i.e., phase is `post_rewrite_check` or `decide_next_action`)"
        が存在。review は prose から除去されていることを独立確認。
    - id: AC2
      status: pass
      evidence: >
        line 82 に "| `review` | `continue_investigation` | false |" が存在。
        phase table は変更なし。
    - id: AC3
      status: pass
      evidence: >
        line 92 に "post_rewrite_check` or `decide_next_action`" が存在。
        review は含まれていない。
    - id: AC4
      status: pass
      evidence: >
        line 82 (phase table) と line 93-94 の散文両方で
        review phase が "NOT call decide_next_loop_action.py" および
        "explicitly not hard-stop eligible" として記述されている。
    - id: AC5
      status: pass_ci
      evidence: >
        CI チェック: python-test / test / typecheck / build / lint / e2e がすべて pass。
        deploy-pr のみ pre-existing failure(merge blocking 外)。

notes: >
  AC1-AC4 は git show FETCH_HEAD で独立検証済み。
  Allowed Paths 逸脱なし。contract fingerprint 一致。
  blocker は PR 本文セクション欠落のみ(実装内容は正確)。
  B1(Safety Claim Matrix)とB2(Schema Change Applicability)を追記すれば
  即時 APPROVE 可能。

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2

schema: LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "95e34849950a9a39e931124c5e85b5b30acb9822"
merge_ready: true
mergeability:
  mergeable: MERGEABLE
  merge_state_status: CLEAN
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []

allowed_paths_gate:
  schema: ALLOWED_PATHS_GATE_RESULT_V1
  producer_role: review_subagent
  worker_report_used_as_canonical: false
  status: ok
  expected_contract_fingerprint:
    source_kind: issue_comment
    source_id: "https://github.com/squne121/loop-protocol/issues/1040#issuecomment-4758323641"
    body_sha256: "sha256:0f8f6f38f79f23dcdeba6e7159a3ad5a5e8b5c4b6299fdc953944a0c1f410933"
  changed_files:
    - ".claude/skills/issue-refinement-loop/references/loop-state.md"
  allowed_paths:
    - ".claude/skills/issue-refinement-loop/references/loop-state.md"
  violations: []

ci_evidence:
  source: CI_CHECK_RUN_SCOPED
  ci_run_head_sha: "95e34849950a9a39e931124c5e85b5b30acb9822"
  sha_matches_pr_head: true
  checks_passed:
    - PR Body Japanese Check
    - python-test
    - test
    - typecheck
    - build
    - lint
    - e2e
    - ci-verdict-summary
    - deploy-pr
    - validate-generated-artifact
  verification_skipped_count: 0
  fallback_used: false

ac_verification:
  - id: AC1
    status: pass
    method: review_subagent_independent
    evidence: "PR branch API 取得テキストで 'is .post_rewrite_check. or' がline 92に存在。'phase is `review`, `post_rewrite_check`, or `decide_next_action`' は存在しない(negativeチェックexit1確認)"
  - id: AC2
    status: pass
    method: review_subagent_independent
    evidence: "line 82: '| `review` | `continue_investigation` | false |' が維持されている"
  - id: AC3
    status: pass
    method: review_subagent_independent
    evidence: "line 92: 'phase is `post_rewrite_check` or `decide_next_action`' が存在。review は含まれていない"
  - id: AC4
    status: pass
    method: review_subagent_independent
    evidence: "line 82の phase table description + line 94の散文 'without invoking decide_next_loop_action.py' で review phase の明示確認"
  - id: AC5
    status: pass
    method: CI_CHECK_RUN_SCOPED
    evidence: "typecheck: pass / test: pass (CI run 27874216221, head_sha一致)"

safety_claim_gate:
  applicable: true
  reason: ".claude/skills/** 配下の変更"
  matrix_present: true
  not_controlled_column: none
  result: pass

schema_change_gate:
  applicability: not_schema_change
  reason: "loop-state.md は orchestrator 向け参照文書。機械読み取りJSON/YAMLスキーマではなく散文誤記修正のみ"
  result: pass

notes: >
  docs-only prose 修正 PR。変更ファイルは contract の Allowed Paths 内の 1 ファイルのみ。
  CI 全 check が PR head SHA と一致した run で pass 済み。
  review subagent が PR branch の実ファイル内容を GitHub API で独立取得し、
  全 AC を再計算で確認。merge_ready: true。

@squne121
squne121 merged commit 153927d into main Jun 20, 2026
31 of 32 checks passed
@squne121
squne121 deleted the worktree-issue-1040-loop-state-review-hard-stop-prose branch June 20, 2026 17:11
@squne121

Copy link
Copy Markdown
Owner Author

post-merge-cleanup: 完了 (2026-06-21)

  • status: ok
  • 次アクション: なし(standalone issue、parent なし)
FOLLOW_UP_MATERIALIZATION_RESULT_V1:
  schema_version: 1
  materialized_by: post-merge-cleanup
  follow_up_issues: []
  note_only_observations: []

実施内容:

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(#1013-followup): loop-state.md の散文誤記修正 — review phase の hard_stop_eligible を false に修正

1 participant