Skip to content

実装: issue-refinement-loop SKILL.md を thin control-plane に縮小し loop state / routing 判断を schema・script に外出しする #795

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#293"
goal_ref: "claude/AI 運用の usage コスト削減"
change_kind: workflow

Parent Issue

#293

Parent Goal Ref

Current Validated Scope

  • .claude/skills/issue-refinement-loop/SKILL.md を thin control-plane(trigger / routing / 最小 workflow / 出力契約)に縮小する
  • LOOP_STATE summary・routing 判断・termination report 例を schema / reference / script に外出しする
  • .claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py を新規追加する(既存 decide_rewrite_route.py の改修で足りる場合は改修でよい)

Remaining Parent Gaps

  • 施策 D の残り対象(issue-contract-review / post-merge-cleanup / impl-review-loop の SKILL.md thin 化)は別 child issue で対応する

Background

parent #293 の施策 D(巨大 SKILL.md thin entrypoint + references/ 分割)のうち issue-refinement-loop 分を実装する。blocker だった #264(gemini-cli-headless-delegation の thin 化、先行事例)は CLOSED 済み。

Issue #781 の refinement loop 実行ログ分析(#791 参照)で、issue-refinement-loop/SKILL.md(289 行)に LOOP_STATE の長い YAML 例・termination report 例・routing 判断の自然言語手順が残っており、loop 1 巡ごとに長い自然言語手順の読込が発生していることが確認された。

  • runtime state は .claude/artifacts/issue-refinement-loop/<issue_number>/loop_state.current.json に外出しし、agent は script が出す compact STATUS / NEXT_ACTION のみ追従する
  • loop continuation 判断(needs_fix 継続 / max iteration / human escalation)は decide_next_loop_action.py が決定論的に返す
  • モデル判断として残すもの: 矛盾する人間コメントの解決、外部公式 docs 要否、終了後の人間向け要約

Outcome

issue-refinement-loop/SKILL.md が thin control-plane に縮小され、LOOP_STATE schema(schemas/loop_state.schema.json)・reference(references/loop-state.md)・next action 判断 script(decide_next_loop_action.py)に手順情報が外出しされ、既存 + 新規の pytest と pnpm 品質ゲートが全 PASS した状態のコミットが作成されている。

In Scope

  • SKILL.md から以下を削除し参照に置換する
    • LOOP_STATE summary の YAML 例(schema / reference へ移動)。SKILL.md から ## LOOP_STATE Summary ブロック・インライン LOOP_STATE キー一覧を完全削除し、schemas/loop_state.schema.json と references/loop-state.md への参照のみを残す
    • reviewer / author routing の自然言語判断手順(decide_next_loop_action.py へ移動)。SKILL.md から needs-fix / approve / max_iterations の自然言語分岐を完全削除し、判断 SSOT を decide_next_loop_action.py / references/ に統一する。SKILL.md が許可するのは「decide_next_loop_action.py を呼ぶ」「stdout の STATUS / NEXT_ACTION に従う」の 2 行のみ
    • termination report の本文例(既存 render_termination_report.py / reference へ寄せる)
  • schemas/loop_state.schema.json の新規追加と references/loop-state.md の新規追加
  • decide_next_loop_action.py の新規追加(入力: loop state JSON(input schema version v1)/ compact review result(status/verdict enum)/ max iterations。コマンドは argv array(shell string 不可)。出力: STATUS / NEXT_ACTION / COMMANDS / BLOCKERS(stdout budget < 2000 bytes)。loop_state の更新は行わず読み取り専用。exit code: 0 pass / 1 warn / 2 human_escalation / 3 inconsistent_state。優先順位: inconsistent_state > human_escalation)
  • 上記の pytest(schema 検証 / next action 判定 / iteration 上限 / 不整合 state: issue_number mismatch / invalid enum / missing required / negative iteration)

Out of Scope

Acceptance Criteria

  • AC1: .claude/skills/issue-refinement-loop/SKILL.md に ## LOOP_STATE Summary ブロックおよびインライン LOOP_STATE: キー一覧が残っておらず、schemas/loop_state.schema.json と references/loop-state.md への参照に置換されている。Verification Command は SKILL.md 側を negated チェックし、schema 内容の検証は pytest(AC2)に委譲する
  • AC2: schemas/loop_state.schema.json が存在し、pytest で current loop state fixture が schema 検証を PASS する
  • AC3: decide_next_loop_action.py が compact review result fixture から next action を決定し、iteration 上限超過で human escalation(exit 2)を返すことが pytest で検証されている
  • AC4: SKILL.md 内に uv run を伴わない python3 .claude/skills/issue-refinement-loop/scripts/ 実行例が存在しない(rg がヒット 0 件となる)
  • AC5: 既存の issue-refinement-loop tests を含め pnpm typecheck / lint / test / build と uv run pytest が全 PASS する

Runtime Verification Applicability

decision: immediate
applicable_acs:
  - AC2
  - AC3
  - AC5
execution_environment:
  cli_tools:
    - uv
    - python3
    - node
    - pnpm
  auth_required: false
  network_required: false
skip_conditions:
  - "local repository checkout が存在しない場合は environment blocked として扱う"
fallback_policy:
  fallback_success_is_pass: false
  notes: "fallback 経由の成功を PASS に変換しない"
artifact_requirements:
  - "uv run pytest output(test_loop_state_schema.py)"
  - "uv run pytest output(test_decide_next_loop_action.py)"
  - "pnpm typecheck / lint / test / build output"

Verification Commands

# AC1
$ ! rg -n 'LOOP_STATE:' .claude/skills/issue-refinement-loop/SKILL.md
$ rg -n 'schemas/loop_state\.schema\.json|references/loop-state\.md' .claude/skills/issue-refinement-loop/SKILL.md
# AC2
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py -v
# AC3
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action.py -v
# AC4
$ ! rg -n 'python3 \.claude/skills/issue-refinement-loop/scripts/' .claude/skills/issue-refinement-loop/SKILL.md
# AC5
$ uv run pytest .claude/skills/issue-refinement-loop/tests/ -v
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

