Repository navigation
feat: agent-retrospective に session-window coverage / --since-last-retrospective を追加する - #2612
Conversation
…trospective を追加する (#2601) Session collector 未配線・unavailable・partial を "0 sessions observed" や "retrospective 完了" と誤解釈しない machine-readable coverage を新規実装する。 - 新規 session_window_coverage/v1 schema(既存 agent_improvement_candidate_v1 の source_coverage、latitude_runtime_evidence_v1 の availability/reason_code パターンを踏襲した required|observed|unavailable|partial|not_requested 5値) - collect_snapshot.py の既存 collect_claude_code_source / collect_claude_gpt_source をそのまま再利用する最小 collector wiring ($HOME/.claude/projects/<repo-slug>/ と CLAUDE_GPT_HOOK_SINK_PATH の 既存規約を再利用、未解決時は None のまま集計しない) - from_exclusive/to_inclusive/covered_sources watermark と SessionWindowCoverageRegression fail-closed guard(cross-run で required_sources を絞った際の checkpoint 巻き戻り漏れも検出) - orchestration.status と analysis_completeness を構造的に分離し、 pipeline 成功を retrospective completeness の根拠にしない - durable checkpoint は publish_authorized なしでは advanced と誤報しない (--prior-watermark-file による proposal-only 設計。新規 GitHub-comment 永続化プロトコルは追加しない) - focused tests 32件 + mutation 検証(guard の raise を無効化すると 2 test が red になることを確認済み、コミットには含めない) - AC9 live verification: 既存 verify_latitude_runtime_evidence_live_cli.py と同じ opt-in SKIP 規約の新規 pytest ファイル Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2612/ The preview will be removed when this PR is closed. |
結論Verdict: REQUEST_CHANGES です。 CI は通っており、 Issue #2601 は AC4 で「window 内の対象 session が0件」、AC5 で Findings
評価できる点この PR の AC2 の false-zero 防止、5-state coverage、 一方、この PR に追加の sandbox、permission broker、approval gate、複雑な security receiptを増やすことは推奨しません。今回不足しているのは security hardness ではなく、session-window のデータモデルと identity correlation です。そこへ実装コストを集中させるべきです。 Merge 条件私なら Finding 1 と 2 を必須修正、Finding 3 と 4 も #2601 を 修正後の理想形は、「既存 metadata を索引に |
|
推奨は、Issue #2601 / 既存 PR #2612 の 対象コメントの P0/P1 は同 PR 内で解消するのが妥当です。特に現実装には「Claude Code session を全 また、新規 DB/daemon を作るより既存 以下を、そのまま 既に auto mode で起動済みの対話的 Claude Code に渡すのを推奨します。 PR #2612 / Issue #2601 の既存実装について、以下の OWNER review comment を新しい human feedback / fix_delta として取り込み、 Target PR: Target human-context / review comment: 対象 Issue: この対話プロンプト自体を最新の direct interactive human instruction として扱ってください。対象コメントの
既存 PR・既存 canonical worktree・既存 branch を再利用し、fresh implementation を重複して開始しないでください。開始時に live Issue、live PR、対象コメント、現在の PR HEAD、base、mergeability、dirty state、最新 CI、review/thread、関連する既存 repository assets を再取得し、対象コメントが評価した HEAD から変更があれば必ず current HEAD を authority としてください。 作業方針は以下です。
auto mode で実行中なので、通常の implementation、test、format/lint、commit、既存 branch への publish、PR body 更新、review feedback 対応、CI 再確認、必要な ready-for-review 遷移は、skill / repository policy が許可する範囲で人間への逐次承認なしに進めてください。 PR body は最終 implementation と一致するよう更新してください。古い test count、古い HEAD、解消済み limitation、 最終終了条件は 絶対に PR を merge しないでください。 破壊的操作、secret/credential の公開・変更、force push / history rewrite、または repository policy 上の明示的 hard stop が必要になった場合のみ停止してください。それ以外の通常のレビュー修正では人間承認を求めず loop を継続してください。 最後に、すべての SubAgent が終了済みであることを確認してから、current HEAD、実施した fix、全 finding の disposition、verification/CI、最終 reviewer verdict、live mergeability、残 blocker、PR が merge 直前まで到達したかを簡潔に報告してください。 この形なら、前回 APPROVE を誤って再利用せず、今回の OWNER review を明示的 provenance 付きで取り込み、P0/P1 を実装へ戻した上で |
… checkpoint を修正する (#2601) OWNER REQUEST_CHANGES (PR #2612 issuecomment-5613892754) の Finding 1-7 に対応する fix_delta。 - Finding 1: prior_watermark が session 選択に実際に適用されていなかった false-green を修正。 `resolve_claude_code_session_paths()` に min/max_completed_at bound を追加し、 `collect_session_sources()` から window_start_exclusive/window_end_inclusive として配線した。 - Finding 2: claude_gpt collector が retrospective 自身の run_id を correlation nonce として 誤用していた構造的バグを修正。`run_nonce=None` でこの launch の実際の観測 nonce から auto-derive する経路を追加(`collect_claude_gpt_source`)。 - Finding 3: durable checkpoint persistence を追加。`_write_prior_watermark_file()` (atomic temp-file + os.replace)が checkpoint_advanced 時に --prior-watermark-file へ 書き戻し、次回invocationが読み戻す。 - Finding 4: --prior-watermark-file の読み込み/parse を main() の外側から run_since_last_retrospective_cli() 自身の typed-failure boundary の内側へ移動。 欠落パスは正当な first-run bootstrap として扱い、破損 JSON のみ typed failure とする。 - Finding 5: jsonschema.validate() に format_checker を渡し、schema の format: "date-time" 制約を実際に強制する。 - Finding 6: 既存 agent_session_manifest/v1 を window index として再利用する可能性を調査し、 per-phase GitHub comment 経由(gh network 必須・session 粒度で未索引)である理由から transcript-timestamp ベースの選択を主経路として維持する判断を `_claude_code_session_completed_at()` のdocstringに記録した。 - Finding 7: live test (`verify_since_last_retrospective_live_cli.py`) に、実データによる window filtering 除外証明・claude_gpt nonce correlation 証明の2テストを追加した。 test_session_window_coverage.py に regression test を追加(55 tests、実 fixture ベース)。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Summary
--since-last-retrospective(新規実装)向けに.claude/skills/agent-retrospectiveへ session-window / source-coverage の false-green 防止 gate を greenfield で追加する(P0: agent-retrospective の --since-last-retrospective で session collector 未配線を false-green にしない #2601)。current main には該当機能自体が存在しなかった。session_window_coverage/v1schema を追加し、required session source ごとのrequired | observed | unavailable | partial | not_requested5値 coverage を machine-readable に表現する(AC1)。既存 2 語彙(agent_improvement_candidate_v1.schema.jsonのsource_coverageclosed enum、latitude_runtime_evidence_v1.schema.jsonのavailability/reason_codeforcing invariant)を readback した上で、パターン(enum 値・reason_codeforcing・indeterminate相当の allOf invariant)を踏襲しつつ、粒度が異なる(session-window/collector 単位)ため新設した。selected_session_countを「0 件観測」と「未観測」で絶対に混同しない。from_exclusive/to_inclusive/covered_sourceswatermark とSessionWindowCoverageRegressionfail-closed guard を実装し、未観測 required source を跨いで checkpoint を進めない(AC5。cross-run でrequired_sourcesを絞った場合の巻き戻り漏れも検出する専用テストあり)。orchestration.status(pipeline 実行成否)とanalysis_completeness(要求分析の完全性)を構造的に分離し、pipeline 成功を retrospective completeness の根拠にしない(AC7)。publish_authorizedなしでは常にblocked_no_publish_authorizationとし、proposal を already-durable と誤報しない(AC6)。fix_delta(下記参照)で--prior-watermark-fileへの atomic durable write が実装済み —publish_authorized: Trueかつ checkpoint が実際に advance した run は、そのファイルへ新しい watermark を書き戻し、次回 invocation がそれを読み戻す(GitHub-comment ベースの新規永続化プロトコル・DB・daemon は依然として導入していない。あくまで caller 供給のローカル--prior-watermark-file自体が durable state であるという既存設計を維持したまま、それを書く主体がこの authorized invocation自身になっただけ)。Fix Delta(OWNER レビュー指摘への対応)
OWNER の敵対的レビュー(PR コメント: issuecomment-5613892754)で、初回実装に P0 構造的欠陥が2件・追加修正が5件発見された。全7件を本 commit で解消した。
prior_watermarkが session 選択に実際に適用されていなかった(watermark は reporting 用に計算されるのみでresolve_claude_code_session_paths()に決して feed back されない false-green)resolve_claude_code_session_paths()にmin_completed_at/max_completed_atを追加し、collect_session_sources()から window bound として配線。境界は exclusive-lower/inclusive-upper((from_exclusive, to_inclusive])。session の completion signal は transcript 自身の最新timestamp(無ければ mtime にフォールバック、単独の authoritative selector にはしない)test_collect_session_sources_applies_window_bounds_to_claude_code/test_resolve_claude_code_session_paths_boundary_exclusive_lower_inclusive_upper/test_run_since_last_retrospective_cli_second_run_excludes_prior_window_sessions/live:test_since_last_retrospective_window_filtering_excludes_old_sessions_live(実session file の最古のcompletion timestampを実際の watermark boundaryとして使用)claude_gptcollector にこの retrospective 自身の freshly-mintedrun_idを correlation nonce として渡していた構造的バグ(過去の launch の nonce と一致するはずがない)collect_session_sources()はrun_nonce=Noneでcollect_claude_gpt_source()を呼ぶように変更。run_nonce=Noneの場合、sink file 自身の in-window records から観測された実際の nonce を auto-derive する(単一 nonce のみ観測できた場合に限る。複数/ゼロ観測時は fail closed でunavailable)test_collect_claude_gpt_source_auto_derives_nonce_from_sink_content/test_collect_claude_gpt_source_ambiguous_multiple_nonces_fails_closed/test_run_since_last_retrospective_cli_claude_gpt_uses_real_nonce_not_run_id/live:test_since_last_retrospective_claude_gpt_nonce_correlation_live(CLAUDE_GPT_HOOK_SINK_PATHが実際に設定されている場合のみ実行、未設定時は明示的に SKIP)checkpoint_advanced: trueは proposal のまま(人間が手動で--prior-watermark-fileを書き換えないと次回 run に反映されない)_write_prior_watermark_file()(atomic temp-file +os.replace)を追加。checkpoint が実際に advance した run が、authorized な同一 invocation 内でその同じファイルへ書き戻すtest_run_since_last_retrospective_cli_writes_watermark_file_on_advancement/test_run_since_last_retrospective_cli_does_not_write_watermark_file_when_not_authorized/test_run_since_last_retrospective_cli_second_invocation_reads_back_written_watermark(write→readback を1つの test で end-to-end 証明)--prior-watermark-fileの読み込み/JSON parse がmain()側でrun_since_last_retrospective_cli()呼び出しより前・その typed-failure try/except の外側で行われており、欠落/破損ファイルが rawFileNotFoundError/JSONDecodeErrorとして CLI 呼び出し元に漏れていたrun_since_last_retrospective_cli()自身の内部・その try/except boundary の内側へ移動。欠落パスは正当な first-run bootstrap(orchestration.status: succeeded)、既存だが破損した JSON のみ typed failure(orchestration.status: failed,reason_code: JSONDecodeError)として区別するtest_run_since_last_retrospective_cli_missing_watermark_file_bootstraps_as_first_run/test_run_since_last_retrospective_cli_malformed_watermark_json_is_typed_failure/test_main_missing_watermark_file_never_raises_raw_exception/test_main_malformed_watermark_file_never_raises_raw_exceptionjsonschema.validate()はformat_checkerを明示的に渡さない限りformatkeyword を検証しない(ライブラリ自身の既定挙動)ため、schema のwatermark.from_exclusive/to_inclusiveのformat: "date-time"が実質的に無視されていたrfc3339-validatorは未導入かつ repo-rootpyproject.toml編集は Allowed Paths 外)でモジュールスコープのjsonschema.FormatCheckerを stdlibdatetime.fromisoformatベースで自作し、validate_session_window_coverage()へ渡すよう変更test_schema_rejects_invalid_date_time_string/test_schema_accepts_valid_date_time_stringagent_session_manifest/v1を window index として再利用できないか、という設計上の問いagent_session_manifest/v1は per-Main-Loop-phase の記録であり、GitHub Issue/PR comment に opaque ref として public 投稿される形式(scripts/generate-session-manifest.mjsは stdout 出力のみでローカル永続 index を作らない)で、phase_instance_id/issue_numberをキーとし、ローカル~/.claude/projects/<slug>/*.jsonlファイルとの対応が無く、読み戻しにはghnetwork 呼び出しが必要で、かつ記録された Main Loop phase 以外の生 Claude Code session を一切カバーしない(publish されなかった session は静かに欠落する)。この window index としての採用を却下し、transcript 自身のtimestampを主経路として維持する判断を_claude_code_session_completed_at()の docstring に記録したrun_retrospective.py、_claude_code_session_completed_at()docstring)に調査根拠を明記。新規 DB/daemon は追加していないverify_since_last_retrospective_live_cli.py) が既存の1テストのみで、Finding 1/2 の P0 修正を実際に証明していなかったtest_since_last_retrospective_window_filtering_excludes_old_sessions_live: 実環境の実 session file のうち最古の completion timestamp を実際の watermark boundary として使い、production のrun_since_last_retrospective_cli()が返すselected_session_countが pre-run で観測した全件数より厳密に小さいことを検証する(並行して動く他の Claude Code session による host 上のレースを避けるため、2回の別々の real-time呼び出しの厳密一致ではなく、この不変条件で検証する設計にした)。(b)test_since_last_retrospective_claude_gpt_nonce_correlation_live: production と同じCLAUDE_GPT_HOOK_SINK_PATH解決機構を使い、未設定時(プレーンな対話 pytest 実行では常に未設定)は明示的に SKIP、実際に設定されていれば実 sink file に対する nonce auto-derivation を検証するverify_since_last_retrospective_live_cli.py)。ローカルでの実行結果は「## AC9 動作検証」節参照Design Decision(Issue 本文で明示的に flag された open ambiguity への回答)
AC2 の「required session source が1つも collector に configured されていない場合、typed configuration/coverage failure にするか degraded result にするか」という open ambiguity(
semantic_review_result.json記載)に対して、本 PR は degraded result(analysis_completeness: "unavailable"、exit code 0、例外を投げない) を採用した。理由:## Desired Outcomeが「不足がある場合も...evidence を捨てずに degraded/partial として返してよい」と明記している。run_since_last_retrospective_cli()は内部で例外を捕捉し、orchestration.status: "failed"として型付きで返す設計にしており、真のバグ(例:repo_rootが git checkout でない)と「単に session source が未配線」を別軸で表現する。Checks
pnpm typecheckpnpm lintpnpm testpnpm builduv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/ -v(794 passed, 11 deselected — 既存 opt-in live CLI テストの deselect は本 PR 起因ではない既存挙動。test_session_window_coverage.py単体は 55 passed)uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py(24 passed)uv run --locked ruff check .claude/scripts scripts schemas .claude/skills(All checks passed)07fbab2d1bcfca7961997004677e508cd54c9d85)でローカル実行し、成功したことを確認してからチェックしていますAC9 動作検証(
verify_since_last_retrospective_live_cli.py)opt-in pytest(
verify_since_last_retrospective_live_cli.py)をverify_latitude_runtime_evidence_live_cli.pyと同じ SKIP 規約で実装している(fix_delta で 3 test に拡張済み)。ローカル実行結果:claudeCLI(PATH 上に存在)チェックは全 test で通過。.claude/worktrees/issue-2601-...)自身の$HOME/.claude/projects/<repo-slug>/には本 worktree 固有のセッション履歴が存在しないため、3 test すべてがclaude_code_sessions_dir_not_found/CLAUDE_GPT_HOOK_SINK_PATH_env_var_not_set_no_active_claude_gpt_launchで正しく SKIP した(fabrication なし、実環境の実際の状態。fix_delta で SKIP artifact のファイル名を test ごとに分離し、複数 test が同じ artifact ファイルを上書きしないよう修正した)。~/.claude/projects/-home-squne-projects-LOOP-PROTOCOL/)に向けて手動確認したところ(本 PR のコード自体は変更していない、collector の実データに対する手動 sanity check):collect_claude_code_sourceが実在する 4676 件の*.jsonlセッションファイルに対してstatus: complete/partialを返すことを確認。run_since_last_retrospective_cli()が返すselected_session_countが pre-run で観測した全件数(4676件)より厳密に少ない値(例: 4672件)を返し、境界より古い session が正しく除外されることを確認した。run_nonce/UserPromptSubmit+Stoppair を含む実データ)にCLAUDE_GPT_HOOK_SINK_PATHを向けた手動実行で確認:run_nonce=Noneのままstatus: observed,selected_session_count: 1を返すことを確認した(この retrospective invocation 自身は claude-gpt launch nonce を一切知らないにもかかわらず、sink file 自身の内容から正しく auto-derive されている)。備考: Issue 本文は「この live test file は
pytest .../tests/ -vの包括的な実行に自動的に含まれるため、独立した VC 行は追加しない」と記載しているが、本リポジトリの pytest 既定python_filesパターン(test_*.py)はverify_*.pyにマッチしないため、verify_since_last_retrospective_live_cli.pyはこのリポジトリの全ての既存 sibling live-test file(verify_latitude_runtime_evidence_live_cli.py等)と同様、直接パス指定でのみ収集される opt-in test であり、pytest .claude/skills/agent-retrospective/scripts/tests/ -vには自動的に含まれない(これは本 PR が導入した挙動ではなく、リポジトリ全体の既存の opt-in live-test 規約であり、修正対象としていない)。AC9 の実体(live proof が存在し、SKIP-based で fabrication しない)は満たされている。AC8 mutation test(手動検証、コミットには非含有)
guard_checkpoint_advancementのraise SessionWindowCoverageRegression(...)を一時的にpassへ書き換えてtest_session_window_coverage.pyを再実行したところ、以下 2 test が red になることを確認した(確認後 revert 済み・commit には含めていない):test_ac5_guard_raises_on_direct_regressiontest_ac5_ac8_scenario_d_narrowed_required_sources_blocks_via_guard_not_step1受け入れ条件の達成状況
Issue #2601 は AC1〜AC10 の 10 個を持つ。本 PR(
HEAD=07fbab2d1bcfca7961997004677e508cd54c9d85)で全 AC を実装済み(fix_delta で Finding 1-7 を修正した後の状態)。.claude/skills/agent-retrospective/schemas/session_window_coverage_v1.schema.jsonにrequired|observed|unavailable|partial|not_requestedの 5 値source_coverageenum を定義し、compute_source_coverage_entry()/compute_source_coverage_map()(run_retrospective.py)が生成する。既存 2 語彙を readback したうえでパターンを踏襲。test_ac1_source_coverage_five_state_vocabulary_reuses_collector_enum/test_ac1_unrecognized_collector_status_fails_closed/test_ac1_claude_gpt_selected_session_count_uses_complete_sessions_provenance— PASScompute_analysis_completeness()が required source 全未配線時にselected_session_count: 0を「0 件観測」と誤報せず degraded/typed coverage failure として扱う —test_ac2_ac8_no_collector_scenario_a_zero_wired_never_complete— PASSunavailable/partialにし数値を捏造しない —test_ac3_ac8_one_source_unavailable_scenario_b_evidence_retained— PASStest_ac4_ac8_both_sources_zero_scenario_c_complete_distinct_from_ac2(fix_delta 後は window filtering が実際に機能するため、この区別が false-green ではなく genuine な steady-state として証明されている) — PASSfrom_exclusive/to_inclusive/covered_sourceswatermark invariant とSessionWindowCoverageRegression(guard_checkpoint_advancement())の fail-closed guard —test_ac5_watermark_covers_only_observed_sources/test_ac5_guard_raises_on_direct_regression/test_ac5_guard_noop_on_first_run/test_ac5_ac8_scenario_d_narrowed_required_sources_blocks_via_guard_not_step1/test_ac5_guard_still_blocks_after_selector_fix_when_source_regresses(fix_delta 追加 — window-aware selector 修正後も guard が引き続き機能することを再確認) — PASScompute_checkpoint_disposition()が first-run / zero-finding / zero-session / no-publish-authorization の各ケースでcheckpoint_advanced/checkpoint_advance_reason/durable checkpoint 有無を明示。fix_delta で durable checkpoint の実際の write/readback を実装(Finding 3) —test_ac6_ac8_scenario_e_first_run_no_publication_blocked_explicit/test_ac6_first_run_with_authorization_advances/test_ac6_no_new_sessions_selected_when_prior_state_exists/test_run_since_last_retrospective_cli_writes_watermark_file_on_advancement/test_run_since_last_retrospective_cli_second_invocation_reads_back_written_watermark(fix_delta 追加) — PASSorchestration.status(pipeline 実行成否)とanalysis_completeness(要求分析の完全性)を構造的に分離し、pipeline 成功を completeness の根拠にしない —test_ac7_orchestration_succeeded_even_when_analysis_completeness_unavailable/test_ac7_run_since_last_retrospective_cli_never_raises_reports_orchestration_failed— PASStest_session_window_coverage.py55 tests)で固定。guard_checkpoint_advancementのraise SessionWindowCoverageRegression(...)を一時的にpassへ書き換える mutation test を手動実行し、2 test が red になることを確認済み(「AC8 mutation test」節参照) — PASSdecision: immediate):verify_since_last_retrospective_live_cli.pyをverify_latitude_runtime_evidence_live_cli.pyと同じ opt-in・SKIP 規約で実装(fix_delta で 3 test に拡張、Finding 7 参照)。今回改めてローカル再実行した結果、本 worktree 自身の$HOME/.claude/projects/<repo-slug>/にはこの worktree 固有のセッション履歴が存在しないため全 test が正しく SKIP(exit 77 相当・fabrication なし)。production 保持している main checkout へ手動照合した際は実在する*.jsonlに対し window filtering・nonce correlation とも実データで正しく機能することを確認済み(コード自体は本 PR で変更なし、「## AC9 動作検証」節参照) — PASS(legitimate SKIP、fallback PASS への昇格なし).claude/skills/agent-retrospectiveの全 test suite と repository-required checks が PASS — 下記「## 検証コマンド結果」参照 — PASS検証コマンド結果
Issue #2601 の
## Verification Commandsに記載された全コマンドおよび project constitution の必須検証を、本 PR head(HEAD=07fbab2d1bcfca7961997004677e508cd54c9d85、fix_delta 反映後)で改めて再実行した結果:project constitution が要求する追加ゲート:
Allowed Paths 遵守
git diff --name-only main...HEAD(本 PR headHEAD=07fbab2d1bcfca7961997004677e508cd54c9d85)で取得した変更ファイルは以下の 5 件のみである(fix_delta でcollect_snapshot.pyが新たに変更対象に加わった)。.claude/skills/agent-retrospective/schemas/session_window_coverage_v1.schema.json(新規).claude/skills/agent-retrospective/scripts/run_retrospective.py(更新).claude/skills/agent-retrospective/scripts/collect_snapshot.py(更新、fix_delta で追加。Finding 1/2 の collector-level 修正).claude/skills/agent-retrospective/scripts/tests/test_session_window_coverage.py(新規).claude/skills/agent-retrospective/scripts/tests/verify_since_last_retrospective_live_cli.py(新規)Issue #2601 の
## Allowed Pathsは以下を候補として挙げており、上記 5 件はすべてこの範囲内に収まる(scripts/claude-gpt/**の追加は不要だったため未使用)。.claude/skills/agent-retrospective/schemas/**←session_window_coverage_v1.schema.jsonが該当.claude/skills/agent-retrospective/scripts/run_retrospective.py← 完全一致.claude/skills/agent-retrospective/scripts/collect_snapshot.py← 完全一致.claude/skills/agent-retrospective/scripts/tests/**←test_session_window_coverage.py/verify_since_last_retrospective_live_cli.pyが該当Allowed Paths 外のファイル変更は存在しない。
Schema Change Applicability
schema_changesession_window_coverage/v1schema(.claude/skills/agent-retrospective/schemas/session_window_coverage_v1.schema.json)を追加した。fix_delta では schema 定義自体は変更していない(validator のformat_checker適用のみ追加、Finding 5)。Schema Consumer Inventory
変更対象 schema:
session_window_coverage/v1(新規)before/after 差分:
Consumer 列挙(rg コマンド例と結果):
Consumer 更新状況:
.claude/skills/agent-retrospective/scripts/run_retrospective.pybuild_session_window_coverage_result()が生成しvalidate_session_window_coverage()が自己検証する(fix_delta でformat_checker適用を追加)。--since-last-retrospectiveCLI mode がこの envelope を stdout に出力する唯一の producer。.claude/skills/agent-retrospective/scripts/collect_snapshot.pycollect_claude_code_source()/collect_claude_gpt_source()が window bound / auto-derived nonce を受け取れるよう拡張(Finding 1/2)。schema 自体は生成しない(run_retrospective.py側が consumer)。.claude/skills/agent-retrospective/scripts/tests/test_session_window_coverage.py.claude/skills/agent-retrospective/scripts/tests/verify_since_last_retrospective_live_cli.pyimpl-review-loop等)--since-last-retrospective呼び出し配線は別 Issue(この PR には含まれていない、In Scope 上も含まれていない)。Compatibility Decision(互換性判定)
additive(追加のみ)backward_compatible(後方互換)no(不要)N/A(該当なし)--since-last-retrospective)の追加のみ。既存のrun_cli()/ デフォルト CLI 引数契約・既存 schema には非破壊的な変更(--repository-id等のrequired=Trueをrequired=Falseにした上でmain()冒頭で手動必須チェックへ置き換えたが、デフォルトモードの実効的な必須性・エラーメッセージ挙動は変えていない)。fix_delta は既存のcollect_claude_code_source()/collect_claude_gpt_source()/resolve_claude_code_session_paths()の呼び出しシグネチャに キーワード引数 を追加しただけで、既存の位置引数呼び出しは非破壊的。Visual Impact Declaration(視覚影響申告)
該当なし(UI/DOM/CSS 変更を含まない)。
Safety Claim Matrix
--since-last-retrospectiveは headless Agent subprocess(claude -p --agent ...)を一切起動しない(既存 observer/evaluator pipeline とは独立した collector-only 経路)run_since_last_retrospective_cli()の実装(invoke_agent/AgentInvocationRequestを一切参照しない)。uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_session_window_coverage.py -v(55 passed)observed/completeとして誤報しない(false-green 防止が本 Issue の主目的)test_ac2_ac8_no_collector_scenario_a_zero_wired_never_completeほか AC1-AC8 focused tests(test_session_window_coverage.py、55 passed)。AC8 mutation 検証(guard 無効化で 2 test が red、PR body「AC8 mutation test」節参照)prior_watermarkは実際に session 選択に適用される(reporting のみに計算され selection に feed back されない false-green ではない)test_collect_session_sources_applies_window_bounds_to_claude_code/test_run_since_last_retrospective_cli_second_run_excludes_prior_window_sessions/live:test_since_last_retrospective_window_filtering_excludes_old_sessions_live(実 session file に対する window filtering を実データで証明)claude_gptcorrelation nonce はこの retrospective invocation 自身のrun_idではなく、対象 launch 自身が観測した nonce から auto-derive されるtest_run_since_last_retrospective_cli_claude_gpt_uses_real_nonce_not_run_id/test_collect_claude_gpt_source_ambiguous_multiple_nonces_fails_closed(複数/ゼロ観測時は fail closed)publish_authorized: Trueを明示しない限り proposal のまま。authorized 時は--prior-watermark-fileへ atomic 書き戻しを行い、次回 invocation がそれを読み戻す(新規 GitHub-comment 永続化プロトコル・DB・daemon は追加しない)test_run_since_last_retrospective_cli_writes_watermark_file_on_advancement/test_run_since_last_retrospective_cli_does_not_write_watermark_file_when_not_authorized/test_run_since_last_retrospective_cli_second_invocation_reads_back_written_watermarkclaude_code/claude_gptcollector 設定解決はローカルファイルパス・既存 env var 規約のみを読み、raw absolute path や credential を出力に含めない_scrub()(collect_snapshot.py、既存・未変更)を経由したCollectorResultをそのまま利用。verify_since_last_retrospective_live_cli.pyの raw path 非包含 assertion(fix_delta 追加の2 test も同様のassertionを含む)記載ルール遵守:
Not controlledが非空の行は現時点で存在しない(fix_delta で Finding 3 の durable persistence が実装されたため、以前の「durable persistence write path はスコープ外」の限定を削除した)。PR title / summary で無限定のcomplete/safe等は使っていません。Notes
--since-last-retrospectiveの session-window coverage / watermark / checkpoint disposition 計算層。fix_delta で durable checkpoint の実際の write/readback(Finding 3)を追加したが、GitHub-comment ベースの新規永続化プロトコルや別 daemon は依然として導入していない(既存のローカル--prior-watermark-file設計の範囲内)。オーケストレーターからの実配線は本 PR に含まない(Issue の In Scope 通り、collector-only の最小 wiring に限定)。--since-last-retrospectiveは greenfield 実装のため、CLI 引数の--repository-id/--target-issue/--request-id/--idempotency-keyをargparseのrequired=Trueからrequired=False+main()内の手動必須チェックへ変更した(--since-last-retrospectiveモードではこれらを要求しないため)。既存デフォルトモードの挙動(未指定時にエラーで停止する)は維持している(test_main_default_mode_still_requires_target_issue_argsで検証)。07fbab2d)で解消した。詳細は上記「## Fix Delta」節を参照。