Skip to content

実装: AI作業ログ public-safe 要約スクリプトを追加する #947

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "巨大な AI 作業ログを public-safe に要約し、token 消費と context 汚染を減らす"
change_kind: workflow

Parent Issue

none

Parent Goal Ref

  • Goal: Codex / Claude の長大ログをそのまま再読せず、result / fallback / mutation / token usage / known gaps だけを短く引き継げるようにする。
  • Desired Destination: public-safe worklog summarizer が raw transcript 本文を含めず compact summary を生成できる。

Current Validated Scope

  • worklog summarize script と helper を追加する。
  • tests / docs / package script を追加する。
  • helper failure、raw gh fallback、token usage、created issues、parent updates を friction signal として抽出する。

Remaining Parent Gaps

なし

Outcome

Codex / Claude の貼り付けログから token_usage, commands, mutations, errors, fallbacks, created_issues, parent_updates, known_gaps を public-safe に抽出する summarizer と tests / docs / package wiring が 1 PR で追加され、巨大ログを main thread が直接再読しなくてよい状態。

In Scope

  • worklog summarize CLI と helper。
  • --max-chars と priority ベースの出力制御。
  • raw transcript / local absolute path / secret / full command output の除外。
  • line number または evidence ref の保持。
  • helper failure や raw gh fallback を friction signal として抽出。

Out of Scope

  • run report schema 本体の変更。
  • create_issue_txn helper の仕様変更。
  • overlap preflight。

Acceptance Criteria

  • AC1: Codex / Claude の貼り付けログから token_usage, commands, mutations, errors, fallbacks, created_issues, parent_updates, known_gaps を抽出できる。
  • AC2: raw transcript 本文・local absolute path・secret・full command output を出力しない。
  • AC3: --max-chars と section priority で出力を制御できる。
  • AC4: line number または evidence ref を保持できる。
  • AC5: helper failure や raw gh fallback を friction signal として拾える。

Verification Commands

# AC1
rtk pnpm test -- --run tests/agent-logs/worklog-summary-fields*.test.ts

# AC2
rtk pnpm test -- --run tests/agent-logs/worklog-summary-redaction*.test.ts

# AC3
rtk pnpm test -- --run tests/agent-logs/worklog-summary-budget*.test.ts

# AC4
rtk pnpm test -- --run tests/agent-logs/worklog-summary-evidence*.test.ts

# AC5
rtk pnpm test -- --run tests/agent-logs/worklog-summary-friction*.test.ts

Allowed Paths

  • scripts/agent-logs/summarize-agent-worklog.mjs
  • scripts/agent-logs/lib/worklog-summary*.mjs
  • tests/agent-logs/worklog-summary*.test.ts
  • docs/dev/agent-run-report.md
  • package.json

Runtime Verification Applicability

decision: not_applicable
reason: "summary CLI / tests / docs 更新であり、interactive runtime の証跡を成功条件に含まない"

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • raw transcript を含めずに必要 field を抽出できないことが判明した場合

Required Skills

なし

Scope Delta(任意)

N/A

Delivery Rule

  • 1 Issue = 1 PR で完了する。
  • Draft PR を既定とする。
  • worklog summarizer は public-safe aggregate だけを扱い、source transcript 正本や manifest 本文の再露出をしない。

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    workflow
    area/ai-ops
    on Jun 15, 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/implementerarea/ai-opsenhancementphase/implementationworkflow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions