Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "agent-retrospective が Latitude CLI の利用可能な runtime evidence を public-safe かつ予算上限付きで決定論的に enrichment できるようにする"
change_kind: mixedParent Issue
none
Parent Goal Ref
- Goal: agent-retrospective の finding を、GitHub に raw trace を公開せず再現可能な evidence で補強する。
- Desired Destination: 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の private observation/public retrospective boundary と 導入: repo URL起点の日次retrospective worksetとagent completion artifact投稿を確立する #1939 の日次 retrospective 運用に接続できる、bounded な Latitude CLI evidence producer。
Current Validated Scope
agent-retrospectiveは deterministic enrichment phase と structured retrospective output を持つ。- 実装: observation-source adapter を allowlist projection で agent_run_report/v1 に接続する #1223 は Latitude を public
source_kindにせず、allowlist projection をagent_run_report/v1へ接続する境界を確立済みである。 - 本 Issue は Latitude CLI の private runtime evidence を
agent-retrospectiveに限定して収集・正規化し、raw trace を public output へ通さない。
Remaining Parent Gaps
- なし。本 Issue は 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 と 導入: repo URL起点の日次retrospective worksetとagent completion artifact投稿を確立する #1939 の完了を主張せず、Cloud pilot または provider adoption decision を行わない。
Background
#1153 は Latitude trace を private observation plane に保持し、GitHub には public-safe summary と opaque evidence reference だけを投稿することを固定している。#1223 は agent_run_report/v1 向けの observation-source adapter を実装済みだが、agent-retrospective 自身には Latitude CLI から runtime evidence を bounded に取得して finding evaluation へ反映する専用経路がない。#1939 の日次 retrospective は provider telemetry を完了 gate にしないため、Latitude が unavailable でも retrospective の実行を妨げず、availability を明示した evidence として扱う必要がある。
Outcome
agent-retrospective に latitude_runtime_evidence/v1 の validator、bounded collector、deterministic enrichment とテストが追加され、Latitude CLI が利用可能なときは public-safe evidence reference と allowlisted metrics を finding evaluation に結合し、利用不能・不正・予算超過時は raw payload を出さず明示的な unavailable/error evidence に縮退する状態。
Design
- CLI collector は private input を process memory 内で allowlist projection に変換し、raw JSON、trace body、prompt、tool I/O、command output 全文、absolute path、credential を retrospective run、finding、fixture、log、GitHub artifact に永続化しない。
latitude_runtime_evidence/v1は collector の唯一の公開可能な出力契約とし、collector result をそのまま任意 JSON として受理しない。- deterministic enrichment は validated evidence の stable identity と availability を finding input に加えるだけで、Latitude evidence の欠落を supported/verified/positive finding へ昇格させない。
- CLI failure、timeout、malformed output、schema violation、forbidden field 検出、collection-budget 超過は fail-closed な evidence result に正規化する。retrospective 全体を false-green にせず、provider unavailable が単独で既存 retrospective を中断させることもない。
CLI Boundary
- Latitude CLI は read-only evidence collection のみを許可する。workspace/configuration/trace の作成、更新、削除、export、credential login/logout、remote state mutation を禁止する。
- collector は allowlisted command shape のみを
argv配列で起動し、shell、eval、stdin prompt、任意 subcommand、任意 path、環境変数値のログ出力を使用しない。 - executable 不在、認証不足、network unavailable、non-zero exit、timeout は
availability: unavailableまたは closed error code として表現し、raw stderr/stdout は捨てる。 - real CLI verification は opt-in とし、credential の表示・保存・GitHub への送信を行わない。unavailable 時は pytest 経由の SKIP(
pytest.skip()、stdout にSKIP:prefix)と evidence artifact を残す。
Binding Rules
latitude_runtime_evidence/v1がavailableの場合だけ、allowlisted metrics と opaqueevidence_refを finding evaluation に bind できる。- evidence identity は canonical public projection から決定論的に算出し、raw trace ID、raw payload、local absolute path を identity/digest input に含めない。
- 同一 retrospective run 内の evidence は最大 1 件とし、duplicate、unknown schema version、unknown field、forbidden field、identity mismatch は fail closed とする。
- unavailable/error evidence は
evidence_refと metric を null にし、finding の claim class、status、confidence を positive 側へ変更しない。 latitude_otlpは private provenance としてのみ扱い、既存 実装: observation-source adapter を allowlist projection で agent_run_report/v1 に接続する #1223 の publicsource_kindenum を変更しない。
latitude_runtime_evidence/v1
schema_version: latitude_runtime_evidence/v1
availability: available | unavailable | error
collected_at: RFC3339 UTC timestamp
collector_version: non-empty string
evidence_identity: sha256 public-projection identity | null
evidence_ref: opaque non-secret reference | null
metrics:
trace_count: integer | null
span_count: integer | null
duration_ms: integer | null
reason_code: closed non-free-form code | nullavailable は non-null evidence_identity、evidence_ref、allowlisted metrics を要求する。unavailable と error は metrics/evidence fields をすべて null にし、closed reason_code を要求する。上記以外の key、raw textual payload、prompt、message、tool、authorization、token、secret、path を拒否する。
Collection Budget
- 1 retrospective run あたり Latitude CLI 起動は最大 1 回。
- collector timeout は 10 秒以下、captured output は 64 KiB 以下、allowlisted projected metric は 3 個以下とする。
- pagination、trace content export、retry loop、background polling、network retry は行わない。
- budget 超過は reason code を伴う unavailable/error result に正規化し、partial raw output を保持しない。
In Scope
agent-retrospectiveにlatitude_runtime_evidence/v1schema/validation、bounded CLI collector、deterministic enrichment binding を追加する。- fake CLI を使う unit/integration tests、public-safety negative fixtures、CLI unavailable/timeout/malformed/budget-exceeded tests を追加する。
- runtime verification script と skill/reference documentation に CLI boundary、collection budget、pytest 経由の SKIP/FAIL semantics を記録する。
Acceptance Criteria
- AC1:
latitude_runtime_evidence/v1validator は closed key set、availability 別 nullability、closed reason code、canonical public identity を強制し、unknown/forbidden/raw field を fail closed する。 - AC2: collector は allowlisted argv の Latitude CLI を最大 1 回だけ起動し、10 秒/64 KiB/3 metrics の Collection Budget を超える結果を raw output なしで unavailable/error evidence に正規化する。
- AC3: available evidence だけが deterministic enrichment に bind され、unavailable/error/invalid/duplicate evidence は finding を positive claim/status/confidence に昇格させない。
- AC4: raw trace、prompt、message、tool I/O、stdout/stderr 全文、authorization、token、secret、absolute local path が schema output、retrospective result、fixture、log に混入すると validator/test が fail closed する。
- AC5: existing
agent_run_report/v1publicsource_kindenum を変更せず、latitude_otlpを publicsource_kindとして出力しない。 - AC6: available Latitude CLI に対する opt-in runtime verification(pytest 経由)は public-safe artifact を生成して成功する。CLI/auth/network が unavailable のときは artifact を残して
pytest.skip()による SKIP、予期しない runtime failure は assertion による FAIL で終了する。
Verification Commands
# AC1
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_latitude_runtime_evidence.py
# AC2
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_latitude_runtime_evidence.py
# AC3
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_run_retrospective.py
# AC4
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_public_safe_evidence_refs.py
# AC5
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_latitude_runtime_evidence.py
# AC6
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/verify_latitude_runtime_evidence_live_cli.pyRuntime Verification Applicability
decision: immediate
reason: "AC6 は実際の Latitude CLI process、authentication/network availability、および public-safe artifact を検証対象とする。"
applicable_acs:
- AC6
execution_environment:
cli_tools:
- python3
- uv
- latitude
auth_required: true
network_required: true
skip_conditions:
- "Latitude CLI 実行ファイルが見つからない場合は SKIP とし FAIL に変換しない"
- "Latitude 認証情報または network が利用不能な場合は SKIP とし FAIL に変換しない"
fallback_policy:
fallback_success_is_pass: false
notes: "CLI/認証/ネットワーク unavailable 時に fallback 経由の成功を PASS に変換しない。SKIP を維持し、public-safe artifact を保存する。"
artifact_requirements:
- "raw trace/credential を含まない generated public-safe artifact"
- "command exit status(PASS/FAIL/SKIP を判別できる形式)"- runtime VC:
uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/verify_latitude_runtime_evidence_live_cli.py - evidence: command exit status と raw trace/credential を含まない generated public-safe artifact を Draft PR に添付する。CLI/auth/network unavailable は artifact を保存して SKIP とし、success と扱わない。
Out of Scope
- Latitude Cloud pilot、provider adoption/withdraw decision、self-host、billing/retention policy の変更。
- Latitude credential/configuration の作成・変更・削除、remote workspace/trace mutation、raw trace export。
- 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153、実装: observation-source adapter を allowlist projection で agent_run_report/v1 に接続する #1223、導入: repo URL起点の日次retrospective worksetとagent completion artifact投稿を確立する #1939 の body/status/closure condition の変更。
agent_run_report/v1schema またはsource_kindenum の変更。- automatic GitHub Issue/PR posting、background polling、multi-provider evidence collection。
Allowed Paths
Proposed Allowed Paths
.claude/skills/agent-retrospective/SKILL.md.claude/skills/agent-retrospective/references/**.claude/skills/agent-retrospective/schemas/latitude_runtime_evidence_v1.schema.json.claude/skills/agent-retrospective/schemas/fixtures/**.claude/skills/agent-retrospective/scripts/collect_snapshot.py.claude/skills/agent-retrospective/scripts/run_retrospective.py.claude/skills/agent-retrospective/scripts/validate_retrospective_schema.py.claude/skills/agent-retrospective/scripts/tests/test_latitude_runtime_evidence.py.claude/skills/agent-retrospective/scripts/tests/verify_latitude_runtime_evidence_live_cli.py.claude/skills/agent-retrospective/scripts/tests/**
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合。
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
- 後続 Phase / 別スコープへの波及が判明した場合。
- nested SubAgent delegation が必要になった場合。
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
- Latitude CLI が read-only allowlisted command shape で必要 evidence を返せず、CLI boundary の拡張または remote mutation が必要になった場合。
- raw trace、credential、secret、prompt、tool I/O、absolute local path の保存・出力・GitHub publication が必要になった場合。
Required Skills
- Python CLI development
- JSON Schema validation
- public-safe evidence design
Required Design References
.claude/skills/agent-retrospective/SKILL.md.claude/skills/agent-retrospective/references/wire-contract.md.claude/skills/agent-retrospective/references/execution-budget.mddocs/dev/agent-run-report.mddocs/dev/runtime-verification-policy.mddocs/dev/secret-policy.md- 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153
- 実装: observation-source adapter を allowlist projection で agent_run_report/v1 に接続する #1223
- 導入: repo URL起点の日次retrospective worksetとagent completion artifact投稿を確立する #1939
Scope Delta(任意)
N/A
Delivery Rule
- 1 Issue = 1 PR。
- 実装: agent-retrospective の codebase observer を role-specific contract で接続し、AGY operational failure 時の native fallback 結果を base_sha-bound な OBSERVER_RESULT_V1 へ正規化する #2374 merge に依存する。実装: agent-retrospective の codebase observer を role-specific contract で接続し、AGY operational failure 時の native fallback 結果を base_sha-bound な OBSERVER_RESULT_V1 へ正規化する #2374 の
run_retrospective.py/SKILL.md変更を含む PR が merge されるまで本 Issue の実装を開始しない。 - 専用 worktree で実装し、Draft PR を既定とする。
- raw evidence、credential、secret を commit、Issue、PR、artifact に含めない。
- Allowed Paths 外、CLI boundary 拡張、schema enum 変更が必要になった場合は停止して follow-up Issue を提案する。
Notes for Reviewer
Scope Collision (C1): related_issue=#2374; overlapping_paths=.claude/skills/agent-retrospective/SKILL.md, .claude/skills/agent-retrospective/scripts/run_retrospective.py, .claude/skills/agent-retrospective/scripts/tests/test_run_retrospective.py. Non-conflict reason: #2374 は AGY advisory native fallback の observer-wave 回帰を対象とし、本 Issue は Latitude CLI の public-safe runtime evidence schema/collector/binding を対象とする。Edit intent: #2374 merge 後の current head に対して本 Issue の差分だけを追加する。Dependency ordering: #2374 merge 後に開始する。
Activity
squne121 commentedon Aug 28, 2026
squne121 commentedon Aug 29, 2026
you asked
message time: 2026-08-29 12:57:21
#2375
内容について関連Issue、PR、リポジトリ資産、コメントを参照した上で敵対的レビューして。
取り扱う技術や配布物の実装をWEB検索し高品質化してほしい。
個人趣味開発の前提で品質・有用性を優先したいからセキュリティやハーネスはワークフローを妨げないことを優先して。
chatgpt response
Issue・コメント・関連PR/Issue・実装資産を照合し、外部一次資料で技術前提も検証します。実害ある欠陥と過剰設計を分離し、個人開発での実用性、修正優先度、受け入れ条件まで厳しく判定します。
chatgpt response
最大の懸念は、runtime evidenceを3集計値へ縮めた結果、project・時間窓・trace集合が未定義で分析価値まで失っている点です。さらに「ローカル非永続化」は親Issueのprivate保持方針と下流#2376のbundle設計に矛盾します。
chatgpt response
既存#1223/PR #1247にはLatitude→
agent_run_report/v1の投影経路があり、別schema/validator新設は二重正本化を招きます。現行7.10のsessions listならsessionId一致で、内容を露出せずエラー・token・costまで取得できます。chatgpt response
敵対的レビュー結果
判定
Request changes。現状の #2375 は、そのまま実装すべきではありません。
問題は「安全側に倒しすぎている」だけではありません。現在の契約では、Latitude CLIを一度呼び出し、
trace_count・span_count・duration_msという三つの数字を生成する一方で、それが今回レビューしているClaude Codeセッションに対応する証拠なのかを保証できません。結果として、「安全だが役に立たない」より悪い、出所の違う数字をruntime evidenceらしく見せる仕組みになり得ます。Issue本文の一回実行・三メトリクス・非ページング・raw破棄という制限は、証拠の正確性より境界防御を優先しすぎています。一方、任意ソースとして扱うこと、public側へraw payloadを出さないこと、取得失敗で通常のretrospectiveを止めないことは妥当です。この核だけ残し、設計を組み直すべきです。
重要な指摘
P0-1. 対象セッションとのexact bindingが存在しない
出力には
evidence_identityやevidence_refがありますが、少なくとも契約上、次の情報が明示されていません。既存の
collect_snapshot.pyは、public-safeなローカル投影にもsessionIdを残しています。つまり結合キーの候補はすでにあります。これを使わず、project全体や時間窓の集計値を「今回のセッションの証拠」と扱う理由はありません。Latitude 7.10.0のschemaには、会話本文を含まないsession listと、
sessionIdによるexact filterがあります。session summaryにはtrace数、span数、error数、実行時間、token、costなども含まれます。したがって、v1はexact session queryだけを許可すべきです。availability: availableの意味を、次のように強化してください。ゼロ件、複数件、時間範囲だけの推測は
availableにしてはいけません。P0-2.
evidence_identityが証拠のidentityになっていない三つの集計値を中心にdigestを作っても、別セッションが同じtrace数・span数・durationを持てば同じidentityになり得ます。それは証拠のidentityではなく、せいぜい
summary_digestです。次の二つを分ける必要があります。
evidence_identityprovider namespace、project、session IDから作る安定した識別子
snapshot_digestbinding、coverage、metrics、source schema versionから作る取得時点の内容digest
collected_atはsnapshot digestに入れません。同じ証拠を再取得しただけでdigestが毎回変わるためです。P1-1. 既存のobservation-source adapterと二重化する
#1223とPR #1247ですでに、次の経路が実装されています。
PR #1247は
latitude_otlpをprovider側のinput kindとして受け、public出力ではagent surfaceへ正規化し、raw混入やavailability driftを既存gateで検査するところまで実装済みです。現行adapterにも、
trace_count、span_count、prompt/completion/total tokenなどのcanonical projectionがあります。したがって、#2375の
latitude_runtime_evidence/v1を第二のpublic evidence schemaとして配線するのは不適切です。許されるのは次の構成です。IssueのAllowed Pathsにも、最低限以下を追加する必要があります。
scripts/agent-logs/lib/observation-source-adapter.mjsrun_retrospective.pyとcollectorの結合テスト新しいsecurity validatorを別に作るのではなく、既存adapterの境界を再利用すべきです。
P1-2. 三メトリクス制限が主要な価値を捨てている
Issueコメント側では、当初次のような分析を想定していました。
本文への収束過程で、これが
trace_count・span_count・duration_msの三つだけに縮んでいます。しかし現行Latitudeのsession listは、会話内容を取得せず、一件のsummary rowから少なくとも以下を取得できます。
traceCountspanCounterrorCountdurationNsこのため「最大三メトリクス」はsecurity boundaryではなく、単なる情報損失です。
v1では一回のsession summary取得に限定しつつ、最低でも次を採用すべきです。
なお、Latitudeの
durationNsは単純なwall-clockではなく、sessionのactive execution timeとして定義されています。duration_msという曖昧な名称ではなく、active_duration_msと明記すべきです。wall-clockが必要なら、start/endから別途wall_duration_msを導出します。p95、遅いspan、重複tool callなどはspan queryと追加取得が必要になるため、v1から外して構いません。三メトリクスに削るのではなく、一回のsession summaryで取れる有用な値を全部使うのが適切な境界です。
P1-3. 「一回だけ実行」とversion/auth/schema preflightが両立していない
Issueコメントは、version・auth・schemaのpreflightを求めています。一方で本文は、CLI invocationを最大一回に制限しています。両方を同時に満たす契約にはなっていません。
さらに、Latitude CLI 7.10.0は2026年8月18日に公開済みです。CLIのcommand/schema driftは将来の仮定ではなく、継続的に対処すべき現実の問題です。
実行時契約は次のように分けるべきです。
doctor実行時、fixture更新時に行う--versionはcache miss時だけ許可>=7.10,<8unsupported_cli_versionschema_mismatch毎回version、auth、schema、data queryを順番に呼ぶのは遅く、逆に一切検証しないのは壊れやすいので、この分離が最も実用的です。
P1-4. 非ページングなのにcoverageを表現していない
Latitudeのlist APIはcursor paginationを持ちます。ページングを禁止すること自体は、exact session summaryだけを読むなら問題ありません。しかし、現在の契約には「取得結果が完全だったか」を表すフィールドがありません。
一回の読み取りで完結させるなら、次の規則が妥当です。
判定は次の通りです。
hasMore == false→
available、coverage: complete→
unavailable、session_not_foundまたはingestion_pendinghasMore == true→
error、ambiguous_binding→ project集計や時間範囲検索へ自動fallbackしない
limit: 2はデータを集めるためではなく、bindingの曖昧さを検出するためです。P1-5. 親設計・後続Issueとのprivate evidence契約が噛み合っていない
#1153の設計は、rawなEntireCLI/Latitude情報をprivate observation planeに保持し、public review planeには要約・メトリクス・opaque referenceだけを出す二層構造です。
#1939も、publicなopaque referenceからprivate evidenceを解決するresolver、availability、retention、failure semanticsを求めています。
さらに後続の#2376は、permission-restrictedなlocal evidence bundleを明示的に作る契約です。
したがって、#2375の「raw stdout/stderrは即破棄」「ローカルにも永続化しない」という絶対条件では、
evidence_refを後から解決できず、#2376とも整合しません。個人開発向けには、次の軽量な方針で十分です。
「private planeを許容する」と「毎回raw transcriptを保存する」は別です。現在のIssueは両者を混同して、監査可能性まで捨てています。
P1-6. public-safeとoperator diagnosticを混同している
LatitudeのClaude Code向けtelemetryは、設定によってprompt、assistant response、tool call、tool resultを含むfull-fidelityな会話情報を送ります。したがって、session detail、trace detail、span detail、export、debug出力をpublic経路から禁止するのは正しい判断です。
一方で、session listのrowはper-message contentを含まないため、ここだけに限定すれば危険度は大きく下げられます。
しかし、stderrを完全に捨てると、次の区別ができません。
public reportには出さず、ローカルに次だけ残すべきです。
既存のobservation adapterはすでにpublic出力のraw混入を検査しています。新しいrecursive secret/path scannerをcollector側へ重ねる必要はありません。typed projectionを作り、既存gateへ渡す方が小さく、保守しやすく、ワークフローを妨げません。
P1-7. runtime evidenceがretrospectiveを改善する条件がない
現在のAcceptance Criteriaは、主として次を検証しています。
しかし、「取得した証拠がretrospectiveの品質を改善したか」を検証していません。
少なくともfixtureで次を証明すべきです。
error_count > 0によりruntime reliability findingの優先度またはconfidenceが上がるこれがなければ、#2375は「JSONを一個増やした」だけで終わります。
P2-1. Issue dependencyとAllowed Pathsが不正確
Machine-Readable Contractは
parent_issue: noneですが、実際には少なくとも次の関係があります。また、PR #2387は直近で
run_retrospective.pyのobserver呼び出し、schema選択、role adapterを変更しています。#2375が同じorchestratorを触るなら、この経路を壊さないregression testが必要です。#2375のAllowed Pathsは、既存adapterとの統合を許すように更新し、PR #2387のhead以降をauthoritative baseとして扱うべきです。
推奨する最小設計
Issue名も次の程度まで具体化した方がよいです。
取得契約
取得する値は、session summary一件に限定します。
Latitude公式も、request・conversation・agent境界へsession IDやmetadataを付ける運用を案内しています。Claude Code側の
sessionIdとLatitude側sessionの対応が直接取れない場合は、共通のretrospective_run_idをtelemetry metadataへ設定する処理が先行条件です。(GitHub)時間範囲による推測fallbackは入れません。 Exact bindingが作れないなら、そのrunでは
unavailableにするべきです。推奨出力schema
{ "schema_version": "latitude_runtime_summary/v2", "availability": "available", "binding": { "kind": "session_id", "strength": "exact", "project_ref_digest": "sha256:...", "session_ref_digest": "sha256:...", "coverage": "complete" }, "metrics": { "trace_count": 12, "span_count": 93, "error_count": 2, "active_duration_ms": 18432, "prompt_tokens": 120000, "completion_tokens": 8000, "total_tokens": 128000, "cost_total_microcents": 123456 }, "dimensions": { "models": ["..."], "providers": ["..."] }, "evidence_identity": "sha256:...", "snapshot_digest": "sha256:...", "source_version": "latitude-cli/7.10.0", "collected_at": "2026-08-29T00:00:00Z", "reason_code": null }規則は次の通りです。
availability != availableではmetricsをすべてnullevidence_identityはprovider/project/sessionのidentitysnapshot_digestはbinding・coverage・metrics・source versionのcanonical digestcollected_atはdigest対象外agentNamesやdefinedToolsはpublicには出さず、必要なら件数のみevidence_refは実際にresolverが存在する場合だけ付ける書き換えるべきAcceptance Criteria
Exact binding
ローカルrunとLatitude sessionをproject+session IDでexactに結び付ける。時間窓・最新session・project全体へのfallbackは禁止。
Content-free read
session list相当のread-only commandだけを許可し、session/trace/span detail、export、mutation、debugを拒否する。
Complete result
limit: 2で取得し、一件かつhasMore == falseのときだけavailable / completeとする。Useful metrics
trace、span、error、active duration、prompt/completion/total token、costを投影する。任意の「最大三個」制限は削除する。
Existing adapter reuse
collector-private summaryを既存observation-source adapterへ渡し、public側に新しい並行schemaを作らない。
Correct identity
evidence identityとsnapshot digestを分離し、digestから
collected_atを除外する。Nonblocking semantics
CLI不在、未認証、session未検出、timeout、schema driftのいずれでも、基礎retrospectiveは成功させる。弱いevidenceでfindingを昇格させない。
Bounded diagnostics
publicにはraw stdout/stderr、会話、tool I/O、local pathを含めない。ローカルにはtyped reasonと最大2KiBのnormalized diagnosticを許可する。
Compatibility
7.10系のschema fixtureを保存し、対応version範囲を宣言する。version/schema検査はinstall/doctorまたはcache miss時に行い、毎runの多段preflightを要求しない。
Utility proof
Hermetic fixtureで、availableなruntime evidenceが少なくとも一つのfindingの根拠・confidence・priorityを決定論的に変えることを検証する。unavailable時は完全なno-opとする。
Lightweight live verification
実装時に一回だけ実CLI smokeを実行し、恒久的なnetwork CI gateにはしない。これはPR #2387で採用済みの「一回のlive consumer smoke、常設CIにはしない」という方針とも整合します。
セキュリティ境界として残すもの
個人趣味開発の前提では、hard guardは次の五つで十分です。
逆に、次は削除または緩和すべきです。
実装順
最終結論
#2375の方向性自体には価値があります。特にerror・token・cost・active durationをsession単位でretrospectiveへ渡せれば、ログ本文だけでは弱い「実行効率」「予算消費」「runtime failure」の評価を改善できます。
ただし、現在の本文は最重要のexact bindingを欠いたまま、三メトリクス・一回実行・完全破棄という形式的制約だけを強めています。実装着手前にIssueを改稿すべきです。
exact bindingを実証できない場合は、project集計や時間範囲推定を証拠として導入せず、#2375を
not plannedにする方が高品質です。誤って結び付いたruntime metricsは、証拠がない状態よりレビュー品質を悪化させます。you asked
message time: 2026-08-29 13:25:51
懸念として agent-retrospective が Latitude CLI を必須とするような実装になると、他の環境で使えなくなってしまうので、依存しないような選択的に利用できるような構成にする方が良いと思います。
agent-retrospective との導入について検証を行って、どのような接続がいいのか確認した方がいいのではないかと思いますが、いかがでしょうか。
agent-retrospective が対象としたセッションログのIDから、AgentのIDからLatitudeの情報検索が可能なら、それがデータの整合性を保つ一意のデータになるのでは?
chatgpt response
その方針が妥当です。まず「optional enrichment」として成立するかを実環境で検証し、ローカルのsession IDからLatitude側へexact bindできることを確認してから本実装へ進むのが安全です。Agent IDについても、Latitude側で実際にどの識別子が保存・検索可能かを確認します。
確認した限り、session ID はかなり強い結合キーです。LatitudeのClaude Code telemetry実装はStop hookの
session_idをそのまま取り出し、mainとSubAgentのspanすべてに同じsession.idを付けています。一方、SubAgent IDはsubagent.idとしてspan属性に載りますが、現行CLI/APIでこれを第一級の検索キーとして安定利用できるかは別途確認が必要です。はい。その考え方の方が良いです。前回のレビューから一段修正すると、#2375は**「Latitudeをagent-retrospectiveへ組み込むIssue」ではなく、「Latitudeが利用可能な環境だけで追加evidenceを供給するoptional adapterを成立させられるか検証し、成立した場合だけ接続するIssue」**に寄せるべきです。
特にsession IDについては、かなり期待できます。
LatitudeのClaude Code telemetry実装を確認すると、Stop hookのpayloadからClaude Codeの
session_idを直接取得し、その値をbuildOtlpRequest()へ渡しています。SubAgentについても親と同じsessionIdを引き継いでLatitudeへ送っています。さらにLatitude CLI 7.10.0には、明示したsession IDを扱う
latitude sessions get --project-slug ... --session-id ...が存在し、sessions listはconversation本文を含まないsession summaryを返します。 Latitude自身もClaude Code integrationについて「全spanがsession idを共有してLatitude UI上でgroupされる」と説明しています。(npm)したがって、基本bindingはかなり明快です。
これは時間範囲やrepository名で「たぶんこのtrace」と推定するより大幅に強いです。
Agent IDについて
ここはsession IDと分けて考えるべきです。
Latitudeの現行Claude Code telemetryはSubAgentについてもかなり良い情報を送っています。実装上、SubAgent transcriptから
agentIdを取得し、SubagentInvocation.agentIdとして扱っています。さらに実際のOTLP spanには、
が付加されています。
subagent.idは実装上<agentType>:<agentId>という形になっています。したがって概念的には、
という二段階bindingが可能です。
ただし、ここには重要な留保があります。
「Latitudeに
subagent.idが保存されている」ことと、「現行Latitude CLIのfilterでsubagent.idを直接検索できる」ことは別です。現在確認できたCLIではsession IDは正式なaddressing keyですが、SubAgent IDについて同等の第一級CLI検索インターフェースまでは確認できていません。そのため現時点では、
として設計するのが適切です。
先にlive verificationをやるべき
ここは同意します。実装より先に、小さな検証を入れた方がよいです。
特に次の4点だけ確認すれば、接続方式をかなり確定できます。
sessionId = Xを取る。Xを指定して一意のsessionを取得できるか確認する。agentId = Yと対応するsubagent.idが存在するか確認する。ここで、
が成立すれば、これをcanonical bindingにできます。
さらに、
まで成立すれば、Agent単位のruntime analysisもかなり精密になります。
逆にここが成立しなかった場合には、時間範囲matchingなどへ安易にfallbackせず、Latitude enrichmentを
unavailableにする方がいいです。agent-retrospective本体はLatitude非依存にする
ここはIssueの必須設計条件にした方がよいです。
推奨構成はこうです。
Latitude adapterはroot orchestrationからinjectするだけで、core schemaやobserverがLatitudeの存在を要求しない構造にします。
通常動作は例えば、
です。
重要なのは、「Latitude CLIがPATHにあったら勝手にネットワークアクセスする」仕様にも、しない方がよいことです。
明示的に例えば、
あるいはrepo-local設定で、
としたときだけ利用する方が予測可能です。
環境依存をさらに小さくするなら、
程度の三状態で十分です。通常運用は
offまたは明示設定されたautoです。#2375の設計をどう変えるか
私は、いまの#2375をそのまま実装開始するより、runtime verificationをimplementation gateにすることを勧めます。
つまり最初のAcceptance Criteriaを、
とします。
その上で実装を、
というprogressive enhancementにするのがよいです。
これならLatitude側APIの変更でAgent ID検索が使えなくなっても、
agent-retrospectiveそのものは壊れません。さらに重要な点
この設計にすると、前回私が提案した「Latitude用schemaをかなり厳密にpublic contract化する」必要性も下がります。
Latitudeはあくまで、
です。
したがって、
という変換境界にする方がよいです。
observer/evaluatorには、
程度のgeneric evidenceを渡せばよく、observer自身にLatitude CLIの知識を持たせる必要がありません。
これは将来的にLatitude以外のobservability sourceを使う場合にも有利です。
結論として、#2375は「Latitude integration」より「optional runtime-evidence provider interface + Latitudeによる最初の実証」に修正するのが適切です。
そして、ユーザーの指摘どおり、Claude Codeのsession ID → Latitude session IDの一致が確認できれば、それを最上位のcanonical identityにするべきです。実装を見る限り、この一致はかなり成立する可能性が高いです。SubAgentについても
agentIdはLatitude spanへsubagent.idとして送られているので、次のlive verificationではここまで確認する価値があります。この検証結果が揃ってから、#2375の最終schemaとACを固定するのが順序として最も堅いです。
squne121 commentedon Aug 29, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Aug 29, 2026
implement-issue: 実装完了 (2026-08-29T05:00:00Z)
.claude/worktrees/issue-2375-agent-retrospective-latitude-cli-runtimeworktree-issue-2375-agent-retrospective-latitude-cli-runtimetest_latitude_runtime_evidence.py→ 57 passed(AC1/AC2/AC5)test_run_retrospective.py→ 158 passed(AC3 追加分含む、既存回帰なし)test_public_safe_evidence_refs.py→ 36 passed(AC4 追加分含む)verify_latitude_runtime_evidence_live_cli.py -rs→ 1 skipped(AC6。latitudeCLI 不在のため期待通りSKIP: latitude CLI executable not found in PATH。public-safe artifact 保存済み、gitignored)scripts/tests/→ 582 passed, 9 deselected(既存回帰なし)ruff check(変更ファイル)→ passfix: latitude_runtime_evidence/v1 の available 判定で metrics 全 non-null …
fix: latitude_runtime_evidence/v1 の CLI 連携を実 CLI (traces list) 契約へ全面修…
feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収…
fix: LATITUDE_PROJECT を Claude-GPT 生成 settings env へ配線し、live 検証の circ…
feat: Claude-GPT を Native Latitude local profile 経由で同一 project へ接続する (#…