Skip to content

feat(doctor): agent-tools status contract v3 に追従 (Closes #194) - #195

Merged
kosako merged 2 commits into
mainfrom
feat/194-agent-tools-contract-v3
Jul 12, 2026
Merged

feat(doctor): agent-tools status contract v3 に追従 (Closes #194)#195
kosako merged 2 commits into
mainfrom
feat/194-agent-tools-contract-v3

Conversation

@kosako

@kosako kosako commented Jul 11, 2026

Copy link
Copy Markdown
Owner

概要

Closes #194。agent-tools#186 (kosako/agent-tools#198, bb085a9) で status contract が v2→v3 になった (target state に deployed_but_inactive を追加 = 「一度承認して配布 → 後で gate がかかった」まま実体がディスクに残る配置物の可視化)。

変更内容

  • scripts/doctor.sh: expected contract_version を 3 へ更新 (exact-match 維持 = 未知 version は従来どおり「not interpreting fields」の fail-closed warn)。conflict / stale と同様に deployed_but_inactive の件数 warn を追加 (掃除候補の可視化という新語彙の趣旨に沿う消費)。
  • scripts/test-doctor.sh: fake status.sh fixture を v3 化し、deployed_but_inactive target を追加して新 warn の発火を検証。unknown-version ケースの期待文言を "expected 3" に追従。AGENT_TOOLS override ケースの fixture / 期待文言も v3 化。

検証

  • scripts/test-doctor.sh full run 緑 (exit 0・全 [ok])。
  • 実環境の agent-tools main は既に v3 を出力しており、本 PR 適用で doctor の warn (expected 2) が解消される。

author=Claude → reviewer=Codex (相互レビュー契約)。

🤖 Generated with Claude Code

https://claude.ai/code/session_01Wqz3c5ope2oVauyyWZNkyv

agent-tools#186 (#198, bb085a9) で status contract が v2→v3 になった
(target state に deployed_but_inactive を追加 = 未登録なのに実体が残る
配置物の可視化)。doctor の expected version を 3 へ更新し (exact-match
維持・fail-closed のまま)、conflict / stale と同様に deployed_but_inactive
の件数 warn を追加する (掃除候補の可視化という新語彙の趣旨に沿う消費)。

test-doctor: fake status.sh fixture を v3 化し、deployed_but_inactive
target を足して新 warn の発火を検証。unknown version ケースは
"expected 3" に追従。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wqz3c5ope2oVauyyWZNkyv
@kosako

kosako commented Jul 11, 2026

Copy link
Copy Markdown
Owner Author

🔍 レビュー依頼(→ Codex)

  • 観点: agent-tools status contract v3 追従。重点: (1) exact-match の fail-closed 維持 (unknown version で fields 解釈しない)、(2) 新 warn (deployed_but_inactive) の yq クエリと文言の整合、(3) fixture 更新でテストが空振りしていないか (v3 化 + 新 state の発火検証)、(4) doctor の report-only / exit 0 不変。
  • ランク: 🔴 must(merge 前必須)/ 🟡 should(推奨・対応は依頼元判断)/ ⚪ nit(任意)
  • 結果はこの PR にコメントで返します

- test-doctor: unknown contract version の fixture に sentinel fields
  (repo / sync_targets) を持たせ、warn を出しつつ fields を解釈する退行を
  否定検証で固定 (working tree / sync conflicts / deployed-but-inactive の
  summary 行が出ないこと)。
- docs/ai-environment-boundary.md: contract_version 2 の残存記載を 3 へ更新し
  deployed_but_inactive を warning 対象に追記。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wqz3c5ope2oVauyyWZNkyv
@kosako

kosako commented Jul 11, 2026

Copy link
Copy Markdown
Owner Author

📋 レビュー結果(by Codex / gpt-5.6-sol・reasoning=medium)

判定: ✅ merge 可(must 0 件) — 🟡 should 2 件は両方採用し 86ea718 で対応済み

🟡 should (採用・対応済み)

  • scripts/test-doctor.sh:202 — unknown-version fixture が contract_version しか返さず、「warn を出しつつ fields も解釈する」退行を検出できない → sentinel fields (repo / sync_targets) を fixture に足し、summary 行 (working tree / sync conflicts / deployed-but-inactive) が出ないことの否定検証を追加。
  • docs/ai-environment-boundary.md:85 — contract_version: 2 の残存記載 → 3 へ更新 + deployed_but_inactive を warning 対象に追記 (repo 内の現行仕様上の v2 参照はこの 1 件のみと Codex が確認)。

Codex の確認内容

  • exact-match の fail-closed 分岐は維持 (unknown version で fields を解釈しない)。
  • 新 yq クエリは v3 contract と整合し fixture で件数 1 を返す。sj|| true で set -e も壊さない。
  • v3 fixture + 肯定検証により新 warn を壊せばテストは失敗する (空振りなし)。
  • report-only / 常時 exit 0 不変。bash -n / git diff --check 通過。

補足 (依頼元)

  • Codex sandbox は read-only で test-doctor full run 不可 → 依頼元がローカルで full run 緑 (exit 0) を対応前後の両方で確認済み

must 0 のため merge 可。

@kosako
kosako merged commit 0cb460f into main Jul 12, 2026
2 checks passed
@kosako
kosako deleted the feat/194-agent-tools-contract-v3 branch July 12, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doctor: agent-tools status contract v3 への追従 (deployed_but_inactive 追加)

1 participant