Skip to content

実装: worktree bootstrap を direct Python/no-project-mutation launcher に統一する #1588

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "worktree bootstrap を project environment(.venv/uv.lock)を変更しない direct Python launcher に統一し、malformed input を executor 自身が fail-closed にする"
change_kind: workflow
supersedes:
  - "#1209 worktree bootstrap の RTK 一段 envelope 互換契約"
compatibility_change: "RTK 一段 envelope と legacy uv launcher は worktree bootstrap では canonical launcher として扱わない"
migration_required: true

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: root checkout の default branch を維持したまま、implementation Issue の専用 worktree を .venv/uv.lock を変更しない direct Python launcher で作成できるようにする。
  • Desired Destination: python3 scripts/agent-ops/worktree_bootstrap_exec.py ... --json の direct invocation が production caller(implementation-worker/implement-issue)の canonical supported path になっており、executor 自身が argv・path・branch・repo・default branch を検証し、malformed input を fail-closed にする。

Current Validated Scope

  • scripts/agent-ops/worktree_bootstrap_exec.py(control-plane が git show HEAD: で直接確認済み、464行)は既に次を実装している。
    • repository root 検証(_validate_repo_root)
    • slug 妥当性検証(_is_valid_slug)
    • branch 名検証(check-ref-format 相当)
    • symlink escape guard
    • worktree 作成後の readback(post-creation の存在確認)
  • 現在の production invocation は uv run --locked python3 scripts/agent-ops/worktree_bootstrap_exec.py ...(.claude/skills/implement-issue/SKILL.md:70)であり、uv run --locked を経由する。uv run --locked は .venv の作成を防止せず、stale lock の失敗も保証しない(--locked は lock file と pyproject の整合を検証するだけで、--no-sync なしでは venv 同期が発生し得る)。
  • .venv/uv.lock を変更しないことを isolated fixture で実証する既存テストは repo 内に存在しない。
  • 実装: implement-issue の worktree bootstrap を controlled executor 化し、rtk/raw git policy 衝突を解消する #1209(CLOSED)は direct command と RTK 一段 envelope を同値として許可したが、本 Issue はその互換契約を撤回し、direct python3 単一形状を canonical launcher とする。

Remaining Parent Gaps

なし

Outcome

python3 scripts/agent-ops/worktree_bootstrap_exec.py ... --json が、production caller(implementation-worker/implement-issue)の唯一の canonical supported path となり、project fixture 内で .venv と uv.lock を新規作成・変更しない状態。executor 自身が exact argv・path・branch・repo・default branch を検証し、malformed input(wrong flag、extra positional、path traversal 等)を fail-closed で拒否する。

In Scope

  • production caller(implementation-worker.md/implement-issue/SKILL.md)の Worktree / Branch 手順を、uv run --locked python3 ... から direct python3 scripts/agent-ops/worktree_bootstrap_exec.py ... --json invocation へ変更する。JSON status / worktree path の読取りも direct Python の標準出力から行う。
  • worktree_bootstrap_exec.py に、malformed input(unknown flag、duplicate flag、--flag=value 形式の混在、想定外の positional 引数、shell metacharacter を含む引数)を executor 自身が起動直後に fail-closed で拒否する入力検証を追加する(現状の repository/branch/path/slug 検証に加えて、CLI 引数 shape の検証を明示的に追加する)。
  • isolated temporary Git repository で canonical launcher(direct python3)を実 subprocess として実行し、.venv absent / existing、uv.lock absent / stale / existing の各ケースで .venv tree digest、uv.lock SHA-256、git status --porcelain=v1 -z が不変であることを検証する。
  • 実装: implement-issue の worktree bootstrap を controlled executor 化し、rtk/raw git policy 衝突を解消する #1209 の RTK 一段 envelope 互換を撤回する caller inventory と migration note を、Skill/Agent 定義内(docs/dev/hook-boundaries.md ではなく、.claude/skills/implement-issue/SKILL.md または docs/dev/agent-skill-boundaries.md)に記録する。

Out of Scope

  • worktree_bootstrap_exec.py の branch/path/repository validation、JSON schema、worktree 作成以外の domain behavior の変更(既存実装を維持する)。
  • origin/<default-branch> の remote-tracking base identity preservation(実装: worktree bootstrap の origin/default-branch base ref を保持する #1604 の責務)。
  • Claude Code/Codex CLI Hook(local_main_branch_guard、worktree_scope_guard 等)による raw command の block/allow、Hook parity、Hook wrapper subprocess test の追加・修正。
  • RTK launcher・legacy uv run launcher を Hook レベルで deny すること(Hook を authority にしないため、この形の deny は実装しない。production caller が direct python3 のみを使用することで足りるとする)。
  • .claude/settings.json/.codex/rules/** の変更。
  • uv option grammar、toolchain pin の再設計。
  • raw git worktree add、RTK wrapper、shell wrapper の Hook レベル許可判定。
  • uv.lock、.venv、GitHub branch protection の無効化または迂回。

Acceptance Criteria

  • AC1: implementation-worker.md/implement-issue/SKILL.md の Worktree / Branch 手順が、uv run --locked python3 ... ではなく direct python3 scripts/agent-ops/worktree_bootstrap_exec.py ... --json の canonical invocation のみを記載している
  • AC2: worktree_bootstrap_exec.py が起動直後に unknown flag/duplicate flag/--flag=value/想定外 positional/shell metacharacter を含む malformed input を fail-closed で拒否し、git worktree add を実行しない
  • AC3: isolated project fixture で canonical launcher を実 subprocess として実行し、.venv absent / existing と uv.lock absent / stale / existing の全ケースで .venv tree digest、uv.lock SHA-256、git status --porcelain=v1 -z が不変であることを検証する
  • AC4: worktree 作成後、executor が作成された worktree の存在・path・branch を readback し、readback 失敗時は success を返さない(既存 postcondition の回帰確認)
  • AC5: 実装: implement-issue の worktree bootstrap を controlled executor 化し、rtk/raw git policy 衝突を解消する #1209 の RTK envelope 互換の撤回について caller inventory・migration note が .claude/skills/implement-issue/SKILL.md または docs/dev/agent-skill-boundaries.md に記録されている

Runtime Verification Applicability

runtime_verification_applicability:
  decision: immediate
  reason: "temporary Git repository と direct Python subprocess を使い、malformed input の fail-closed 拒否と project-file non-mutation を実行境界で決定論的に検証できる。"
  applicable_acs: [AC2, AC3, AC4]
  execution_environment: "WSL2 Ubuntu 24.04、Python 3.12+、git、pytest"
  skip_conditions:
    - "python3 または git が利用できず isolated fixture を起動できない場合"
  fallback_policy: "static parser test のみを runtime verification 成功として扱わず、実 subprocess test が実行不能なら blocked とする。"
  artifact_requirements:
    - "tests/agent_ops/test_worktree_bootstrap_exec_argv_validation.py の pytest output"
    - "tests/agent_ops/test_worktree_bootstrap_direct_python_nonmutation.py の project-file digest assertions"

Verification Commands

# AC1
# baseline-expect: pass
$ rg -n "worktree_bootstrap_exec.py" .claude/agents/implementation-worker.md .claude/skills/implement-issue/SKILL.md
# baseline-expect: pass
$ rg -n "uv run --locked python3 scripts/agent-ops/worktree_bootstrap_exec.py" .claude/skills/implement-issue/SKILL.md
# AC2
$ uv run --locked pytest tests/agent_ops/test_worktree_bootstrap_exec_argv_validation.py -v
# AC3
$ uv run --locked pytest tests/agent_ops/test_worktree_bootstrap_direct_python_nonmutation.py -v
# AC4
# baseline-expect: pass
$ uv run --locked pytest tests/agent_ops/test_worktree_bootstrap_exec.py -v
# AC5
$ rg -n "#1209" .claude/skills/implement-issue/SKILL.md docs/dev/agent-skill-boundaries.md

Allowed Paths

  • scripts/agent-ops/worktree_bootstrap_exec.py
  • .claude/skills/implement-issue/SKILL.md
  • .claude/agents/implementation-worker.md
  • docs/dev/agent-skill-boundaries.md
  • tests/agent_ops/test_worktree_bootstrap_exec_argv_validation.py
  • tests/agent_ops/test_worktree_bootstrap_direct_python_nonmutation.py
  • tests/agent_ops/test_worktree_bootstrap_exec.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合。
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
  • 後続 Phase / 別スコープへの波及が判明した場合。
  • nested SubAgent delegation が必要になった場合。
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
  • worktree_bootstrap_exec.py の branch/path/repository validation や JSON schema の domain behavior 変更が必要と判明した場合。
  • isolated fixture で .venv、uv.lock、または project Git status の非変更を実証できない場合。
  • Hook、settings、Codex rules の変更が実装に必要と判明した場合(本 Issue のスコープ外であり着手しない)。
  • origin/<default-branch> の base ref identity 保持が本 Issue の実装対象に含まれると判明した場合(実装: worktree bootstrap の origin/default-branch base ref を保持する #1604 の責務であり、混入させない)。

Required Skills

  • Python 3
  • Git
  • subprocess-based fixture testing

Required Design References

Scope Delta

SCOPE_DELTA_V1:
  decision: reframe_in_place
  reason: "#1860 Owner Decision により、Claude/Codex Hook を worktree bootstrap の authority にしない executor-only 契約へ改訂したため"
  removed_contract:
    - "local_main_branch_guard / worktree_scope_guard による raw RTK/legacy launcher の Hook-level deny"
    - "Claude/Codex shared guard parity テスト"
    - ".claude/settings.json / .codex/rules/** の変更"
    - "Hook boundary を completion condition とする AC"
    - "#1595(共有 launcher parser、Hook 向け)を blocking dependency とすること"
  kept_contract:
    - "python3 scripts/agent-ops/worktree_bootstrap_exec.py ... --json を canonical launcher とすること"
    - ".venv / uv.lock 非変更の isolated fixture 検証"
    - "executor 自身による exact argv / path / branch / repo / default branch validation"
    - "malformed input の executor-level fail-closed"
  compatibility_impact: "production caller(implementation-worker / implement-issue)の bootstrap invocation は direct python3 canonical shape へ移行する"
  rollback: "対象 PR の squash revert で direct-only policy を撤回し、旧 uv run 呼び出しに戻す"

Scope Collision Evidence

Scope Collision (C1): related_issue=#1209, #1604; overlapping_paths=.claude/skills/implement-issue/SKILL.md, .claude/agents/implementation-worker.md, scripts/agent-ops/worktree_bootstrap_exec.py(path のみ、domain 分離)。

Delivery Rule

  • 1 Issue = 1 PR
  • 作業前に fresh CONTRACT_REVIEW_RESULT_V1 status: go を取得する。
  • normal commit / push のみを使用し、force push、guard bypass、hook disable を行わない。

Notes for Reviewer

  • 本改訂は issue-refinement-loop(実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732 Child C 改訂作業の一部)により、旧版(Claude/Codex shared guard parity・local_main_branch_guard/worktree_scope_guard 変更・RTK/legacy launcher の Hook-level deny・Hook wrapper test・実装: launcher command 共有 parser(argv boundary 保持・cwd/project_root 対応)を抽出し全 consumer の invocation contract を移行する #1595 blocking dependency を In Scope としていた版)を全面差し替えしたものである。旧版の historical comment は削除・改変していない。
  • 撤回した理由: #1860 Owner Decision により、Hook はこの系列の authority・security boundary・dependency・AC にしないことが確定した。Web research で、Claude Code の Hook は「local workflow guardrail であり security boundary ではない」ことが公式ドキュメントで確認されている。
  • 維持した理由: worktree_bootstrap_exec.py 自身の repository/branch/path/slug validation、worktree 作成後の readback、.venv/uv.lock 非変更の実証は、Hook の有無に関わらず bootstrap の安全性を担保する実体であり、そのまま維持・強化する。

Activity

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

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES / 実装開始不可

    方向性自体は妥当です。bare uv run を privileged bootstrap の canonical launcher にしないこと、unknown flag・順序変更・wrapper を fail-closed にすること、Claude/Codex が同じ policy を参照することは正しい設計です。

    ただし現契約には、ACを実現できない Allowed Pathsと、採用予定 launcher 自体が AC6 を破る実挙動があります。


    P0-1: uv run --locked --no-sync は .venv 非変更を保証しない

    uv 公式仕様では、project 内の uv run は project environment を作成・更新してからコマンドを実行します。--no-sync は environment の同期を省略しますが、project environment の作成まで禁止するとは規定されていません。また --no-sync は --frozen を含意します。([Astral Docs]1)

    実際に uv 0.10.0 で次を検証しました。

    1. pyproject.toml と uv.lock がある一時 project を作成
    2. .venv は存在しない状態
    3. pyproject.toml を変更して uv.lock を stale にする
    4. uv run --locked --no-sync python3 -c 'print("ok")' を実行

    結果は以下です。

    • exit code: 0
    • .venv が新規作成された
    • stale lock でも --locked error にならなかった

    つまり、Issue の以下の主張は成立しません。

    • AC6: .venv を変更しない
    • --locked による lock freshness の担保
    • 「locked/no-sync = no-mutation」という launcher 契約

    リポジトリ側も uv executable の明示的な version 入力を持っておらず、patch/version reproducibility の判断を扱う #375 は未完了です。flag の意味を guard policy の安全性根拠にするには不安定です。

    必須修正

    第一候補は、uv を bootstrap boundary から除外することです。

    python3 scripts/agent-ops/worktree_bootstrap_exec.py ...

    worktree_bootstrap_exec.py と、その直接 import 先はここで確認した範囲では標準ライブラリとリポジトリ内モジュールだけで構成されています。リポジトリの Python 要件も 3.12 です。

    uv を残す必要があるなら、少なくとも project discovery を切る形へ設計し直す必要があります。

    uv run --no-project --no-python-downloads --offline python3 ...

    ただしこの場合、--locked は契約から消えます。Issue のタイトル・Outcome・ACを「project-independent launcher」へ変更すべきです。--offline は network access、--no-python-downloads は interpreter の自動取得を止める別の責務です。([Astral Docs]2)


    P0-2: wrapper deny は現在の Allowed Paths では実装不能

    現行 shared policy は先頭の rtk を明示的に許可しています。

    しかし、単にこの policy から rtk 対応を削除しても、Codex/local-main 側では拒否できません。

    local_main_branch_guard.py は shared policy を呼ぶ前に次の処理を行っています。

    1. rtk を検出

    2. 先頭の rtk を除去

    3. 内側の argv から normalized_cmd を再構築

    4. その direct command を worktree bootstrap policy に渡す

    したがって、

    rtk uv run --locked --no-sync python3 scripts/agent-ops/worktree_bootstrap_exec.py ...

    は policy 到達時には、

    uv run --locked --no-sync python3 scripts/agent-ops/worktree_bootstrap_exec.py ...

    へ変換され、Codex/local-main では allow され続けます。

    一方、Claude の worktree_scope_guard は raw command をそのまま shared policy に渡すため、こちらだけ reject されます。

    つまり現状のままでは、以下を同時に満たせません。

    • AC2: wrapper reject
    • AC3: Claude/Codex parity
    • 「shared policy の変更だけで完結」

    必須の Scope Delta

    Allowed Paths に最低でも以下を追加してください。

    scripts/agent-guards/local_main_branch_guard.py
    tests/codex/test_local_main_branch_guard.py
    

    実装方法は、generic RTK unwrap より前に raw command に対して次の順序で判定するのが安全です。

    1. raw direct canonical command → allow
    2. worktree bootstrap script を含むが canonical でない → block
    3. その後に通常の RTK unwrap/classification

    P1-1: bootstrap 手順には bare uv run がまだ2回残る

    現行 implement-issue の Step 3 は executor を uv run --locked で呼んだ後、JSONを読むために bare uv run python3 -c を2回実行しています。

    BOOTSTRAP_STATUS=$(uv run python3 -c ...)
    WORKTREE=$(uv run python3 -c ...)

    uv run は既定で lock と environment sync を行います。したがって launcher の一行だけを変更しても、worktree bootstrap procedure 全体は lock/sync-free になりません。([docs.astral.sh]1)

    JSON解析には外部依存が不要なので、次のように direct Python にすべきです。

    BOOTSTRAP_STATUS=$(python3 -c "import json,sys; print(json.load(sys.stdin)['status'])" <<<"$BOOTSTRAP_JSON")
    WORKTREE=$(python3 -c "import json,sys; print(json.load(sys.stdin)['worktree_path'])" <<<"$BOOTSTRAP_JSON")

    AC4には次を追加すべきです。

    implement-issue の Worktree / Branch 作成手順には、canonical executor invocation 以外の uv run を残さない。


    P1-2: #1209 の既存互換契約を無言で破棄している

    元の Issue #1209 と merged PR #1216 は、direct command と rtk 一段 envelope を意図的に同値として許可しました。テストも両形状を positive fixture に固定しています。

    #1588 はこれを破棄しますが、以下がありません。

    RTK は Bash command を透過的に intercept/rewrite する運用を公式に推奨しています。wrapper 拒否は単なるテスト更新ではなく、既存 agent runtime の互換性変更です。([GitHub]3)

    Machine-Readable Contract に、少なくとも次を加えるべきです。

    supersedes:
      - "#1209 canonical launcher envelope"
    compatibility_change: "rtk one-stage envelope is no longer accepted"
    migration_required: true

    P1-3: 親 #1580 と後続 #1601 の最新契約から既に drift している

    #1588 は #1580 を有効化することを Parent Goal としていますが、最新の #1580 / #1601 は canonical launcher を次に固定しています。

    uv run --locked --offline --no-sync ...

    さらに #1601 は #1588 を dependency ではなく「path-only overlap」として扱い、shared guard/parser integration の前提を #1595 としています。

    #1595 は実際に local_main_branch_guard.py と worktree_scope_guard.py の launcher parsing contract を変更する予定です。#1588 の Scope Collision Evidence に #1595 がなく、dependency ordering も定義されていません。

    次のいずれかが必要です。


    P1-4: AC6 のテストは現状、launcher を一度も実行していない

    現在の tests/agent_ops/test_worktree_bootstrap_exec.py は、すべて sys.executable で Python script を直接起動しています。uv run の挙動は検証していません。

    したがって、現在の Verification Command を実行しても次は証明されません。

    uv run --locked --no-sync python3 scripts/agent-ops/worktree_bootstrap_exec.py ...

    AC6には具体的な fixture 契約が必要です。

    • exact launcher argv を subprocess 実行する
    • pyproject.toml、uv.lock、.python-version を持つ project fixture
    • .venv absent と existing の両ケース
    • stale lock の期待結果
    • 実行前後の uv.lock SHA-256
    • .venv の存在有無と tree digest
    • git status --porcelain=v1 -z の before/after
    • cache と Python download の隔離
    • executor 成功時の worktree 作成だけを許可された mutation として分離

    現 launcher をこの fixture に通すと、少なくとも .venv absent ケースは失敗するはずです。


    P1-5: Verification Command が実際に壊れている

    Issue 内の AC5 は次です。

    rg -n "--locked --no-sync" docs/dev/hook-boundaries.md

    ripgrep は --locked --no-sync を option と解釈します。手元の ripgrep 14.1.1 では次の結果でした。

    rg: unrecognized flag --locked --no-sync
    exit 2
    

    正しくは次です。

    rg -n -- "--locked --no-sync" docs/dev/hook-boundaries.md

    また、Issue 内の CI_TEST_PERFORMANCE_DECISION_V1 は Ruff と pnpm build を required command としていますが、Verification Commands には両方ありません。Issue 内部で gate 定義が一致していません。


    P2: Hook Boundary SSOT の既存記述が実装と矛盾している

    docs/dev/hook-boundaries.md は、active issue worktree 時に bootstrap allowlist を導入しないと記述しています。

    しかし実装は、worktree bootstrap executor を明示的に allow しています。

    AC5は新しい説明を追記するだけでなく、以下を必須にすべきです。

    • stale な「bootstrap allowlist は導入しない」を削除
    • direct canonical allow を明記
    • legacy bare launcher deny
    • RTK wrapper deny
    • Claude/Codex の raw-command/normalized-command boundary
    • hook は security boundary ではないという既存前提を維持

    修正後に必要な最小契約

    CONTRACT_REVIEW_RESULT_V1:
      status: blocked
      verdict: request_changes
      blockers:
        - id: B1
          reason: proposed uv launcher can create .venv and does not reliably enforce stale-lock failure
        - id: B2
          reason: local_main_branch_guard unwraps rtk before shared policy; wrapper deny is impossible within Allowed Paths
        - id: B3
          reason: implement-issue bootstrap procedure still contains two bare uv run invocations
        - id: B4
          reason: exact launcher non-mutation test is absent
        - id: B5
          reason: AC5 rg verification command exits 2
      required_scope_delta:
        - scripts/agent-guards/local_main_branch_guard.py
        - tests/codex/test_local_main_branch_guard.py
      required_contract_changes:
        - replace or redesign uv launcher
        - define supersession of Issue #1209 rtk compatibility
        - define ordering against Issue #1595
        - refresh relationship with Issues #1580 and #1601
        - make end-to-end bootstrap procedure no-uv or explicitly narrow the claim

    結論

    現状の #1588 は、policy parser の token 差し替え Issue としては実装してはいけません。

    最大の問題は、提案 launcher が .venv 非変更を保証せず、さらに Codex guard の前段 unwrap により wrapper deny が成立しないことです。まず launcher を direct Python または project-independent invocation に再設計し、local_main_branch_guard.py を Allowed Paths に追加した上で、#1209/#1595/#1601 との契約関係を更新する必要があります。

  3. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-07-18T10:41:51Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1588
      body_sha256: "sha256:d39ab7d82bc74a45d5e24a66fb13ea1a5a53fbc950d578b0b7bbda09c248c3b1"
      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:d39ab7d82bc74a45d5e24a66fb13ea1a5a53fbc950d578b0b7bbda09c248c3b1","source_provenance":{"source_type":"github_api","body_file":null}}
        vc_preflight:
          decision: pass
          classifications: [{"ac":"AC1","line":2,"raw_command":"uv run --locked pytest tests/codex/test_worktree_bootstrap_direct_python_contract.py -v","command_hash":"sha256:4be33120e2dcc796ea02ae4d6a0f42aa91b0710e19bb07e0ad3d13e28b9d1fa6","execution_key_hash":"sha256:421d1eaea8b3326fe4b97df893451e620ce958748f90794b5c27a7fd1bccd2d8","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","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 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":["ERROR: file or directory not found: tests/codex/test_worktree_bootstrap_direct_python_contract.py"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":192,"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},{"ac":"AC2","line":4,"raw_command":"uv run --locked pytest tests/codex/test_worktree_bootstrap_direct_python_guard.py -v","command_hash":"sha256:e57baeb260a2f0f5c2190d5015ad8805569a9336c0fa9b1e6c712ae6207e6c22","execution_key_hash":"sha256:1c4fd89f7ed0c61bf6c741651b9fac7995d1ec95d444ac9de3b99e9f28ad0ca6","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","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 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":["ERROR: file or directory not found: tests/codex/test_worktree_bootstrap_direct_python_guard.py"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":154,"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},{"ac":"AC3","line":6,"raw_command":"uv run --locked pytest .claude/hooks/tests/test_worktree_scope_guard_direct_python_bootstrap.py -v","command_hash":"sha256:5b0db89a3ffab61749d43edbeaa47254f22be4c4d5f27af6831f0f68c9f8ac47","execution_key_hash":"sha256:df6c58c7aa6fc2394c753b920e245927a049932930f29f840168746b5c623c95","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","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 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":["ERROR: file or directory not found: .claude/hooks/tests/test_worktree_scope_guard_direct_python_bootstrap.py"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":171,"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},{"ac":"AC4","line":8,"raw_command":"uv run --locked pytest tests/agent_ops/test_implement_issue_worktree_bootstrap_no_uv.py -v","command_hash":"sha256:78b6a33c0f0886d639e72c6b94c5dd9063a69f25616fd3b353ebda5cecb395b6","execution_key_hash":"sha256:b619584803850a68c018185e389c243ea22d10666f534eb810809c16a9a8d0d3","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","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 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":["ERROR: file or directory not found: tests/agent_ops/test_implement_issue_worktree_bootstrap_no_uv.py"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":173,"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},{"ac":"AC5","line":10,"raw_command":"rg -n -- \"direct Python.*RTK.*deny\" docs/dev/hook-boundaries.md","command_hash":"sha256:805ed98a8156c595b964f0e4822a354c5344c0f495d17f2228eb409f56bba37c","execution_key_hash":"sha256:9d8b5a1fb642ab05169978af30bbe8b7bc2a8bb4a4af95cc8f042b1f865ab091","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":null,"vc_role":null,"missing_baseline_expect":false},"annotation_source":{"line":null,"raw":null},"strict":null,"repair":null},{"ac":"AC6","line":12,"raw_command":"uv run --locked pytest tests/agent_ops/test_worktree_bootstrap_direct_python_nonmutation.py -v","command_hash":"sha256:ffa94a09eda4ad540608e4804a6afb6050e6d6d53c85c453fdc3c6b9a1fd9ff3","execution_key_hash":"sha256:ed0ac80ada0dbdab8a5154f974edae96699c017e63a286597b1ed4d5dfa1875b","runner":"exec","exit_code":4,"classification":"expected_fail","category":"expected_baseline_fail","decision":"go","scope_class":"baseline_fail_expected","confidence":"high","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 0 items","============================ no tests ran in 0.01s ============================="],"stdout_truncated":false,"stdout_original_line_count":10,"stderr_head":["ERROR: file or directory not found: tests/agent_ops/test_worktree_bootstrap_direct_python_nonmutation.py"],"stderr_truncated":false,"stderr_original_line_count":3,"runner_env_delta":{},"duration_ms":153,"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},{"ac":"AC7","line":14,"raw_command":"rg -n -- \"#1209.*RTK.*migration.*rollback\" docs/dev/hook-boundaries.md","command_hash":"sha256:eb7090ab59e60374c8f588f937446769a15d9da7fb6bc61eb9c245f0e01d295c","execution_key_hash":"sha256:b6c908130d4b9e0023299855d4b005f0e94cd871eabfebe49bec1375f52d726f","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":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":1588,"contract_source_kind":"issue_comment","contract_source_id":"5010955050","contract_body_sha256":"sha256:d39ab7d82bc74a45d5e24a66fb13ea1a5a53fbc950d578b0b7bbda09c248c3b1","allowed_paths_normalized_sha256":"e45f45e69b9eb926e76c923c342561c3aa6375f87f7237d14a61ef43b942c039","base_ref":"main","base_sha_at_snapshot":"c0048fab6e5544c5b599cd0feb8f85571a9bd4b8"}
  4. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: https://github.com/squne121/loop-protocol/issues/1588#issuecomment-5010955050
        generated_at: '2026-07-18T10:41:46Z'
        body_sha256: sha256:d39ab7d82bc74a45d5e24a66fb13ea1a5a53fbc950d578b0b7bbda09c248c3b1
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: '2026-07-18T10:42:12Z'
      checked_body_sha256: sha256:d39ab7d82bc74a45d5e24a66fb13ea1a5a53fbc950d578b0b7bbda09c248c3b1
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  5. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    Refinement Loop: Approved

    The issue has been approved and is ready for implementation.

    LOOP_HANDOFF_RESULT_V1:
      status: blocked
      routing_action: blocked
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: https://github.com/squne121/loop-protocol/issues/1588#issuecomment-5010955050
        generated_at: '2026-07-18T10:41:46Z'
        body_sha256: sha256:d39ab7d82bc74a45d5e24a66fb13ea1a5a53fbc950d578b0b7bbda09c248c3b1
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: blocked
        required: []
        skipped: []
      blockers:
      - kind: blocking_dependency
        description: '#1595 が OPEN のため、Issue #1588 の Stop Conditions により実装を開始しない'
      permissions:
        unavailable: []
      generated_at: '2026-07-18T10:44:24Z'
      checked_body_sha256: sha256:d39ab7d82bc74a45d5e24a66fb13ea1a5a53fbc950d578b0b7bbda09c248c3b1
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []

    Correction: the contract review is fresh go, but implementation handoff remains blocked until #1595 is merged.

  6. squne121 commented on Jul 18, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 人間判断要請(2026-07-18T10:51:00Z)

  7. squne121 commented on Aug 5, 2026

    @squne121
    OwnerAuthor

    #1732 系列 issue-refinement-loop による本文改訂(2026-08-05)

    #1860(Minimal harness decision)の Owner Decision を反映し、本 Issue の本文を全面改訂しました。

    撤回した契約:

    • Claude/Codex shared guard parity(local_main_branch_guard/worktree_scope_guard の同一判定検証)
    • local_main_branch_guard/worktree_scope_guard の Hook-level allow/deny 追加
    • RTK/legacy uv run launcher の Hook-level deny
    • Hook wrapper subprocess テスト
    • .claude/settings.json/.codex/rules/** の変更
    • Hook boundary(docs/dev/hook-boundaries.md)を completion condition とする AC
    • #1595(共有 launcher parser、Hook 向け)を blocking dependency とすること

    理由: #1860 Owner Decision により、Claude/Codex Hook はこの系列の authority・security boundary・dependency・AC にしないことが確定しました。production caller(implementation-worker/implement-issue)が direct python3 invocation のみを使用することで足りるとし、Hook レベルの deny は実装しません。

    維持した契約(executor safety):

    • python3 scripts/agent-ops/worktree_bootstrap_exec.py ... --json を canonical launcher とすること
    • .venv/uv.lock 非変更の isolated fixture 検証
    • executor 自身による exact argv/path/branch/repo/default branch validation
    • malformed input の executor-level fail-closed(新規追加: CLI 引数 shape の検証を executor 自身に追加する)
    • worktree 作成後の readback

    worktree_bootstrap_exec.py の repository/branch/path/slug validation と worktree 作成後 readback は既に current main に実装済みであることを control-plane が git show HEAD: で直接確認済みです。現在の production invocation は uv run --locked python3 ... であり、本 Issue はこれを direct python3 ... へ変更します。

    本改訂は #1732 系列の issue-refinement-loop の一部です。旧本文は削除せず、上記コメントの下に新本文として反映します。

  8. squne121 commented on Aug 5, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop iteration 2(review needs-fix 対応)

    前回改訂に対する issue-reviewer レビューで、Verification Commands の VC 注記に関する human_judgment blocker が指摘されました。以下を修正しました。

    • AC1: 現状(実装前)で既に true となる grep コマンド 2 本に # baseline-expect: pass 注記を追加
    • AC4: -k "readback" フィルタが既存テストに一致しなかったため、フィルタを外して既存 test_worktree_bootstrap_exec.py 全体を参照する回帰確認 VC に変更し、# baseline-expect: pass 注記を追加

    issue-contract-review の pre-edit static readiness check で status: go を再確認済みです。

  9. changed the title [-]実装: worktree bootstrap の locked/no-sync exact launcher を guard policy に統合する[/-] [+]実装: worktree bootstrap を direct Python/no-project-mutation launcher に統一する[/+] on Aug 5, 2026
  10. squne121 commented on Aug 5, 2026

    @squne121
    OwnerAuthor

    タイトル更新(issue-refinement-loop 追記)

    旧タイトル「実装: worktree bootstrap の locked/no-sync exact launcher を guard policy に統合する」は、本文改訂(Hook/guard policy への統合を撤回)と矛盾していたため、Owner Decision の推奨タイトルへ変更しました。

    新タイトル: 実装: worktree bootstrap を direct Python/no-project-mutation launcher に統一する

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