Skip to content

導入: repo URL起点の日次retrospective worksetとagent completion artifact投稿を確立する #1939

Open
1 of 1 issue completed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: parent
goal_ref: "repository URL・calendar date・timezoneから日次agent worksetとpublic-safe artifact coverageを決定論的に導出し、ChatGPT GitHub connectorで発見できる人間起動型daily retrospective運用を確立する"
change_kind: workflow
parent_mode: delivery-rollup
closure_mode: child-complete
dedupe_key: "delivery-rollup:squne121/loop-protocol:repo-daily-retrospective-operation:v1"

Summary

#1415が完了させた特定Issue/PR向けconnector-only retrospective proofと、repository URL・日付・timezoneを入口にする日次repository retrospective運用を分離して届ける親Issueである。#1153は観測・public-safe artifact基盤として維持し、本Issueは未実装の運用deliveryを束ねる。既存のrun report、retro index、context marker、GitHub live stateを再利用し、新しい専用control-plane・state DB・強制hookは導入しない。

Goal

repository URL、calendar date、timezoneを入力にcanonical daily worksetとartifact coverageを再現可能に解決し、ChatGPTがGitHub connectorだけで正式entrypointを発見して、人間の依頼時にpublic-safeなretrospectiveを実施できる状態を作る。Claude CodeおよびCodex CLIのagent run完了は、public-safeなrun report、retro index、context markerを一つのcompletion transactionとして生成・投稿し、未投稿・失敗・interruptをreconciliationで検出できるようにする。

Desired Destination

  1. URL正規化、対象日のtimezone-aware half-open interval、GitHub activityとagent sessionの対応、retry/duplicate/superseded、missing/partial/unavailable、安定順序、pagination、freshness、coverage denominator、workset digestを定義するdaily workset contract/result schemaがある。
  2. run report (agent_run_report/v1)、retro index (agent_retro_index/v1)、context marker (CHATGPT_RETRO_CONTEXT_V1)を再利用したcompletion transactionがあり、公開前のpublic-safe/secret検査、idempotency、partial recovery、network retryを扱う。
  3. default branch上の固定repository entrypointがschema・validator・workset digest bindingと共に存在し、ChatGPT GitHub connectorはheuristic検索ではなくそれを発見して読む。entrypoint欠落は正式retroとしてfail-closedにする。
  4. retrospectiveの実行とfollow-up Issue候補の採否・起票は人間起動であり、候補は既存dedupe/materialization契約でClaude CodeまたはCodex CLIへhandoffする。
  5. public artifactのopaque evidence referenceを、GitHubへraw transcript/prompt/tool I/O/credential/absolute pathを出さずに、許可されたローカルprivate evidenceへ解決できるadapter contractがある。

Current Validated Scope

  • docs/dev/agent-run-report.md、docs/dev/agent-retro-index.md、agent_run_report/v1、agent_retro_index/v1、CHATGPT_RETRO_CONTEXT_V1とその生成・投稿コマンドは存在するが、daily worksetを起点に一括完了を保証するlifecycle transactionは未確認である。
  • chatgpt_retrospective_result/v1とfollow-up candidate schema、generate-retro-live-verification.mjs等はspecific target向けに存在する。#1415はそのproofでありrepo-wide daily operationの完成証明ではない。
  • .claude/settings.jsonはClaude Stop/SubagentStop、.codex/hooks.jsonはCodex SessionEnd/SubagentStopに限定される。Claude interrupt/StopFailure、Codex Stop、cancel/crash/timeout/network failureを同一成功経路とみなせない。
  • retrospective系GitHub Actionsはworkflow_dispatch等で、schedule単独をcompleteness evidenceにはできない。
  • #1926はCodex CLIのanchor discovery bridgeとしてOPENであり、本deliveryの実装完了の前提ではない。

Decisions Fixed

  • 2026-08-01: #1415をreopenせず、specific-target proofをrepo-wide daily operationの完成証明として流用しない。
  • 2026-08-01: ChatGPT retrospectiveとfollow-up Issue起票は自動化しない。人間の依頼と既存controlled materializationを境界にする。
  • 2026-08-01: completion eventを主経路、failure/interrupt/未投稿検出をreconciliation補助経路とする。単一Stop hookまたはscheduled workflowだけでは完全性を主張しない。
  • 2026-08-01: Latitude/EntireCLI/provider traceは利用可能時のprivate監査補助であり、日次retrospectiveの最低完了gateにしない。
  • 2026-08-01: public artifactはopaque referenceと検証可能な公開safe fieldsだけに限定し、private evidence availabilityを明示する。
  • 2026-08-01: childはrollback単位の実装workstreamで作り、この親の作成時にはchildを一括起票しない。

Quality Decision Record

In Scope

  • 下記5 workstreamのparent-level contract、順序、依存、closure evidenceを固定する。
  • 既存public-safe artifact producer/poster/index/context markerおよびfollow-up materializationを再利用する設計境界を定義する。
  • 日次workset、completion/reconciliation、repository discovery、handoff、private audit resolverを個別childへ分離する。

Out of Scope

  • この親Issueでのrepository実装、branch、worktree、commit、PR、child Issueの一括起票。
  • #1153のgoal置換・close、#1415のreopen、#1926の実装。
  • raw transcript、full prompt、tool input/output、credential、secret、local absolute pathのGitHub投稿。
  • ChatGPT retrospectiveまたはfollow-up Issueの無断自動実行。
  • provider telemetry、Latitude、EntireCLI captureをcompletion成功の必須条件にすること。
  • 新規の専用ledger、state DB、enforcing hook、schedule単独によるcompleteness主張。

Child Workstream Plan

依存順(このIssue作成時点では未起票):

  1. daily workset contract/result schema — repository identity、URL canonicalization、date/timezone、half-open interval、activity/session対応、ordering、digest、freshness、pagination、coverage/missing/partial/unavailable/supersededを定義する。後続全ての前提。
  2. Claude Code/Codex CLI completion transaction and reconciliation — 既存run report/index/marker投稿をworksetにbindし、terminal path inventory、idempotency、retry、partial recovery、network failure queue、未投稿reconciliationを実装する。Claude StopFailure/interruptとCodex Stop/SessionEndをadapter別に扱う。
  3. repository-level ChatGPT discovery entrypoint — default branch上の固定pathまたは同等の単一entrypoint、discovery algorithm、schema/digest/validator binding、missing時fail-closedを実装する。Workstream 1に依存。
  4. follow-up Issue candidate materialization handoff — human-triggered retrospectiveが返すcandidateを既存dedupe keyとcontrolled Issue materializationへ渡し、自動起票を禁止する。Workstreams 1・3に依存。
  5. opaque public evidence/private local audit resolver — public-safe opaque referenceからlocal private session history、skill、custom SubAgent、hook firing availabilityを解決するcontractを定義する。raw公開を禁止し、Workstream 2に依存。

Child Issues

Remaining Parent Gaps

  • Daily worksetのschema、deterministic resolver、coverage evidenceが未実装。
  • agent terminal pathごとのpublic-safe completion transactionとreconciliationが未実装。
  • repository-level discovery entrypointとdaily result schemaが未実装。
  • candidate-to-controlled-materialization handoffのdaily運用bindingが未実装。
  • opaque evidenceからprivate local auditへのresolver contractが未実装。
  • childのcurrent-head runtime evidenceとlive E2Eをparent closureへ集約する必要がある。

Phase Handoff Contract

各childは次を引き継ぐ: Desired Destination、Current Validated Scope、対応するRemaining Parent Gaps、このparentのMachine-Readable Contract、normative references、最小Allowed Paths、独立したAC/VC、agent-specific adapter boundary、public/private safety boundary、stop conditions、artifact readback、linked Draft PR。childは1 Issue = 1 PRとし、親に新しい作業を戻さない。

Acceptance Criteria

  • AC1: Workstream 1がrepository URL・date・timezoneから同一入力で同一workset、half-open boundary、stable order、digest、source availability/coverageを導出し、pagination/retry/supersessionをmachine-readableに記録する。
  • AC2: Workstream 1のschemaはGitHub activityとagent sessionの対応規則、missing/partial/unavailableの区別、およびuntrusted GitHub proseをauthorityにしない扱いを定義する。
  • AC3: Workstream 3がdefault branchから発見可能な単一repository entrypointを提供し、schema/digest/validator bindingを検証する。entrypoint欠落・不正は正式daily retrospectiveをfail-closedにする。
  • AC4: Workstream 2がClaude CodeとCodex CLIのadapter差を明示し、normal completion、failure、interrupt、cancel、crash、hook timeout、network failure、retryをcoverage状態として記録する。
  • AC5: Workstream 2がrun report、retro index、context markerの生成・検査・投稿をidempotent completion transactionとして扱い、partial success recoveryとduplicate comment preventionを検証する。
  • AC6: Workstream 2はprovider telemetry unavailableでもpublic-safe completion artifactまたは明示的unavailable coverageを残し、provider-side traceをsuccess gateにしない。
  • AC7: Workstream 5はpublic-safe validator/forbidden-field scannerをpublish前に通し、公開artifactにraw transcript、full prompt、tool I/O、credential、secret、absolute local pathを含めない。
  • AC8: Workstream 5はopaque referenceのlocal private audit resolverとavailability/retention/failure semanticsを定義し、private evidence欠落をfalse-greenにしない。
  • AC9: Workstream 4はhuman-triggered ChatGPT retrospectiveのcandidateをdedupe key・overlap readbackを伴うcontrolled materializationへhandoffし、無断自動Issue起票をしない。
  • AC10: #1415のspecific-target proofをdaily operationのcompletion evidenceに混入させず、全childのcurrent-head evidenceとlive E2Eが揃うまでこのparentをcloseしない。

Verification Commands

