Repository navigation
Open
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "agent ops 監査で inventory artifact に基づく read plan を使い、トークン消費とコンテキスト汚染を減らす"
change_kind: mixedParent Issue
なし(単独改善)
Parent Goal Ref
- Goal: agent ops 監査(AGENTS / CLAUDE / skills / hooks / subagents / rules / scripts の棚卸し)を token-efficient かつ coverage-traceable に実施できる状態にする
- Desired Destination: agent-ops-review タスクでは
agent_ops_inventory.pyの artifact を入口として read plan を組み立て、無差別 read によるコンテキスト汚染を防ぐ
Current Validated Scope
scripts/agent_ops_inventory.pyにissue-refinement-ops-reviewtask kind のサポートを確認・拡張するAGENTS.md/CLAUDE.mdの agent-ops-review 例外定義と一致する形で、loop Step 0 相当の preflight を追加する- coverage target(
.claude/agents/,.claude/skills/,.claude/hooks/,.claude/rules/,.agents/skills/,.codex/)を inventory profile に持つことを確認し、欠落があれば追加する DO_NOT_READ_INITIAL_ONLYを machine-readable フィールドとして保持・返却する- secret-like path / repo 外 symlink escape を inventory から除外または
blockedとして扱う - stdout を 2048 bytes 以下の compact summary に収め、詳細は artifact のみで扱う
tests/test_issue_refinement_ops_review.pyを追加する
Remaining Parent Gaps
- loop オーケストレーター(
issue-refinement-loopまたは専用agent-ops-reviewSkill)への Step 0 inventory preflight の組み込み(本 Issue はagent_ops_inventory.py側の対応のみ) - coverage 不足時の
warn/blockedを loop routing に反映する仕組み(follow-up Issue) - feat: agent-ops-review 用の compact audit bundle を生成する script を追加する #921(
agent_ops_audit_bundle.py)との統合
Outcome
scripts/agent_ops_inventory.py --task-kind issue-refinement-ops-review --json --artifact-out <path> が coverage target 6 種を含む artifact を出力し、tests/test_issue_refinement_ops_review.py が PASS する状態。
In Scope
scripts/agent_ops_inventory.pyにissue-refinement-ops-reviewtask kind サポートを追加・確認する- coverage target(
.claude/agents/,.claude/skills/,.claude/hooks/,.claude/rules/,.agents/skills/,.codex/)を inventory profile に含める DO_NOT_READ_INITIAL_ONLYフィールドを artifact に machine-readable で保持する- secret-like path(
*secret*,*credential*,*token*,*key*等)と repo 外 symlink escape を除外 / blocked 扱いにする - stdout を 2048 bytes 以下 compact summary に制限し、詳細は
--artifact-out指定ファイルのみに出力する tests/test_issue_refinement_ops_review.pyを追加し、AC1〜AC5 を pytest で決定論的に検証する
Out of Scope
- loop オーケストレーターへの Step 0 組み込み(別 Issue)
- coverage 不足時の routing 反映(別 Issue)
agent_ops_audit_bundle.py(feat: agent-ops-review 用の compact audit bundle を生成する script を追加する #921 担当).codex/が存在しない場合のエラー抑制以外の挙動変更
Acceptance Criteria
- AC1:
uv run python3 scripts/agent_ops_inventory.py --task-kind issue-refinement-ops-review --json --artifact-out /tmp/inv_test.jsonが exit 0 を返し、/tmp/inv_test.jsonが生成される - AC2: artifact の coverage target に
.claude/agents/,.claude/skills/,.claude/hooks/,.claude/rules/,.agents/skills/,.codex/が含まれる - AC3: artifact に
do_not_read_initial_onlyフィールドが存在し、値が list 型である - AC4: secret-like path のサンプル(例:
.env.secret)が artifact の除外リストまたはblockedフラグ付きエントリとして扱われる - AC5:
--jsonオプション指定時の stdout が 2048 bytes 以下であり、詳細は artifact にのみ含まれる
Verification Commands
# AC1
uv run python3 scripts/agent_ops_inventory.py --task-kind issue-refinement-ops-review --json --artifact-out /tmp/inv_test.json# AC2
uv run pytest tests/test_issue_refinement_ops_review.py -q -x -k test_coverage_targets# AC3
uv run pytest tests/test_issue_refinement_ops_review.py -q -x -k test_do_not_read_initial_only# AC4
uv run pytest tests/test_issue_refinement_ops_review.py -q -x -k test_secret_path_exclusion# AC5
uv run pytest tests/test_issue_refinement_ops_review.py -q -x -k test_stdout_compactAllowed Paths
scripts/agent_ops_inventory.pyAGENTS.mdCLAUDE.mddocs/dev/agent-skill-boundaries.mddocs/dev/workflow.mdtests/test_issue_refinement_ops_review.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- Python / pytest
- JSON schema / artifact design
Scope Delta(任意)
N/A
Delivery Rule
1 Issue = 1 PR- worktree での実装
- Draft PR 既定
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity