Skip to content

実装: command_registry 実 subprocess fixture に uv required-version pin を供給し 3 件の false failure を解消する #2902

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "隔離 git fixture に production と同じ uv exact-version pin を供給し、実 subprocess dispatch の false failure を除去する"
change_kind: code
dedupe_key: "follow-up:squne121/loop-protocol:2860-ac7-uv-fixture:v1"

Parent Issue

なし(単独改善)

Parent Goal Ref

Current Validated Scope

  • .claude/skills/issue-refinement-loop/tests/test_command_registry.py 内の _crpd_make_repo() が作成する隔離 git repo と TestAuthorityTransportPrivilegedExecutorRealSubprocessDispatch の三つのテストのみ。
  • scripts/agent-guards/skill_runtime_exec.py の _required_uv_version() / _validate_trusted_executable_version() は読み取り参照であり編集しない。

Remaining Parent Gaps

なし(単独改善)。#2860 の scratch workspace・実機 runtime AC5/AC6 等はその Issue に残り、本 Issue は解決を主張しない。

Background

Source: #2860 (comment) (note 1)。現在の fixture は README と .gitignore は作るが pyproject.toml を作らない。executor の _required_uv_version() は pin 不在を None とし、_validate_trusted_executable_version() は fail-closed の uv_version_mismatch へ進む。root pyproject.toml の [tool.uv] required-version は ==0.11.29、報告された installed uv は 0.11.29。canary は exit 77、独立した三つの subprocess test は各 exit 1。fixture に限り同じ pin を与える positive control で mismatch → success が観測された。これは実 installed uv の不一致ではなく、fixture に SSOT が欠ける問題である。

方針比較: root の [tool.uv] を read-only SSOT として fixture に production-compatible exact pin を供給し、実 subprocess と executor の version/trust gate は維持する決定論的修正を採用する。uv_version_mismatch を握りつぶす・期待値を失敗へ変更する・テストを skip/xfail する・operator に pin を手作業で都度書かせる workaround は採用しない。fixture に無条件で installed version を埋め込むと mismatch 検出不能になるため避ける。

Outcome

更新された .claude/skills/issue-refinement-loop/tests/test_command_registry.py の隔離 fixture が production と同じ uv exact-version pin を提供し、三つの real subprocess dispatch test と pin 不在・不正・不一致の fail-closed 回帰が PASS する状態を納品する。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 本件は fixture-only の hermetic pytest 回帰で閉じる。production launcher の live runtime / 外部サービスを検証する AC は設けず、subprocess はユニットテスト内の隔離 git repo 上で完結する。実機 canary の exit 77 を pytest PASS と混同しない。

In Scope

  • _crpd_make_repo() の隔離 repo に root の [tool.uv] required-version と整合する最小 pyproject.toml を供給する。pin を勝手に最新化せず、production pin との一致を維持する。
  • TestAuthorityTransportPrivilegedExecutorRealSubprocessDispatch の既存三経路(decide.run、authority_transport.produce、authority_transport.consume)を実 subprocess のまま成功/契約上の fail-closed まで検証する。
  • 同じテストファイル内で positive production-compatible pin と negative の missing / malformed / mismatched pin を区別し、negative は正常 dispatch と見なさず executor の version/trust 拒否を確認する。

Out of Scope

Acceptance Criteria

  • AC1: fixture git repo が root [tool.uv] required-version に一致する exact pin を含む pyproject.toml を持ち、version/trust validator の緩和・root pin 更新なしで三つの既存 real subprocess dispatch test が期待契約どおり PASS する。
  • AC2: 同じ fixture の positive pin と missing / malformed / mismatched pin の negative controls を追加し、三つの negative は uv_version_mismatch 相当で fail-closed、成功へ偽装されない。実 installed uv 不一致は fixture SSOT 欠落と区別する。
  • AC3: 当該テストファイル全体と repository の品質 gate が PASS し、実機 canary の SKIP (77) や無関係な test failure を本修正の成功と呼ばない。

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry.py::TestAuthorityTransportPrivilegedExecutorRealSubprocessDispatch -q

# AC2
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry.py::test_crpd_fixture_uv_pin_fail_closed_controls -q

# AC3
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry.py -q
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py

AC2 の新規 test node は追加前 baseline では存在しない(# baseline-expect: fail)。実装時はこの node 名で positive と三つの negative control を一つのパラメータ化テスト等として追加する。root uv 環境自体が exact-version mismatch の場合は fixture 改善を成功と判定せず環境問題として報告する。

Allowed Paths

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

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • root の pin と installed uv の実不一致、または fixture-only 修正で三件が再現性をもって解消しない場合は環境・別原因を切り分けて停止する

Required Skills

なし

Required Design References

  • docs/dev/workflow.md
  • docs/dev/runtime-verification-policy.md

Scope Delta

N/A(起票時の Allowed Paths からの乖離なし)

Delivery Rule

1 Issue = 1 PR。linked worktree で作業し Draft PR を既定とする。#1555 / #1829 / #1601 の同一テストファイル編集と並行実装せず、実着手時に open PR と branch の編集範囲を再確認して衝突時は直列化する。

Notes for Reviewer

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Oct 3, 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

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions