Skip to content

実装: concurrent work ledger で active worktree / dirty main / overlapping paths を loop 前に検出する #966

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "loop 着手前に active worktree / dirty main / stash / overlapping Allowed Paths を圧縮提示する concurrent work ledger を追加し、複数 Issue 並行時の context 汚染と main 誤編集の混線を事前可視化する"
change_kind: workflow

Parent Issue

none(単独改善)

Parent Goal Ref

  • Goal: current Issue の Allowed Paths と既存 dirty / staged / worktree changed paths の overlap を着手前に検出し、continue_with_worktree_guard か stop_human を明示 route する
  • Desired Destination: build_concurrent_work_ledger.py が CONCURRENT_WORK_LEDGER_V1 を返し、intake capsule に ledger summary を 20 行以内で埋め込む

Current Validated Scope

  • .claude/skills/impl-review-loop/scripts/build_concurrent_work_ledger.py を新規追加する
  • .claude/skills/impl-review-loop/steps/preparation.md を更新し、ledger summary を着手前に参照する
  • .claude/skills/impl-review-loop/tests/test_build_concurrent_work_ledger.py を新規追加する

Remaining Parent Gaps

Outcome

build_concurrent_work_ledger.py が git worktree list --porcelain と git status --short から CONCURRENT_WORK_LEDGER_V1(active_worktrees / main_checkout / overlaps)を生成し、current Issue の Allowed Paths との overlap に対し continue_with_worktree_guard か stop_human を明示 route、ledger summary を 20 行以内で intake capsule に埋め込む。新規 pytest と pnpm typecheck/lint/test/build が PASS する状態。

In Scope

  • git worktree list --porcelain + git status --short からの active worktree / main checkout ledger 生成
  • current Issue の Allowed Paths と既存 dirty / staged / worktree changed paths の overlap 検出
  • overlap 時の continue_with_worktree_guard / stop_human 明示 route
  • patch-id / reflog の自動深追い禁止(必要時に follow-up command を提示するのみ)
  • intake capsule への ledger summary(20 行以内)埋め込み参照点
  • 対応するテスト追加

Out of Scope

  • OPEN Issue の Allowed Paths 重複検出(既存 scope rollup preflight の責務)
  • patch-id / reflog の自動調査
  • worktree 自体の作成 / 削除
  • Allowed Paths を impl-review-loop skill 配下以外へ拡張すること

Acceptance Criteria

  • AC1: git worktree list --porcelain と git status --short から active_worktrees / main_checkout を含む ledger を生成する。
  • AC2: current Issue の Allowed Paths と既存 dirty / staged / worktree changed paths の overlap を検出する。
  • AC3: overlap がある場合、continue_with_worktree_guard か stop_human の明示 route を返す。
  • AC4: patch-id / reflog 調査を自動で深追いせず、必要なときだけ follow-up command を提示する。
  • AC5: intake capsule に ledger summary を 20 行以内で埋め込む(preparation.md に参照手順が明記される)。
  • AC6: uv run pytest .claude/skills/impl-review-loop/tests/test_build_concurrent_work_ledger.py, pnpm typecheck, pnpm lint, pnpm test, pnpm build が PASS する。

Runtime Verification Applicability

decision: not_applicable
reason: "git 状態を読み取る ledger script + docs 変更であり、外部 service 実行を成功条件に含まない。全 AC は fixtures(git 状態サンプル)+ pytest で静的検証可能"

Verification Commands

baseline では新規 script / test が未作成のため、AC1〜AC5 の pytest は file not found(pytest exit 4)で baseline-fail する(baseline-expect: fail)。実装後に PASS する。AC6 は regression gate。

# AC1
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_build_concurrent_work_ledger.py -k "ledger_from_worktree_and_status" -v
# AC2
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_build_concurrent_work_ledger.py -k "overlap_detection" -v
# AC3
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_build_concurrent_work_ledger.py -k "overlap_route" -v
# AC4
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_build_concurrent_work_ledger.py -k "no_auto_patch_id" -v
# AC5
# baseline-expect: fail
$ uv run pytest .claude/skills/impl-review-loop/tests/test_build_concurrent_work_ledger.py -k "capsule_summary_bounded" -v
# AC6
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build

Allowed Paths

  • .claude/skills/impl-review-loop/scripts/build_concurrent_work_ledger.py
  • .claude/skills/impl-review-loop/steps/preparation.md
  • .claude/skills/impl-review-loop/tests/(concurrent work ledger 関連テスト / fixtures のみ)

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • 既存 scope rollup preflight の責務に踏み込む必要が出た場合
  • intake capsule スキーマの破壊的変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割)
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

  • Python 3(git porcelain パース / overlap 検出 / fixtures ベーステスト)
  • impl-review-loop の preparation / intake capsule と Allowed Paths の理解

Scope Delta(任意)

N/A

Activity

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

    @squne121
    OwnerAuthor

    Disposition: #1860 の結論待ち(OPEN のまま維持)

    親 Issue #1889(parent, delivery-rollup)の owner comment(https://github.com/squne121/loop-protocol/issues/1889#issuecomment-5149813241)に基づく敵対的レビューは、本 Issue が提案する新規スクリプト・新規 LOOP_STATE 永続化が、#1860(「導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する」、現在 OPEN)の方向性と整合しない可能性を指摘し、not planned 候補としました。

    ただし #1860 自体がまだ結論に至っていないため、本 Issue を close するかどうかは #1860 の結論確定後に人間が判断します。本コメントは disposition 保留の記録であり、Issue の状態・内容は変更しません。

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