Skip to content

実装: feat(agent-ops): issue-refinement-ops-review で agent_ops_inventory を必須 preflight 化する #1009

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "agent ops 監査で inventory artifact に基づく read plan を使い、トークン消費とコンテキスト汚染を減らす"
change_kind: mixed

Parent 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-review task 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

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-review task 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

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_compact

Allowed Paths

  • scripts/agent_ops_inventory.py
  • AGENTS.md
  • CLAUDE.md
  • docs/dev/agent-skill-boundaries.md
  • docs/dev/workflow.md
  • tests/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 既定

Activity

  1. added
    enhancement
    phase/implementation
    triage-required
    agent/implementer
    on Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions