Skip to content

実装: command_registry.py の scope_rollup.run argv テンプレートに --invocation-id/--requested-at を反映する #1579

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "PR #1560(Closes #1547)レビューで pr-reviewer が指摘した command_registry.py の argv テンプレート陳腐化を解消する"
change_kind: code

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: scope_rollup.run の registry エントリが、実際の executor が要求する argv 形状を正しく docs/SSOT として反映する
  • Desired Destination: command_registry.py の scope_rollup.run argv テンプレート更新のみで完結する単独改善(parent tracker なし)

Current Validated Scope

  • .claude/skills/issue-refinement-loop/scripts/command_registry.py の scope_rollup.run エントリの argv テンプレート定義を更新する
  • 対応する既存テスト(.claude/skills/issue-refinement-loop/tests/test_command_registry.py 等)に、更新後の argv 形状を検証するテストケースを追加または更新する

Remaining Parent Gaps

なし

Outcome

command_registry.py の scope_rollup.run エントリの argv テンプレートが、実際の executor(scripts/agent-guards/run_scope_rollup_preflight.py)が要求する現行の argv 形状(--invocation-id / --requested-at を含む)と一致した状態になり、対応するテストが PASS している状態。

In Scope

  • command_registry.py の REGISTRY["scope_rollup.run"]["argv"] を、--issue-number / --repo に加えて --invocation-id / --requested-at プレースホルダを含む形状に更新する
  • 新規プレースホルダ(invocation_id / requested_at)の placeholders 定義(型・required)を追加する
  • 上記変更を検証するテストケースの追加・更新
  • Verification Commands の read-only assertion を contract-review allowlist に適合する rg -n に正規化する

Out of Scope

  • scope_rollup.run を skill_runtime_exec.py の registry SSOT 経路へ統合すること(別 Issue で扱う。P1-5 follow-up)
  • scripts/agent-guards/run_scope_rollup_preflight.py 本体のロジック変更
  • local_main_branch_guard.py / skill_runtime_command_policy.py の dispatch ロジック変更

Acceptance Criteria

  • AC1: command_registry.py の scope_rollup.run エントリの argv に --invocation-id トークンが含まれる
  • AC2: command_registry.py の scope_rollup.run エントリの argv に --requested-at トークンが含まれる
  • AC3: command_registry.py の scope_rollup.run エントリの placeholders に invocation_id / requested_at が定義されている
  • AC4: 既存の command_registry.py 関連テストスイートが PASS する

Verification Commands

# AC1
# baseline-expect: fail
$ rg -n -- "invocation-id" .claude/skills/issue-refinement-loop/scripts/command_registry.py
# AC2
# baseline-expect: fail
$ rg -n -- "requested-at" .claude/skills/issue-refinement-loop/scripts/command_registry.py
# AC3
# baseline-expect: fail
$ rg -n -- "invocation_id" .claude/skills/issue-refinement-loop/scripts/command_registry.py
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry.py -v

Allowed Paths

  • .claude/skills/issue-refinement-loop/scripts/command_registry.py
  • .claude/skills/issue-refinement-loop/tests/test_command_registry.py

Stop Conditions

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

Required Skills

なし

Required Design References

  • docs/dev/hook-boundaries.md#12c-scope_rollup-run-の位置づけissue-1547

Scope Delta(任意)

該当なし。

Source(起票元の参照情報)

Runtime Verification Applicability

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    on Jul 18, 2026
  2. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Scope Overlap Preflight (C1): 以下の OPEN issue と Allowed Paths が重複しています。

    related_issue: #1555, #1007, #1006, #998, #997, #995, #944, #926
    overlapping_paths: .claude/skills/issue-refinement-loop/scripts/command_registry.py, .claude/skills/issue-refinement-loop/tests/test_command_registry.py

    non_conflict_reason: 上記候補はいずれも .claude/skills/issue-refinement-loop/scripts または tests ディレクトリ全体を広く Allowed Paths に含むだけの既存 issue であり、本 issue が対象とする scope_rollup.run の argv テンプレート更新という具体的な編集意図とは一致しません。#1555 は parent_replay_binding.py 関連の別機能追加、#1007/#1006/#997/#944/#926 は loop state / preflight 関連の広範な変更です。

    edit_intent: command_registry.py の REGISTRY["scope_rollup.run"]["argv"] エントリ 1 箇所のみに --invocation-id / --requested-at プレースホルダを追加する、局所的かつ小規模な変更です。

    dependency ordering: 上記候補との明示的な依存関係はありません。並行して進める場合はマージコンフリクトのリスクを軽減するため、先にマージされた方に追従してリベースします。

    ISSUE_OVERLAP_PREFLIGHT_RESULT_V1: decision=overlap_requires_comment, reason_code=allowed_paths_overlap, policy_class=C1 (check_issue_overlap.py 出力より)

  3. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Contract repair

  4. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-18T07:01:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1579
      body_sha256: "sha256:84c59d06dbfd19fb671cdcaa85bd4cbc48a98059870d5db39423a48b379f0301"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        product_spec_check: {"schema":"product_spec_check/v1","applicability":"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,"machine_readable_contract_present":true},"conditions":{"docs_product_requires_spec_evidence":{"status":"pass","evidence":[]},"tasks_md_not_direct_source":{"status":"pass","evidence":[]},"specify_not_canonical":{"status":"pass","evidence":[]},"diff_first_rationale_present":{"status":"pass","evidence":[]},"generated_task_trace_present":{"status":"pass","evidence":[]},"task_dependencies_materialized":{"status":"pass","evidence":[]}},"blocked_reasons":[],"body_sha256":"sha256:84c59d06dbfd19fb671cdcaa85bd4cbc48a98059870d5db39423a48b379f0301","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":3,"raw_command":"rg -n -- \"invocation-id\" .claude/skills/issue-refinement-loop/scripts/command_registry.py","command_hash":"sha256:1692ee00938bc98401afacf1c7f900faedd639a6f3b4b5f9017629922dfdeac5","execution_key_hash":"sha256:1ca8368ffb2e2b50f03776da7a29a5431df779692172aaedc07240bb0f954860","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":1,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":2,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC2","line":6,"raw_command":"rg -n -- \"requested-at\" .claude/skills/issue-refinement-loop/scripts/command_registry.py","command_hash":"sha256:8324019ee17208f2a47df69b6b931710fd7df9d75bf766bd3df89885b944a954","execution_key_hash":"sha256:f3d0747a247b071a97d1af4d3655df52353833a99d9718559e2a01cb13bd2d64","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":2,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":5,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC3","line":9,"raw_command":"rg -n -- \"invocation_id\" .claude/skills/issue-refinement-loop/scripts/command_registry.py","command_hash":"sha256:7d4b4850b2994eb38558c22245d83c9b068d6dcca326b9fe1c1f39c8e29c4ecb","execution_key_hash":"sha256:32f070bb534d5ceaf6e2c639ef1e4492ef6f306bc8a41c85f8d5c2f840442873","runner":"exec","exit_code":1,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","stdout_head":[],"stdout_truncated":false,"stdout_original_line_count":1,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":1,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":"fail","vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":8,"raw":"# baseline-expect: fail"},"strict":null,"repair":null},{"ac":"AC4","line":11,"raw_command":"uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry.py -v","command_hash":"sha256:4eb24529b99069f0566091153d92f09e361ddf47313bd386e46871b16195844b","execution_key_hash":"sha256:43bc541d95bd4a67976425203629c64430d2f75023e9bcd182ef84545517fd22","runner":"exec","exit_code":0,"classification":"expected_pass","category":"regression_gate","decision":"go","scope_class":"regression_gate","confidence":"low","stdout_head":["============================= test session starts ==============================","platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0 -- /home/squne/projects/LOOP_PROTOCOL/.venv/bin/python","cachedir: .pytest_cache","rootdir: /home/squne/projects/LOOP_PROTOCOL","configfile: pyproject.toml","plugins: xdist-3.8.0","collecting ... collected 32 items",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRegistryListOutput::test_list_schema_version PASSED [  3%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRegistryListOutput::test_list_has_commands_dict PASSED [  6%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRegistryListOutput::test_list_required_fields_per_entry PASSED [  9%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestArgvOnlyCanonicalForm::test_all_argv_are_lists PASSED [ 12%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestArgvOnlyCanonicalForm::test_no_shell_string_in_argv PASSED [ 15%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRenderCommandValidation::test_render_valid_preflight PASSED [ 18%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRenderCommandValidation::test_render_valid_gh_issue_view PASSED [ 21%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRenderCommandValidation::test_render_invalid_issue_number_zero PASSED [ 25%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRenderCommandValidation::test_render_invalid_issue_number_negative PASSED [ 28%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRenderCommandValidation::test_render_invalid_issue_number_string PASSED [ 31%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRenderCommandValidation::test_render_invalid_repo_no_slash PASSED [ 34%]",".claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestRenderCommandValidation::test_render_invalid_repo_empty PASSED [ 37%]"],"stdout_truncated":true,"stdout_original_line_count":43,"stderr_head":[],"stderr_truncated":false,"stderr_original_line_count":1,"runner_env_delta":{},"duration_ms":249,"fix_hint":null,"certified_target_paths":null,"annotations":{"baseline_expect":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null}]
      source: ensure_contract_snapshot_auto
      expected_contract_fingerprint: {"issue_number":1579,"contract_source_kind":"issue_comment","contract_source_id":"5010327640","contract_body_sha256":"sha256:84c59d06dbfd19fb671cdcaa85bd4cbc48a98059870d5db39423a48b379f0301","allowed_paths_normalized_sha256":"fb0c9ef18f59050edfa4a28785c8e1674c10abb998fe5367b225d2d2f57a023e","base_ref":"main","base_sha_at_snapshot":"15c3f143877bab657886e2987927431594a7fbbd"}
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