Skip to content

実装: markerless PR の本文 marker・closing relation 変化を decision-time freshness rebind に反映する #2992

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "markerless open/draft PR の decision-time body marker と closing relation の意味変化を HEAD 不変でも ownership/disposition に反映する"
change_kind: code
dedupe_key: "impl-review-loop-v1:markerless-live-body-closing-authority-rebind"

Parent Issue

なし(#2972 / PR #2985 の別スコープ follow-up。親子登録はしない)

Parent Goal Ref

Current Validated Scope

  • .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py の _live_freshness_reference() と disposition 前の再評価、および同 skill の既存 unit / fake-gh intake integration test に限定する。
  • 収集時に markerless な open/draft candidate について、HEAD / Issue body / main SHA が不変でも decision-time の live PR body marker semantics または closingIssuesReferences による current target authority が変化した場合の freshness rebind を扱う。

Remaining Parent Gaps

Background

#2972 / PR #2985 の独立レビューで判明した別スコープの欠陥(finding、APPROVE)。現状 _live_freshness_reference() は decision-time に live PR body / closingIssuesReferences を取得するが、その意味的再導出は主に irrelevant sibling と historical carve-out の参加 candidate に限定される。通常の markerless open/draft candidate は HEAD 等の identity が同じなら収集時の scope_coverage / current_scope_ownership / provenance を保持したまま existing_pr_resume し得る。根本原因は取得不足ではなく、取得済み live authority の通常 markerless branch への再束縛不足。

決定論的な修正として marker の追加・削除・malformed 化と current target の closing relation 昇格・降格を rebind 時に意味的に比較し、変化時は bounded な再収集・再評価または等価の live 再導出で freshness を確証してから disposition を確定する。PR body 全文の byte equality を要求する案は無関係な prose edit も停止させるため不採用。operator の marker 手入力・リトライによる回避は stale authority を検知できず都度介入が必要なため不採用。

Outcome

.claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py と既存テストが更新され、markerless open/draft PR の live body marker または current target closing relation の意味変化が HEAD / Issue / main SHA 不変でも decision-time disposition に反映され、古い ownership に基づく existing_pr_resume は発生せず、意味不変な prose edit は resume を妨げない状態となる。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: fake gh transport の unit / intake integration test で収集と decision-time fetch の差分をオフライン・決定論的に検証する。実 GitHub mutation や外部 service smoke は不要。

In Scope

  • 通常の markerless open/draft candidate に対し、既に取得する live PR body と closingIssuesReferences の current target 向け意味を再導出する。PR body の無関係 prose だけの変更は identity drift と扱わない。
  • markerless → 同一 Issue の valid marker / malformed marker、marker 付き → markerless を含む意味変化が起きたら、旧 scope_coverage / current_scope_ownership をそのまま採用せず、再収集・再束縛後に正規の coverage / ownership 規則で確定する。malformed marker や確認不能な live payload を marker 不在として扱わない。
  • current target の closing relation 昇格・降格を双方向に反映し、closing-priority と候補の conflict counting を再評価する。単独候補だけの局所変更で他候補の authority を見落とさない。
  • bounded retry 後も authority が確認できない・drift が続くときは reconciliation_required とし、既存の irrelevant sibling carve-out / 複数 candidate fail-closed を維持する。
  • 既存 unit test と fake-gh intake integration test に HEAD / Issue / main SHA 固定の before / after fixture と positive / negative を追加する。

Out of Scope

Acceptance Criteria

  • AC1: HEAD / Issue body / main SHA 固定で markerless open/draft candidate の live marker 追加(valid / malformed)または marker 削除が起きると、旧 scope_coverage / current_scope_ownership からの stale resume をせず、更新後の marker/markerless 規則で再評価する。malformed は fail-closed。
  • AC2: 同じ identity 固定で current target の closingIssuesReferences が追加または削除された場合、closing-priority / provenance を双方向で再評価し、古い authority で resume しない。
  • AC3: PR body の marker semantics / closing relation が不変な prose-only edit は不必要な retry や freshness_rebind_failed を起こさず、従来の正当な markerless resume を維持する。
  • AC4: live body または closingIssuesReferences の欠落・型異常・fetch / parse 失敗、もしくは bounded retry 後も意味的 drift が安定しない場合は確認済み markerless とみなさず fail-closed。HEAD identity だけ一致しても resume しない。
  • AC5: fake-gh intake production composition で marker/closing relation の live 意味変化が pre-Step-1 action に反映され、複数 candidate の conflict と irrelevant sibling carve-out の既存安全規則を退行させない。
  • AC6: impl-review-loop の既存 pytest 全体が成功する。

Verification Commands

# AC1
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_markerless_live_marker_add_remove_rebind
# AC2
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_markerless_live_closing_relation_promote_demote_rebind
# AC3
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_markerless_live_prose_only_stays_fresh
# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py::test_markerless_live_authority_unconfirmed_fail_closed
# AC5
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py::test_markerless_live_authority_change_intake_rebind
# AC6
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/

Allowed Paths

  • .claude/skills/impl-review-loop/scripts/implementation_landed_evidence.py
  • .claude/skills/impl-review-loop/tests/test_implementation_landed_evidence.py
  • .claude/skills/impl-review-loop/tests/test_implementation_landed_intake_integration.py

Stop Conditions

Required Skills

なし

Required Design References

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

Scope Delta(任意)

N/A(#2972 の glob matcher、#2991 の PR files completeness には含まれない意味論的 freshness rebind)

Source

Delivery Rule

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