# baseline-expect: fail
$ test -f docs/schemas/repo-daily-workset.schema.json # AC1
# baseline-expect: fail
$ test -f docs/schemas/repo-daily-workset.schema.json # AC2
# baseline-expect: fail
$ test -f docs/dev/chatgpt-repository-retrospective-entrypoint.md # AC3
# baseline-expect: fail
$ test -f docs/schemas/agent-completion-coverage.schema.json # AC4
# baseline-expect: fail
$ test -f scripts/check-agent-completion-transaction.mjs # AC5
# baseline-expect: fail
$ test -f scripts/check-agent-completion-transaction.mjs # AC6
# baseline-expect: fail
$ test -f scripts/check-public-retro-artifact-safety.mjs # AC7
# baseline-expect: fail
$ test -f docs/dev/private-retro-evidence-resolver.md # AC8
# baseline-expect: fail
$ test -f scripts/check-follow-up-materialization-handoff.mjs # AC9
# baseline-expect: fail
$ test -f scripts/check-repo-daily-retrospective-e2e.mjs # AC10

Runtime Verification Applicability

decision: deferred
reason: この親は実装を行わず、runtime proofは5 childのcurrent-head evidenceと統合live E2Eでのみ可能である。
deferred_destination: Child Workstreams 1–5と統合live E2E。
deferred_verification_condition: AC1–AC10の実装evidence、public-safe artifact readback、ChatGPT connector discovery readback、各terminal path coverageを親へ集約後に判定する。

Parent Closure Rule

  • delivery-rollupとして、Child Workstreams 1–5が各自のindependent AC/VC/current-head reviewを満たしてclosedであり、統合live E2EがAC1–AC10を実証した場合のみcloseする。
  • 実装: ChatGPT GitHub connector retro E2E proof を live 環境で検証し resolve-live status を記録する #1415、scheduled workflow、hookの存在、producer/poster単体の存在、provider telemetryの可用性、Issue stateのみではcloseしない。
  • missing/partial/private-evidence-unavailableはcoverageとして記録し、required public-safe artifactまたはresolver semanticsが欠ける場合はcloseしない。

Safety Boundary

  • automatic: terminal eventの検知、public-safe artifact生成/更新、coverage/missing artifact記録、bounded reconciliation。
  • human-triggered: ChatGPT retrospective、follow-up candidateの採否、Claude Code/Codex CLIへのIssue materialization依頼。
  • prohibited: private transcript/prompt/tool I/O/credential/secret/absolute local pathのGitHub投稿、ChatGPT retrospectiveの無断自動実行、follow-up Issueの無条件自動起票。

Allowed Paths

  • 該当なし。このparent作成ではrepository tracked fileを変更しない。各childが最小Allowed Pathsを個別に定義する。

Stop Conditions

  • child実装でこのparentの固定されたGoal、Safety Boundary、Child Workstream Planを変更する必要がある場合。
  • public/private evidence boundaryを破る証跡公開、外部課金、権限昇格、破壊的Git操作が必要になった場合。
  • child間で同一Outcomeの重複またはAllowed Paths conflictがreadbackで解消できない場合。

Required Design References

Delivery Rule

  • このparent自身はno-code/no-PRである。childは1 Issue = 1 Draft PR、current-head review、body/verification evidence readbackを必須とする。
  • child materialization前に同一OutcomeのOPEN/CLOSED Issueをdedupeし、exact duplicate以外はこの親のworkstreamを再実装しない。
  • child起票はこの親のcontractを読んだClaude CodeまたはCodex CLIへの人間依頼で行う。

Notes for Reviewer

Source / dedupe key

  • source anchor: #5151883631(OWNER)
  • historical source anchor: #5150799075(multi-turnのためauthorityとしてsuperseded)
  • dedupe key: delivery-rollup:squne121/loop-protocol:repo-daily-retrospective-operation:v1

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    tracking
    state/in-progress
    on Aug 1, 2026
  2. squne121 commented on Aug 1, 2026

    @squne121
    OwnerAuthor

    人間はChatGPTに「今日のレトロスペクティブを実施して」と依頼する(特定のプロンプト「〇〇を使って」「◯◯を参照して」のような形を想定)。
    ClaudeCode、CodexCLIは全セッションでIssue、PRにまつわる作業履歴をGithub上に自動で残す(hookなどを使ってAIエージェントの利用上限を消費しない形が望ましい)。
    ChatGPTはGithub上の情報からレトロスペクティブを実施する。

  3. squne121 commented on Aug 1, 2026

    @squne121
    OwnerAuthor

    From: https://chatgpt.com/c/6a6e0d1d-b49c-83ee-9a4d-e0ebf3a8571d

    you asked

    message time: 2026-08-02 00:15:01

    #1939
    さんざん色々実装してきたけど、 https://github.com/entireio/cli をメインにレトロスペクティブした方が簡単なのでは?シークレットに関する制約が厳しすぎる。


    chatgpt response

    Issue #1939 の前提・関連実装・Entire CLI の実際の保存モデルを突き合わせ、置換可能範囲と秘密情報制約の過剰設計を切り分けます。結論だけでなく、Issue の再定義案まで出します。

    現時点で見える本質は、#1939 が「レトロスペクティブ」よりも、独自の完全性台帳・公開用証跡プロトコルを主目的化している点です。Entire はセッション捕捉・Git 紐付け・要約・別ブランチ保存を既に提供しますが、公開リポジトリへそのまま送る前提には危険が残ります。

    #1939 の Workstream 1・3・5 は、Entire の recap/checkpoint branch/session metadata と大きく競合しています。特に Workstream 5 の opaque resolver は、Entire を採用するなら独自実装せず「private checkpoint remote を読む薄い投影層」に縮退できます。

    結論

    #1939 は Entire-first に再設計した方がよいです。
    ただし、entire recap に全面委譲するのではなく、次の役割分担が妥当です。

    • Entire CLI:Claude Code/Codex CLI のセッション捕捉・Git commitとの対応・private GitHubへの保存・要約メタデータ生成
    • loop-protocol:日次対象の選択、Entireで捕捉できなかったセッションの欠落表示、ChatGPT向け固定entrypoint、follow-up Issue化
    • ChatGPT:Entireの要約メタデータとGitHub上のIssue/PR状態を統合してレトロスペクティブを実施

    #1939 の現在の5 workstreamは、実際の要求である「Claude/Codexが履歴をGitHubへ残し、人間が依頼したときChatGPTがレトロする」より明らかに大きくなっています。

    Entireで既に置換できる部分

    Entireの現在の実装には、既に以下があります。

    • agent sessionのhook capture
    • commitとcheckpointの対応
    • entire/checkpoints/v1 または別checkpoint repositoryへの保存
    • Claude Code/Codexなど複数agent対応
    • entire checkpoint list --json
    • entire checkpoint explain <id> --json
    • sessionごとの intent、outcome、learnings、friction、open_items
    • metadata読取失敗時の partial 表示とnon-zero終了

    特に checkpoint explain --json は、transcriptを読まずmetadataだけを出力し、内容もレトロスペクティブに必要な項目とほぼ一致しています。独自の agent_run_report/v1 と agent_retro_index/v1 を中心に据え続ける必然性はかなり薄くなっています。

    一方、loop-protocolには既にreport builder、retro index builder、context marker、複数validator、投稿処理、schema、テストが存在します。つまり、Entireが今では提供している機能を独自protocolとして並行維持している状態です。

    シークレット制約は実際に厳しすぎる

    現在のEntire安全性checkerは、概ね次を要求しています。

    • push_sessions=false
    • Entire telemetryが明示的にfalse
    • checkpoint remoteがprivateまたはlocal-only
    • visibility不明はblocked
    • public checkpoint branchが存在すればblocked

    さらに同じ安全性ロジックをJavaScriptとPythonで別実装し、「変更時は両方を更新」と明記しています。これは防御というより、二重実装されたpolicy engineです。

    特に push_sessions=false は、GitHub上の情報をChatGPTが読むという目的と正面から矛盾します。必要なのはpush禁止ではなく、

    push_sessions=true かつ push先がアクセス制御されたprivate checkpoint repository

    です。

    また、Entireのtelemetryはcommand名、agent、OS、フラグ名などの利用情報が対象で、transcriptやコードそのものを送るものではありません。telemetryの有効・無効はプライバシー上の選択ではありますが、checkpoint transcriptの秘密漏洩と同じfail-closed gateにする必要はありません。(Entire)

    推奨構成

    Claude Code / Codex CLI
            |
            v
    Entire hooks
            |
            +-- local raw/session state
            |
            v
    private GitHub checkpoint repository
      - Entire checkpoint refs
      - push_sessions: true
            |
            v
    薄い daily projector
      - entire checkpoint list --json
      - entire checkpoint explain <id> --json
      - GitHub Issue / PR activity
      - date / timezone filter
      - missing / partial の集計
            |
            v
    default branch上の固定daily index
            |
            v
    ChatGPT GitHub connector
      - 日次レトロスペクティブ
      - follow-up候補生成
    

    ChatGPTのGitHub接続は、ユーザーが許可したprivate repositoryも読み取り対象にできます。したがって「ChatGPTが読むものはすべてpublic repositoryへpublic-safe変換して投稿しなければならない」という前提自体を外せます。(OpenAI Help Center)

    publicなloop-protocol本体へ出すのは、必要な場合だけ次に限定します。

    • 採用した改善Issue
    • retrospectiveの最終結論
    • secret非含有の統計
    • private checkpoint IDへのopaque reference

    #1939のworkstream再編

    現在 Entire-first後
    WS1 daily workset schema 日付・timezone・checkpoint一覧を束ねる薄いprojectorとして縮小
    WS2 completion transaction Entireへ委譲。commitなし・異常終了の欠落検出だけ残す
    WS3 discovery entrypoint 維持。ただし固定JSONまたは短いMarkdown 1ファイルだけ
    WS4 follow-up handoff 維持
    WS5 opaque private resolver 廃止。checkpoint ID・commit trailer・private repoをそのままresolverにする

    実装単位も5 childではなく、次の3件で足ります。

    1. Entire導入とprivate checkpoint remoteの確立
    2. Entire metadataから日次indexを生成するprojector
    3. commitless/aborted sessionのcoverageとChatGPT handoff

    残すべき安全境界

    Entire-firstにしても、無制限に公開してよいわけではありません。Entire自身もsecret redactionをbest-effortと説明しており、public repositoryへcheckpoint履歴を送ることは推奨できません。shadow branchのコードsnapshotには、ソースへ直書きされたsecretが未redactで残る可能性もあります。

    ただし、fail-closedにする条件は以下だけで十分です。

    • checkpoint push先がpublicまたはvisibility不明
    • raw transcript/tool I/O/credentialをpublic repositoryへ投稿しようとした
    • public projectionがsecret scannerを通らない
    • Entire metadataが壊れている、または一部sessionを読めず partial になった

    反対に、以下は停止理由にしない方がよいです。

    • agent用secretがローカルに存在する
    • private repository用tokenが存在する
    • push_sessions=true
    • Entire telemetryが有効
    • private checkpoint branchが存在する
    • private evidenceの一部が取得不能
      → unavailable または partial としてレトロを続行する

    Entireだけでは不足する点

    全面置換できない理由は、Entireの永続checkpointが基本的にGit commitへ結び付くためです。commitを作らなかったIssue調査、途中終了、read-onlyレビューなどは、恒久的checkpointにならない可能性があります。Entireは一時sessionをhookで捕捉しますが、永続化はcommitとのlinkが中心です。(Entire)

    したがって残す独自機能は、詳細なcompletion transactionではなく、次の小さなtombstoneで十分です。

    session_coverage:
      agent: codex
      started_at: ...
      ended_at: ...
      issue_or_pr: "#1939"
      entire_checkpoint_id: null
      status: commitless | interrupted | capture_failed

    また、entire recap 自体はEntireの認証済みAPIから集計を取得するcloud機能です。日次レトロの唯一の正本にはせず、local/private Gitに保存された checkpoint list/explain --json を正本にする方が再現性があります。

    #1939に対する判定

    新Issueを増やさず、#1939をそのままEntire-firstへ大幅改稿するのが最善です。 まだchild Issueが未起票なので、今なら過去の独自実装を互換層へ降格させ、追加ハーネスを最小限に抑えられます。

    新しいgoalは、この程度で十分です。

    goal_ref: >
      Entire CLIをClaude Code/Codex CLI session evidenceのcanonical sourceとし、
      private GitHub checkpoint repositoryへ永続化する。
      Entire metadataとGitHub Issue/PR activityから日次indexを生成し、
      ChatGPT GitHub connectorが人間の依頼時にretrospectiveを実施できるようにする。
      Entireで恒久化されなかったcommitless・interrupt・capture failureだけを
      lightweight coverage recordで補完する。

    現在の設計は「秘密を守りながらレトロする仕組み」ではなく、かなりの部分で「秘密情報policyとartifact完全性を検証する独自基盤の開発」へ目的が転倒しています。Entireを正本にすれば、その大部分を撤去できます。


    Powered by AI Exporter

  4. squne121 commented on Aug 1, 2026

    @squne121
    OwnerAuthor

    総合判定

    REQUEST_CHANGES。Issue #1939 は、指定コメントの要求を過剰に抽象化した一方、最重要の配送保証を契約化できていません。

    指定コメントが求めている運用は、実質的には次の3点です。

    1. 人間が ChatGPT に「今日のレトロスペクティブ」を依頼する
    2. Claude Code / Codex CLI が、Issue・PR関連セッションの履歴をモデル追加呼び出しなしで GitHub に自動投稿する
    3. ChatGPT が GitHub 上の記録だけで振り返る

    実際のコメントもこの単純な運用境界を明示しています。

    しかし #1939 は、これを daily workset schema、completion transaction、repository discovery entrypoint、follow-up materialization、private audit resolver の5 workstreamへ膨張させています。
    この分割は実装量を大幅に増やす一方、「各セッション終了後に GitHub へ確実に1件のpublic-safe記録が残る」という中心的な成功条件を直接保証していません。


    Blocker

    1. 「全セッション」が契約上消失している

    指定コメントは Claude Code、Codex CLIの全セッション を対象にしています。

    一方、#1939 は対象を以下のように変質させています。

    • GitHub activityとagent sessionの対応
    • canonical daily workset
    • coverage denominator
    • missing / partial / unavailable / superseded
    • repository URL・日付・timezoneからのresolver

    これは「GitHubに投稿された記録を後から分類する契約」であり、そもそも全セッションがcapture対象として登録されたことを証明する契約ではありません。

    最低限必要なのは、daily worksetより前に次のセッション母集団契約です。

    agent_session_enrollment/v1:
      agent: claude_code | codex_cli
      session_id: opaque
      repository_identity: owner/repo | unavailable
      started_at: RFC3339
      ended_at: RFC3339 | null
      issue_pr_binding:
        status: resolved | ambiguous | absent
        targets: [...]
      capture_attempted: true
      publication_status:
        pending | posted | retrying | unavailable | abandoned

    これがなければ、投稿されなかったセッションはworksetに現れず、missingなのか、存在自体を知らないのか区別できません。

    必要な修正

    AC1より前に、以下を独立した最上位ACとして追加すべきです。

    Claude Code / Codex CLIの各開始セッションについて、モデル呼び出しを伴わないローカルproducerがsession enrollment recordを生成し、終了経路にかかわらずpublication状態を追跡する。終了artifactだけを母集団にしない。


    2. 現行Claude hookは指定コメントの「全セッション」を満たせない

    現在の .claude/settings.json は主経路として Stop と SubagentStop だけを session_manifest_coordinator.sh に接続しています。SessionEnd と StopFailure は設定されていません。

    Claude Code公式仕様では、次の違いがあります。

    • Stop は通常応答終了時
    • ユーザーinterruptでは Stop は発火しない
    • APIエラー時は Stop ではなく StopFailure
    • SessionEnd はセッション自体の終了時
    • StopFailure と SessionEnd はcommand hookを使用できる
    • SessionEnd は既定timeoutが短いため、重い処理ではなくローカルqueue投入程度に限定すべき

    (Claude)

    #1939本文はinterruptやStopFailureの不足を認識していますが、それを5 childの一部へ先送りしています。指定コメントの要求から見ると、これは周辺事項ではなく 最初に直すべき主機能 です。

    必要なClaude経路

    SessionStart
      -> enrollment record
    
    Stop
      -> normal turn completion snapshot
      -> enqueue publication
    
    StopFailure
      -> failed turn snapshot
      -> enqueue publication
    
    SessionEnd
      -> terminal session record
      -> enqueue publication
      -> local cleanup
    
    SubagentStop
      -> optional child record
      -> parent sessionへ集約
    

    Stop を「session completion」と呼ぶ設計は不正確です。Claude公式上、Stop はターン終了です。(Claude)


    3. 現行coordinatorは失敗を成功として返す

    session_manifest_coordinator.sh は、guard失敗時にも以下の挙動です。

    • reason_code: "guard_failed" を出力
    • プロセス自体は exit 0

    またproducer失敗時も最終的に status:"ok"、reason_code:null を出し、exit 0 します。

    これは advisory hook として停止を妨げないための設計だとしても、artifact publication completenessの証拠には使用できません。

    特にproducer失敗が最終resultへ反映されないのは明確なfalse-greenです。

    現行コードでは概ね次の状態が成立します。

    producer failed
    ↓
    producer_exit != 0
    ↓
    summary stderrにはwarn
    ↓
    final JSON status=ok, reason_code=null
    ↓
    exit 0
    

    この状態で後段が最終JSONだけを見ると、「manifest生成成功」と誤認します。

    必要な修正

    hook自体は exit 0 のままで構いませんが、machine-readable verdictは少なくとも次にすべきです。

    {
      "status": "partial",
      "completion_verdict": "publication_pending",
      "steps": {
        "guard": "pass",
        "producer": "failed",
        "enqueue": "not_attempted"
      },
      "reason_codes": [
        "producer_failed"
      ],
      "retry_required": true
    }

    hookのexit codeと、completion artifactの成功判定を分離してください。


    4. GitHubへの自動投稿経路が中心ACになっていない

    指定コメントは「作業履歴をGitHub上に自動で残す」と明記しています。

    ところが現在確認できるcoordinatorは、ローカルmanifest生成・debounce・guard・scope captureを行うだけで、GitHubへの投稿処理を実行していません。

    #1939は将来のWorkstream 2として投稿transactionを予定していますが、親Issueの主軸はdaily worksetになっています。優先順位が逆です。

    まず成立させるべき最小E2Eは次です。

    agent terminal event
      -> local public-safe JSON生成
      -> durable outboxへatomic write
      -> non-LLM posterがGitHubへupsert
      -> GitHub readback
      -> local outboxをack済みに更新
    

    GitHub issue comment作成は通知を発生させ、短時間で大量作成するとsecondary rate limit対象になり得ます。GitHubはrate-limit時にretry-afterやreset時刻を尊重し、指数的backoffを使うよう求めています。([GitHub Docs]2)

    したがって、各hookから直接同期POSTするのではなく、次の構成が必要です。

    • hook: ローカルoutboxへ書くだけ
    • poster: flock付きsingle consumer
    • exact markerによるupsert
    • exponential backoff + jitter
    • Retry-After 尊重
    • GitHub readback後にack
    • 最大試行後もrecordを消さない
    • content generation burstを抑制

    5. 「モデル利用上限を消費しない」が検証可能なACになっていない

    指定コメントでは、hook等を使い AIエージェントの利用上限を消費しない形が望ましい とされています。

    #1939には、これを実証するACがありません。

    単にcommand hookであるだけでは不足します。そのcommandの内部から次を呼べばモデル利用は発生します。

    • claude
    • codex exec
    • agent SDK
    • prompt hook
    • model-backed summarizer
    • MCP経由のLLM処理

    必要なAC

    non_llm_completion_path:
      required: true
      prohibited_processes:
        - claude
        - codex
        - openai_api
        - anthropic_api
        - prompt_hook
        - agent_hook
      allowed:
        - local parsing
        - deterministic redaction
        - schema validation
        - git metadata read
        - GitHub REST posting

    検証ではfixtureだけでなく、subprocess spyまたはPATH shimによって禁止実行物が起動されないことを確認すべきです。


    High

    6. daily workset resolverは初期deliveryとして過剰

    repository URL、calendar date、timezone、half-open interval、pagination、freshness、digest、supersession、coverage denominatorを一度に実装するのは、個人開発リポジトリの初期運用として過剰です。

    ChatGPT GitHub connectorが取得可能な正本を、日単位の固定Issueまたは固定markerへ集約すれば、最初の運用は成立します。

    例えば以下で十分です。

    Issue/PR上の per-session marker
            ↓
    repository daily index comment
            ↓
    ChatGPTが対象日indexを読む
    

    初期版で必要な日付処理は次だけです。

    timezone: Asia/Tokyo
    interval:
      start: 2026-08-01T00:00:00+09:00
      end_exclusive: 2026-08-02T00:00:00+09:00

    repository URL canonicalization、複雑なactivity/session照合、workset digestは、実運用で曖昧性が確認されてから追加すべきです。


    7. repository discovery entrypointは専用childを作るほどの機能ではない

    Workstream 3は、default branch上の単一entrypointとfail-closed discoveryを独立childにしています。

    しかし既に以下の資産があります。

    • docs/dev/agent-run-report.md

    • docs/dev/agent-retro-index.md

    • run report validator

    • ChatGPT retrospective context marker helper

    • marker tests

    新しい「repository-level discovery subsystem」を作るより、既存 agent-retro-index.md に次の固定節を追加するだけで足ります。

    chatgpt_daily_retrospective_entrypoint:
      schema: agent_retro_index/v1
      canonical_marker: CHATGPT_RETRO_CONTEXT_V1
      lookup:
        - repository issue search
        - exact marker
        - target calendar date
      fail_closed_when:
        - marker_missing
        - schema_invalid
        - digest_mismatch

    独立Issue・独立PRにする合理性は弱いです。


    8. opaque public evidence/private resolverは今回の要求外に近い

    指定コメントは、ChatGPTがGitHub上の情報からretrospectiveを行うことを求めています。

    private evidence resolverを追加すると、次の問題が増えます。

    • ローカル保持期間
    • session IDとopaque IDの対応表
    • ローカルpathの漏えい
    • machine間移行
    • stale reference
    • resolver implementationの保守
    • ChatGPTから解決できない証拠を正本に混ぜる危険

    #1153は既にprivate observation planeとpublic retrospective planeを分離し、ChatGPTはGitHubのみを見る方針です。

    したがって今回必要なのはprivate resolverではなく、public artifact自体に判断可能な情報を十分含めることです。

    public artifact:
      outcome
      target_issue_pr
      changed_paths
      commands_summary
      test_verdicts
      failure_reason_codes
      unresolved_items
      retry_count
      artifact_digest

    private referenceはoptional metadataに留めるべきです。


    9. Codex hooksを既成事実として扱っている

    現行 .codex/hooks.json は SessionEnd と SubagentStop を設定しています。

    しかし #1939 はこのhook surfaceの安定性、Codex CLIのversion、実際の発火確認、timeout後の挙動を具体的な前提条件にしていません。

    特に3秒timeoutは、次を同期実施するには短すぎます。

    • public-safe artifact生成
    • validation
    • GitHub API投稿
    • readback
    • retry

    したがってCodex側も、hookではoutbox enqueueだけを行う必要があります。

    また、今回確認できた範囲では、Claude Codeについては公式hook lifecycleを確認できましたが、Codex CLIのこの .codex/hooks.json 契約について同等の公開公式仕様を確認できませんでした。したがって #1939 はCodex hook capabilityを supported と暗黙に扱わず、少なくとも以下を要求すべきです。

    codex_hook_capability:
      status: unverified | supported | partial | unsupported
      cli_version: required
      config_source: required
      session_end_observed: required
      subagent_stop_observed: required
      interrupt_observed: required
      timeout_behavior_observed: required
      negative_control: required

    10. GitHub commentをセッションごとに増殖させる設計は避けるべき

    GitHubのcomment作成は通知を発生させ、短時間でのcontent creationはsecondary rate limit対象です。

    「全セッションで自動投稿」を素直に1セッション1新規コメントで実装すると、subagentやretryの多いrunでコメントが大量発生します。

    推奨は次の二層です。

    • Issue/PRごとにexact-marker upsertするsession index
    • immutableな詳細artifactは必要な場合だけ別コメントまたはartifact file

    例:

    <!-- AGENT_SESSION_INDEX_V1 target=issue-1939 date=2026-08-02 -->
    
    {
      "sessions": [
        {
          "session_key": "sha256:...",
          "agent": "claude_code",
          "status": "completed",
          "report_digest": "sha256:..."
        }
      ]
    }

    更新競合に備え、read-modify-write時のdigest比較またはoptimistic concurrencyも必要です。


    Medium

    11. Verification Commandsが存在確認に偏りすぎている

    #1939のVerification Commandsは、多くが単なるtest -fです。

    ファイルが存在しても、次は一切証明されません。

    • hookが発火した
    • interruptを捕捉した
    • artifactがGitHubに投稿された
    • duplicateが発生しなかった
    • retry後にreadbackできた
    • secretが漏れなかった
    • ChatGPT connectorが発見できた
    • モデル利用が発生しなかった

    親Issueでもbaseline検証は、少なくともcontract checkerにすべきです。

    pnpm exec vitest run tests/repo-daily-retrospective-contract.test.ts
    node scripts/check-repo-daily-retrospective-parent-contract.mjs \
      --issue-body-file "$BODY"

    統合E2Eはchild完了後でもよいですが、親のACとVCの対応関係は今の時点で固定する必要があります。


    12. child 1 Issue = 1 PRの固定は不自然

    Workstream 1〜5をそれぞれ1 Issue = 1 PRに固定すると、設計変更だけのIssueや、同じproducer/posterを触るWorkstream 2・5で変更競合が生じます。

    rollback単位は「概念」ではなく、実際のコード境界で決めるべきです。

    現実的な分割は3件です。

    1. session capture and durable outbox
    2. GitHub poster and daily index
    3. ChatGPT retrospective contract and live E2E

    follow-up Issue materializationは既存契約を再利用し、今回のdeliveryから外してよいです。private resolverも別要求が発生するまで不要です。


    推奨するIssue再構成

    タイトル

    導入: Claude Code / Codex CLIのIssue・PR作業セッションをpublic-safeにGitHubへ記録し、ChatGPT日次retrospectiveを成立させる

    Goal

    goal_ref: >
      Claude CodeおよびCodex CLIの各Issue・PR関連セッションについて、
      モデル追加呼び出しを行わないローカルhook/producerがpublic-safeな
      completion recordをdurable outboxへ生成し、非同期posterがGitHubへ
      idempotentに投稿する。人間がChatGPTへ日次retrospectiveを依頼した際、
      ChatGPT GitHub connectorだけで対象日の記録を発見・評価できる。

    Child構成

    Child A: capture / outbox

    • Claude SessionStart、Stop、StopFailure、SessionEnd
    • Codex capability runtime verification
    • durable local outbox
    • AI/LLM subprocess禁止
    • secret-safe projection
    • crash-safe atomic write

    Child B: GitHub poster / index

    • exact-marker upsert
    • rate-limit対応
    • retry/backoff
    • duplicate prevention
    • GitHub readback
    • daily index生成
    • failed posting reconciliation

    Child C: ChatGPT retrospective E2E

    • repository固定entrypoint
    • JST half-open interval
    • Issue/PR両方のlive proof
    • missing/partialの表示
    • prompt injection境界
    • human-triggered execution
    • follow-upは草案生成まで

    必須Acceptance Criteria案

    - [ ] AC1: Claude CodeのSessionStartごとにsession enrollment recordが生成される。
    - [ ] AC2: Claude CodeのStop、StopFailure、SessionEndを区別して記録する。
    - [ ] AC3: user interruptまたは異常終了で通常completionを偽装しない。
    - [ ] AC4: Codex CLI hook capabilityを実binary/version/runtime evidenceで判定する。
    - [ ] AC5: hook経路からLLM、Claude、Codex、OpenAI API、Anthropic APIを呼ばない。
    - [ ] AC6: artifactはatomicにdurable outboxへ保存され、process crash後も残る。
    - [ ] AC7: producer/validator/poster失敗をstatus=okとして出力しない。
    - [ ] AC8: posterはexact markerとsession keyでidempotent upsertする。
    - [ ] AC9: 403/429、Retry-After、network timeoutへbounded exponential backoffする。
    - [ ] AC10: GitHub readback成功前にlocal recordをack済みにしない。
    - [ ] AC11: raw transcript、prompt、tool I/O、credential、absolute pathを投稿しない。
    - [ ] AC12: Issue/PRに紐づかないsessionもunboundとして母集団へ残す。
    - [ ] AC13: Asia/Tokyoの対象日をhalf-open intervalでdaily indexへ集約する。
    - [ ] AC14: ChatGPT GitHub connectorだけでdaily indexと各reportを取得できる。
    - [ ] AC15: missing、partial、posting_failedをretrospectiveの分母から除外しない。
    - [ ] AC16: Issue operationとPR operationのlive E2Eを各1件実証する。

    最終結論

    #1939の方向性自体、つまり「privateな生ログをGitHubへ出さず、public-safe artifactだけをChatGPTに読ませる」は妥当です。既存のrun report、retro index、context markerを再利用する判断も適切です。

    ただし現状は、単純な運用要求に対して5つの抽象workstreamを新設しながら、全セッションcapture、異常終了、durable outbox、非LLM保証、GitHub posting/readbackという本当のblockerが薄い状態です。

    推奨判定は以下です。

    review_verdict: REQUEST_CHANGES
    
    blockers:
      - all-session enrollment contract missing
      - Claude Stop-only path cannot cover interrupt/API failure/session termination
      - current coordinator can report false-green on producer failure
      - durable GitHub publication path is not the primary delivery contract
      - non-LLM/no-agent-quota requirement is not verifiable
    
    scope_reduction:
      remove_or_defer:
        - generalized repository URL canonicalization
        - dedicated discovery subsystem
        - follow-up materialization workstream
        - private evidence resolver
        - five-child mandatory decomposition
    
    recommended_children:
      - session capture and durable outbox
      - GitHub poster and daily index
      - ChatGPT connector-only live E2E

    このままchild materializationへ進めるべきではありません。まず #1939 本文を、指定コメントの3段階運用へ再収束させる必要があります。

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

    state/in-progresstracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions