Skip to content

test: scope_signal_guard termination の publisher-level 回帰テストを追加する #926

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "scope_signal_guard stop の decide output から termination payload を組み立てる helper/fixture を追加し、publisher-level で termination_cause: human_judgment_required が使われることを pytest で固定する"
change_kind: test

Source

Background

PR #924(Issue #919)で decide_next_loop_action.py は scope_signal_guard.triggered=true 時に TERMINATION_CAUSE: human_judgment_required を stdout に出力するようになった。

ただし現状の regression は、stdout から termination payload を組み立てて publish_termination_report.py に渡す end-to-end 経路までは固定していない。そのため、将来の orchestrator / next-agent prompt 実装で scope_signal_guard_triggered を再び termination_cause に混入させる余地が残る。

Outcome

scope_signal_guard stop の decide output から termination payload を組み立てる helper / fixture が存在し、publisher-level で termination_cause: human_judgment_required が使われることを pytest で固定する。

In Scope

  • .claude/skills/issue-refinement-loop/scripts/ — 必要であれば stdout parse helper を追加する
  • .claude/skills/issue-refinement-loop/tests/ — publisher-level regression fixture を追加する

Out of Scope

  • render_termination_report.py の VALID_TERMINATION_CAUSES enum への scope_signal_guard_triggered 追加
  • decide_next_loop_action.py の挙動変更

Allowed Paths

  • .claude/skills/issue-refinement-loop/scripts/
  • .claude/skills/issue-refinement-loop/tests/

Acceptance Criteria

  • AC1: decide_next_loop_action.py の stdout から TERMINATION_CAUSE と BLOCKERS を parse する fixture/helper がある
  • AC2: scope_signal_guard.triggered=true / reason_code=new_allowed_path_layer で、publisher input の termination_cause が human_judgment_required になる
  • AC3: blockers_summary に scope_signal_guard_triggered と scope_signal_guard_reason_code:new_allowed_path_layer が残る
  • AC4: termination_cause: scope_signal_guard_triggered を publisher に直接渡す経路は fail-closed のまま

Verification Commands

# AC1: decide stdout parse helper の存在確認
# baseline-expect: pass
$ rg -n "TERMINATION_CAUSE" .claude/skills/issue-refinement-loop/tests/

# AC2・AC3: publisher-level fixture の回帰テスト
# baseline-expect: pass
$ uv run pytest .claude/skills/issue-refinement-loop/tests/ -v -k "scope_signal_guard"

# AC4: fail-closed 経路の確認(既存テストも含む全 suite)
# baseline-expect: pass
$ uv run pytest .claude/skills/issue-refinement-loop/tests/ -v

Runtime Verification Applicability

applicability: not_applicable
decision: not_applicable
reason: 全 AC は pytest fixture で決定論的に検証可能であり、外部サービス・CI 実行時依存はない。

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • decide_next_loop_action.py や publish_termination_report.py の挙動変更が必要と判断した場合(Non-Goal)
  • 既存テストの大規模改変が必要と判断した場合(publisher-level fixture の追加のみが許容範囲)

Non-Goals

  • render_termination_report.py の VALID_TERMINATION_CAUSES enum への scope_signal_guard_triggered 追加
  • decide_next_loop_action.py の挙動変更

Activity

  1. added
    triage-required
    on Jun 15, 2026
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

    triage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions