Skip to content

実装: runtime smoke の --expect-ordered-marker を causal evidence の marker provenance 検証へ接続する #2874

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "runtime smoke runner の --expect-ordered-marker を causal evidence の marker provenance 検証へ接続し、--no-session-persistence の structured lane で documented VC が通るようにする"
change_kind: code
dedupe_key: runtime-smoke-ordered-marker-causal-provenance-2817

Parent Issue

none(単独改善。#2817 AC11 の blocker 解消を目的とする repo-owned follow-up)

Parent Goal Ref

  • Goal: --require-subagent-causal-evidence と --expect-ordered-marker を組み合わせた documented VC が、冗長な --expect-marker なしで判定可能になる
  • Desired Destination: scripts/agent-ops/run_worktree_agent_runtime_smoke.py の causal evidence 判定と .claude/skills/worktree-agent-runtime-smoke/SKILL.md の記述

Current Validated Scope

  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py の structured lane(L8077 付近)と interactive lane(L8407 付近)の subagent_causal_evidence_verdict(...) 呼び出しで、--expect-ordered-marker の値を expected_markers に合流させる
  • scripts/agent-ops/tests/test_expect_marker_source_provenance.py に回帰テストを追加する
  • .claude/skills/worktree-agent-runtime-smoke/SKILL.md に採用挙動を記載する

Remaining Parent Gaps

Background

検証済みの根本原因(コード読解 + Claude Code 2.1.287 での実走 4 回):

採用方針: 実装で --expect-ordered-marker の値を marker provenance 検証へ合流させる(child スコープの last_assistant_message / handbackReport.text を根拠にする)。parser.error で組み合わせを拒否する案は、documented VC をそのまま使えなくなるため不採用。

Outcome

run_worktree_agent_runtime_smoke.py が --expect-ordered-marker の値を causal evidence の marker provenance 検証へ渡し、ordered marker が child の last_assistant_message / handbackReport.text にのみ存在する場合に hook_id_correlated となる状態が、追加した pytest の PASS と SKILL.md の記述更新(PR)で確認できる。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: 変更は runner の判定ロジックのみで、決定論的な unit test(合成 transcript / output fixture)で全分岐を検証できる。実 Claude 起動は不要(policy の not_applicable 定義: 静的検証・unit test のみで完結)。

In Scope

  • structured lane / interactive lane の subagent_causal_evidence_verdict 呼び出しへ ordered marker を合流(重複排除し、順序は維持)
  • fail-closed 維持: parent の出力にのみ存在する marker、child の user prompt / tool input にのみ存在する marker は hook_id_correlated に昇格させない
  • 回帰テスト追加(下記 AC)
  • SKILL.md への採用挙動の記載

Out of Scope

Acceptance Criteria

  • AC1: ordered marker が child の last_assistant_message / handbackReport.text にのみ存在し、--expect-marker なしでも causal_evidence_source == hook_id_correlated になる
  • AC2: ordered marker が parent の出力にのみ存在する場合、hook_id_correlated に昇格しない
  • AC3: child が非同期起動で last_assistant_message / handbackReport がない場合、hook_id_correlated に昇格しない
  • AC4: 既存の test_expect_marker_source_provenance.py 全テストが PASS を維持する
  • AC5: SKILL.md に、--expect-ordered-marker が causal evidence の provenance 検証にも使われる旨が記載されている

Verification Commands

# AC1
$ uv run pytest scripts/agent-ops/tests/test_expect_marker_source_provenance.py -k ordered_marker_child_handback_promotes -q
# AC2
$ uv run pytest scripts/agent-ops/tests/test_expect_marker_source_provenance.py -k ordered_marker_parent_only_not_promoted -q
# AC3
$ uv run pytest scripts/agent-ops/tests/test_expect_marker_source_provenance.py -k ordered_marker_async_child_not_promoted -q
# AC4
$ uv run pytest scripts/agent-ops/tests/test_expect_marker_source_provenance.py -q
# AC5
$ rg -n "expect-ordered-marker.*(provenance|causal)" .claude/skills/worktree-agent-runtime-smoke/SKILL.md

AC1〜AC3 の VC は baseline-expect: fail(実装前は対象テスト未存在のため失敗する)。

Allowed Paths

  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py
  • scripts/agent-ops/tests/test_expect_marker_source_provenance.py
  • .claude/skills/worktree-agent-runtime-smoke/

Stop Conditions

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

Required Skills

  • Python / pytest

Required Design References

  • .claude/skills/worktree-agent-runtime-smoke/SKILL.md
  • docs/dev/runtime-verification-policy.md

Scope Delta(任意)

N/A

Delivery Rule

  • 1 Issue = 1 PR、専用 worktree、Draft PR 既定。

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions