Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1153"
goal_ref: "Claude Code / Codex CLI / Google Antigravity の capture capability、hook coexistence、negative control、unsupported / unverified verdict を synthetic evidence で確定し、Child C0/C1 が依存できる adoption matrix を作る"
change_kind: mixed
evidence_mode: synthetic_only
real_runtime_evidence: blocked_until_pilot_exception_approve_timeboxed_real_pilotParent Issue
Parent Goal Ref
- Goal: Claude Code / Codex CLI / Google Antigravity の運用データを public-safe な agent_run_report/v1 / agent_retro_index/v1 に正規化し、ChatGPT が GitHub 経由で再現可能なレトロスペクティブを行える pilot 運用を確立する
- Desired Destination: vendor docs だけに依存せず、各 agent surface の capture capability verdict と hook coexistence を synthetic evidence と negative control で固定した adoption matrix を残す
Current Validated Scope
docs/dev/agent-observation-capability.mdに Claude / Codex / Antigravity のagent_observation_capability/v1capability matrix(closed enum verdict とsupportedの成立述語、checked surface 列挙、admission contract)を追加するdocs/dev/session-recording-policy.mdとdocs/dev/agent-run-report.mdに hook coexistence / canonical gate(post-run verifier)/ async hook を gate にしない境界の位置づけを追記する.codex/hooks.jsonと validator の drift、[features].hookscanonical key とcodex_hookslegacy alias、Antigravity の browser / artifacts を capture supported と同一視しない evidence contract を matrix へ projection する- runtime safety checker と fixture/test を拡張し、duplicate upload / duplicate finalization / async false-green / hook-exit-zero-without-artifact / codex validator drift の negative control と JSON postcondition assertion を追加する
Remaining Parent Gaps
- Child C0 で observation source / provenance / safety verdict の schema admission を追加する
- Child C1 で adapter を実装し public-safe report に接続する
- Child D で GitHub marker 境界を実装する
- Child E で Cloud pilot decision を記録する
Evidence Mode 分離(#1221 の前提)
本 Issue は parent #1153 の Child B(capture capability verdict の確定)であり、Child C0/C1 の入力契約を作る。成果物は文章の matrix ではなく closed enum + evidence mode + provenance + negative fixture + JSON postcondition assertion まで揃える。
synthetic evidence mode: synthetic fixture / read-only host inventory のみを根拠に capability verdict を確定する。本 Issue で許可されるのはこの mode のみ。real runtime evidence mode: real prompt / real trace export / real Latitude upload を伴う評価。実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 のLATITUDE_PILOT_EXCEPTION_V1がapprove_timeboxed_real_pilotかつ activation fields / distribution digest / remote cleanup / argv exposure が machine-verified になるまで実行しない。本 Issue では Stop Condition として扱う。- activation gate の正本は Stop hook ではなく
check_session_recording_runtime_safety.py --json --execution-profile hostの pre-session host verifier JSON である。現行既定はapprove_synthetic_only/pilot_activation_state: blocked_until_activationであり、real capture 証跡は要求しない。
Outcome
docs/dev/agent-observation-capability.md に agent_observation_capability/v1 の machine-readable matrix が追加され、3 surface(Claude Code / Codex CLI / Antigravity)が supported | partial | unsupported | unverified の closed enum を 1 つだけ持ち、supported は runtime_event_observed == true かつ capture_artifact_observed == true かつ raw_values_emitted == false のときだけ成立する状態。負の制御として duplicate upload / duplicate finalization / async false-green / hook-exit-zero-without-artifact / codex validator drift の fixture が fail し、unsupported / unverified が Child C0/C1 の input availability として参照できる状態。
In Scope
- Claude Code の user / project / local / managed policy / plugin / skill / agent frontmatter hook surface の棚卸し(checked surface を matrix に列挙する)
- Latitude async Stop hook と既存 coordinator hook の共存検証。共存 PASS 条件は以下の closed contract を満たすこととする:
hook_coexistence_pass_requires:
expected_handlers_fired_once: true
duplicate_finalization_absent: true
duplicate_upload_absent: true
async_hook_not_used_as_gate: true
post_run_verifier_observed_final_state: true
runtime_event_and_capture_artifact_correlated: true
hook_exit_zero_not_authoritative: true
raw_values_emitted: false- Codex CLI の canonical feature key を
[features].hooksとし、codex_hooksは legacy alias としてのみ扱う。.codex/hooks.jsonの現行 shape とscripts/session-recording/validate-codex-hooks.mjsの期待 shape の drift を fixture で検出し、drift がある間は Codex をsupportedにしない - Antigravity で MCP 接続 / IDE 起動 / Artifacts 生成 / browser recording を capture supported と同一視しない evidence contract(capture artifact と runtime event の両方が確認できない限り
unverified固定) supported | partial | unsupported | unverifiedの closed verdict 定義とsupportedの成立述語- duplicate hook execution / duplicate report finalization / async false-green / hook-exit-zero-without-artifact / codex validator drift / unsupported misclassification の negative fixture
- 全 evidence artifact に対する public-safe admission contract:
public_safety:
raw_values_emitted: false
forbidden_field_scan: pass
prompt_excerpt_present: false
tool_io_excerpt_present: false
local_absolute_path_present: false
credential_value_present: false
digest_is_over_public_projection_only: truepnpm run security:session-recording:fixtureの JSON postcondition assertion(pilot_activation_state/pilot_exception.decision/components.latitude.verdict/components.latitude.raw_values_emitted/inspection_complete)を test で検証する
Out of Scope
- real Latitude trace upload
- real prompt / real trace export を伴う production Cloud pilot
- adapter 実装(Child C1)
- schema migration(Child C0)
- self-host 構築
docs/dev/secret-policy.mdの decision / digest 境界の変更(distribution evidence は matrix への projection のみ).codex/hooks.json/scripts/session-recording/validate-codex-hooks.mjsの shape 変更
Acceptance Criteria
- AC1:
docs/dev/agent-observation-capability.mdにagent_observation_capability/v1の machine-readable block と Claude / Codex / Antigravity の matrix が存在する - AC2: 各 surface に
supported | partial | unsupported | unverifiedのいずれか 1 つだけが設定される - AC3:
supportedはruntime_event_observed == trueかつcapture_artifact_observed == trueかつraw_values_emitted == falseのときだけ成立する(fixture で述語が強制される) - AC4: Claude Code は user / project / local / managed policy / plugin / skill / agent frontmatter hook を checked surface に含め、async hook を gate にせず post-run verifier を canonical gate とする(
hook_coexistence_pass_requiresを満たす) - AC5: Codex CLI は
[features].hooksを canonical feature key、codex_hooksを legacy alias として記録し、.codex/hooks.jsonと validator の drift がある間はsupportedにしない - AC6: Antigravity は capture artifact と runtime event の両方が確認できない限り
supportedにせずunverified固定とする - AC7:
unsupportedとunverifiedは失敗ではなく、Child C0/C1 の input availability として扱う - AC8: duplicate upload / duplicate finalization / async false-green / hook-exit-zero-without-artifact / codex validator drift の negative fixture が fail する
- AC9: 全 evidence artifact に対し
public_safetyadmission(raw_values_emitted == falseを含む)が成立し、security:session-recording:fixtureの JSON postcondition が assert される
Verification Commands
VC は VC preflight allowlist(pnpm typecheck / pnpm lint / pnpm test / pnpm build / test -f 等)内のコマンドのみで構成する。security:session-recording:fixture の JSON postcondition / negative fixture / matrix 検証は Allowed Paths 内の tests/session_recording_runtime_safety.test.ts(vitest が .claude/scripts/check_session_recording_runtime_safety.py を子プロセス起動して assert する)に集約し、pnpm test で実行する。
# AC1
# baseline-expect: fail
$ test -f docs/dev/agent-observation-capability.md
# AC1
$ pnpm typecheck
# AC2
$ pnpm lint
# AC3
# AC4
# AC5
# AC6
# AC7
# AC8
# AC9
$ pnpm test
# AC1
$ pnpm buildAllowed Paths
docs/dev/agent-observation-capability.mddocs/dev/session-recording-policy.mddocs/dev/agent-run-report.md.claude/scripts/check_session_recording_runtime_safety.py.claude/scripts/lib/latitude_telemetry_safety.pytests/session_recording_runtime_safety.test.tstests/fixtures/session-recording-runtime-safety/**package.json
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合(特に
docs/dev/secret-policy.md/.codex/hooks.json/scripts/session-recording/validate-codex-hooks.mjs/tests/session_recording/codex/**) - In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- real runtime evidence mode が必要になった場合(実装: decision(latitude): credential を保持した real pilot 例外を承認/却下し、time-boxed activation gate を定義する #1220 の
LATITUDE_PILOT_EXCEPTION_V1がapprove_timeboxed_real_pilotへ変わるまで実走しない) - Codex hook validator を
pnpm test常設 gate に組み込むためにscripts// vitest 構成変更が必要になった場合(follow-up Issue を提案する) - 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- raw transcript / tool I/O / full prompt / local absolute path / credential value を evidence に含める必要が出た場合
Required Skills
- Claude Code hook configuration
- Codex CLI hook semantics
- evidence-driven test design
- fail-closed capability classification
Scope Delta(任意)
N/A
Runtime Verification Applicability
decision: not_applicable
rationale: synthetic fixture / read-only host inventory の synthetic evidence で capability verdict を固定する。security:session-recording:host は secret 非出力で expected blocked/deny を返す pre-session diagnostic として記録し、CI failure として扱わない。real cloud telemetry の実走は要求しない
Delivery Rule
- 1 Issue = 1 PR
- Draft PR を既定とする
- unsupported / unverified verdict を failure 扱いしない
- 追加した negative fixture は、修正前に fail し、修正後も unsafe state を supported に昇格させないことを確認する
Activity
squne121 commentedon Jun 28, 2026
判定
REQUEST_CHANGES。#1221 は方向性は正しいが、このまま実装すると false green を作る危険が高いです。
特に危険なのは、
capture capability matrixを docs-only 成果物として作ってしまい、実 runtime evidence、fixture negative control、public-safe artifact admission の境界が曖昧なまま Child C0/C1 の入力に昇格する点です。#1221 自体は「matrix 追加」「policy/report doc 更新」「duplicate upload / duplicate finalization / async false-green の negative control 追加」を掲げていますが、Issue コメントは空で、まだレビューによる補正が入っていません。良い点
#1221 が
supported | partial | unsupported | unverifiedを closed verdict とし、Antigravity の MCP 接続成功を capture supported と同一視しない方針にしている点は妥当です。Parent #1153 も、Latitude MCP と session telemetry capture は別 concern、Latitude 欠落は agent run 成功で隠さずavailability: unavailableとして残す、GitHub へ永続化するのは public-safe report/index で raw trace ではない、と明記しています。また、A0/A1 の前提整理は進んでいます。#1157 は Latitude credential / preload / export / local payload / active process / uninstall state を Secret Inventory / Kill Switch へ fail-closed 接続する Child A0 で、#1220 は real pilot 例外を
reject_and_uninstall | approve_synthetic_only | approve_timeboxed_real_pilot | deferの decision enum に閉じる Child A1 です。Blocker 1: 現在の既定は synthetic-only であり、real capture 証跡を要求すると矛盾する
PR #1226 は #1220 を実装済みですが、既定 decision は
approve_synthetic_only、real pilot はblocked_until_activationのままです。activation gate の正本は Stop hook ではなくcheck_session_recording_runtime_safety.py --json --execution-profile hostの pre-session host verifier です。docs/dev/session-recording-policy.mdでも、approve_synthetic_onlyは synthetic fixture / policy validation のみ許可し、real prompt / real trace export / real Cloud pilot は禁止しています。さらに、Child B、つまり #1221 の real pilot 評価は A1 がapprove_timeboxed_real_pilotのときだけ許可される、と明記されています。修正: #1221 の AC を
synthetic evidence modeとreal runtime evidence modeに分けてください。現時点で許可できるのは synthetic fixture / read-only host inventory までです。real trace arrival や real Latitude upload を実施するなら、#1220 の decision がapprove_timeboxed_real_pilotへ変わり、activation fields / distribution digest / remote cleanup / argv exposure が全て machine-verified であることを前提にする必要があります。Blocker 2: Hook coexistence を「hook が動いた」で PASS にしてはいけない
Claude Code 公式 docs は hook location として user、project、local、managed policy、plugin、skill / agent frontmatter を挙げています。
async: trueは background 実行であり、iffilter は best-effort かつ fail-open です。したがって、Latitude の async Stop hook と repo の coordinator hook が両方起動しただけでは、coexistence の安全性は証明できません。([Claude]1) ([Claude]1)repo 側も同じ方針です。
docs/dev/agent-run-report.mdは hook を diagnostic/prevention layer とし、canonical gate は post-run verifier だと明記しています。docs/dev/session-recording-policy.mdでも、activation gate の正本は Stop hook ではなく pre-session host verifier JSON です。修正: coexistence PASS 条件を最低限こうしてください。
Blocker 3: Codex hook validator が現行
.codex/hooks.jsonとズレている現行
.codex/hooks.jsonのPreToolUseは Bash matcher に 5 hooks、patch/write matcher に 3 hooks を持っています。一方、
scripts/session-recording/validate-codex-hooks.mjsは Bash matcher に exactly 3 hooks、patch/write matcher に exactly 2 hooks を期待しています。つまり、現行設定を validator に通すと失敗する可能性が高いです。さらに、その validator を実行する
tests/session_recording/codex/test_hook_adapter.pyは存在しますが、package.jsonのpnpm testはvitest runだけで、pytest は通常テストに含まれていません。修正: #1221 で Codex の capability / trust state を扱う前に、次のどちらかを必須化してください。
または、Codex hook validator を Vitest 側へ移して
pnpm testに確実に入れる。現状のままpnpm testを AC3 に置くと、Codex hook config drift を見逃します。Blocker 4:
security:session-recording:fixtureの exit 0 は real activation の証明ではない#1220 の deterministic fixture gate は
verdict: safeでもpilot_activation_state: blocked_until_activationを期待しています。つまり、fixture gate の成功は「synthetic-only policy として安全」なだけで、real telemetry の許可や capture supported の証明ではありません。修正: #1221 の verification command は exit code だけでなく JSON postcondition を assert してください。最低限、
pilot_activation_state,components.latitude.verdict,components.latitude.raw_values_emitted,pilot_exception.decision,inspection_completeを読む必要があります。pnpm security:session-recording:fixtureを単に PASS と見るのは false-green です。Blocker 5: Latitude distribution evidence が Issue #1221 の Allowed Paths と衝突しやすい
Latitude 公式 docs は
npx -y @latitude-data/claude-code-telemetry installと unversioned command を案内し、manual configuration でも Stop hook にnpx -y @latitude-data/claude-code-telemetry、async: trueを設定する例を示しています。さらに受信内容は prompts、responses、tool input/output、system context を含む full-fidelity telemetry と説明されています。([Latitude Docs]2)repo 側の checker はこれを受けて、exact semver でない Latitude package spec を unpinned 扱いにし、
latest、range、caret、tilde、x-range を reject します。問題: #1221 の Allowed Paths には
docs/dev/secret-policy.mdがありません。package exact version、npm integrity、tarball sha256、preload digest、hook command digest、activation decision 参照を正しく追記しようとすると、Allowed Paths 外変更になりやすいです。これは Stop Condition 直行です。修正: #1221 は distribution evidence を
docs/dev/agent-observation-capability.mdに projection として持つだけにし、secret-policy.mdの decision / digest 境界を変更する必要が出たら別 Issue に分割してください。Blocker 6: Antigravity は初期値
unverified固定でよい公開情報上、Antigravity は editor / terminal / browser へ agent が直接アクセスし、task list、plan、screenshot、browser recording などの Artifacts を生成する agent-first IDE として説明されています。ただし、これらは session telemetry capture contract そのものではありません。([The Verge]3)
Antigravity は #1221 の AC6 通り、capture artifact と runtime event の両方が確認できない限り
supportedにしてはいけません。MCP 接続、IDE 起動、Artifacts 生成、スクリーンショット生成は capture supported の代替証拠ではありません。これは parent #1153 の「Antigravity で MCP 接続だけを根拠に capture supported と判定するな」という Stop Condition と一致します。Blocker 7:
raw_values_emitted: falseだけでは弱いrepo policy は GitHub comment surface で raw transcript、local absolute path、secret value、full command output、full prompt を forbidden content としています。
agent_run_reportの Stop Condition も raw transcript、full command output、stdout、stderr、local_path 等の scan を要求しています。修正: evidence artifact の admission は
raw_values_emitted: falseだけでなく、以下を required にしてください。#1221 に追加すべき negative fixtures
最低限、次を足してください。
特に
codex-current-hooks-validator-driftは優先度が高いです。現行.codex/hooks.jsonと validator の期待がずれているため、この fixture が fail しない限り Codex 側の “authoritative evidence” は信用できません。修正後の Issue #1221 実装プロンプト
最終コメント
#1221 は「調査 Issue」ではなく、後続 Child C0/C1 の入力契約を作る Issue です。したがって、成果物は文章の matrix では足りません。closed enum + evidence mode + provenance + negative fixture + JSON postcondition assertion まで揃えて、
unsupported/unverifiedを正常な入力 availability として固定するべきです。squne121 commentedon Jun 28, 2026
Contract Snapshot — issue-contract-review
実装着手直前 preflight を
run_contract_review_once.py --mode executeで実行した。全 checks pass。checks
VC preflight 集約
test -f docs/dev/agent-observation-capability.mdfile_not_found_expected)pnpm typecheckpnpm lintpnpm testpnpm buildtest -fは新規 Allowed Path ファイル(未作成)に対する# baseline-expect: fail注釈付き baseline fail で go。tests/session_recording_runtime_safety.test.ts(vitest が.claude/scripts/check_session_recording_runtime_safety.pyを子プロセス起動して assert)へ集約しpnpm testで実行する。contract_snapshot
sha256:41c4e57d639f481a0591c57adc7a00e586da33e6ab64b5801de3b840a26574absqune121 commentedon Jun 28, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approved反映した anchor review(#issuecomment-4825185295)の補正
evidence_mode: synthetic_onlyを contract に追加し、real runtime evidence は #1220LATITUDE_PILOT_EXCEPTION_V1がapprove_timeboxed_real_pilotになるまで Stop Condition 化。activation gate 正本を host verifier JSON と明記hook_coexistence_pass_requiresclosed contract(async 非gate / post-run verifier canonical / duplicate 不在 / hook exit0 非authoritative)を In Scope と AC4 に明記[features].hookscanonical /codex_hookslegacy alias。.codex/hooks.json(Bash5/patch3) と validator 期待(Bash3/patch2) の drift を fixture で検出し、drift 中は Codex をsupportedにしない(AC5)pilot_activation_state/pilot_exception.decision/components.latitude.verdict/inspection_complete/raw_values_emitted)を AC9 で要求secret-policy.md/.codex/hooks.json/ validator は Allowed Paths 外に保ち Stop Condition 化。distribution evidence は matrix への projection のみunverified固定(AC6)public_safety拡張契約(forbidden_field_scan / prompt・tool_io・local_path・credential 不在 / digest は public projection のみ)を In Scope と AC9 に明記VC 修正
pnpm security:session-recording:*/pnpm entirecli:check/codex --version/entire version)を allowlist 内(test -f/pnpm typecheck/pnpm lint/pnpm test/pnpm build)へ置換。# AC<N>marker へ修正。新規ファイル検査に# baseline-expect: fail注釈を付与。収束
VCP_MISSING_BASELINE_EXP1件)→ deterministic_fail_confirmed → rewritefix(#1221): 日本語比率ゲートを満たすよう matrix doc と PR 本文を日本語化
fix(#1221): close capability checker contract gaps (3-surface set, ho…
feat(#1221): agent observation capability matrix を synthetic evidence…