Allowed Paths

  • .claude/skills/issue-refinement-loop/SKILL.md
  • .claude/skills/issue-refinement-loop/schemas/loop_state.schema.json(新規)
  • .claude/skills/issue-refinement-loop/references/loop-state.md(新規)
  • .claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py(新規。既存 decide_rewrite_route.py の改修を選ぶ場合はそのファイルも可)
  • .claude/skills/issue-refinement-loop/scripts/decide_rewrite_route.py
  • .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py(新規)
  • .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action.py(新規)
  • .claude/skills/issue-refinement-loop/tests/test_loop_policy.py(既存テスト更新)
  • .claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.py(既存テスト更新)
  • .claude/skills/issue-refinement-loop/fixtures/**(fixture 追加のみ)

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • SKILL.md 縮小により既存 orchestrator 動作(plan consume / termination publish)が再現できないと判明した場合

Required Skills

なし

Scope Delta(任意)

  • test_loop_policy.py を Allowed Paths に追加(既存テスト更新、AC5 適合)
  • test_thin_entrypoint.py を Allowed Paths に追加(既存テスト更新、AC5 適合)

Delivery Rule

Notes for Reviewer

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Jun 10, 2026
  2. squne121 commented on Jun 11, 2026

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES

    方向性は正しいです。issue-refinement-loop/SKILL.md を thin control-plane にして、LOOP_STATE・routing・termination 例を schema/reference/script へ逃がす方針は、親 #293 の usage cost 削減スコープと整合しています。#795 自体もその範囲を明示しています。([GitHub]1)

    ただし、この Issue は 実装契約としてまだ弱い です。このまま実装させると、「SKILL.md から YAML 例を消したが、routing 判断はまだ自然言語で残る」「schema はあるが状態遷移は未定義」「テストは max iteration だけ通る」程度の PR で閉じられるリスクが高いです。


    ブロッカー

    1. AC1 の検証コマンドが目的と逆を向いている

    AC1 は「SKILL.md に LOOP_STATE YAML example が残っていないこと」ですが、Issue の Verification Command は schemas/loop_state.schema.json 側で LOOP_STATE を探しています。これは SKILL.md から消えたことを証明しません。#795 の AC1/Verification Commands は修正必須です。([GitHub]1)

    修正案:

    $ ! rg -n '^## LOOP_STATE Summary$|^\s+LOOP_STATE:' .claude/skills/issue-refinement-loop/SKILL.md
    $ rg -n 'schemas/loop_state\.schema\.json|references/loop-state\.md|decide_next_loop_action\.py' .claude/skills/issue-refinement-loop/SKILL.md

    2. max_iterations default の整合性が危険

    親 #293 では measure A として max_iterations default 3→1 が既に完了済み扱いです。一方、私が確認した main 表示上の issue-refinement-loop/SKILL.md には max_iterations default 3 が残っていました。#795 は max iteration default 変更を Out of Scope にしていますが、現状が本当に 3 なら、#295/#293 の完了状態と矛盾します。([GitHub]2)

    #795 に次を追加してください。

    Preflight:
    - If SKILL.md still declares max_iterations default as 3, STOP and report contract drift against #293/#295.
    - This issue must not silently reintroduce or preserve default_max_iterations: 3.
    

    3. routing 判断の SSOT が曖昧

    #795 は routing 判断を decide_next_loop_action.py に出すと言っていますが、現行 SKILL.md 側には needs-fix 時の auto continuation 判断など、自然言語の分岐が残っています。これを残したまま script を追加すると、人間にも agent にも「SKILL.md と script のどちらが正か」が曖昧になります。([GitHub]1)

    AC に次を追加すべきです。

    AC追加:
    SKILL.md must not contain a reviewer/author routing decision table or natural-language branching rules.
    SKILL.md may only state:
    - call decide_next_loop_action.py
    - consume its stdout/result artifact
    - follow its exit code and next_action
    

    4. decide_next_loop_action.py の入出力契約が不足

    Issue では STATUS / NEXT_ACTION / COMMANDS / BLOCKERS と exit code が示されていますが、以下が未定義です。

    • input schema version
    • loop_state.current.json を script が読むだけか、更新もするのか
    • compact review result の status/verdict enum
    • issue number mismatch の扱い
    • stale artifact の扱い
    • invalid enum / missing required / extra property の扱い
    • human_escalation と inconsistent_state が同時に成立する場合の優先順位
    • stdout budget
    • commands が shell string ではなく argv array であること

    #792 の run_refinement_preflight.py は compact stdout と artifact を分け、commands を argv array として扱う実装方針を既に入れています。#795 も同じ設計原則に合わせるべきです。([GitHub]3)

    5. Allowed Paths の fixture 指定が #802 と同じ罠を踏む可能性がある

    #793 の checker 仕様では Verification Commands の $ prefix、Allowed Paths、bare python3 などを検出する設計になっています。さらに #802 のレビューでは、tests/fixtures/ のような末尾スラッシュ指定が recursive と扱われず、fixture ファイルが Allowed Paths 外と判定される問題が出ています。#795 の Allowed Paths も fixtures/(fixture 追加のみ) 型なので、同じ失敗を再現しやすいです。([GitHub]4)

    修正案:

    Allowed Paths:
    - .claude/skills/issue-refinement-loop/fixtures/**(fixture 追加のみ)
    - .claude/skills/issue-refinement-loop/tests/fixtures/**(fixture 追加のみ、必要な場合)
    

    6. Verification Commands に $ prefix を付けるべき

    #793 の checker 仕様では、Verification Commands 内の実行コマンドは $ prefix を前提に解析されます。#795 のコマンド群は、今後 #793/#802 系の checker が入ると無駄に落ちる可能性があります。([GitHub]4)

    #795 の VC はすべて次の形式に寄せるべきです。

    $ uv run pytest .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py -v
    $ uv run pytest .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action.py -v

    高品質化のための追加 AC

    最低限、次を #795 に追加した方がよいです。

    AC追加: decide_next_loop_action.py input/output schemas
    - decide_next_loop_action.py consumes a versioned input schema.
    - The output includes schema_version, status, next_action, commands, blockers, artifacts.
    - commands are argv arrays, not shell strings.
    - stdout is compact and does not include raw issue/comment/review bodies.
    
    AC追加: invalid state tests
    pytest covers:
    - max_iterations reached -> exit 2 human_escalation
    - approved review result -> terminate_approved
    - needs-fix under max_iterations -> continue_rewrite
    - issue_number mismatch -> exit 3 inconsistent_state
    - missing required field -> exit 3 inconsistent_state
    - invalid enum -> exit 3 inconsistent_state
    - negative iteration -> exit 3 inconsistent_state
    - extra property rejection or documented extension field behavior
    
    AC追加: SKILL.md thinness budget
    - SKILL.md line count and byte count must not increase.
    - Prefer a hard ceiling, e.g. <= 220 lines or <= 10 KB, unless the implementer justifies otherwise in the PR body.
    

    JSON Schema は、未指定プロパティをデフォルトで許可します。閉じた契約にしたいなら additionalProperties: false が必要ですが、将来拡張したいなら schema_version と extensions のような明示領域を用意するべきです。([JSON Schema]5)


    修正版 Verification Commands 案

    # AC1: SKILL.md no longer embeds LOOP_STATE YAML example
    $ ! rg -n '^## LOOP_STATE Summary$|^\s+LOOP_STATE:' .claude/skills/issue-refinement-loop/SKILL.md
    $ rg -n 'schemas/loop_state\.schema\.json|references/loop-state\.md|decide_next_loop_action\.py' .claude/skills/issue-refinement-loop/SKILL.md
    
    # AC2: loop state schema and fixtures
    $ uv run pytest .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py -v
    
    # AC3: deterministic next action decision
    $ uv run pytest .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action.py -v
    $ rg -n 'human_escalation|inconsistent_state|schema_version|argv|issue_number' .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action.py
    
    # AC4: no bare python3 execution examples
    $ ! rg -n '^\s*(?:\$ )?python3\s+\.claude/skills/issue-refinement-loop/scripts/' .claude/skills/issue-refinement-loop/SKILL.md
    
    # AC4b: direct planner invocation must not return
    $ ! rg -n '^\s*(?:\$ )?uv run python3\s+\.claude/skills/issue-refinement-loop/scripts/plan_refinement_loop\.py\b' .claude/skills/issue-refinement-loop/SKILL.md
    
    # AC5: existing gates
    $ pnpm lint
    $ pnpm typecheck
    $ pnpm test
    $ uv run pytest

    uv run は Python command/script を project environment 上で実行する用途に合っています。Python 内から子プロセスを呼ぶ場合は、Python 公式 docs 上も subprocess.run() が推奨され、timeout/capture_output 等を持つため、#792 と同じく shell=False + argv array + timeout を要求するのが妥当です。([Astral Docs]6)


    技術設計上の注意

    Claude Skills の docs は、SKILL.md 本体を簡潔にし、大きな reference/examples/scripts は別ファイル化する設計を推奨しています。また、supporting files は必要時だけ参照させる前提です。したがって #795 の方向性自体は正しいですが、SKILL.md から削った情報を reference に雑に移すだけでは不十分で、「SKILL.md に何を残すか」「script/schema が何を決めるか」の境界を AC で固定する必要があります。([Claude Code]7)

    また、Claude Skills の allowed-tools は安全境界ではなく事前許可の指定に近い扱いです。#795 の成果物は workflow control-plane なので、権限や安全性を frontmatter に期待せず、script 側の入力検証・allowed paths・argv-only command generation で閉じるべきです。([Claude Code]7)


    推奨コメント案

    REQUEST_CHANGES.
    
    方針は賛成ですが、この Issue は実装契約として弱いです。
    
    特に AC1 の Verification Command が SKILL.md から LOOP_STATE YAML example が消えたことを検証しておらず、schema 側の LOOP_STATE 文字列を探しているだけです。また、routing 判断を decide_next_loop_action.py に外出しするなら、SKILL.md 側に needs-fix / approve / max_iterations の自然言語分岐を残さないことを AC 化してください。
    
    さらに decide_next_loop_action.py の input/output schema、exit code 優先順位、commands が argv array であること、invalid state の扱い、stdout budget が未定義です。max_iterations reached だけではなく、issue_number mismatch / invalid enum / missing required / stale artifact / negative iteration の fixture test を追加してください。
    
    Allowed Paths の fixture 指定も `fixtures/` ではなく `fixtures/**` と明示した方がよいです。#802 と同じ gate failure を避けるためです。Verification Commands も #793 checker 前提で `$ ` prefix を付けてください。
    
    このままでは「SKILL.md から YAML 例を消しただけで、routing の SSOT は曖昧なまま」の PR が通るリスクがあります。
    
  3. squne121 commented on Jun 11, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

  4. squne121 commented on Jun 11, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-11T11:50:36Z)

    • Outcome: issue-refinement-loop/SKILL.md が thin control-plane に縮小され、LOOP_STATE schema・reference・next action 判断 script に手順情報が外出しされ、既存 + 新規の pytest と pnpm 品質ゲートが全 PASS した状態のコミットが作成されている
    • Acceptance Criteria:
      1. AC1: SKILL.md に ## LOOP_STATE Summary ブロック・インライン LOOP_STATE: キー一覧が残っておらず、schema/reference への参照に置換
      2. AC2: schemas/loop_state.schema.json が存在し pytest で schema 検証 PASS
      3. AC3: decide_next_loop_action.py が compact review result fixture から next action を決定し、iteration 上限超過で exit 2 を返すことが pytest で検証
      4. AC4: SKILL.md 内に uv run 非伴走の python3 .claude/skills/issue-refinement-loop/scripts/ 実行例が存在しない
      5. AC5: 既存 issue-refinement-loop tests 含め pnpm typecheck / lint / test / build と uv run pytest が全 PASS
    • Verification Commands: Issue 本文 ## Verification Commands の fenced bash block 参照
    • Allowed Paths:
      • .claude/skills/issue-refinement-loop/SKILL.md
      • .claude/skills/issue-refinement-loop/schemas/loop_state.schema.json(新規)
      • .claude/skills/issue-refinement-loop/references/loop-state.md(新規)
      • .claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py(新規)
      • .claude/skills/issue-refinement-loop/scripts/decide_rewrite_route.py
      • .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py(新規)
      • .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action.py(新規)
      • .claude/skills/issue-refinement-loop/fixtures/**
    • Worktree: .claude/worktrees/issue-795-issue-refinement-loop-skill-md-thin-cont
    • Branch: worktree-issue-795-issue-refinement-loop-skill-md-thin-cont
    • VC preflight: baseline fail = 5, 想定外 pass = 0, 実行不可 = 0(regression gate expected_pass = 4)
      • 注: pnpm lint が .claude/skills/.system/(untracked)による lint 汚染で blocked だが、worktree 非伝播のため go 判定。実装 worktree では pass となることが確認されている
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: 2026-06-11T11:50:36Z
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/795
      body_sha256: sha256:5e6ba6d4ec3cdfcd9494feec452fc7540c3c363fa64c24fe0d5021d21dcae13d
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 5
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 4
          vc_skipped: 0
          lint_regression_gate_note: >
            pnpm lint は .claude/skills/.system/(untracked)による false positive で blocked だが
            worktree 非伝播により実装 worktree では pass となる。go 判定。
          classifications:
            - ac: AC1
              command: "! rg -n 'LOOP_STATE:' .claude/skills/issue-refinement-loop/SKILL.md"
              exit_code: null
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC1
              command: "rg -n 'schemas/loop_state\\.schema\\.json|references/loop-state\\.md' .claude/skills/issue-refinement-loop/SKILL.md"
              exit_code: 1
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC2
              command: "uv run pytest .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py -v"
              exit_code: 4
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC3
              command: "uv run pytest .claude/skills/issue-refinement-loop/tests/test_decide_next_loop_action.py -v"
              exit_code: 4
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC4
              command: "! rg -n 'python3 \\.claude/skills/issue-refinement-loop/scripts/' .claude/skills/issue-refinement-loop/SKILL.md"
              exit_code: null
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC5
              command: "uv run pytest .claude/skills/issue-refinement-loop/tests/ -v"
              exit_code: 1
              category: expected_baseline_fail
              scope_class: baseline_fail_expected
              confidence: high
              decision: go
            - ac: AC5
              command: pnpm typecheck
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC5
              command: pnpm lint
              exit_code: 1
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
              note: "false positive: untracked .claude/skills/.system/ による lint 汚染。worktree 非伝播で go 判定"
            - ac: AC5
              command: pnpm test
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
            - ac: AC5
              command: pnpm build
              exit_code: 0
              category: regression_gate
              scope_class: regression_gate
              confidence: low
              decision: go
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
          triggers:
            docs_product_allowed_paths: false
            tasks_md_mentioned: false
            specify_artifact_mentioned: false
            generated_task_mentioned: false
            product_spec_context_present: false
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - "pnpm lint regression gate: .claude/skills/.system/(untracked)による既知 false positive。worktree 非伝播で go 判定"
  5. squne121 commented on Jun 11, 2026

    @squne121
    OwnerAuthor

    実装完了

    PR #804 を Draft で作成しました。

    変更内容

    issue-refinement-loop/SKILL.md から ## LOOP_STATE Summary ブロックとインライン LOOP_STATE: キー一覧を削除し、以下の専用アーティファクトへ外出しした。

    ファイル 種別 役割
    schemas/loop_state.schema.json 新規 LOOP_STATE_V1 JSON Schema
    references/loop-state.md 新規 フィールド定義・routing semantics SSOT
    scripts/decide_next_loop_action.py 新規 決定論的 next action ルーター
    fixtures/loop_state_v1_fixture.json 新規 pytest 用 schema 検証 fixture
    tests/test_loop_state_schema.py 新規 AC2: 13テスト
    tests/test_decide_next_loop_action.py 新規 AC3: 16テスト
    tests/test_loop_policy.py 更新 schema ファイルへの検証先変更
    tests/test_thin_entrypoint.py 更新 schema ファイルへの検証先変更

    AC 検証結果

    • AC1: PASS — LOOP_STATE: が SKILL.md から除去、schema/reference 参照に置換
    • AC2: PASS — test_loop_state_schema.py 13テスト全PASS
    • AC3: PASS — test_decide_next_loop_action.py 16テスト(max_iterations超過→exit 2含む)全PASS
    • AC4: PASS — SKILL.md 内に uv run なし bare python3 呼び出しなし(pytest で negative lookbehind 検証済み)
    • AC5: PASS — uv run pytest 519テスト全PASS、pnpm typecheck/lint/test/build 全PASS
  6. squne121 commented on Jun 11, 2026

    @squne121
    OwnerAuthor
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: 2026-06-11T12:09:43Z
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/795
      body_sha256: cc1fa4dba6a75346efc18a105c47ddd3318a3b266695119f2c81985759e1d8ae
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 5
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 4
          vc_skipped: 0
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings:
        - "pnpm lint regression gate: .claude/skills/.system/(untracked)による既知 false positive。worktree 非伝播で go 判定"
        - "Scope Delta: test_loop_policy.py と test_thin_entrypoint.py を Allowed Paths に追加(既存テスト更新、AC5 適合)"
  7. squne121 commented on Jun 11, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-06-11T12:49:46Z)

    • status: ok
    • 次アクション: なし(全 cleanup 完了)
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions