Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1153"
related_issues:
- "#1220"
- "#2158"
- "#2375"
- "#2222"
goal_ref: >
Claude-GPT launcher から既存の Native Claude Code 用 Latitude local profile を
credential/config source として限定利用し、同一 Latitude project に Claude-GPT
session telemetry を送信するとともに、Latitude trace 上で Native Claude Code と
Claude-GPT を deterministic に識別可能にする
change_kind: mixedParent Issue
Parent Goal Ref
- Goal(導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 より): Claude Code / Codex CLI / Google Antigravity の運用データを public-safe な
agent_run_report/v1/agent_retro_index/v1に正規化し、ChatGPT が GitHub 経由で再現可能なレトロスペクティブを行える運用を確立する。 - Desired Destination(導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 より、parent スコープの記述であり本 Issue の write-capable scope ではない): Private Observation Plane(EntireCLI / Latitude OTLP traces / CLI 固有 local artifacts)→ deterministic adapter/verifier(source availability 判定・public-safe redaction・schema validation・evidence digest 生成)→ GitHub Issue/PR marker comment(
agent_run_report/v1/agent_retro_index/v1/CHATGPT_RETRO_CONTEXT_V1)→ ChatGPT GitHub connector、という一連のフローが再現可能な状態。raw transcript・full prompt・tool I/O 全文・local absolute path・API key は GitHub へ投稿しない。
Current Validated Scope
本 Issue が write-capable な scope(#1153 全体のスコープではない):
scripts/claude-gpt/launch.sh/scripts/claude-gpt/lib.shへの Latitude Stop hook wiring の追加- Native user settings からの限定 allowlist read helper の追加
docs/dev/secret-policy.mdのLATITUDE_PILOT_EXCEPTION_V1に対する、本 Issue に限定した owner-controlled policy supersession の追記(下記 Existing Policy Reconciliation 参照。既存 decision 値・既存 gate 契約自体は変更しない)docs/dev/agent-observation-capability.mdへの、本 Issue のスコープが同文書の capability matrix・実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 A1 gate 既定を変更しない旨の最小限の参照コメント追記- 実装着手前の pre-implementation live precondition probe(AC0)の実施と bounded summary の記録
- exact Claude-GPT session ID による live Latitude trace arrival確認(実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 の production collector コードは変更しない、verification-only の責務)
Remaining Parent Gaps
#1153 の gap のうち、本 Issue では閉じないもの(#1153 の gap 全部の機械的コピーではない):
- Codex CLI の Entire hook 互換性の capture capability verdict 確定
- Google Antigravity の capture capability verdict 確定
- private observation source →
agent_run_report/v1の正規化 adapter 実装(Child C0/C1) - Latitude Cloud pilot の実施と
adopt_cloud/adopt_self_host/conditional_adoption/withdrawDecision(Child E、LATITUDE_DISTRIBUTION_GATE_V1実装: Latitude telemetry distribution / argv / remote cleanup gate を real pilot 前提で強化する #1261) - 実装: ChatGPT GitHub retro E2E proof と Issue/PR operation session index を追加する #1405 由来の retro e2e proof(
chatgpt_retro_execution_proof/v1等)
Related Issues
- 実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 — Latitude real pilot / credential policy(historical human decision、CLOSED)
- 実装: claude-gpt launcher を bootstrap し native canary で runtime を検証する #2158 — Claude-GPT launcher / isolation architecture(CLOSED)
- 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 — agent-retrospective Latitude CLI runtime evidence enrichment(CLOSED、PR feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392 で実装済み)
- feat: worktree-agent-runtime-smoke に claude-gpt 同一 session multi-turn / 複数 SubAgent lifecycle 判定を追加する #2222 — worktree-agent-runtime-smoke(Claude-GPT interactive lane の main transcript 非存在に関する実機知見。下記 Design 0節参照)
Background
Native Claude Code では @latitude-data/claude-code-telemetry が利用され、user-level ~/.claude/settings.json の Latitude local configuration(LATITUDE_API_KEY / LATITUDE_PROJECT 等)を使って Latitude に telemetry を送信している。
一方 scripts/claude-gpt/launch.sh は Claude-GPT 専用の CLAUDE_CONFIG_DIR、HOME、XDG config/cache、launcher-owned settings を使用し、Native Claude Code の user settings を config authority として読み込まない。このため Claude-GPT は同じ Claude Code CLI を利用していても Native 側の Latitude Stop hook が自動適用されない。
また #2375 で実装済みの agent-retrospective Latitude runtime evidence path(PR #2392)は、claude_gpt collector が取得した exact session ID を Latitude query target として使用する。consumer 側の Claude-GPT binding は既に存在する一方、Claude-GPT session を Latitude へ export する producer wiring が不足している。
アンカーレビュー(issuecomment-5467028442)による成立性ギャップ: merged PR #2222 の実機 interactive Herdr lane では、Claude-GPT の隔離された config 配下に flat main .jsonl transcript が存在せず subagents/*.meta.json のみだったことが複数回再現されており、#2222 自身も transcript-based evidence を放棄し hook-event channel に設計変更している。現行 @latitude-data/claude-code-telemetry は Stop payload の session_id/transcript_path を読み、実在する transcript JSONL から turn を構築するため、通常の Claude-GPT interactive session で transcript が実在するかは未証明である。したがって本 Issue は実装着手前に一度だけ live precondition probe を行う(下記 AC0 参照)。
Outcome
Claude-GPT の通常 session で launcher-owned Latitude Stop hook が動作し、Native Claude Code と同じ LATITUDE_PROJECT へ trace が送信される。
Latitude 上では exact session ID と model attribute により、以下を deterministic に分類できる。
claude_gptclaude_code_nativeunknown
既存 #2375(PR #2392)の agent-retrospective Latitude collector は schema / collection budget を変更せず、Claude-GPT session ID に対応する実 Latitude trace を取得できる。
Design
0. Pre-implementation live precondition(アンカー P0 反映)
実装着手前に、現在の通常 Claude-GPT interactive session の Stop payload について一度だけ、session_id / transcript_path を取得し、test -f "$transcript_path" かつサイズ > 0 であることを確認する(AC0)。新しい harness・transcript assembler・OTLP proxy・専用 recorder は作らない。
注記: merged PR #2222 の実機 Herdr-driven session の live reproduction では、隔離された config 配下に flat main .jsonl transcript が存在せず subagents/*.meta.json のみだったことが複数回確認されている。本 AC0 の probe が同じ結果になった場合、それは実装未着手の失敗ではなく Claude-GPT interactive lane の構造的制約についての追加 evidence として扱い、Stop Condition として記録する(transcript assembler 等への無条件 scope 拡張はしない)。
この probe が FAIL した場合は #2426 の技術的 Stop Condition として扱う。これは human approval gate ではない。FAIL した場合に custom transcript assembler / OTLP proxy / Claude-GPT専用 recorder / upstream fork へ勝手に scope expansion しない。
1. Native settings 全体を Claude-GPT の config authority にしない
Claude-GPT は引き続き独立した以下を使用する。
CLAUDE_CONFIG_DIR- HOME
- XDG config/cache
- launcher-owned settings
- plugin / MCP boundary
~/.claude/settings.json 全体、Native hooks、permissions、plugins、MCP configuration を Claude-GPT settings へ merge/copy しない。
2. Latitude profile の allowlist read(アンカー P1 反映:8項目に固定)
launcher-owned Latitude hook adapter は Native user settings の env から Latitude 用の以下 8 項目のみを読み取る closed allowlist とする。
LATITUDE_API_KEY
LATITUDE_PROJECT
LATITUDE_BASE_URL
LATITUDE_CLAUDE_CODE_ENABLED
LATITUDE_CLAUDE_CODE_MEMORY
LATITUDE_CLAUDE_CODE_MEMORY_CONTENT
LATITUDE_REDACT_ATTRIBUTES
LATITUDE_REDACT_MASK
LATITUDE_DEBUG と BUN_OPTIONS はこの allowlist に含めない(LATITUDE_DEBUG は stderr noise を増やすのみで通常運用に不要、BUN_OPTIONS は下記5節で明示 unset するため)。unknown key は無視する。実装時に upstream current version の設定面が上記と異なる場合は、closed allowlist を実装時点の upstream 実装に合わせて再確認し、必要なものだけ追加する。
LATITUDE_API_KEY の値は stdout/stderr、generated settings、evidence、GitHub、argv に出さない。
3. API key を main Claude-GPT process の新規 ambient export にしない
LATITUDE_API_KEY は Latitude hook adapter が telemetry subprocess を起動するときだけ必要な child environment に渡す設計を優先する。
Native settings から取得した API key を repository file、GitHub、test fixture、generated Claude-GPT settings へコピーしない。
LATITUDE_PROJECT は secret ではないため、既存 #2375(PR #2392)collector が同一 project を解決できるよう runtime から解決可能にしてよい。
4. Launcher-owned Stop hook / exact telemetry identity(アンカー P2 反映)
Claude-GPT generated settings の既存 hook groups を維持したまま Stop に Latitude observation hook group を additive に追加する。既存 hook group を replacement してはならない。
telemetry command/package は実装時に current installed/upstream implementation を確認し、再現可能な exact identity を一箇所の SSOT(scripts/claude-gpt/lib.sh)で pin する(docs/dev/secret-policy.md の該当 exact_version / tarball_sha256 相当のプレースホルダも同じ値で更新する)。versionless / floating npx を新しい canonical production command にしない。
Stop hook は observation-only / fail-open とし、Latitude ingest failure によって Claude-GPT workflow 自体を失敗させない。async hook の exit 0 は成立性の証明として扱わない。
5. BUN_OPTIONS 明示 unset(アンカー P1 反映)
現行 scripts/claude-gpt/launch.sh は SSH_AUTH_SOCK / GIT_ASKPASS / SSH_ASKPASS / GIT_CREDENTIAL_HELPER を明示 unset しているが、BUN_OPTIONS は unset も export もしておらず、親シェルの ambient BUN_OPTIONS が Claude-GPT 子プロセスへそのまま継承されうる。
canonical Claude-GPT child process では、既存の unset ブロックと同じ箇所で BUN_OPTIONS を明示的に unset してから Claude を起動する方針とする。ambient environment に有効な Latitude preload が既に存在する場合の enrichment 自体は許容するが、これを AC5 の PASS 根拠にはしない(BUN_OPTIONS 未設定を production invariant として扱う)。
Claude-GPT 専用 preload の materialization / lifecycle 管理が必要と判明した場合は、本 Issue を無条件に拡張せず必要性を evidence 付きで再評価する。
6. Session-local telemetry HOME(アンカー P1 反映:upstream state locking 対策)
upstream Latitude telemetry(実装時点の current version)は state を全 session 共通の HOME 配下に保存するため、Claude-GPT launcher が共通の persistent isolated HOME を使う限り複数 Claude-GPT session の並行 Stop hook で state file が競合しうる。
launcher-owned Latitude hook adapter は Stop stdin の session_id を読み、telemetry subprocess の HOME を $CLAUDE_GPT_HOME/latitude-sessions/<sha256(session_id)>/ に設定してから exact package を起動し、session ごとに state を分離する。session_id の raw value 自体を public evidence に出す必要はない(opaque な取り扱いで良い)。
7. Same-project runtime identity / model classifier(#2375 production collector とは分離)
Native Claude Code と Claude-GPT は同じ LATITUDE_PROJECT を使用する。
現行 Latitude Claude Code telemetry は service.name=claude-code を固定で生成し、llm_request span に model / gen_ai.request.model / gen_ai.response.model を記録するため、canonical runtime classifier は model attributes を使用する。
現行 Claude-GPT launcher model mapping:
gpt-5.6-sol[1m]
gpt-5.6-terra[1m]
gpt-5.6-luna[1m]
classifier 前に [1m] 等の context hint suffix を除去する。
latitude_runtime_classifier_v1:
claude_gpt:
model_base_ids:
- gpt-5.6-sol
- gpt-5.6-terra
- gpt-5.6-luna
claude_code_native:
model_regex: "^claude-"
unknown:
otherwise: trueunknown を Native Claude Code とみなしてはならない。launcher model mapping が変更された場合は classifier も同一変更で同期する。
分離の明記(アンカー P1 反映): この classifier は #2375(PR #2392)の production retrospective collector には実装しない。#2392 の schema(latitude_runtime_evidence_v1、additionalProperties: false、trace_count/span_count/duration_ms の3 metric限定)と collection budget は変更しない。classifier は本 Issue の live verification 専用の bounded helper(AC6/AC7 用)として実装し、その結果は PASS/FAIL の bounded summary としてのみ Issue に記録する。将来 retrospective 自体に runtime_source が必要になった場合は、schema v2 として別 Issue で扱う。
将来 model 名から独立した first-class runtime identity が必要になった場合は、upstream telemetry の custom metadata/tag support または別 project 等を独立に評価する。本 Issue では独自 OTLP transformer / fork を新設しない。
Existing Policy Reconciliation
docs/dev/secret-policy.md の LATITUDE_PILOT_EXCEPTION_V1 は現在 decision: approve_synthetic_only を正本としており(pilot_activation_state: blocked_until_activation)、これは stale text ではなく #1220 で確定した明示的な human decision である。本 Issue はこれを無視・偽装せず、以下の形で明示的に reconcile する。
approve_synthetic_onlyという closed enum の値自体は変更しない。approve_timeboxed_real_pilotへ遷移させることを本 Issue の目的にしない(旧 real pilot の provenance / registry-signature / remote-cleanup 等の重量級 harness を日常の Claude-GPT workflow に復活させない)。- 一方で、本 Issue が対象とする「Native Claude Code が既に利用している local Latitude observation profile を、同一 project 宛に限り Claude-GPT にも適用する」という owner-approved local operation は、
approve_synthetic_onlyの一般的な意味(synthetic fixture / policy validation のみ許可、real trace export 禁止)とは異なる owner 意図に基づく。この owner 意図をdocs/dev/secret-policy.mdに対する owner-controlled policy supersession として明示的に materialize する。実装 PR でLATITUDE_PILOT_EXCEPTION_V1ブロックに隣接する形で以下相当の最小 block を追加する:
# owner_local_observation_supersession_v1(#2426 由来)
# LATITUDE_PILOT_EXCEPTION_V1.decision は approve_synthetic_only のまま変更しない。
owner_local_observation_supersession_v1:
supersedes: none
scope: claude_gpt_native_latitude_local_observation_only
authorized_by: "#2426 owner decision (2026-08-30)"
authorizes:
- native_claude_code_local_latitude_profile_reuse_by_claude_gpt_launcher
- same_project_telemetry_export_to_existing_latitude_project
does_not_authorize:
- unrestricted_real_pilot
- approve_timeboxed_real_pilot_transition
- cloud_pilot_activation
- legacy_provenance_registry_signature_remote_cleanup_harness_revival
retained_constraints:
- latitude_api_key_not_in_tracked_file_github_argv_fixture_persisted_evidence
- raw_trace_raw_prompt_tool_io_not_published_to_github
- latitude_failure_not_a_claude_gpt_workflow_completion_gate
- native_claude_settings_not_full_config_authority_for_claude_gpt
- claude_gpt_home_config_mcp_plugin_isolation_not_relaxed
- issue_2375_pr_2392_schema_and_collection_budget_unchangeddocs/dev/agent-observation-capability.mdが持つreal_runtime_evidence: blocked_until_pilot_exception_approve_timeboxed_real_pilotという既存の synthetic-only 契約・capability matrix・実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 A1 gate 既定自体は変更しない。本 Issue のスコープは Claude-GPT ⇄ Native Claude Code 間の telemetry 接続であり、Codex CLI / Google Antigravity の capture capability verdict マトリクス(実装: research(agent-observation): capture capability matrix と hook coexistence を authoritative evidence で確定する #1221)とは別レイヤーであることを同文書への参照コメントとして明記する。- raw Latitude trace の GitHub 公開禁止、API key の tracked file 保存禁止、Latitude telemetry を workflow completion gate にしない境界は維持する。
In Scope
scripts/claude-gpt/launch.shへ Latitude Stop hook wiring を追加する。scripts/claude-gpt/lib.shに必要な helper / exact telemetry identity を追加する。- Native user settings から Latitude allowlist field(8項目)だけを読む launcher-owned adapter を追加する。
- Latitude API key を repository / GitHub / generated settings / argv / persisted evidence に残さない。
- Native と Claude-GPT が同一
LATITUDE_PROJECTを使用できるようにする。 - existing hook groups と Latitude Stop hook の additive composition をテストする。
- 実装前に一度だけ、現在の通常 Claude-GPT interactive session の Stop payload transcript 実在性を live probe で確認する(AC0)。
- canonical Claude-GPT child process で
BUN_OPTIONSを明示 unset する。 - session-local telemetry HOME(
$CLAUDE_GPT_HOME/latitude-sessions/<sha256(session_id)>/)で upstream state race を回避する。 - exact Claude-GPT session ID で live Latitude trace arrival を確認する。
- Latitude trace の model attribute から Native Claude Code / Claude-GPT / unknown を deterministic に分類する live verification helper を実装する(実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 production collector には実装しない)。
- 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375(PR feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392)の existing Latitude collector / retrospective tests の regression を確認する。
docs/dev/secret-policy.mdのapprove_synthetic_onlyを、本 Issue に限定した owner-controlled policy supersession として明示的に reconcile する。docs/dev/agent-observation-capability.mdへ、本 Issue のスコープが同文書の capability matrix・実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 A1 gate 既定を変更しないことを示す最小限の参照コメントを追加する。
Out of Scope
- Native
~/.claude/settings.json全体の merge/copy。 - Native permissions/plugins/MCP/hooks の Claude-GPT への継承。
- API key の repository file、GitHub artifact/comment、test fixture への保存。
- Latitude raw trace の GitHub 投稿。
- custom OTLP proxy / telemetry package fork。
- upstream Latitude packageへの custom metadata 実装。
- Latitude を workflow completion / approval gate にすること。
- 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375(PR feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392)の evidence schema / one-query collection budget の変更。
- model 名だけでなく永続的な専用
agent.runtimeattribute を実現するための upstream fork/harness 新設。 docs/dev/agent-observation-capability.mdの capability matrix・verdict enum・実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 A1 gate 既定の変更。approve_timeboxed_real_pilotへの遷移、および旧 real pilot 用 provenance/registry-signature/remote-cleanup harness の実装・復活。- Codex CLI / Google Antigravity の capture capability verdict 確定、Cloud pilot 実施、private→public adapter 実装(いずれも 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の別 child issue の責務)。
Acceptance Criteria
- AC0: 実装着手前に、現在の通常 Claude-GPT interactive session の Stop payload について
session_id/transcript_pathを取得し、test -f "$transcript_path"かつサイズ > 0 であることを一度だけ live probe で確認する。FAIL の場合は本 Issue の技術的 Stop Condition として扱い、AC1 以降の実装に進まない。 - AC1: Claude-GPT generated settings に launcher-owned Latitude Stop hook が additive に存在し、既存 hook groups は維持される。
- AC2: Native user settings から読み取る field は下記8項目の closed allowlist に限定され、Native hooks / permissions / plugins / MCP /
LATITUDE_DEBUG/BUN_OPTIONSは import されない。LATITUDE_API_KEY/LATITUDE_PROJECT/LATITUDE_BASE_URL/LATITUDE_CLAUDE_CODE_ENABLED/LATITUDE_CLAUDE_CODE_MEMORY/LATITUDE_CLAUDE_CODE_MEMORY_CONTENT/LATITUDE_REDACT_ATTRIBUTES/LATITUDE_REDACT_MASK。 - AC3:
LATITUDE_API_KEYは repository tracked file、Claude-GPT generated settings、argv、stdout/stderr、persisted evidence、fixture に現れない。 - AC4: Native と Claude-GPT は同一
LATITUDE_PROJECTを使用でき、既存 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375(PR feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392)collector の project/session binding を変更しない。 - AC5: canonical Claude-GPT child process では
BUN_OPTIONSが明示的に unset されており、その production invariant の下で Claude-GPT session の Stop-hook telemetry が Latitude に到達する。preload enrichment の有無を trace arrival PASS と混同しない。 - AC6: live Claude-GPT canary の exact session ID で Latitude trace を取得でき、少なくとも1つの
llm_requestspan の model attribute が launcher-owned GPT model set に一致する。この判定は 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 production collector ではなく本 Issue の live verification helper が行う。 - AC7: Native Claude Code trace と Claude-GPT trace を runtime classifier(本 Issue の live verification helper)に入力するとそれぞれ
claude_code_native/claude_gptに分類され、unknown model は fail-closed でunknownになる。 - AC8: Latitude ingest unavailable / auth failure / hook failure は Claude-GPT session本体を失敗させない。
- AC9: 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375(PR feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392)の existing Latitude collector / retrospective tests が回帰せず、Claude-GPT session ID → Latitude evidence pathを維持する。
- AC10:
docs/dev/secret-policy.mdのLATITUDE_PILOT_EXCEPTION_V1(decision: approve_synthetic_only)は値を変更せず、本 Issue に限定した owner-controlled policy supersession が明示的に追記されており、raw-publication / secret-publication prohibition は維持される。docs/dev/agent-observation-capability.mdには本 Issue のスコープが同文書の capability matrix・実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 A1 gate 既定を変更しない旨の参照コメントが存在する。
Runtime Verification Applicability
decision: immediate
reason: >
launcher hook wiring と Latitude ingest は static test だけでは成立を証明できず、
actual Claude-GPT session ID と Latitude trace の correlation、および
Claude-GPT interactive lane での transcript 実在性が必要なため
applicable_acs:
- AC0
- AC5
- AC6
- AC7
execution_environment: local Claude-GPT + Latitude
skip_conditions: >
Claude-GPT launcher、Latitude API、ChatGPT Pro Codex subscription 経由の認証のいずれかが
利用不能な場合は `SKIP:` と exit 77 を返し、fixture-only PASS を主張しない。
fallback_policy: >
fixture-only / hook exit 0 / model constant inspection だけを live trace arrival PASS にしない。
transcript 実在性の probe を省略して hook wiring 実装のみで PASS を主張しない。
artifact_requirements: >
session identity の public-safe opaque representation、transcript exists/size>0 の PASS/FAIL、
trace/span count、runtime classification、model base-id、PASS/FAIL の bounded summary のみ。
prompt/tool IO/API key/raw trace は GitHub evidence に保存しないVerification Commands
非sensitive canary session の Stop payload から session_id / transcript_path を取得したうえで、以下を実行する(AC0)。
# AC0
$ test -f "$transcript_path"
$ test -s "$transcript_path"# AC1
$ uv run --locked pytest scripts/claude-gpt/tests/test_latitude_stop_hook_wiring.py# AC2
$ uv run --locked pytest scripts/claude-gpt/tests/test_latitude_allowlist.py# AC3
$ uv run --locked pytest scripts/claude-gpt/tests/test_latitude_api_key_hygiene.py# AC4
$ uv run --locked pytest scripts/claude-gpt/tests/test_latitude_same_project_binding.py# AC5
$ uv run --locked pytest scripts/claude-gpt/tests/test_latitude_bun_options_live.py# AC6
$ uv run --locked pytest scripts/claude-gpt/tests/test_latitude_trace_arrival_live.py# AC7
$ uv run --locked pytest scripts/claude-gpt/tests/test_latitude_runtime_classifier_live.py# AC8
$ uv run --locked pytest scripts/claude-gpt/tests/test_latitude_ingest_failure_fail_open.py# AC9
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_latitude_runtime_evidence.py .claude/skills/agent-retrospective/scripts/tests/test_run_retrospective.py# AC10
$ grep -n owner_local_observation_supersession_v1 docs/dev/secret-policy.mdAC5〜AC7 の live probe test(scripts/claude-gpt/tests/test_latitude_bun_options_live.py / test_latitude_trace_arrival_live.py / test_latitude_runtime_classifier_live.py)は実装時に作成し、non-sensitive canary prompt の Claude-GPT session を1回起動して、その exact session ID を用いた Latitude readback を行う。Claude-GPT launcher / Latitude API が利用不能な環境では SKIP: と exit 77 を返し、fixture-only PASS を主張しない。
PASS 条件:
transcript exists (AC0)
trace found
session.id exact match
llm_request >= 1
runtime_classifier == claude_gpt
raw prompt/tool IO/API key not persisted as verification evidence
Native Claude Code の既存 trace または bounded canary についても classifier が claude_code_native を返すことを確認する。
Allowed Paths
scripts/claude-gpt/launch.shscripts/claude-gpt/lib.shscripts/claude-gpt/latitude_hook.pyscripts/claude-gpt/tests/**docs/dev/secret-policy.md(LATITUDE_PILOT_EXCEPTION_V1の owner-controlled policy supersession 追記のみ。既存 decision enum 値・既存 activation gate 契約は変更しない)docs/dev/session-recording-policy.md(同上の最小限 reconciliation 参照が必要な場合のみ)docs/dev/agent-observation-capability.md(本 Issue のスコープと同文書の capability matrix・実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 A1 gate 既定が独立であることを示す最小限の参照コメント追記のみ。capability matrix・verdict enum・実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 gate 既定自体は変更しない)
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- Latitude API key を tracked file / GitHub / test fixture / persisted evidence に保存する必要が生じた場合。
- Native Claude settings 全体を Claude-GPT config authority として merge しなければ成立しない場合。
- existing Claude-GPT config/HOME isolation を解除しなければ成立しない場合。
- same-project identity が live trace の model attribute で確認できず
unknownになる場合。 - 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375(PR feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392)の schema または collection-budget 変更が必要と判明した場合。
- dedicated preload lifecycle または upstream telemetry package変更が必須と判明した場合は、本 Issue の scope 拡張前に必要性を evidence 付きで再評価する。
- raw prompt/tool I/O/API key を public verification artifact に含める必要が生じた場合。
- AC0 の live precondition probe が FAIL した場合(transcript 不在または size 0)。custom transcript assembler / OTLP proxy / 専用 recorder / upstream fork を勝手に作らず、技術的理由として記録し停止する。
docs/dev/agent-observation-capability.mdの capability matrix や 実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 A1 gate 既定そのものの変更が必要と判明した場合(本 Issue のスコープ外)。
Required Skills
なし
Required Design References
scripts/claude-gpt/launch.shscripts/claude-gpt/lib.sh.claude/skills/agent-retrospective/scripts/run_retrospective.py.claude/skills/agent-retrospective/scripts/collect_snapshot.pydocs/dev/secret-policy.mddocs/dev/session-recording-policy.mddocs/dev/agent-observation-capability.md- Latitude
packages/telemetry/claude-codecurrent upstream implementation - 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153
- 実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220
- 実装: claude-gpt launcher を bootstrap し native canary で runtime を検証する #2158
- 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375(PR feat: agent-retrospective に Latitude CLI の bounded runtime evidence 収集/検証/enrichment を追加する #2392)
- feat: worktree-agent-runtime-smoke に claude-gpt 同一 session multi-turn / 複数 SubAgent lifecycle 判定を追加する #2222(Claude-GPT interactive lane の transcript 非存在に関する実機知見)
Delivery Rule
- 1 Issue = 1 PR。
- 実装後は fixture-only で終了せず、AC0 の live precondition probe → actual Claude-GPT → Latitude trace arrival → exact session correlation → runtime classification まで確認してから merge-ready とする。
- telemetry absence は Claude-GPT workflow completion failure と同一視しないが、本 Issue の live runtime AC5/AC6/AC7 の PASS には実 trace arrival を要求する。
Source / Dedupe Key
source_kind: owner_requested_design
source_context: "2026-08-30 Claude-GPT Latitude connection review"
dedupe_key: "follow-up:squne121/loop-protocol:claude-gpt:latitude-same-project-runtime-identity-v1"
Activity
squne121 commentedon Aug 30, 2026
結論
判定は
REQUEST_CHANGESです。ただし、#2426 の中心方針――「Native Claude Code の設定全体は継承せず、Latitude の必要項目だけを再利用し、同一 project に送り、model attribute で Native / Claude-GPT を識別する」――は妥当です。全面的な設計変更は不要です。
問題は、実装に入る前に潰すべき 2つの成立性ギャップ と、実装スコープ上の 3つの契約不整合 が残っていることです。#2426 には現時点でコメントはなく、#2426 を実装する PR も検索上まだ見つかりませんでした。
敵対的レビュー結果
優先度 | Finding | 判定 -- | -- | -- P0 | Claude-GPT interactive lane で Latitude が必要とする main transcript が本当に存在するか未証明 | 実装前に1回 live probe 必須 P0 | approve_synthetic_only は単なる stale 文書ではなく #1220 の明示 human decision | controlled reframe 必須 P1 | #2375 の schema に runtime classifier を混ぜられない | classifier を別レイヤーへ置く P1 | Native profile allowlist が upstream current config に対して不足 | memory/redaction 4項目追加 P1 | upstream Latitude の state locking は並行 Claude-GPT session に弱い | session-local telemetry HOME 推奨 P1 | BUN_OPTIONS の ambient inheritance を許容すると transcript-only 契約が不安定 | Claude-GPT child では明示 unset 推奨 P2 | exact telemetry identity の具体化不足 | 現行 0.0.14 exact pin で十分P0: 「Stop hook を追加すれば通常 Claude-GPT session が届く」はまだ成立していない
ここが最大の問題です。
merged PR #2222 の 実機 interactive Herdr lane では、Claude-GPT の隔離された config 配下に、通常想定していた flat main
.jsonltranscript が存在せず、subagents/*.meta.jsonだけだったことが複数回再現されています。そのため #2222 自身も transcript-based evidence を捨て、hook-event channel に設計変更しています。一方、現行
@latitude-data/claude-code-telemetryは Stop payload のsession_idとtranscript_pathを読み、実在する transcript JSONL を差分読み込みして turn を構築します。ファイルが存在しなければ rows は空になり、span がなければ export せず終了します。Claude Code 公式仕様としても Stop payload には
transcript_pathが渡りますが、「そのパスに Claude-GPT + Herdr interactive lane で期待する transcript が永続化される」ことまでは保証していません。(Claude)したがって #2426 の実装順を変えるべきです。最初に一度だけ現在の通常 Claude-GPT interactive session で Stop payload の
session_id、transcript_path、test -f "$transcript_path"、サイズ > 0 を確認する。これだけでよく、新しい harness は不要です。ここが FAIL なら、#2426 の Stop Condition に従って止めるのが正しいです。そこで独自 transcript assembler、OTLP proxy、Claude-GPT 専用 recorder を作り始めるのはスコープ膨張です。
P0:
approve_synthetic_onlyは「stale text」ではなく過去の owner decision#2426 は
approve_synthetic_onlyが current operation と矛盾すれば最小修正する、としています。しかし currentsecret-policy.mdは、この値を単なる既定値ではなく human Decision の machine-readable SSOT と明記しています。さらに #1220 自体が
reject_and_uninstall / approve_synthetic_only / approve_timeboxed_real_pilot / deferの人間 Decision を決める Issue として完了済みです。当時の review でも real pilot は承認せずapprove_synthetic_only側に倒す判断がされています。ただし、現在の個人趣味開発に昔の time-boxed real-pilot machinery を復活させる必要はありません。 むしろ current policy は provenance、registry signature、remote cleanup、複数 digest などを要求しており、日常的なローカル観測用途には明らかに重すぎます。
推奨は、
approve_timeboxed_real_pilotの全 gate を満たそうとするのではなく、#2426 を 明示的な owner-controlled policy supersession として扱うことです。たとえばowner_local_observation相当の簡素な契約にして、最低限「API key は tracked/public surface に出さない」「raw trace を GitHub に出さない」「telemetry failure は workflow を止めない」だけ残す形です。ここにはもう一つ scope bug があります。
docs/dev/agent-observation-capability.mdも現在「real telemetry はapprove_timeboxed_real_pilotまで blocked」と明記していますが、#2426 の Proposed Allowed Paths に入っていません。したがって AC10 の Allowed Paths に少なくとも
docs/dev/agent-observation-capability.mdを追加するか、同文書の旧 Latitude pilot gate を historical とする必要があります。secret-policy だけ書き換えると SSOT 同士が矛盾します。P1: classifier を #2375 collector に実装してはいけない
#2392 / #2375 はかなり明確に contract を閉じています。Latitude CLI から取得して public evidence に出してよいものは、
trace_count / span_count / duration_msの3値だけです。schema は
additionalProperties: falseです。PR #2392 も「1 run 1 CLI invocation」「raw trace を即破棄」「3 metrics のみ」という設計を deliberate に実装しています。
したがって AC6/AC7 の
llm_request.model読み出しやruntime_classifierを既存 collector に追加すると、#2426 自身の「#2375 schema / budget を変更しない」と衝突します。分類は live verification 専用 readback に置くのが最小です。production の retrospective collector は一切変更せず、#2426 の live VC だけが trace detail を一度読み、
model → claude_gpt/native/unknownを判定して bounded summary だけ残す。その後の通常 retrospective は従来通り3 metricsです。将来 retrospective 自体に
runtime_sourceが必要になった時だけ schema v2 を別 Issue にするのがよいです。P1: Latitude allowlist は8項目に固定した方がよい
現行 upstream 0.0.14 の実装を確認すると、設定として実際に読むのは API key/project/base URL/enabled に加え、memory と redaction です。
Native と同じ project に送るのに Native 側で設定済みの redaction を Claude-GPT だけ無視すると、同一観測面なのにデータ内容が変わります。これはセキュリティより観測品質の問題です。
closed allowlist は次で確定してよいです。
LATITUDE_DEBUGは既定では継承しない方がよいです。stderr noise を増やすだけで通常運用には不要です。BUN_OPTIONSも含めません。upstream README でもこれら memory/redaction 項目が current configuration surface として公開されています。(NPM)P1:
BUN_OPTIONSは「コピーしない」ではなく Claude-GPT では明示的に unset がよい#2426 は「ambient に preload があれば enrichment を許容」としていますが、ここは逆に明示 unsetを勧めます。
現行 launcher は Claude child の
HOME/ XDG は隔離しますが、Claude child 自体をenv -iでは起動していないため、caller environment の変数は別途 unset しなければ残り得ます。upstream Latitude は、
BUN_OPTIONSが preload を指しているのに対象ファイルが無ければ Claude 自体が起動失敗すると明記しています。また preload は required ではなく、Stop hook 単体でも transcript telemetry は成立する設計です。(NPM)したがって canonical Claude-GPT path は、
unset BUN_OPTIONS LATITUDE_API_KEY ...してから Claude を起動し、Stop adapter が Native settings を直接読み、telemetry subprocess にだけ8変数を渡す方が単純です。
これなら AC5 の「BUN_OPTIONS 無し」が特殊 test condition ではなく production invariant になり、ワークフローも壊れにくくなります。
P1: upstream telemetry state は並行 session で race し得る
これは upstream 実装を見ないと気付きにくい点です。
Latitude 0.0.14 は state を
homedir()/.claude/state/latitude/state.jsonに全 session 共通で保存します。ロックは最大2秒しか待たず、取得できなくても処理を続行します。ところが export 側の HTTP timeout は30秒で、lock を保持したまま POST を待ちます。
Claude-GPT launcher は Claude child に共通の persistent isolated HOME を設定しているため、複数 Claude-GPT session の async Stop hook が同時に走ると、2秒後に同じ state file を lock なしで操作する可能性があります。Claude Code 自体も matching hooks は並列実行すると公式に明記しています。(Claude)
fork や新しい harness は不要です。
latitude_hook.pyが Stop stdin のsession_idを読み、$CLAUDE_GPT_HOME/latitude-sessions/<sha256(session_id)>/を telemetry subprocess の
HOMEに設定してから exact package を起動するだけで、session ごとに state を分離できます。これは防御目的ではなく、並行開発時の trace 欠落/再送/状態競合を避けるデータ品質改善なので採用価値があります。
package pin は重くしなくてよい
現在 npm の package は
@latitude-data/[email protected]で、Node>=20.12.0、bin はlatitude-claude-codeです。(NPM)ここで昔の policy にある registry signature、tarball digest、entrypoint SHA、preload SHA まで復活させる必要はありません。
lib.shに exact spec を1か所だけ置き、を adapter から
npx -yで実行すれば十分です。Stop hook はasync: trueのままにし、Claude Code 公式が async command hook に timeout を設定できるので、例えば45秒程度で background process の蓄積だけ防ぐのが実用的です。async hook は Claude の処理を block できないため、Latitude 障害を workflow gate にしない #2426 の意図とも一致します。(Claude)model classifier の方向性は正しい
ここは #2426 を支持します。
Latitude upstream は resource の
service.nameを"claude-code"固定で出すため、Native/Claude-GPT の分類キーには使えません。一方 transcript の assistantmessage.modelをAssistantCall.modelにし、それをllm_requestの model attributes に出しています。raine proxy 側も Anthropic-compatible
message_start.message.modelを生成する構造になっています。 また現行 Claude-GPT launcher は Sol/Terra/Luna[1m]mapping を既に SSOT として持ち、merged PR #2162 では実際にprovider=codex / model=gpt-5.6-terraが live 確認されています。したがって現在の
GPT set → claude_gpt^claude- → claude_code_nativeotherwise → unknownは妥当です。重要なのは定数を二重管理して drift させず、classifier test が
lib.shの3 model mapping と一致することを直接検証することです。推奨する #2426 の reframe
実装そのものは大きくしない方がよいです。変更後の設計は
launch.sh + lib.sh + latitude_hook.py + focused testsで十分です。特に Issue 本文を修正するなら、次の5点が重要です。
AC0相当として「current interactive Claude-GPT の Stop
transcript_pathが実在すること」を実装前 live precondition に追加する。AC2 の allowlist を上記8項目で確定する。
BUN_OPTIONSは canonical Claude-GPT child では明示 unset とし、preload enrichment を完全に非必須・非標準扱いにする。AC7 classifier は 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 collector ではなく 実装: Claude-GPT を既存 Latitude project に接続し Native Claude Code と runtime source を識別可能にする #2426 live verification/helper の責務と明記する。
AC10 は「stale policy 修正」ではなく「実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 decision を current owner-local operation が明示 supersede」とし、
agent-observation-capability.mdも Allowed Paths に追加する。ただし旧 provenance/remote-cleanup/signature harness を Claude-GPT 日常運用へ持ち込まない。この形なら、観測の有用性を上げながら Claude-GPT の通常 workflow に新たな承認・preflight・security harness を追加せずに済みます。 最も重要なのは、実装前に transcript availability を1回確認することです。そこが PASS なら、残りは比較的素直な wiring です。
## 結論判定は
REQUEST_CHANGESです。ただし、#2426 の中心方針――「Native Claude Code の設定全体は継承せず、Latitude の必要項目だけを再利用し、同一 project に送り、model attribute で Native / Claude-GPT を識別する」――は妥当です。全面的な設計変更は不要です。
問題は、実装に入る前に潰すべき 2つの成立性ギャップ と、実装スコープ上の 3つの契約不整合 が残っていることです。#2426 には現時点でコメントはなく、#2426 を実装する PR も検索上まだ見つかりませんでした。
敵対的レビュー結果
approve_synthetic_onlyは単なる stale 文書ではなく #1220 の明示 human decisionBUN_OPTIONSの ambient inheritance を許容すると transcript-only 契約が不安定P0: 「Stop hook を追加すれば通常 Claude-GPT session が届く」はまだ成立していない
ここが最大の問題です。
merged PR #2222 の 実機 interactive Herdr lane では、Claude-GPT の隔離された config 配下に、通常想定していた flat main
.jsonltranscript が存在せず、subagents/*.meta.jsonだけだったことが複数回再現されています。そのため #2222 自身も transcript-based evidence を捨て、hook-event channel に設計変更しています。一方、現行
@latitude-data/claude-code-telemetryは Stop payload のsession_idとtranscript_pathを読み、実在する transcript JSONL を差分読み込みして turn を構築します。ファイルが存在しなければ rows は空になり、span がなければ export せず終了します。Claude Code 公式仕様としても Stop payload には
transcript_pathが渡りますが、「そのパスに Claude-GPT + Herdr interactive lane で期待する transcript が永続化される」ことまでは保証していません。(Claude)したがって #2426 の実装順を変えるべきです。最初に一度だけ現在の通常 Claude-GPT interactive session で Stop payload の
session_id、transcript_path、test -f "$transcript_path"、サイズ > 0 を確認する。これだけでよく、新しい harness は不要です。ここが FAIL なら、#2426 の Stop Condition に従って止めるのが正しいです。そこで独自 transcript assembler、OTLP proxy、Claude-GPT 専用 recorder を作り始めるのはスコープ膨張です。
P0:
approve_synthetic_onlyは「stale text」ではなく過去の owner decision#2426 は
approve_synthetic_onlyが current operation と矛盾すれば最小修正する、としています。しかし currentsecret-policy.mdは、この値を単なる既定値ではなく human Decision の machine-readable SSOT と明記しています。さらに #1220 自体が
reject_and_uninstall / approve_synthetic_only / approve_timeboxed_real_pilot / deferの人間 Decision を決める Issue として完了済みです。当時の review でも real pilot は承認せずapprove_synthetic_only側に倒す判断がされています。ただし、現在の個人趣味開発に昔の time-boxed real-pilot machinery を復活させる必要はありません。 むしろ current policy は provenance、registry signature、remote cleanup、複数 digest などを要求しており、日常的なローカル観測用途には明らかに重すぎます。
推奨は、
approve_timeboxed_real_pilotの全 gate を満たそうとするのではなく、#2426 を 明示的な owner-controlled policy supersession として扱うことです。たとえばowner_local_observation相当の簡素な契約にして、最低限「API key は tracked/public surface に出さない」「raw trace を GitHub に出さない」「telemetry failure は workflow を止めない」だけ残す形です。ここにはもう一つ scope bug があります。
docs/dev/agent-observation-capability.mdも現在「real telemetry はapprove_timeboxed_real_pilotまで blocked」と明記していますが、#2426 の Proposed Allowed Paths に入っていません。したがって AC10 の Allowed Paths に少なくとも
docs/dev/agent-observation-capability.mdを追加するか、同文書の旧 Latitude pilot gate を historical とする必要があります。secret-policy だけ書き換えると SSOT 同士が矛盾します。P1: classifier を #2375 collector に実装してはいけない
#2392 / #2375 はかなり明確に contract を閉じています。Latitude CLI から取得して public evidence に出してよいものは、
trace_count / span_count / duration_msの3値だけです。schema は
additionalProperties: falseです。PR #2392 も「1 run 1 CLI invocation」「raw trace を即破棄」「3 metrics のみ」という設計を deliberate に実装しています。
したがって AC6/AC7 の
llm_request.model読み出しやruntime_classifierを既存 collector に追加すると、#2426 自身の「#2375 schema / budget を変更しない」と衝突します。分類は live verification 専用 readback に置くのが最小です。production の retrospective collector は一切変更せず、#2426 の live VC だけが trace detail を一度読み、
model → claude_gpt/native/unknownを判定して bounded summary だけ残す。その後の通常 retrospective は従来通り3 metricsです。将来 retrospective 自体に
runtime_sourceが必要になった時だけ schema v2 を別 Issue にするのがよいです。P1: Latitude allowlist は8項目に固定した方がよい
現行 upstream 0.0.14 の実装を確認すると、設定として実際に読むのは API key/project/base URL/enabled に加え、memory と redaction です。
Native と同じ project に送るのに Native 側で設定済みの redaction を Claude-GPT だけ無視すると、同一観測面なのにデータ内容が変わります。これはセキュリティより観測品質の問題です。
closed allowlist は次で確定してよいです。
LATITUDE_DEBUGは既定では継承しない方がよいです。stderr noise を増やすだけで通常運用には不要です。BUN_OPTIONSも含めません。upstream README でもこれら memory/redaction 項目が current configuration surface として公開されています。([NPM]2)P1:
BUN_OPTIONSは「コピーしない」ではなく Claude-GPT では明示的に unset がよい#2426 は「ambient に preload があれば enrichment を許容」としていますが、ここは逆に明示 unsetを勧めます。
現行 launcher は Claude child の
HOME/ XDG は隔離しますが、Claude child 自体をenv -iでは起動していないため、caller environment の変数は別途 unset しなければ残り得ます。upstream Latitude は、
BUN_OPTIONSが preload を指しているのに対象ファイルが無ければ Claude 自体が起動失敗すると明記しています。また preload は required ではなく、Stop hook 単体でも transcript telemetry は成立する設計です。([NPM]2)したがって canonical Claude-GPT path は、
unset BUN_OPTIONS LATITUDE_API_KEY ...してから Claude を起動し、Stop adapter が Native settings を直接読み、telemetry subprocess にだけ8変数を渡す方が単純です。
これなら AC5 の「BUN_OPTIONS 無し」が特殊 test condition ではなく production invariant になり、ワークフローも壊れにくくなります。
P1: upstream telemetry state は並行 session で race し得る
これは upstream 実装を見ないと気付きにくい点です。
Latitude 0.0.14 は state を
homedir()/.claude/state/latitude/state.jsonに全 session 共通で保存します。ロックは最大2秒しか待たず、取得できなくても処理を続行します。ところが export 側の HTTP timeout は30秒で、lock を保持したまま POST を待ちます。
Claude-GPT launcher は Claude child に共通の persistent isolated HOME を設定しているため、複数 Claude-GPT session の async Stop hook が同時に走ると、2秒後に同じ state file を lock なしで操作する可能性があります。Claude Code 自体も matching hooks は並列実行すると公式に明記しています。(Claude)
fork や新しい harness は不要です。
latitude_hook.pyが Stop stdin のsession_idを読み、$CLAUDE_GPT_HOME/latitude-sessions/<sha256(session_id)>/を telemetry subprocess の
HOMEに設定してから exact package を起動するだけで、session ごとに state を分離できます。これは防御目的ではなく、並行開発時の trace 欠落/再送/状態競合を避けるデータ品質改善なので採用価値があります。
package pin は重くしなくてよい
現在 npm の package は
@latitude-data/[email protected]で、Node>=20.12.0、bin はlatitude-claude-codeです。([NPM]2)ここで昔の policy にある registry signature、tarball digest、entrypoint SHA、preload SHA まで復活させる必要はありません。
lib.shに exact spec を1か所だけ置き、を adapter から
npx -yで実行すれば十分です。Stop hook はasync: trueのままにし、Claude Code 公式が async command hook に timeout を設定できるので、例えば45秒程度で background process の蓄積だけ防ぐのが実用的です。async hook は Claude の処理を block できないため、Latitude 障害を workflow gate にしない #2426 の意図とも一致します。([Claude]1)model classifier の方向性は正しい
ここは #2426 を支持します。
Latitude upstream は resource の
service.nameを"claude-code"固定で出すため、Native/Claude-GPT の分類キーには使えません。一方 transcript の assistantmessage.modelをAssistantCall.modelにし、それをllm_requestの model attributes に出しています。raine proxy 側も Anthropic-compatible
message_start.message.modelを生成する構造になっています。 また現行 Claude-GPT launcher は Sol/Terra/Luna[1m]mapping を既に SSOT として持ち、merged PR #2162 では実際にprovider=codex / model=gpt-5.6-terraが live 確認されています。したがって現在の
GPT set → claude_gpt^claude- → claude_code_nativeotherwise → unknownは妥当です。重要なのは定数を二重管理して drift させず、classifier test が
lib.shの3 model mapping と一致することを直接検証することです。推奨する #2426 の reframe
実装そのものは大きくしない方がよいです。変更後の設計は
launch.sh + lib.sh + latitude_hook.py + focused testsで十分です。特に Issue 本文を修正するなら、次の5点が重要です。
transcript_pathが実在すること」を実装前 live precondition に追加する。BUN_OPTIONSは canonical Claude-GPT child では明示 unset とし、preload enrichment を完全に非必須・非標準扱いにする。agent-observation-capability.mdも Allowed Paths に追加する。ただし旧 provenance/remote-cleanup/signature harness を Claude-GPT 日常運用へ持ち込まない。この形なら、観測の有用性を上げながら Claude-GPT の通常 workflow に新たな承認・preflight・security harness を追加せずに済みます。 最も重要なのは、実装前に transcript availability を1回確認することです。そこが PASS なら、残りは比較的素直な wiring です。
squne121 commentedon Aug 30, 2026
issue-refinement-loop 終了報告(human_judgment_required)
対象アンカーコメント: #2426 (comment)
結果
Step 0f preflight(
preflight.run.with_human_context)がSTATUS: blocked/NEXT_ACTION: human_judgment_requiredを返したため、loop を開始前に停止しました。理由
structural repair check(
structural_repair_action)が、Issue #2426 本文から以下 5 セクションの欠落を検出しました(implementation テンプレート必須項目)。Parent Goal Ref— disposition:human_review_required(自動導出不可)Current Validated Scope— disposition:human_review_required(自動導出不可)Remaining Parent Gaps— disposition:human_review_required(自動導出不可)Allowed Paths— disposition:human_review_required(自動導出不可)Required Skills— disposition:auto_apply_safe(テンプレート既定値「なし」で自動補完可能)全体の
disposition_summaryはhuman_review_requiredのため、apply_deterministic_structural_repairの自動適用対象にはなりません。override 不成立の理由
human_decision_reframeによる override は、対象アンカーコメントが「不足 section を明示的に認識している」ことを条件とします(references/refinement-loop-plan-output.mdの override 契約)。しかし対象コメント(issuecomment-5467028442)は #2426 の設計方針に対する敵対的レビュー(REQUEST_CHANGES、P0: Claude-GPT interactive lane の transcript 成立性 live probe 必須、approve_synthetic_only の controlled reframe 必須、他 P1 事項)であり、Issue テンプレートの構造的欠落(Parent Goal Ref 等)には言及していません。そのため override 条件2「不足 section/key の明示認識」を満たさず、override は成立しません。必要なアクション(人間判断)
Parent Goal Ref/Current Validated Scope/Remaining Parent Gaps/Allowed Pathsを人手で追記する(内容は親 Issue のゴールと現状の検証済みスコープを踏まえた記述が必要で、自動導出できません)。issue-refinement-loopを再実行する。termination_cause: human_judgment_requiredsqune121 commentedon Aug 30, 2026
推奨アクション
今回の停止は、安全側の挙動としては仕様どおりですが、#2426 に対しては過剰停止になっている可能性が高いです。Implementation template が要求する
Parent Goal Ref / Current Validated Scope / Remaining Parent Gaps / Allowed Paths / Required Skillsという「正確な見出し」が不足している一方、#2426 には親 Issue、goal_ref、In Scope、Proposed Allowed Pathsなど実質的な材料が既にあり、親 #1153 にも Goal / Desired Destination / Remaining Parent Gaps が存在します。さらに structural repair 実装自体は、free-form の必須欄でも fully-provenanced な authoritative
source_span_exactがあればauto_apply_safeにできる設計です。したがって「自由記述欄だから常に人間に聞く」が本来の設計ではなく、preflight 側が親 Issue・現 Issue・trusted owner anchor から必要な source span / contract patch input を十分に組み立てられていない可能性を優先して調べるべきです。一方、
approve_synthetic_onlyは単なるフォーマット問題ではありません。指定コメント自身が #1220 の過去の human decision だと指摘し、#2426 では 限定的な owner-controlled policy supersession として扱うことを推奨しています。ここは「承認を省略」するのではなく、今回の人間による実行指示を #2426 に限定した現在の owner decision として明示的に materialize するのが適切です。そのうえで、live transcript probe、8項目 allowlist、BUN_OPTIONSunset、classifier 分離、agent-observation-capability.mdの整合を Issue contract に反映します。つまり推奨順序は、①原因調査を SubAgent に並行委譲 → 全員完了待ち → ②#2426 の controlled reframe を自動 materialize → ③同種の過剰停止が再発するなら issue-refinement-loop 自体を別スコープで修正 → ④canonical preflight を再実行 → ⑤refinement-loop を承認要求なしで完走です。単純に
human_judgment_requiredを無視するパッチにはしない方がよいです。以下をそのまま Claude Code に渡せます。
あなたは
squne121/loop-protocolの root control-plane として作業してください。対象:
squne121/loop-protocol#2426https://github.com/squne121/loop-protocol/issues/2426#issuecomment-5467028442https://github.com/squne121/loop-protocol/issues/2426#issuecomment-5467034933目的は、#2426 に対する
issue-refinement-loopを、人間への追加承認要求なしで正規の control-plane を通して完走させることです。直前の
STATUS: blockedNEXT_ACTION: human_judgment_requiredを単純に無視・ハードコード回避するのではありません。
なぜこのケースが human_judgment_required になったのかを調査し、
issue-refinement-loop側の過剰停止・producer/consumer wiring 不足として恒久修正すべき部分を切り分けてください。
今回の Human / Owner Decision
これは人間による明示的な実行指示です。
この作業中、以下について追加の人間承認を求めないでください。
issue-refinement-loopの canonical repair consumer の実行issue-refinement-loopの過剰 human escalation を再発防止するためのコード・test・skill/reference 修正今回の指示は、単なる「loop iteration を自動承認する」という意味だけではありません。
#2426 に必要な bounded contract reframe を現在の human/owner intent として承認しています。
特に、指定 anchor comment が推奨している次の policy reframe を #2426 の範囲で採用して構いません。
approve_synthetic_onlyを「stale text」と偽装して無視しない。owner_local_observationまたは repository の既存契約により適した同等の最小表現を採用してよい。ただし以下は維持してください。
LATITUDE_API_KEYを tracked file / GitHub / argv / fixture / persisted evidence に出さない。この bounded owner decision を、必要なら canonical GitHub comment / policy contract に machine-readable に materialize してください。
「過去の decision が human decision なので、再び人間へ聞く」という理由だけでは停止しないでください。
現在のこの明示指示を新しい decision input として扱ってください。
最重要: SubAgent を使用すること
最初に Main Agent 自身だけで結論を出さないでください。
可能な限り並列に、少なくとも以下の3系統を SubAgent に委譲してください。
SubAgent A — refinement control-plane investigator
read-only を基本として以下を調査する。
.claude/skills/issue-refinement-loop/**run_refinement_preflight.pyplan_refinement_loop.pyrepair_issue_contract.pyanchor_context.pyworkflow_start_entry.pycommand_registry.pyhuman_judgment_requiredになった正確な producer → routing → consumer 経路特に確認すること:
Parent Goal RefCurrent Validated ScopeRemaining Parent GapsAllowed PathsRequired Skillsがなぜ
human_review_requiredになったか。repair_issue_contract.pyに既に存在するtemplate_value_exactsource_span_exactderived_scalar_exactを producer が十分に利用できているか。
known_scalars/source_spansがどこで assemble され、今回なぜ親 Issue / current Issue / trusted anchor から供給されなかったのか。human_decision_reframe/ trusted human-context override が、「missing heading 名そのものを anchor が言及していない」という理由で過度に狭く判定されていないか。SubAgent B — #2426 contract reframer
以下をすべて読み、#2426 の canonical body candidate を作る。
54670284425467034933.github/ISSUE_TEMPLATE/implementation.yml少なくとも以下の exact heading を canonical template に合わせて解決する。
## Parent Goal Ref## Current Validated Scope## Remaining Parent Gaps## Allowed Paths## Required Skills既存 #2426 の有用な本文を落とさず、単なる template 再生成もしないこと。
特に、
## Proposed Allowed Pathsが実質的に Allowed Paths であれば、意味を失わず canonical
## Allowed Pathsへ正規化する。Parent Goal Refは #1153 の Goal / Desired Destination を authority とする。Current Validated Scopeは template の定義どおり この Issue の write-capable scope とし、#2426 の In Scope / existing design / allowed paths と矛盾させない。Remaining Parent Gapsは #1153 の gap のうち #2426 で閉じないものを保持する。全部を機械コピーして #2426 の責務と誤認させない。SubAgent C — Claude-GPT / Latitude runtime investigator
以下を調査する。
scripts/claude-gpt/launch.shscripts/claude-gpt/lib.shanchor comment の P0/P1 finding が現在も成立するか確認し、#2426 contract へ反映すべき最小差分を返す。
SubAgent は nested delegation しないこと。
Main Agent は上記 SubAgent 全員の作業が完了するまで、Issue mutation・policy mutation・最終 reframe を開始しないこと。
一部の SubAgent の結果だけを見て先に進めないこと。
全員の完了を明示的に待ち、結果を join してから判断してください。
Phase 1 — 現在の blocker を再現する
canonical main root / default branch で作業する。
最初に repository state / current Issue state / anchor snapshot を固定する。
現在の canonical
preflight.run.with_human_contextを使用して #2426 の blocker を再現する。手書き wrapper invocation で governance を迂回しない。
再現結果について、最低限以下を特定する。
終了コメントに書かれた説明をそのまま真実として扱わず、artifact / producer output / source code まで追うこと。
Phase 2 — #2426 の controlled reframe
SubAgent の join 後、#2426 を canonical Implementation contract に揃える。
anchor comment の推奨事項を原則採用する。
必須 reframe
current interactive Claude-GPT session の Stop payload について、実装前に一度だけ、
session_idtranscript_pathを確認する AC0 相当の precondition を Issue に入れる。
新しい global harness は作らない。
この probe が FAIL した場合は #2426 の技術的 Stop Condition として扱う。
これは human approval gate ではない。
FAIL した場合に勝手に
へ scope expansion しない。
LATITUDE_DEBUGとBUN_OPTIONSは allowlist に含めない。BUN_OPTIONSを明示 unset する方針へ変更する。ambient preload を AC PASS 根拠にしない。
#2426 の live verification / bounded helper の責務にする。
#2375 の
trace_count / span_count / duration_msadditionalProperties: falseを壊さない。
#1220 の
approve_synthetic_onlyが過去の human decision だった事実を残したうえで、この Issue の current owner-local operation がその bounded 部分を supersede する、と書く。docs/dev/agent-observation-capability.mdが旧 real-pilot gate を現在も authority としているなら、Allowed Pathsに追加するのどちらか最小の整合方法を採用する。
secret-policy.mdだけを書き換えて SSOT conflict を残さない。例:
session_id の raw value 自体を public evidence に出す必要はない。
current が引き続き
なら exact pin を一箇所の SSOT にする。
versionless / floating package spec を canonical production command にしない。
Phase 3 — trusted contract update を優先する
Issue body を ad-hoc
gh issue editだけで書き換える前に、repository の canonical human-context path を確認する。現行 contract が対応しているなら、
contract_update.run.with_human_contextの正規 consumer を使う。
現在の anchor が canonical mutation input として情報不足なら、この現在の human instructionとSubAgent調査結果を反映した bounded owner reframe comment を #2426 に machine-readable に materializeしてよい。
その場合、
preflight.run.with_human_contextの anchor として使用する追加の人間確認は不要。
Phase 4 — workflow の過剰停止を恒久修正する
#2426 を手作業で直しただけでは、同条件の Issue が再び
missing_required_field_without_exact_source→
human_review_required→
human_judgment_requiredになるなら、そこで終わらせない。
issue-refinement-loopの producer / assembler / trusted-human-context consumer を修正する。ただし、generic fail-closed を削除したり、
「LLM がそれっぽく推測できれば auto_apply_safe」
のような緩い実装にはしない。
優先する修正方向:
Proposed Allowed Paths→ canonicalAllowed Pathsのような、内容を変えない heading normalization を deterministic に処理できるか検討するderived_scalar_exact/template_value_exactを再利用するsource_span_exactでは表現不能な場合も、まず trusted contract editor path で処理できないか検討する絶対に維持する回帰条件:
Regression test
今回 #2426 と同型の fixture を追加し、
ケースで、不要な
human_judgment_requiredにならないことをテストする。同時に negative test として、
では従来通り fail-closed することを証明する。
Scope separation
issue-refinement-loop自体の修正は #2426 の implementation Allowed Paths に混ぜない。必要なら別の workflow-maintenance Issue / branch / PR として扱う。
ただし今回の人間指示により、その maintenance work の起票・実装・test・Draft PR 作成について追加承認は不要。
同一 checkout で無理に異なる責務を混在させない。
既存の並行作業があれば、
「同じファイルを触っている」だけで停止せず、
同一処理・同一契約に相反する意味変更があるかを確認する。
安全に rebase / replay / 別 worktree で分離可能なら自律的に処理する。
Phase 5 — refinement-loop を再実行
contract update 後、必ず fresh canonical preflight を実行する。
stale preflight の PASS を再利用しない。
その後
issue-refinement-loopを iteration approval なしで実行する。needs-fixの場合:レビューで新しい bounded finding が出た場合も、人間に逐次確認せず、Issue goal / owner decision / repository evidence から解決可能なら修正して再レビューする。
Live probe
Issue refinement に必要な成立性 evidence として、anchor comment が要求する current Claude-GPT interactive transcript probe を実施してよい。
probe は non-sensitive canary に限定する。
公開 evidence に残すのは必要最小限:
API key、raw transcript、raw trace を GitHub に出さない。
probe が PASS なら refinement を継続する。
probe が FAIL なら技術的 stop condition として #2426 に結果を記録し、勝手に大幅 scope expansion しない。
Permission / approval behavior
routine command execution、test、Issue編集、comment投稿、branch/commit/PR 作成ごとに人間へ確認しない。
repository の既存 permission/control-plane に machine-consumable auto route がある場合はそれを使う。
現在の owner instruction で解決済みの判断を再質問しない。
一方で、認証自体が存在しない、GitHub transport が実際に壊れている、secret value が必要、不可逆 human-only operation が明示されている、という 実際の capability failure を approval不足と偽装しない。
その場合は可能な alternative lane を試し、なお不可能なときだけ blocker を具体的に記録する。
Done definition
以下をすべて満たすまで完了扱いにしない。
approved/ implementation-ready 相当まで到達するか、真に技術的な Stop Condition が実証されている。最終報告
最後に簡潔に以下を報告する。
human_judgment_requiredの root causeissue-refinement-loop自体を変更したか作業途中で私に承認確認を返さず、SubAgent の完了を待ち、利用可能な canonical repair / trusted-human-context route を最後まで使って自律的に進めてください。
このプロンプトでは、#2426 を通すためだけにガードを無効化するのではなく、現在の owner decision を正式な入力に変換しつつ、今回露呈した「情報はあるのに source authority が control-plane に渡らない」問題まで修正対象にする構成にしています。これが同じ停止を繰り返しにくい進め方です。
squne121 commentedon Aug 30, 2026
Owner Decision: #2426 contract normalization(bounded reframe)
これは現在の repository owner による明示的な実行指示(chat control-plane 経由)であり、直前の issue-refinement-loop 終了報告(#2426 コメント issuecomment-5467034933)が指摘した
human_judgment_required(実装テンプレート必須セクション欠落)を解消するための contract reframe です。欠落していた必須セクションの明示的な充足
本文更新(この直後に反映)により、以下 5 セクションを canonical Implementation テンプレートに合わせて追加・正規化します。
## Parent Goal Ref— 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の Goal / Desired Destination を authority として明記## Current Validated Scope— 本 Issue の write-capable scope を明記## Remaining Parent Gaps— 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153 の gap のうち本 Issue で閉じないものを明記## Allowed Paths(旧## Proposed Allowed Pathsを意味を変えず正規化)## Required Skills(テンプレート既定値「なし」)アンカーコメント(issuecomment-5467028442)の P0/P1/P2 finding の採否
approve_synthetic_onlycontrolled reframe必須BUN_OPTIONS明示unset#1220 policy supersession(owner-controlled、bounded)
docs/dev/secret-policy.mdのLATITUDE_PILOT_EXCEPTION_V1(decision: approve_synthetic_only)は #1220 で確定した human decision であり、stale text として無視しません。値自体も変更しません。本 Issue が対象とする「Native Claude Code が既に利用している local Latitude observation profile を、同一 project 宛に限り Claude-GPT にも適用する」という owner-approved local operation について、以下を owner-controlled policy supersession として明示します(実装 PR で
docs/dev/secret-policy.mdに追記されます)。docs/dev/agent-observation-capability.mdの capability matrix・#1220 A1 gate 既定は変更しません。本 Issue のスコープはこれと独立であることを同文書へ参照コメントとして追記します。本コメントの位置づけ
本コメントは trusted human-context anchor として、直後に行う本文更新(issue-editor 経由)の根拠を machine-readable に materialize するものです。以降の
issue-refinement-loopの fresh preflight は本コメントおよび更新後の本文を前提に再実行します。squne121 commentedon Aug 30, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Aug 30, 2026
issue-refinement-loop 終了報告: approved
issue-refinement-loopは本 Issue を approve で完了しました。経緯サマリ
human_judgment_required→ owner decision に基づき本文を contract normalization(本 Issue コメント issuecomment-5467158005 参照)。guard-issue-body.py/contract_readiness_check.pyの LP010 / LP017 / RVA001 / EXTSURF001 を解消。run_root_review_pipeline.py produce)の初回 pass でneeds-fix(VC の-kfilter が既存ディレクトリに対してcollected 0 itemsになる問題、および.sh直接実行が VC preflight allowlist 外である問題)を検出・修正。VERDICT: approve/deterministic_checks全項目pass。semantic_review_applicable: false(skip)。root_entry_router.pyはroute: invoke_impl_review_loop(reason: fresh_review_go_live_equality)を返却。Final Gate
issue_kind: implementationのためLOOP_HANDOFF_RESULT_V1を以下に記録する。実際のimpl-review-loop起動は本ターンでは行わない(live Claude-GPT/Latitude probe が実クレデンシャル・実課金を伴う実装フェーズへの移行であり、issue-refinement-loop 自体のスコープを超えるため、次の明示的な着手判断を待つ)。squne121 commentedon Aug 30, 2026
implement-issue: 実装完了 (2026-08-30T09:34:57Z)
.claude/worktrees/issue-2426-claude-gpt-latitude-project-native-claudworktree-issue-2426-claude-gpt-latitude-project-native-claudfix: secret-policy.md の supersession 見出しに日本語を含める(#2426)
squne121 commentedon Aug 30, 2026
impl-review-loop: 完了 (2026-08-30T10:15:00Z)
fix: LATITUDE_PROJECT を Claude-GPT 生成 settings env へ配線し、live 検証の circ…
squne121 commentedon Aug 30, 2026
impl-review-loop: 完了 (2026-08-30T11:10:00Z)
feat: Claude-GPT を Native Latitude local profile 経由で同一 project へ接続する (#…
feat: issue-refinement-loop の structural repair producer に known_scal…