Skip to content

実装: #1939 Workstream 5 — opaque public evidence/private local audit resolver を追加する #2376

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1939"
goal_ref: "#1939 Workstream 5: agent-retrospective の既存 public evidence_ref/run_identity/publication を再利用し、opaque public evidence から private local audit evidence へ解決する resolver を、fail-closed な availability/failure semantics 付きで追加する"
change_kind: mixed

Parent Issue

#1939

Workstream

5(opaque public evidence → private local audit resolver)

Parent Goal Ref

  • Goal: repository URL・日付・timezoneから日次agent worksetとpublic-safe artifact coverageを決定論的に導出し、ChatGPT GitHub connectorで発見できる人間起動型daily retrospective運用を確立する。
  • Desired Destination: #1939のopaque public evidence→private local audit resolverと、#1153のpublic retrospective planeを守る人間起動critique handoff。

Current Validated Scope

Remaining Parent Gaps

Background

trusted anchor comment(OWNER、https://github.com/squne121/loop-protocol/issues/2376#issuecomment-5546808866)の判定は NO-GO_AS_IS / REFRAME_AND_DEFER であり、旧 body が提案していた新規第二 public dialect(RETRO_CRITIQUE_CONTEXT_V1)と claim_class: supported | refuted | indeterminate の再定義は、以下の理由で採用しない:

  1. 既存 retrospective publication(agent_retrospective_run_publication/v1)が既に run_identity/source_observations/candidate_records/delta_results/publication_digest を公開済みであり、summary/finding/coverage の複製artifactは不要。
  2. claim_class は既存 agent_improvement_candidate/v1 schema(ADR 0007 Decision 2)で code_content / code_authorship_timing / internal_loop_review_verdict / github_native_review_state / review_comment / mergeability / issue_intent / external_fact / runtime_behavior の9値 canonical taxonomy として既に使われており、同名フィールドを別の3値 enum として再定義すると意味衝突する。
  3. github_connector_only: true / local_file_access_used: false は generation 時点で検証不能な将来行動への自己申告attestationであり、machine contract として強制できない。

semantic design review(issue-design-reviewer、2回の独立実行で再現確認済み)も同じ3点を blocker として報告した。本 Issue はこれらの reframe を反映し、WS5 の責務を「既存 public evidence_ref を private local audit evidence へ解決する resolver」に絞り込んだ。

Contract repair(2回目、OWNER、https://github.com/squne121/loop-protocol/issues/2376#issuecomment-5551373964、判定: REQUEST_CHANGES / GO_AFTER_CONTRACT_REPAIR): 縮小方向自体は妥当だが、以下の構造的欠陥があるため実装着手前に契約修正が必要と指摘された。

  1. resolver の producer が存在しない: public evidence_ref だけでは private evidence の所在地を逆算できず、run_retrospective.py に generation-time の sidecar registration hook がないと resolver は常に unavailable しか返せない。
  2. Stop Condition が In Scope の core functionality(resolver自身のlocal-only storage read/write)を無条件に禁止していた。
  3. AC2 の determinism が自己矛盾していた(time-varying な private_status_at_generation を preimageに含めつつ同一入力→同一digestを要求)。
  4. run_identity の記述が current wire contract(run_id/base_sha/source_set_digest/generated_at/runtime_version、publication_digestは別のtop-level field)と不一致だった。
  5. 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 の2〜3回運用評価を implementation-entry hard gate にする根拠が弱い。
  6. expiry semantics が未仕様化だった。
  7. AC7 が #2239 と重複する generic security harness を再導入しかねなかった。
  8. v1 の distribution boundary(project Skill only、plugin mirror / Latitude raw resolver の Out of Scope)が明記されていなかった。

本Issueはこの2回目の anchor comment の指摘をすべて反映した状態である。加えて、#2489 は当時 OPEN/Draft/unmergedだったが、その後 **CLOSED / MERGED(2026-09-05T04:09:53Z)**に変わったため、hard predecessor blockerは解消済みとして記述した。

Outcome

agent-retrospective が既存 public evidence_ref(agent_improvement_candidate_v1 schema)と run_identity(run_id/base_sha/source_set_digest)に deterministic に bind した private local audit evidence を、fail-closed な availability/retention/failure semantics 付きで local-only storage に解決・保存し、human-triggered disclosure boundary の外側では一切自動送信・自動mutationを行わない状態。resolver 自身の local-only storage read/write は core functionality として明示的に許可され、resolver が実際に解決可能な private evidence を generation 時点の producer hook が sidecar として登録している。

In Scope

  • 既存 typed evidence_ref(ref_type/source_id/resource_identity/projection_digest)を入力として受け取り、private local audit evidence を解決する resolver を追加する。
  • .claude/skills/agent-retrospective/scripts/run_retrospective.py に、public evidence_ref を生成/bind する generation-time に限り、local private source が既に存在する evidence についてだけ local sidecar mapping を1回登録する producer hook(例: register_private_audit_ref(...) 相当の小さい呼び出し)を追加する。大規模な framework は追加しない。
  • 既存 publication run_identity(run_id/base_sha/source_set_digest)を参照し、resolver の stable identity(resolution_key)にbindする(新規 parallel identity block は作らない)。publication_digest は run_identity の内部fieldとして扱わず、別のoptional verification/bindingとして分離してよい。
  • resolver の identity contract を次の2層に分離する。
    • resolution_key: run_identity(run_id/base_sha/source_set_digest)と typed evidence_ref(ref_type/source_id/resource_identity/projection_digest)のみから決定論的に導出される stable identity。同一入力から常に同一値。
    • manifest_digest: generation snapshot(private_status_at_generation、reason_code、object_key、object_digest、expires_at 等)をbindするgeneration時点固有のdigest。access時の source disappeared / permission changed / digest mismatch / expired 等の判定は resolution_key も manifest_digest も書き換えない。
  • generation時点の private availability(private_status_at_generation: available | unavailable)と bounded reason code を持つ小さい index/manifest schema を追加する(anchor comment の RETRO_PRIVATE_AUDIT_INDEX_V1 は設計候補例であり、名前・shapeのコピーは不要。既存contractを再利用したより小さいshapeが成立するなら優先する)。
  • expires_at: RFC3339 UTC | null の bounded field を manifest schema に追加する。null は resolver独自のexpiryなしを意味し、expiry判定はaccess時のみlocal resolverがlazy評価する。background daemon / cleanup serviceは追加しない。
  • local-only storage への atomic write(tempfile.mkstemp() → write → os.replace())と restrictive permission(0600)を実装する。private manifestにはabsolute local pathを保存せず、configured audit rootからのopaque relative object_keyで表現する。1 resolution_key = 1 manifest fileのownership modelを優先する。
  • missing / malformed / digest mismatch / permission mismatch / expiry を unavailable(fail-closed)へ分類し、supported claimを作らず safety scan を bypass しない failure semantics を実装する。
  • 既存 repository canonical JSON実装(sort_keys=True, separators=(",", ":") 系)を再利用し、新しい canonicalization infrastructure を追加しない。
  • 既存 RFC3339/date-time format checker(.claude/skills/agent-retrospective/scripts/validate_retrospective_schema.py 系)を再利用し、新しいvalidation frameworkを追加しない。
  • resolver 自身による local-only storage への read/write は core functionality として明示的に許可する(Stop Conditions 参照)。
  • v1 は project Skill only とする(Allowed Paths / Out of Scope 参照)。
  • public/private boundary と human-triggered deep audit boundary を維持する focused deterministic tests を追加する。

Out of Scope

  • 新しい第二 public dialect としての RETRO_CRITIQUE_CONTEXT_V1(既存 retrospective publication が既に run_identity/source_observations/candidate_records/delta_results/publication_digest を公開済みのため不要)。
  • claim_class: supported | refuted | indeterminate という再定義(既存 canonical claim_class taxonomyは変更しない。この判定軸が本当に必要でも別名フィールドとして検討し、resolver自体に不要なら追加しない)。
  • github_connector_only: true / local_file_access_used: false などの generation-time に検証不能な自己申告attestationフィールド。
  • WS3(repository discovery)責務、WS4(follow-up Issue materialization)責務。
  • ChatGPT critique Questions自体をschema-level machine contractにすること(ChatGPT向け質問セットはrunbook/documentation記述として残してよいが、WS5 implementation contractへ結合しない)。
  • 既存 検証: agent-retrospective のsecurity boundary・evaluation・dual-runtime smokeを統合検証する #2239 / publisher safety gate(collector scrub + publisher rejection の独立oracle設計)と重複する generic scanner/harnessの新規追加。AC7 の fail-closed 境界は closed schema(additionalProperties: false、bounded enum、typed fields、free-form instruction fieldを持たせない)と既存 public-safety validator の再利用で構成し、untrusted instruction の semantic detection(意味解析・prompt-injection scanner)を新規実装しない。
  • v1 distribution boundary: project Skill only。plugins/agent-retrospective/... mirror、portable plugin implementation、Latitude raw trace cacheの新規保存、Latitude serviceの再問い合わせ、「opaque Latitude refから過去raw traceを必ず復元できる」という保証は本Issueのscope外とする。v1のgeneric resolverは、generation時にlocal private sourceが既に存在するevidenceのみ登録可能であれば十分であり、Latitude evidenceがnot_materialized/unsupported_refになることは正常系として許可する。portable deep-audit resolverが実際に必要になった場合は別Issueとする。
  • WAL、transaction journal、lock service、background cleanup daemon、bespoke integrity database、新しい canonical JSON infrastructure、新しい generic security scanner、新しい provider-specific cache frameworkの追加。
  • ChatGPT API、browser automation、MCP経由local-file access、automatic upload、background polling、scheduled critique。
  • ChatGPTによる自動Issue/PR/repository/comment mutation、candidate自動採否、raw evidence自動送信。
  • 導入: EntireCLI + Latitude の観測データを agent_run_report に接続し、GitHub 経由の ChatGPT レトロ動線を確立する #1153、導入: repo URL起点の日次retrospective worksetとagent completion artifact投稿を確立する #1939、実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375、実装: #1939 Workstream 2 — completion transaction and reconciliation(stop reason taxonomy / runtime lane識別) #2489 の body/status/closure rule、既存 agent_improvement_candidate/v1 schema のキー集合・claim_class enum、既存 PUBLISH_REQUEST_V1/publication envelope field 集合の変更。
  • raw transcript、full prompt、tool I/O、credential、token、secret、absolute local pathをpublic artifact、index/manifest、fixture、log、GitHubへ保存すること。

Dependency / Implementation-Entry Gates

Acceptance Criteria

  • AC1: resolverは既存 typed evidence_ref(ref_type/source_id/resource_identity/projection_digest)を入力として受け取り、対応する private local audit evidence を決定論的に解決する。
  • AC2: resolver の identity は resolution_key と manifest_digest の2層に分離する。resolution_key = sha256(canonical-json({run_identity: {run_id, base_sha, source_set_digest}, evidence_ref: {ref_type, source_id, resource_identity, projection_digest}})) は同一 evidence_ref + 同一 run_identity から常に同一値を生成する stable identity であり、private_status_at_generation / reason_code / object_key / object_digest / expires_at 等の time-varying なgeneration snapshot fieldをpreimageに含めない。これらのgeneration snapshot fieldは別途 manifest_digest = sha256(canonical-json(generation_snapshot)) にbindする。access時の source disappeared / permission changed / digest mismatch / expired 等の判定は effective_status として lazy に評価し、resolution_key も manifest_digest も書き換えない。
  • AC3: private evidence が missing / malformed / digest mismatch / permission mismatch / expired のいずれかである場合、resolverは unavailable(fail-closed)を返し、supported claimを作らずsafety scanをbypassしない。この2値(available | unavailable)への畳み込みは、missing/malformed/digest mismatch/permission mismatch/expiryをすべてfail-closedなunavailableとして扱う意図的な設計簡略化であり、sibling contract latitude_runtime_evidence/v1(.claude/skills/agent-retrospective/references/wire-contract.md、available | unavailable | errorの3値モデル)を3値へ変更する必要はない。
  • AC4: local storageへの書き込みはatomic write(tempfile.mkstemp() → write → os.replace())と0600 permissionを満たし、GitHub/public artifact/log/fixtureにprivate contentまたはlocal pathを出さない。private manifestはabsolute local pathを保存せず、configured audit rootからのopaque relative object_keyで表現する。resolver自身によるこのlocal storage read/writeはcore functionalityとして許可される(Stop Conditions参照)。
  • AC5: private_status_at_generation: available | unavailable と bounded reason codeはgeneration時点で固定され、expires_at: RFC3339 UTC | null フィールドを持つ。nullはresolver独自のexpiryなしを意味し、expiry判定はaccess時のlocal resolverによるlazy評価のみで行い、background daemon/cleanup serviceを追加しない。
  • AC6: 新規 index/manifest schemaは既存 canonical JSON実装(sort_keys=True, separators=(",", ":"))と既存RFC3339/date-time format checkerを再利用し、新しいcanonicalization/validation infrastructureを追加しない。
  • AC7: index/manifestまたはtest fixtureはclosed schema(additionalProperties: false、bounded enum、typed fields、free-form instruction fieldを持たない)で構成し、raw transcript、prompt、tool I/O、stdout/stderr、credential、token、secret、absolute local pathの混入を既存 public-safety validator(#2239系)の再利用によってvalidator/testがfail closedすることを確認する。untrusted instructionのsemantic detection(意味解析・prompt-injection scanner)は新規実装しない。
  • AC8: resolverの出力は常にavailable | unavailableの2値に収まり、それ以外の第三のstatusを一切emitしないことをtestが確認する。public evidence_ref単体ではclaim真偽を立証できないため、ChatGPTなどのGitHub-only readerが既存publicなevidence_ref/publication artifactのみから独自にclaim真偽を判定する手段は提供しない。

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py -k test_resolve_from_evidence_ref
# AC2
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py -k test_resolution_key_manifest_digest_separation
# AC3
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py -k test_fail_closed_unavailable
# AC4
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py -k test_atomic_write_permission
# AC5
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py -k test_lazy_expiry
# AC6
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py -k test_canonical_json_reuse
# AC7
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_public_safe_evidence_refs.py
# AC8
$ uv run --locked pytest .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py -k test_public_evidence_ref_cannot_substantiate_claim_truth

Runtime Verification Applicability

  • decision: deferred
  • reason: private local evidence resolution と human-triggered disclosure は external account boundaryを含み自動化しない。PRではdeterministic resolver/local-storage testを実行し、実際のChatGPT critique handoffは人間が行う。#2375の実運用usability observationも本PRの必須条件ではなくdeferredな観察事項として扱う。
  • deferred_destination: human-triggered ChatGPT critique run、および#2375のusability observation(WS5実装後、2〜3回運用しての所感記録)。
  • deferred_verification_condition: connector-only readback、public artifact safety/coverage readback、private evidence非公開、proposal-only critique記録。

Allowed Paths

Proposed Allowed Paths

  • .claude/skills/agent-retrospective/SKILL.md
  • .claude/skills/agent-retrospective/schemas/retro_private_audit_index_v1.schema.json
  • .claude/skills/agent-retrospective/schemas/fixtures/retro_private_audit_index_v1.*.json
  • .claude/skills/agent-retrospective/scripts/private_audit_resolver.py
  • .claude/skills/agent-retrospective/scripts/run_retrospective.py
  • .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py
  • .claude/skills/agent-retrospective/scripts/tests/test_public_safe_evidence_refs.py

v1はproject Skillのみを対象とし、plugins/agent-retrospective/... への mirror は Allowed Paths に含めない。

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合。
  • 既存 agent_improvement_candidate/v1 schema のキー集合・claim_class enumの変更が必要になった場合。
  • 既存 PUBLISH_REQUEST_V1/publication envelope field集合の変更が必要になった場合。
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
  • 後続 Phase / 別スコープへの波及が判明した場合。
  • nested SubAgent delegation が必要になった場合。
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
  • ChatGPT API、browser automation、MCP経由local-file access、automatic upload、background polling、scheduled critique、または ChatGPT/remote process から private local file へ直接 bridge する必要が生じた場合(resolver自身のlocal-only storage read/writeはcore functionalityとして許可され、この停止条件の対象ではない)。
  • raw/private evidence、credential、secret、absolute local pathをpublic artifact、GitHub、fixture、logへ出す必要が生じた場合。
  • plugins/agent-retrospective/ mirror、portable deep-audit resolver、Latitude raw trace cacheの新規保存が必要と判明した場合。

Required Skills

  • Python CLI development
  • JSON Schema validation
  • public-safe evidence design

Required Design References

Scope Delta(任意)

N/A

Delivery Rule

Notes for Reviewer

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    state/blocked
    area/ai-ops
    on Aug 28, 2026
  2. squne121 commented on Sep 4, 2026

    @squne121
    OwnerAuthor

    結論

    No-Go as-is。実装前に Issue #2376 を reframe するのを推奨します。

    狙い自体――「公開証跡だけをChatGPTに読ませつつ、必要なら人間がprivate evidenceを深掘りできる」――は有用です。しかし現在の #2376 は、#1939 が分離した Workstream 3(ChatGPT discovery)・4(follow-up handoff)・5(private audit resolver)を再び1 Issueへ混ぜているうえ、新しい RETRO_CRITIQUE_CONTEXT_V1 が既存 retrospective publication より情報量を落としてしまっています。結果として、かなりの schema / scanner / bundle test を追加するのに、肝心の Required Question 1 をChatGPTが答えられません。

    優先度 | 指摘 | 判定 -- | -- | -- P0 | #1939 の Workstream 5 は Workstream 2 に依存するのに、#2376 は #2374→#2375 だけを dependency としている。WS2 の #2489 / PR #2496 は現在も open Draft・未merge。 | 開始条件が stale P0 | finding_refs[].claim_class を supported/refuted/indeterminate に再定義しているが、現行 canonical claim_class は runtime_behavior 等9値の「主張種別」。 | 既存contractと意味衝突 P0 | ChatGPTに渡るのは summary + opaque evidence ref + coverage だけで、local bundle は読ませない。digest/opaque ref は証拠の同一性を示せても、claimの真偽を示せない。 | Required Q1が成立しない P1 | 既存 persisted retrospective run は既に run_identity、source_observations、candidate_records、delta_results、publication_digest を公開している。新しい critique artifact はかなり重複する。 | 不要な第2 public dialect P1 | AC2 の「同一input→同一public projection」と created_at、時間で変わる local_bundle.availability=expired が衝突。 | determinism未定義 P1 | github_connector_only: true / local_file_access_used: false は生成側が証明できるartifact propertyではなく、将来のChatGPT実行方法についての要求。 | false attestation P1 | public-safe scanner / negative harness をもう1セット作ろうとしているが、既存 evidence_ref と #2239 に既にpublic/private境界・redaction gateがある。 | harness過剰 P1 | 元の設計判断は「#2375を実運用で2〜3回評価してからIssue B」だったが、確認できたのは主として collector/live CLI の機能実証。 | 有用性gate未達

    1. 最優先は dependency と workstream 境界です

    現在の親 #1939 は、WS3=repository discovery、WS4=follow-up materialization、WS5=opaque evidence→private audit resolver を明示的に別物として扱い、さらに WS5 は WS2 に依存するとしています。Child Issues欄でも WS2=#2489、WS5=未起票のままです。

    その #2489 は completion transaction / reconciliation を担い、現在の PR #2496 は open・Draft・unmerged です。

    ところが #2376 は ChatGPT Workflow で repository readback(WS3)と accepted follow-up handoff(WS4)まで自分の契約に取り込んでいます。これは親Issueでせっかく分割した責務を再結合しています。

    推奨は #2376 を WS5 専用へ縮小することです。 WS2がmergeした後なら、WS1/3/4を待たず private resolver 自体を独立実装できます。

    2. claim_class は P0 の実装衝突です

    現行 agent_improvement_candidate/v1 の claim_class は、

    code_content / code_authorship_timing / internal_loop_review_verdict / github_native_review_state / review_comment / mergeability / issue_intent / external_fact / runtime_behavior

    という9値の canonical taxonomy です。Evaluatorもこの意味で出力しています。

    #2376 は同じ名前を supported | refuted | indeterminate に変えています。

    ここは、

    • 入力側: canonical claim_class: runtime_behavior 等をそのまま保持

    • critique出力側: support_verdict: supported | refuted | indeterminate

    と分離すべきです。

    既存 finding にはすでに evaluation_status、source_coverage、observed、presence_delta 等の独立軸もあり、indeterminate の表現も存在します。新しい意味を claim_class に押し込む必要はありません。

    3. 現状のartifactではChatGPTは evidence を評価できません

    ここが機能上最大の問題です。

    現在の evidence_ref は ref_type / source_id / resource_identity / projection_digest を持つtyped referenceです。Latitude evidenceも runtime_receipt/runtime として既存shapeへ結合されています。

    一方 #2376 はこれを単なる opaque non-secret reference に落とします。そしてprivate bundleはChatGPTに読ませません。

    OpenAIの現行GitHub Appも、許可されたGitHub repository contentを検索・読み取りする仕組みで、GitHubへの書き込みはせず、当然ローカルWSL上のprivate bundleをGitHub connector経由で取得するものではありません。 (OpenAI Help Center)

    したがって、たとえば

    finding A → runtime_receipt → sha256:abc...

    だけをChatGPTが見ても、「Aはsupportedか?」を独立判定できません。hashは完全性証明であって内容証明ではないためです。

    ここは Required Question 1 を二段階に変えるべきです。

    GitHub connector-only critique では「このfindingにどのsourceの証拠がbindされ、公開情報だけで再検証可能か」を判定する。証拠がopaque privateなら indeterminate: opaque_evidence_unresolvable が正常結果です。

    より深いcritiqueが必要な場合だけ、人間が選択したsafe projectionを別途提示する。自動bundle uploadは不要です。

    4. 新しい public artifact 自体をかなり疑います

    current main の retrospective publication は、すでに Issue comment として、

    run_identity、source_observations、candidate_records、delta_results、publication_digest

    をcarryしています。

    さらに repository側には PUBLISH_REQUEST_V1 の永続化経路や CHATGPT_RETRO_CONTEXT_V1 marker/upsertも既にあります。

    したがって、candidateのsummary/evidence/coverageをもう一度コピーした RETRO_CRITIQUE_CONTEXT_V1 を保存する必要性は弱いです。二重化すると、そのうち publication と critique context がdriftします。

    より小さい設計はこうです。

    schema_version: RETRO_PRIVATE_AUDIT_INDEX_V1
    

    source_publication:
    publication_digest: sha256:...
    retrospective_run_id: ...
    base_sha: ...

    evidence_resolution:

    • evidence_ref: # 既存typed evidence_refをそのまま使う
      ref_type: runtime_receipt
      source_id: runtime
      resource_identity: ...
      projection_digest: ...
      private_status_at_generation: available | unavailable
      reason_code: ...
      bundle_digest: sha256:... | null

    finding本文・claim_class・summary・deltaは既存publicationから読む。#2376は「opaque refをローカルで解決できるか」だけを追加する。

    これなら本当に WS5 です。

    5. deterministic identity も修正が必要です

    context_id = sha256(canonical-public-projection) としながら、そのprojectionに created_at と時間変化する availability: expired が入っています。同じ retrospective input を翌日再生成すれば同じprojectionになりません。

    created_at をrun自身の固定timestampから継承するか、identity preimageから除外する必要があります。またpublic側のavailabilityは availability_at_generation にすべきです。expiry判定はlocal resolverがアクセス時にlazy評価すれば十分で、expiry daemonやbackground cleanupは不要です。

    canonical JSONについても、リポジトリには既に sort_keys=True, separators=(",", ":") 系の規約があります。クロス言語で暗号学的互換性が必要になって初めて RFC 8785/JCS を採用すればよく、Python-onlyの趣味開発で新しいcanonicalization libraryまで増やす価値は低いです。JCS自体はstable hash用途の標準です。 (RFCエディタ)

    6. security/harness はむしろ削れます

    現行テストは evidence_ref をclosed field setで制限し、raw transcript、secret、path等の追加fieldを拒否しています。しかもテスト自身が「value-level redactionは #2239 の責務」と明記しています。

    #2239にも collector scrub と publisher rejection を独立oracleとするredaction設計があります。

    したがって #2376 で新しいgeneric forbidden-content scannerを増やすより、

    既存 validator → existing publisher safety gate → WS5固有の2〜3個のprojection test

    程度で十分です。

    0600 と atomic write は残して構いません。実装も tempfile.mkstemp(dir=destination_dir) → write → os.replace() で十分です。mkstemp() は作成userのみ読み書き可能で、同一filesystem上の os.replace() は成功時atomicです。独自lock managerやjournalingは不要です。 (Python documentation)

    なお created_at: RFC3339 UTC をJSON Schemaの format: date-time だけで保証するのも避けるべきです。Draft 2020-12では format はdefaultではannotationで、assertionは別扱いです。既存validator側でformat checkerまたは明示UTC checkを1つ入れる方が確実です。 (JSON Schema)

    推奨する #2376 の着地点

    私は 「ChatGPT critique contextを追加するIssue」から「既存public evidence refのlocal private resolverを追加するIssue」へ変更します。

    RETRO_CRITIQUE_CONTEXT_V1、独自 claim_class、github_connector_only attestation、follow-up materialization、Required ChatGPT Questionsの機械契約化は削除します。ChatGPT用の質問セット自体はdocumentation/runbookとして残して構いません。

    開始条件は #2489 / PR #2496 merge後。その後、#2375を使った実 retrospective を最低2〜3回回し、「Latitude evidenceが実際にどの判断を改善したか」を記録します。そもそも元の #2375 議論でも、Issue A → 実運用2〜3回 → Issue B とし、有用でなければbundle/handoffを作り込まない方針でした。

    PR #2392 は実 Latitude CLI v7.10.0 まで検証して最終的に良い状態になっていますが、そこへ至るまで「存在しないCLI commandを前提」「dead code」「レスポンス形状の誤認」まで実際に修正されています。これはまさに、#2376でも schemaを先に精緻化するより、実ChatGPT readbackを先に2〜3回試すべきことを示しています。

    最終判定: NO-GO_AS_IS / REFRAME_AND_DEFER。
    削る方向で直すと、実装量はかなり減り、#1939の分割にも一致し、ChatGPT retrospectiveとしての実用性はむしろ上がります。

    ## 結論

    No-Go as-is。実装前に Issue #2376 を reframe するのを推奨します。

    狙い自体――「公開証跡だけをChatGPTに読ませつつ、必要なら人間がprivate evidenceを深掘りできる」――は有用です。しかし現在の #2376 は、#1939 が分離した Workstream 3(ChatGPT discovery)・4(follow-up handoff)・5(private audit resolver)を再び1 Issueへ混ぜているうえ、新しい RETRO_CRITIQUE_CONTEXT_V1 が既存 retrospective publication より情報量を落としてしまっています。結果として、かなりの schema / scanner / bundle test を追加するのに、肝心の Required Question 1 をChatGPTが答えられません。

    優先度 指摘 判定
    P0 #1939 の Workstream 5 は Workstream 2 に依存するのに、#2376 は #2374→#2375 だけを dependency としている。WS2 の #2489 / PR #2496 は現在も open Draft・未merge。 開始条件が stale
    P0 finding_refs[].claim_class を supported/refuted/indeterminate に再定義しているが、現行 canonical claim_class は runtime_behavior 等9値の「主張種別」。 既存contractと意味衝突
    P0 ChatGPTに渡るのは summary + opaque evidence ref + coverage だけで、local bundle は読ませない。digest/opaque ref は証拠の同一性を示せても、claimの真偽を示せない。 Required Q1が成立しない
    P1 既存 persisted retrospective run は既に run_identity、source_observations、candidate_records、delta_results、publication_digest を公開している。新しい critique artifact はかなり重複する。 不要な第2 public dialect
    P1 AC2 の「同一input→同一public projection」と created_at、時間で変わる local_bundle.availability=expired が衝突。 determinism未定義
    P1 github_connector_only: true / local_file_access_used: false は生成側が証明できるartifact propertyではなく、将来のChatGPT実行方法についての要求。 false attestation
    P1 public-safe scanner / negative harness をもう1セット作ろうとしているが、既存 evidence_ref と #2239 に既にpublic/private境界・redaction gateがある。 harness過剰
    P1 元の設計判断は「#2375を実運用で2〜3回評価してからIssue B」だったが、確認できたのは主として collector/live CLI の機能実証。 有用性gate未達

    1. 最優先は dependency と workstream 境界です

    現在の親 #1939 は、WS3=repository discovery、WS4=follow-up materialization、WS5=opaque evidence→private audit resolver を明示的に別物として扱い、さらに WS5 は WS2 に依存するとしています。Child Issues欄でも WS2=#2489、WS5=未起票のままです。

    その #2489 は completion transaction / reconciliation を担い、現在の PR #2496 は open・Draft・unmerged です。

    ところが #2376 は ChatGPT Workflow で repository readback(WS3)と accepted follow-up handoff(WS4)まで自分の契約に取り込んでいます。これは親Issueでせっかく分割した責務を再結合しています。

    推奨は #2376 を WS5 専用へ縮小することです。 WS2がmergeした後なら、WS1/3/4を待たず private resolver 自体を独立実装できます。

    2. claim_class は P0 の実装衝突です

    現行 agent_improvement_candidate/v1 の claim_class は、

    code_content / code_authorship_timing / internal_loop_review_verdict / github_native_review_state / review_comment / mergeability / issue_intent / external_fact / runtime_behavior

    という9値の canonical taxonomy です。Evaluatorもこの意味で出力しています。

    #2376 は同じ名前を supported | refuted | indeterminate に変えています。

    ここは、

    • 入力側: canonical claim_class: runtime_behavior 等をそのまま保持
    • critique出力側: support_verdict: supported | refuted | indeterminate

    と分離すべきです。

    既存 finding にはすでに evaluation_status、source_coverage、observed、presence_delta 等の独立軸もあり、indeterminate の表現も存在します。新しい意味を claim_class に押し込む必要はありません。

    3. 現状のartifactではChatGPTは evidence を評価できません

    ここが機能上最大の問題です。

    現在の evidence_ref は ref_type / source_id / resource_identity / projection_digest を持つtyped referenceです。Latitude evidenceも runtime_receipt/runtime として既存shapeへ結合されています。

    一方 #2376 はこれを単なる opaque non-secret reference に落とします。そしてprivate bundleはChatGPTに読ませません。

    OpenAIの現行GitHub Appも、許可されたGitHub repository contentを検索・読み取りする仕組みで、GitHubへの書き込みはせず、当然ローカルWSL上のprivate bundleをGitHub connector経由で取得するものではありません。 ([OpenAI Help Center]1)

    したがって、たとえば

    finding A → runtime_receipt → sha256:abc...

    だけをChatGPTが見ても、「Aはsupportedか?」を独立判定できません。hashは完全性証明であって内容証明ではないためです。

    ここは Required Question 1 を二段階に変えるべきです。

    GitHub connector-only critique では「このfindingにどのsourceの証拠がbindされ、公開情報だけで再検証可能か」を判定する。証拠がopaque privateなら indeterminate: opaque_evidence_unresolvable が正常結果です。

    より深いcritiqueが必要な場合だけ、人間が選択したsafe projectionを別途提示する。自動bundle uploadは不要です。

    4. 新しい public artifact 自体をかなり疑います

    current main の retrospective publication は、すでに Issue comment として、

    run_identity、source_observations、candidate_records、delta_results、publication_digest

    をcarryしています。

    さらに repository側には PUBLISH_REQUEST_V1 の永続化経路や CHATGPT_RETRO_CONTEXT_V1 marker/upsertも既にあります。

    したがって、candidateのsummary/evidence/coverageをもう一度コピーした RETRO_CRITIQUE_CONTEXT_V1 を保存する必要性は弱いです。二重化すると、そのうち publication と critique context がdriftします。

    より小さい設計はこうです。

    schema_version: RETRO_PRIVATE_AUDIT_INDEX_V1
    
    source_publication:
      publication_digest: sha256:...
      retrospective_run_id: ...
      base_sha: ...
    
    evidence_resolution:
      - evidence_ref:   # 既存typed evidence_refをそのまま使う
          ref_type: runtime_receipt
          source_id: runtime
          resource_identity: ...
          projection_digest: ...
        private_status_at_generation: available | unavailable
        reason_code: ...
        bundle_digest: sha256:... | null

    finding本文・claim_class・summary・deltaは既存publicationから読む。#2376は「opaque refをローカルで解決できるか」だけを追加する。

    これなら本当に WS5 です。

    5. deterministic identity も修正が必要です

    context_id = sha256(canonical-public-projection) としながら、そのprojectionに created_at と時間変化する availability: expired が入っています。同じ retrospective input を翌日再生成すれば同じprojectionになりません。

    created_at をrun自身の固定timestampから継承するか、identity preimageから除外する必要があります。またpublic側のavailabilityは availability_at_generation にすべきです。expiry判定はlocal resolverがアクセス時にlazy評価すれば十分で、expiry daemonやbackground cleanupは不要です。

    canonical JSONについても、リポジトリには既に sort_keys=True, separators=(",", ":") 系の規約があります。クロス言語で暗号学的互換性が必要になって初めて RFC 8785/JCS を採用すればよく、Python-onlyの趣味開発で新しいcanonicalization libraryまで増やす価値は低いです。JCS自体はstable hash用途の標準です。 ([RFCエディタ]2)

    6. security/harness はむしろ削れます

    現行テストは evidence_ref をclosed field setで制限し、raw transcript、secret、path等の追加fieldを拒否しています。しかもテスト自身が「value-level redactionは #2239 の責務」と明記しています。

    #2239にも collector scrub と publisher rejection を独立oracleとするredaction設計があります。

    したがって #2376 で新しいgeneric forbidden-content scannerを増やすより、

    既存 validator → existing publisher safety gate → WS5固有の2〜3個のprojection test

    程度で十分です。

    0600 と atomic write は残して構いません。実装も tempfile.mkstemp(dir=destination_dir) → write → os.replace() で十分です。mkstemp() は作成userのみ読み書き可能で、同一filesystem上の os.replace() は成功時atomicです。独自lock managerやjournalingは不要です。 ([Python documentation]3)

    なお created_at: RFC3339 UTC をJSON Schemaの format: date-time だけで保証するのも避けるべきです。Draft 2020-12では format はdefaultではannotationで、assertionは別扱いです。既存validator側でformat checkerまたは明示UTC checkを1つ入れる方が確実です。 ([JSON Schema]4)

    推奨する #2376 の着地点

    私は 「ChatGPT critique contextを追加するIssue」から「既存public evidence refのlocal private resolverを追加するIssue」へ変更します。

    RETRO_CRITIQUE_CONTEXT_V1、独自 claim_class、github_connector_only attestation、follow-up materialization、Required ChatGPT Questionsの機械契約化は削除します。ChatGPT用の質問セット自体はdocumentation/runbookとして残して構いません。

    開始条件は #2489 / PR #2496 merge後。その後、#2375を使った実 retrospective を最低2〜3回回し、「Latitude evidenceが実際にどの判断を改善したか」を記録します。そもそも元の #2375 議論でも、Issue A → 実運用2〜3回 → Issue B とし、有用でなければbundle/handoffを作り込まない方針でした。

    PR #2392 は実 Latitude CLI v7.10.0 まで検証して最終的に良い状態になっていますが、そこへ至るまで「存在しないCLI commandを前提」「dead code」「レスポンス形状の誤認」まで実際に修正されています。これはまさに、#2376でも schemaを先に精緻化するより、実ChatGPT readbackを先に2〜3回試すべきことを示しています。

    最終判定: NO-GO_AS_IS / REFRAME_AND_DEFER。
    削る方向で直すと、実装量はかなり減り、#1939の分割にも一致し、ChatGPT retrospectiveとしての実用性はむしろ上がります。

  3. squne121 commented on Sep 4, 2026

    @squne121
    OwnerAuthor

    推奨は REFRAME_AND_DEFER をそのまま issue-refinement-loop に実行させることです。ただし「#2496 がマージされるまで何もしない」ではなく、#2376 の契約修正・dependency materializationまでは今すぐ完了させ、実装だけをblockする形がよいです。

    現時点では #2489 は open、PR #2496 は open / Draft / unmerged です。 一方、#2376 のnative blockedBy は現在 #2375 のみで、その #2375 はすでにclosedです。つまり現在のdependency graphでは、本当に必要なWS2依存が表現されていません。

    また親 #1939 は、WS3=ChatGPT discovery、WS4=follow-up handoff、WS5=private audit resolverを明確に分け、WS5はWorkstream 2に依存すると定義しています。 指定コメントの最終判断も NO-GO_AS_IS / REFRAME_AND_DEFER で、#2376を「既存public evidence refのlocal private resolver」へ縮小することを推奨しています。

    さらに #2376 は既に #1939 のnative sub-issueとして登録済みなので、新しいWS5 Issueを起票する必要はありません。親本文側の「WS5 未起票」はmirrorがstaleな状態です。

    以下をそのまま Claude Code の auto mode に貼るのを推奨します。

    squne121/loop-protocol の Issue #2376 に対して、repository の canonical issue-refinement-loop を実行してください。

    対象:

    目的は実装ではなく、Issue #2376 を現在の repository SSOT と anchor comment に整合する implementation-ready contract へ refinement することです。

    この refinement loop は、人間の中間承認を求めず自律的に進めてください。
    通常の Issue 本文更新、contract rewrite、label hygiene、parent/child mirror の同期、native dependency materialization、再レビュー、再修正について私の承認を求めないでください。

    ただし Claude Code 自身の permission mode や repository の安全機構を弱めないでください。
    --dangerously-skip-permissions 等への切替や permission policy の変更を、この「承認不要」という指示から推論してはいけません。
    承認不要なのは repository の refinement iteration gate です。

    0. Canonical workflow を使用する

    最初に current default branch の最新状態を取得し、以下を読むか canonical preflight の MUST_READ に従ってください。

    anchor comment は今回ユーザーが明示指定した direct human context です。
    canonical preflight.run.with_human_context lane を使用し、URLだけの unlabeled anchor として扱わないでください。

    issue-refinement-loop の planner / command registry / controlled executor を正本とし、手書きの独自 refinement procedure へ置き換えないでください。

    1. Live stateを再検証する

    プロンプト記述時点の状態を盲信せず、GitHub live stateを再取得してください。

    少なくとも確認すること:

    anchor commentの factual snapshotがstaleなら、判断理由は保持しつつlive stateで更新してください。

    2. SubAgent を使用し、必ず完了を待つ

    canonical REFINEMENT_LOOP_PLAN_V1 に従ってSubAgentを起動してください。

    特に repository investigation がrequiredなら codebase-investigator を使用してください。

    調査対象には少なくとも以下を含めます。

    外部仕様の確認がplanner上requiredなら web-researcher を使用してください。

    複数SubAgentを並列起動できる場合は並列で構いませんが、

    起動したすべてのSubAgentの作業完了を必ず待ってください。

    一つでも未完了のまま Step 2 review や Issue rewrite に進んではいけません。

    SubAgent resultを受け取った後、main threadでjoinしてから次へ進んでください。

    nested SubAgent delegation は行わないでください。

    canonical Step 2 review は現在の issue-refinement-loop 契約に従い root-owned pipeline で実施し、legacy issue-reviewer SubAgentを勝手に復活させないでください。

    Step 4で issue-editor SubAgentを起動した場合も、

    issue-editor の作業完了とmutation readbackを必ず待ってから次のreview iterationへ進んでください。

    3. Anchor comment の主要指摘を controlled reframe として処理する

    anchor commentの中心判断は:

    NO-GO_AS_IS / REFRAME_AND_DEFER

    です。

    #2376 を現在の

    「ChatGPT critique context + local evidence bundle」

    という複合Issueのまま実装可能判定しないでください。

    Parent #1939 の Workstream 5 に一致する、

    既存のpublic-safe opaque / typed evidence referenceを、許可されたlocal private audit evidenceへ解決するresolver

    を所有するIssueへreframeしてください。

    anchor comment自体がこのreframeを明示的に要求しているため、この目的に必要なcontract scope変更を単なる「新規scopeなので人間確認」と誤分類しないでください。
    canonical scope-signal / controlled-reframe policyに従って処理してください。

    4. Refined contract の方向性

    最終的なIssue本文はcurrent repository assetsを調査した結果に基づいて決めてください。
    ただし以下を設計上の強い制約として扱ってください。

    残すもの

    • Parent 導入: repo URL起点の日次retrospective worksetとagent completion artifact投稿を確立する #1939 / Workstream 5との明確なbinding
    • existing public evidence reference → local private evidence resolution
    • availability / retention / failure semantics
    • missing / malformed / digest mismatch / permission mismatch / expiry のfail-closed semantics
    • private evidence unavailableをfalse-greenにしないこと
    • local-only storageが必要なら atomic write と restrictive permission
    • existing publication / evidence identityとのdeterministic binding
    • public/private boundary
    • human-triggered deep audit boundary
    • focused deterministic tests

    削除または再設計するもの

    原則として次をWS5のmachine contractから外してください。

    • 新しい第二public dialectとしての RETRO_CRITIQUE_CONTEXT_V1
    • existing publicationから finding / summary / coverageを複製するpublic artifact
    • claim_class: supported | refuted | indeterminate という再定義
    • github_connector_only: true
    • local_file_access_used: false
    • WS3 repository discovery責務
    • WS4 follow-up Issue materialization責務
    • ChatGPT critique Questions自体をschema-level machine contractにすること
    • existing 検証: agent-retrospective のsecurity boundary・evaluation・dual-runtime smokeを統合検証する #2239 / publisher safety gateと重複するgeneric scanner/harness

    canonical claim_class の既存taxonomyを壊さないでください。

    supported / refuted / indeterminate 相当の判定軸が本当に必要なら、既存taxonomyと別概念として扱ってください。
    ただしWS5 resolver自体に不要なら新しいfieldを追加しないでください。

    ChatGPT向け質問セットは有用ならrunbook/documentationとして残して構いませんが、WS5 implementation contractへ不要に結合しないでください。

    5. Public authorityを二重化しない

    current retrospective publicationが既に保持している

    • run identity
    • source observations
    • candidate/finding records
    • delta/evaluation information
    • publication digest
    • typed evidence refs

    等を再コピーしたpublic artifactを作る必要があるか敵対的に検討してください。

    原則は:

    finding本文やclaim semanticsは既存public publicationをauthorityにし、#2376はprivate resolution metadataだけを所有する

    です。

    anchor commentにある RETRO_PRIVATE_AUDIT_INDEX_V1 は設計候補であり、名前・shapeを無条件にコピーする必要はありません。
    current repository contractsを再利用したさらに小さいshapeが成立するならそちらを優先してください。

    新schemaを作る場合も、

    • source publication identity
    • existing typed evidence_ref
    • generation時点のprivate availability
    • bounded reason code
    • bundle/resolution digest

    程度のWS5固有情報へ限定できるか検討してください。

    6. Determinismを明確にする

    time-varying stateをstable identityへ混ぜて同一inputから毎回別digestになる設計を避けてください。

    必要なら、

    • generation timestampはsource runの固定timestampを継承
    • availability_at_generation のようにgeneration時点を固定
    • expiryはaccess時にlocal resolverがlazy判定
    • background expiry daemon / cleanup serviceは作らない

    という小さい設計を優先してください。

    既存repository canonical JSON実装を再利用できるなら再利用し、新しいcanonicalization infrastructureを不要に追加しないでください。

    7. ChatGPT boundary

    current public GitHub artifactだけで検証できないprivate opaque evidenceについて、ChatGPTがclaimの真偽を独立検証できると誤って契約しないでください。

    GitHub-only critiqueでprivate evidenceが解決不能なら、
    「公開情報だけではindeterminate」
    が正常結果になり得る設計にしてください。

    より深いprivate auditはhuman-triggered disclosure boundaryの外側であり、自動upload、ChatGPT API、browser automation、remote bundle uploadを導入しないでください。

    8. Dependencyを修正する

    #1939 Workstream 5 のhard predecessorはWorkstream 2です。

    current live stateを検証したうえで、#2489 がWorkstream 2のcurrent childであるなら、#2376のhard dependencyとして扱ってください。

    Issue本文に文字列を書くのみで終わらせず、repositoryのcanonical dependency materialization経路を使用し、

    GitHub native blockedBy を materializeし、live readbackで確認してください。

    現在の #2375 依存については、refined contract上で本当にhard predecessorなのか再判定してください。

    #2489 / PR #2496 が未完了なら、refinementは完了させても implementation-ready / impl-review-loop handoff には進めないでください。

    9. #2375 の「実運用2〜3回」gateを再評価する

    anchor commentでは、#2489 / PR #2496 merge後に #2375 を使ったreal retrospectiveを最低2〜3回行い、Latitude evidenceが実際に判断を改善したか確認することが提案されています。

    これを無条件に消さず、同時にparent #1939のWS5 dependency contractとも照合してください。

    current evidenceを確認し、

    • 既に必要な2〜3回相当のreal-use evidenceがある
    • まだない
    • WS5をLatitude固有ではないgeneric resolverへ縮小した結果、このgateをhard dependencyにする合理性がなくなった

    のどれかを明示的に分類してください。

    証拠がないのに「評価済み」と推測しないでください。

    必要な場合はimplementation-entry conditionとしてIssueへ明記してください。
    ただしこのrefinement run自身がprivate retrospectiveを勝手に自動実行したり、外部有料操作を始めたりしてはいけません。

    10. Parent #1939との同期

    #2376は既存の #1939 Workstream 5 childとして扱い、新しい重複WS5 Issueを起票しないでください。

    native parent/sub-issue relationshipをreadbackしてください。

    #1939 本文のChild Issues mirrorが依然として

    Workstream 5: 未起票

    のままなら、canonical issue-refinement-loop / child materialization policyで許可される範囲で #2376 へ同期してください。

    既にnative relationが正しい場合、native relationを再作成しないでください。

    11. Issue本文を実装可能な形へ縮める

    reframe後は少なくとも以下を明確にしてください。

    タイトルも内容に合わせて変更してください。

    推奨方向:

    実装: #1939 Workstream 5 — opaque public evidence/private local audit resolver を追加する

    ただしcurrent repository naming conventionにより、意味を変えない軽微な調整は許可します。

    AC/VCはWS5で本当に証明すべきものへ絞ってください。
    大量の新しいscanner/harnessを「安心のため」だけに追加するcontractにはしないでください。

    12. Refinement review loop

    rewrite後は必ずfresh bodyをreadbackし、canonical Step 2 reviewを再実行してください。

    needs-fix なら、人間確認を挟まず次iterationへ進んでください。

    最大iterationまでは自動継続してください。

    各iterationについて:

    1. fresh live body取得
    2. 必要なinvestigation/web research
    3. 起動したSubAgentの完了待ち
    4. root-owned review
    5. needs-fixならissue-editor
    6. issue-editor完了待ち
    7. mutation readback
    8. fresh review

    の順序を守ってください。

    古いreview resultをbody更新後に再利用しないでください。

    13. 終了条件

    通常の途中判断では私に承認を求めないでください。

    以下のみ停止条件です。

    • canonical workflowが genuine human_judgment_required を返し、anchor comment・parent SSOT・repository evidenceだけでは解消不能
    • max_iterations到達
    • secret / credential / private raw evidenceの公開が必要になる
    • destructive repository operationや権限昇格が必要になる
    • canonical controlled executor / native dependency materializationがbounded retry後も失敗し、fail-closedが要求される
    • repositoryのcurrent SSOTとanchor commentの間に、main threadで安全に裁定できない本質的矛盾がある

    以下は停止理由にしないでください。

    • Issue本文の大幅な削減
    • title変更
    • AC/VC変更
    • Allowed Pathsのcontrolled reframe
    • stale label除去
    • native dependency追加・stale dependency除去
    • parent mirrorの同期
    • reviewerからの通常のneeds-fix
    • issue-editorによる再修正

    14. 実装は開始しない

    このrunの主目的は issue-refinement-loop です。

    #2489 / PR #2496 やその他のhard predecessorが未完了なら、実装を開始しないでください。

    refinementがapproveされても、dependency/readiness gateが満たされていない状態を
    implementation_ready
    と誤報しないでください。

    このrunでは、必要なら

    refinement approved / implementation blocked

    の状態で終了して構いません。

    hard dependencyがlive state上すでに完了しており、その他すべてのimplementation-entry gateまで満たされていた場合でも、この依頼では勝手に実装へ進まず、refinement結果を確定して終了してください。

    15. 最終報告

    最後に簡潔に以下を報告してください。

    人間承認を待たず、上記の refinement loop を現在実行可能な終端まで完遂してください。

    一点だけ補足すると、現在の OpenAI のGitHub連携も、通常のChatGPT GitHub Appについてはリポジトリ内容の読み取り・分析が中心で、直接pushする機能ではありません。したがって github_connector_only: true のような将来のconsumer実行方法をproducer artifactが自己証明する設計を削る方向は、現在の外部仕様とも整合します。([OpenAI Help Center]1)

    このプロンプトでは、refinementを完了させた後に #2489をnative blockerとして残して実装を止めるところまでを自動化対象にしています。これは現行 issue-refinement-loop の「hard dependencyはnative blockedBy をSSOTとし、本文だけ更新したfalse-greenを許さない」という契約にも一致します。

  4. changed the title [-]実装: agent-retrospective に ChatGPT critique context と local evidence bundle を追加する[/-] [+]実装: #1939 Workstream 5 — opaque public evidence/private local audit resolver を追加する[/+] on Sep 4, 2026
  5. squne121 commented on Sep 4, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(自律実行)

    Termination: approved(refinement 承認 / 実装は未着手)
    Handoff state: refinement_approved_gate_pending(implementation_ready: false)

    Reframe 概要

    anchor comment(OWNER, NO-GO_AS_IS / REFRAME_AND_DEFER, https://github.com/squne121/loop-protocol/issues/2376#issuecomment-5546808866)の判定に従い、本 Issue を「agent-retrospective に ChatGPT critique context と local evidence bundle を追加する」複合 Issue から、親 #1939 Workstream 5「opaque public evidence/private local audit resolver」専用 Issue へ全面 reframe した。

    • Title: 実装: agent-retrospective に ChatGPT critique context と local evidence bundle を追加する → 実装: #1939 Workstream 5 — opaque public evidence/private local audit resolver を追加する
    • 削除: 新規 public dialect RETRO_CRITIQUE_CONTEXT_V1、claim_class: supported|refuted|indeterminate 再定義(既存9値canonical taxonomyは無傷)、github_connector_only/local_file_access_used 自己申告attestation、WS3/WS4責務、ChatGPT Questionsのmachine-level契約化、既存 検証: agent-retrospective のsecurity boundary・evaluation・dual-runtime smokeを統合検証する #2239 gate と重複するscanner/harness
    • 保持・再設計: 既存 typed evidence_ref を再利用した private resolver、availability/retention/failure semantics(fail-closed, false-green禁止)、atomic write + 0600、既存 run_identity/publication_digest との deterministic binding、public/private boundary、human-triggered disclosure boundary

    Semantic Design Review(issue-design-reviewer, 3 iteration)

    1. 1st: blocker×3(WS2依存欠落, claim_class衝突, evidence answerability不足)→ 全面reframeで解消
    2. 2nd: high×1(AC8 indeterminate 用語衝突), medium×2(AC2/AC5用語曖昧性, 2値/3値乖離未説明)→ 用語修正で解消
    3. 3rd: low×1(determinism適用範囲の軽微な曖昧性, non-blocking)→ assessment: findings だが effective_verdict: approve(low/medium severityはrewrite routingしない)

    Native dependency / parent 同期

    #2375 実運用評価「2〜3回」gate

    証拠未確認。closed 後の実運用評価回数を裏付ける一次証拠をこのrunでは確認できなかったため、「評価済み」と断定せず、implementation-entry condition として body に明記した(自動実行・断定はしていない)。

    Dependency / Readiness gate 状態

    結論

    refinement は承認水準に達したが、hard dependency(#2489 / PR #2496)が live state 上まだ完了していないため、implementation_ready: false のまま終了する。impl-review-loop へのhandoffは行わない。LOOP_HANDOFF_RESULT_V1 marker は出力しない。#2489/PR #2496 が merge され、run_contract_review_once.py が status: go を返すまで、実装着手を保留すること。

  6. squne121 commented on Sep 5, 2026

    @squne121
    OwnerAuthor

    結論

    判定: REQUEST_CHANGES / GO_AFTER_CONTRACT_REPAIR

    #2376 は、以前の RETRO_CRITIQUE_CONTEXT_V1 追加案から 既存 public evidence_ref → private local audit evidence resolver へ縮小した方向自体は妥当です。ただし、現行 contract のまま実装すると、resolver が private evidence を実際には解決できないか、自分自身の Stop Condition に違反する構造が残っています。

    一方、以前の defer 理由だった #2489 / PR #2496 はもう解消済みです。#2489 は closed、PR #2496 は merged なので、ここは 再度 deferred にせず、Issue 本文を修正したら実装へ進めるのがよいです。

    敵対的レビュー

    優先度 | Finding | 問題 | 推奨修正 -- | -- | -- | -- P0 | resolver の producer が存在しない | public evidence_ref だけでは private evidence の所在地を逆算できません。Latitude の current implementation は public-safe projection から opaque ref を作り、binding 時にはその ref と projection digest だけを candidate に載せています。private provenance はその前段にしか存在しません。 | run_retrospective.py を Allowed Paths に追加し、evidence_ref を生成/bind する時点で local sidecar mapping を1回登録する。resolver 単体だけを追加しない。 P0 | Stop Condition が core functionality を禁止している | In Scope は local-only storage の read/write なのに、Stop Conditions は無条件に「local file access が必要なら停止」としています。文字どおり解釈すると AC1/AC4 を実装できません。 | ChatGPT/remote process から private local file へ直接 bridge する必要がある場合 に限定する。resolver 自身の local file access は明示的に許可。 P0 | AC2 の determinism が自己矛盾 | 同一 evidence_ref + run_identity でも、generation A では private source が available、B では unavailable になり得ます。それなのに private_status_at_generation を digest preimage に含めつつ「同一入力なら同一 digest」と要求しています。 | stable lookup key と snapshot manifest digest を分離する。後述。 P0 | identity の記述が current wire contract と不一致 | #2376 は run_identity (publication_digest / retrospective_run_id / base_sha) のように扱っていますが、current publication は run.run_identity = run_id/base_sha/source_set_digest/generated_at/runtime_version で、publication_digest は top-level です。retrospective_run_id ではなく run_id です。 | resolver key は run_id + base_sha + source_set_digest + typed evidence_ref に固定。publication_digest は別の optional verification/binding として扱う。 P1 | #2375 を hard gate にする根拠が弱い | public に確認できた #2375/PR #2392 は collector 実装・live canary まで完了しています。一方「2〜3回運用した」という公開 evidence は今回の調査では確認できませんでした。しかし WS5 は Latitude 専用ではなく、親 #1939 も provider telemetry を最低成功条件にしていません。 | 「#2375 の2〜3回評価完了」を implementation-entry gate から削除。WS5 実装後の usability observation に降格。 P1 | expiry が仕様化されていない | AC3/AC5 は expired を要求しますが、TTL・anchor・expires_at・unknown retention の扱いがありません。この状態では deterministic test を書けません。 | expires_at: RFC3339 UTC \| null の1 fieldだけ追加。null は独自 expiry なし。access時のみ評価。daemon/cleanup は不要。 P1 | AC7 が過剰な security harness を再導入する | 「untrusted instruction が manifest/fixture にあれば fail closed」は意味解析・prompt-injection scanner を要求しやすく、Out of Scope の「#2239 と重複する generic scanner/harness を作らない」と衝突します。 | manifest に free-form instruction field 自体を持たせない。additionalProperties:false + closed enum +型検証で十分。既存 public boundary scanner を再利用する。 P2 | plugin distribution との境界が曖昧 | current Claude Code plugin では install directory は更新で変化するため state を ${CLAUDE_PLUGIN_ROOT} に書くべきではなく、persistent data は ${CLAUDE_PLUGIN_DATA} が用意されています。 (Claude) | #2376 は当面 project Skill only と明記する。plugins/agent-retrospective への mirror は追加しない。portable resolver が本当に必要になった時だけ別 Issue。

    最大の問題: evidence_ref は locator ではない

    ここが #2376 の成立性を左右します。

    現在の Latitude binding は、available evidence に対して

    resource_identity = latitude_evidence["evidence_ref"]
    projection_digest = latitude_evidence["evidence_identity"]

    を candidate の public evidence_refs[] に追加します。一方、その前段では CollectorResult.private_evidence に hook-sink 由来の complete_sessions などが存在しています。つまり、private context が存在する時点と opaque public ref が確定する時点をつなぐ producer hook が必要です。

    現行 #2376 の Allowed Paths は新規 private_audit_resolver.py などに閉じているため、resolver は sidecar を読むことはできても、production run が sidecar を生成する場所がありません。結果、実装しても基本的に not_indexed → unavailable しか返せない機能になります。

    したがって、最小の scope delta として

    .claude/skills/agent-retrospective/scripts/run_retrospective.py

    を Allowed Paths に追加するべきです。

    大掛かりな framework は不要です。public evidence bind 直後に、例えば register_private_audit_ref(...) を一度呼ぶ程度で十分です。

    digest contract は2階層に分けるべき

    AC2 は次の形に直すと単純になります。

    resolution_key =
      sha256(sorted-json({
        run_identity: {
          run_id,
          base_sha,
          source_set_digest
        },
        evidence_ref: {
          ref_type,
          source_id,
          resource_identity,
          projection_digest
        }
      }))
    

    manifest_digest =
    sha256(sorted-json(generation_snapshot))

    resolution_key は公開済みの stable identity だけなので不変です。

    一方 manifest_digest は、

    private_status_at_generation: available | unavailable
    reason_code: ...
    object_key: ...
    object_digest: ...
    expires_at: ...

    のような その generation の snapshot を bind します。

    access 時の

    file disappeared
    permission changed
    expired
    digest mismatch

    は effective_status として lazy に評価し、resolution_key も generation snapshot も書き換えません。

    これなら「deterministic identity」と「private state が時間で変わる」という2つの要件を無理なく両立できます。

    なお publication contract では publication_digest は run.run_identity の一部ではなく、永続 publication 全体の top-level digest です。proposal の public_projection_digest とも別物です。この既存区別を崩すべきではありません。

    private manifest はさらに小さくできる

    趣味開発の前提なら、私なら v1 はこの程度にします。

    schema_version: retro_private_audit_index/v1

    resolution_key: sha256:...

    run_identity:
    run_id: ...
    base_sha: ...
    source_set_digest: ...

    evidence_ref:
    ref_type: ...
    source_id: ...
    resource_identity: ...
    projection_digest: ...

    adapter: hook_sink_session | local_artifact
    object_key: opaque-relative-key | null
    object_digest: sha256:... | null

    private_status_at_generation: available | unavailable
    reason_code:
    null
    | not_materialized
    | source_missing
    | source_invalid
    | integrity_mismatch
    | source_inaccessible
    | expired
    | unsupported_ref

    expires_at: RFC3339-UTC | null

    absolute path は保存せず、configured audit root からの object_key だけにします。

    保存先をプロジェクト外に置きたいなら、Linux/WSL では $XDG_STATE_HOME、未設定時 $HOME/.local/state が「再起動を跨いで残る application state」の標準的な置き場です。追加 dependency は不要です。 (Freedesktop Specifications)

    例えば:

    $XDG_STATE_HOME/loop-protocol/agent-retrospective/private-audit/

    で十分です。環境変数 RETRO_PRIVATE_AUDIT_DIR だけ override として許可してもよいでしょう。

    atomic write は Issue 本文より軽く考えてよい

    tempfile.mkstemp() → write → os.replace() の方向は妥当です。Python の mkstemp() 自体が secure に temp file を生成し、os.replace() は同一 filesystem 上なら成功時 atomic です。 (Python documentation)

    個人運用ならここへ、

    • WAL

    • transaction journal

    • lock service

    • background cleanup

    • fsync hierarchy

    • bespoke integrity database

    を追加する必要はありません。

    むしろ 1 resolution_key = 1 manifest file にして shared mutable index を避けると、locking 自体がほぼ不要になります。

    JSON Schema の date-time についても、新規 validator framework を作る理由はありません。Draft 2020-12 の format は利用形態によって assertion が保証されないので、repo 既存 runtime format checker を再利用するのが正しいです。 (JSON Schema)

    Latitude を v1 resolver の成功条件から外すべき

    ここも重要です。

    #2375 の設計は、Latitude raw payload を private locator として残す設計ではありません。public-safe projection に変換した後、opaque evidence identity を binding するものです。現在の run_retrospective.py も Latitude unavailable を retrospective failure にせず、そのまま処理継続する設計です。

    したがって WS5 v1 で、

    public Latitude evidence_ref を渡せば、過去の raw Latitude trace がローカルから復元できる

    とは約束しない方がよいです。

    それを実現するには、

    • raw Latitude data の local cache を新たに保存する

    • または resolver が Latitude service を再問い合わせする

    必要があり、どちらも今の #2376 より明らかに scope が重くなります。

    v1 は 「generation 時に local private source が既に存在する evidence だけ登録する」 で十分です。Latitude は not_materialized / unsupported_ref でも contract 上は正常です。

    これなら generic resolver を先に完成させ、実際に Latitude の deep audit が欲しくなった時だけ adapter を追加できます。

    配布物について

    #2240 の plugin 化では project Skill と portable plugin を意図的に分離しており、Latitude enrichment のような project-only runtime dependency を portable core に持ち込まない設計になっています。#2376 も同じ扱いが自然です。Claude Code 側も、plugin の bundled code は ${CLAUDE_PLUGIN_ROOT}、永続 state は ${CLAUDE_PLUGIN_DATA} と明確に分離しています。 (Claude)

    したがって #2376 に今、

    plugins/agent-retrospective/...

    まで Allowed Paths として追加することには反対です。

    project Skill 版で usefulness を確認 → portable deep-audit resolver の需要が出たら別 Issue が最も低摩擦です。

    推奨する Issue 修正方針

    実装前に直すべき内容は、実質これだけです。

    1. 実装: #1939 Workstream 2 — completion transaction and reconciliation(stop reason taxonomy / runtime lane識別) #2489 / PR feat: agent_session_manifest/v1 に runtime_lane/completion_outcome/completion_source を追加 (#2489) #2496 の blocker 記述を satisfied に更新し、state/blocked を解除する。

    2. 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 の「2〜3回実運用確認」を implementation-entry hard gate から外す。

    3. run_retrospective.py を Allowed Paths に追加し、generation-time sidecar registration を scope に入れる。

    4. run_identity を current publication contract の run_id/base_sha/source_set_digest に正規化し、publication_digest を混ぜない。

    5. AC2 を stable resolution_key と generation manifest_digest に分割する。

    6. expires_at: datetime|null と小さい reason-code enum を確定する。

    7. Stop Condition の local file access を「remote/ChatGPT からの private local-file bridge」に限定する。

    8. AC7 の untrusted instruction semantic scan を削除し、closed schema + 既存 public-safety scanner 再利用へ変更する。

    9. v1 は project Skill only、Latitude raw resolver と plugin mirror は Out of Scope と明記する。

    これを反映すれば、新しい security/control-plane harness を増やさず、数百行規模以下の sidecar producer + resolver + focused tests で閉じられる Issueになるはずです。

    現状は implementation-ready とは評価しませんが、外部 dependency 待ちで止める理由もありません。Issue refinement を1 iterationかけて上記 contract repair を入れ、そのまま impl-review-loop に進めるのが推奨です。

    ## 結論

    判定: REQUEST_CHANGES / GO_AFTER_CONTRACT_REPAIR

    #2376 は、以前の RETRO_CRITIQUE_CONTEXT_V1 追加案から 既存 public evidence_ref → private local audit evidence resolver へ縮小した方向自体は妥当です。ただし、現行 contract のまま実装すると、resolver が private evidence を実際には解決できないか、自分自身の Stop Condition に違反する構造が残っています。

    一方、以前の defer 理由だった #2489 / PR #2496 はもう解消済みです。#2489 は closed、PR #2496 は merged なので、ここは 再度 deferred にせず、Issue 本文を修正したら実装へ進めるのがよいです。

    敵対的レビュー

    優先度 Finding 問題 推奨修正
    P0 resolver の producer が存在しない public evidence_ref だけでは private evidence の所在地を逆算できません。Latitude の current implementation は public-safe projection から opaque ref を作り、binding 時にはその ref と projection digest だけを candidate に載せています。private provenance はその前段にしか存在しません。 run_retrospective.py を Allowed Paths に追加し、evidence_ref を生成/bind する時点で local sidecar mapping を1回登録する。resolver 単体だけを追加しない。
    P0 Stop Condition が core functionality を禁止している In Scope は local-only storage の read/write なのに、Stop Conditions は無条件に「local file access が必要なら停止」としています。文字どおり解釈すると AC1/AC4 を実装できません。 ChatGPT/remote process から private local file へ直接 bridge する必要がある場合 に限定する。resolver 自身の local file access は明示的に許可。
    P0 AC2 の determinism が自己矛盾 同一 evidence_ref + run_identity でも、generation A では private source が available、B では unavailable になり得ます。それなのに private_status_at_generation を digest preimage に含めつつ「同一入力なら同一 digest」と要求しています。 stable lookup key と snapshot manifest digest を分離する。後述。
    P0 identity の記述が current wire contract と不一致 #2376 は run_identity (publication_digest / retrospective_run_id / base_sha) のように扱っていますが、current publication は run.run_identity = run_id/base_sha/source_set_digest/generated_at/runtime_version で、publication_digest は top-level です。retrospective_run_id ではなく run_id です。 resolver key は run_id + base_sha + source_set_digest + typed evidence_ref に固定。publication_digest は別の optional verification/binding として扱う。
    P1 #2375 を hard gate にする根拠が弱い public に確認できた #2375/PR #2392 は collector 実装・live canary まで完了しています。一方「2〜3回運用した」という公開 evidence は今回の調査では確認できませんでした。しかし WS5 は Latitude 専用ではなく、親 #1939 も provider telemetry を最低成功条件にしていません。 「#2375 の2〜3回評価完了」を implementation-entry gate から削除。WS5 実装後の usability observation に降格。
    P1 expiry が仕様化されていない AC3/AC5 は expired を要求しますが、TTL・anchor・expires_at・unknown retention の扱いがありません。この状態では deterministic test を書けません。 expires_at: RFC3339 UTC | null の1 fieldだけ追加。null は独自 expiry なし。access時のみ評価。daemon/cleanup は不要。
    P1 AC7 が過剰な security harness を再導入する 「untrusted instruction が manifest/fixture にあれば fail closed」は意味解析・prompt-injection scanner を要求しやすく、Out of Scope の「#2239 と重複する generic scanner/harness を作らない」と衝突します。 manifest に free-form instruction field 自体を持たせない。additionalProperties:false + closed enum +型検証で十分。既存 public boundary scanner を再利用する。
    P2 plugin distribution との境界が曖昧 current Claude Code plugin では install directory は更新で変化するため state を ${CLAUDE_PLUGIN_ROOT} に書くべきではなく、persistent data は ${CLAUDE_PLUGIN_DATA} が用意されています。 (Claude) #2376 は当面 project Skill only と明記する。plugins/agent-retrospective への mirror は追加しない。portable resolver が本当に必要になった時だけ別 Issue。

    最大の問題: evidence_ref は locator ではない

    ここが #2376 の成立性を左右します。

    現在の Latitude binding は、available evidence に対して

    resource_identity = latitude_evidence["evidence_ref"]
    projection_digest = latitude_evidence["evidence_identity"]
    

    を candidate の public evidence_refs[] に追加します。一方、その前段では CollectorResult.private_evidence に hook-sink 由来の complete_sessions などが存在しています。つまり、private context が存在する時点と opaque public ref が確定する時点をつなぐ producer hook が必要です。

    現行 #2376 の Allowed Paths は新規 private_audit_resolver.py などに閉じているため、resolver は sidecar を読むことはできても、production run が sidecar を生成する場所がありません。結果、実装しても基本的に not_indexed → unavailable しか返せない機能になります。

    したがって、最小の scope delta として

    .claude/skills/agent-retrospective/scripts/run_retrospective.py
    

    を Allowed Paths に追加するべきです。

    大掛かりな framework は不要です。public evidence bind 直後に、例えば register_private_audit_ref(...) を一度呼ぶ程度で十分です。

    digest contract は2階層に分けるべき

    AC2 は次の形に直すと単純になります。

    resolution_key =
      sha256(sorted-json({
        run_identity: {
          run_id,
          base_sha,
          source_set_digest
        },
        evidence_ref: {
          ref_type,
          source_id,
          resource_identity,
          projection_digest
        }
      }))
    
    manifest_digest =
      sha256(sorted-json(generation_snapshot))
    

    resolution_key は公開済みの stable identity だけなので不変です。

    一方 manifest_digest は、

    private_status_at_generation: available | unavailable
    reason_code: ...
    object_key: ...
    object_digest: ...
    expires_at: ...

    のような その generation の snapshot を bind します。

    access 時の

    file disappeared
    permission changed
    expired
    digest mismatch
    

    は effective_status として lazy に評価し、resolution_key も generation snapshot も書き換えません。

    これなら「deterministic identity」と「private state が時間で変わる」という2つの要件を無理なく両立できます。

    なお publication contract では publication_digest は run.run_identity の一部ではなく、永続 publication 全体の top-level digest です。proposal の public_projection_digest とも別物です。この既存区別を崩すべきではありません。

    private manifest はさらに小さくできる

    趣味開発の前提なら、私なら v1 はこの程度にします。

    schema_version: retro_private_audit_index/v1
    
    resolution_key: sha256:...
    
    run_identity:
      run_id: ...
      base_sha: ...
      source_set_digest: ...
    
    evidence_ref:
      ref_type: ...
      source_id: ...
      resource_identity: ...
      projection_digest: ...
    
    adapter: hook_sink_session | local_artifact
    object_key: opaque-relative-key | null
    object_digest: sha256:... | null
    
    private_status_at_generation: available | unavailable
    reason_code:
      null
      | not_materialized
      | source_missing
      | source_invalid
      | integrity_mismatch
      | source_inaccessible
      | expired
      | unsupported_ref
    
    expires_at: RFC3339-UTC | null

    absolute path は保存せず、configured audit root からの object_key だけにします。

    保存先をプロジェクト外に置きたいなら、Linux/WSL では $XDG_STATE_HOME、未設定時 $HOME/.local/state が「再起動を跨いで残る application state」の標準的な置き場です。追加 dependency は不要です。 ([Freedesktop Specifications]2)

    例えば:

    $XDG_STATE_HOME/loop-protocol/agent-retrospective/private-audit/
    

    で十分です。環境変数 RETRO_PRIVATE_AUDIT_DIR だけ override として許可してもよいでしょう。

    atomic write は Issue 本文より軽く考えてよい

    tempfile.mkstemp() → write → os.replace() の方向は妥当です。Python の mkstemp() 自体が secure に temp file を生成し、os.replace() は同一 filesystem 上なら成功時 atomic です。 ([Python documentation]3)

    個人運用ならここへ、

    • WAL
    • transaction journal
    • lock service
    • background cleanup
    • fsync hierarchy
    • bespoke integrity database

    を追加する必要はありません。

    むしろ 1 resolution_key = 1 manifest file にして shared mutable index を避けると、locking 自体がほぼ不要になります。

    JSON Schema の date-time についても、新規 validator framework を作る理由はありません。Draft 2020-12 の format は利用形態によって assertion が保証されないので、repo 既存 runtime format checker を再利用するのが正しいです。 ([JSON Schema]4)

    Latitude を v1 resolver の成功条件から外すべき

    ここも重要です。

    #2375 の設計は、Latitude raw payload を private locator として残す設計ではありません。public-safe projection に変換した後、opaque evidence identity を binding するものです。現在の run_retrospective.py も Latitude unavailable を retrospective failure にせず、そのまま処理継続する設計です。

    したがって WS5 v1 で、

    public Latitude evidence_ref を渡せば、過去の raw Latitude trace がローカルから復元できる

    とは約束しない方がよいです。

    それを実現するには、

    • raw Latitude data の local cache を新たに保存する
    • または resolver が Latitude service を再問い合わせする

    必要があり、どちらも今の #2376 より明らかに scope が重くなります。

    v1 は 「generation 時に local private source が既に存在する evidence だけ登録する」 で十分です。Latitude は not_materialized / unsupported_ref でも contract 上は正常です。

    これなら generic resolver を先に完成させ、実際に Latitude の deep audit が欲しくなった時だけ adapter を追加できます。

    配布物について

    #2240 の plugin 化では project Skill と portable plugin を意図的に分離しており、Latitude enrichment のような project-only runtime dependency を portable core に持ち込まない設計になっています。#2376 も同じ扱いが自然です。Claude Code 側も、plugin の bundled code は ${CLAUDE_PLUGIN_ROOT}、永続 state は ${CLAUDE_PLUGIN_DATA} と明確に分離しています。 ([Claude]1)

    したがって #2376 に今、

    plugins/agent-retrospective/...
    

    まで Allowed Paths として追加することには反対です。

    project Skill 版で usefulness を確認 → portable deep-audit resolver の需要が出たら別 Issue が最も低摩擦です。

    推奨する Issue 修正方針

    実装前に直すべき内容は、実質これだけです。

    1. 実装: #1939 Workstream 2 — completion transaction and reconciliation(stop reason taxonomy / runtime lane識別) #2489 / PR feat: agent_session_manifest/v1 に runtime_lane/completion_outcome/completion_source を追加 (#2489) #2496 の blocker 記述を satisfied に更新し、state/blocked を解除する。
    2. 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 の「2〜3回実運用確認」を implementation-entry hard gate から外す。
    3. run_retrospective.py を Allowed Paths に追加し、generation-time sidecar registration を scope に入れる。
    4. run_identity を current publication contract の run_id/base_sha/source_set_digest に正規化し、publication_digest を混ぜない。
    5. AC2 を stable resolution_key と generation manifest_digest に分割する。
    6. expires_at: datetime|null と小さい reason-code enum を確定する。
    7. Stop Condition の local file access を「remote/ChatGPT からの private local-file bridge」に限定する。
    8. AC7 の untrusted instruction semantic scan を削除し、closed schema + 既存 public-safety scanner 再利用へ変更する。
    9. v1 は project Skill only、Latitude raw resolver と plugin mirror は Out of Scope と明記する。

    これを反映すれば、新しい security/control-plane harness を増やさず、数百行規模以下の sidecar producer + resolver + focused tests で閉じられる Issueになるはずです。

    現状は implementation-ready とは評価しませんが、外部 dependency 待ちで止める理由もありません。Issue refinement を1 iterationかけて上記 contract repair を入れ、そのまま impl-review-loop に進めるのが推奨です。

  7. squne121 commented on Sep 5, 2026

    @squne121
    OwnerAuthor

    推奨は、#2376 を再 defer せず、指定 OWNER comment を human_context anchor として canonical issue-refinement-loop を最大3 iterationで自律実行することです。

    根拠は明確です。#2376 は現在 open ですが、本文にはまだ #2489 / PR #2496 を未完了 predecessor とする stale 記述が残っています。 一方、#2489 は closed、PR #2496 は merged 済みです。 最新 OWNER comment は REQUEST_CHANGES / GO_AFTER_CONTRACT_REPAIR で、9項目の contract repair 後は implementation へ進める、と明示しています。

    また canonical skill 自体が refinement iteration 間の承認を default_required: false としています。Step 1 の codebase-investigator は SubAgent、必要時の Step 1b は web-researcher、一方 Step 2 review は現在 root-owned pipeline なので、承認不要化のために legacy issue-reviewer を無理に起動する必要はありません。 Claude Code の現行 Auto mode も、permission prompt を減らすためのモードであり、bypassPermissions とは別です。([Claude]1)

    以下を、そのまま Auto mode の対話的 Claude Code セッションに渡すのを推奨します。

    Issue #2376 を、現在の repository に定義されている canonical issue-refinement-loop で refinement してください。

    Target:

    • repository: squne121/loop-protocol
    • issue: #2376
    • anchor comment:
      https://github.com/squne121/loop-protocol/issues/2376#issuecomment-5551373964
    • max_iterations: 3

    目的は、指定 OWNER comment の REQUEST_CHANGES / GO_AFTER_CONTRACT_REPAIR を Issue 本文へ正確に反映し、Issue #2376 を implementation-ready な live contract にすることです。

    これは Issue refinement のみです。

    Issue 本文、canonical refinement 用の必要な label hygiene、canonical refinement/result comment の mutation は許可しますが、以下は行わないでください。

    • 実装
    • implementation 用 branch / worktree の作成
    • PR 作成
    • impl-review-loop の開始
    • merge
    • force push
    • unrelated Issue / PR の mutation

    refinement が成功して implementation-ready になった場合も、canonical Step 5 の handoff/reporting までで停止し、後続 implementation workflow は開始しないでください。

    Autonomous execution policy

    この refinement loop の iteration 間では、人間の承認を求めないでください。

    repository canonical policy の loop_iteration_approval_gate.default_required: false に従い、

    1. investigate
    2. review
    3. needs-fix なら Issue contract を修正
    4. fresh review
    5. 必要なら次 iteration

    を max_iterations まで自動継続してください。

    「Issue本文をこの内容で更新してよいですか?」
    「次のiterationへ進んでよいですか?」
    「レビューをもう一度実行しますか?」

    のような確認は不要です。

    この指示は Claude Code の permission model を変更するものではありません。

    • 現在の Auto mode をそのまま使用する
    • bypassPermissions / --dangerously-skip-permissions へ変更しない
    • permission mode を変更しない
    • repository の canonical command / executor / guard を迂回しない

    Auto mode の classifier 等が required action を拒否した場合は、canonical な代替経路があればそれを試してください。
    それでも required action を自律実行できない場合、私に permission approval を要求して待つのではなく、environment_failure または canonical blocker として fail-closed で停止し、何が実行できなかったかを報告してください。

    Anchor handling

    指定 anchor comment は、この対話で人間が明示的に指定した OWNER comment です。

    したがって canonical issue-refinement-loop の human-context lane として扱い、repository が定義する preflight.run.with_human_context / trusted contract-update 経路を使用してください。

    URL だけを見て human origin を推測する独自処理や、unlabeled/agent-report lane への置き換えはしないでください。

    planner / command registry / canonical executor が判断する内容を prose で再実装せず、repository の SSOT を consume してください。

    Required SubAgent execution

    main Claude Code session は orchestrator として振る舞い、調査作業は canonical SubAgent に委譲してください。

    少なくとも canonical Step 1 の codebase-investigator を SubAgent として実行してください。

    外部仕様・現在の配布仕様等について planner が web research を要求する場合は、canonical Step 1b の web-researcher も SubAgent として実行してください。

    重要:

    SubAgent を起動したら、その SubAgent の作業完了を必ず待ってください。

    foreground execution が可能なら foreground の blocking SubAgent としてください。

    background / parallel execution になった場合も、

    • 各 SubAgent task の completion を確認する
    • 全 required SubAgent が terminal state になるまで待つ
    • 完了した各 SubAgent の結果を取得して main context へ join する
    • その結果を consume してから次 phase に進む

    ことを必須とします。

    SubAgent がまだ実行中の状態で、

    • root review
    • Issue rewrite
    • final readiness judgment
    • loop termination

    へ先行しないでください。

    なお canonical Step 2 は現在 root-owned review pipeline です。
    「SubAgent を使う」という本指示を満たすためだけに legacy issue-reviewer SubAgent を復活させたり、canonical Step 2 を独自構成へ変更したりしないでください。

    Live-state first

    Issue 本文に書かれている dependency status をそのまま信用せず、GitHub の live state と repository assets を調査してください。

    特に最低限、以下を確認してください。

    stale Issue prose と live repository state が衝突する場合は、live state と trusted OWNER anchor を根拠に contract を修正してください。

    Required contract repairs from the OWNER anchor

    anchor comment の指摘を単なる参考情報ではなく、今回の refinement の主要 repair requirements として扱ってください。

    少なくとも以下を Issue 本文へ整合的に反映してください。

    1. Satisfied predecessor

    旧 hard predecessor:

    について live state を再確認し、closed / merged 済みなら blocker を satisfied として記述してください。

    それらを理由に Issue #2376 を再度 deferred にしないでください。

    stale な state/blocked 等が存在し、canonical hygiene で除去可能なら除去してください。

    2. #2375 usability observation

    「#2375 を2〜3回実運用した証拠が揃うまで実装不可」という hard implementation-entry gate は削除してください。

    必要なら WS5 実装後の usability observation / deferred runtime verification として残してください。

    Latitude provider telemetry 自体を WS5 v1 の成功条件にしないでください。

    3. Producer hook / Allowed Paths

    resolver 単体では opaque public evidence_ref から private source location を復元できない問題を解消してください。

    .claude/skills/agent-retrospective/scripts/run_retrospective.py

    を Allowed Paths / implementation scope に追加し、public evidence ref を生成・bind する generation-time に、local private source が既に存在する evidence に限って sidecar mapping を登録できる producer hook を scope に含めてください。

    大規模な framework は追加しないでください。

    4. Current run identity

    resolver の stable identity を、current repository contract に合わせて正規化してください。

    stable identity の中心は:

    • run_id

    • base_sha

    • source_set_digest

    • typed evidence_ref

      • ref_type
      • source_id
      • resource_identity
      • projection_digest

    です。

    publication_digest は run_identity の内部 field として扱わないでください。

    必要なら publication-level optional verification / binding として分離してください。

    retrospective_run_id のような current contract に存在しない名称を新たな canonical name として導入しないでください。

    5. Determinism split

    現行 AC2 の、

    「同一 evidence_ref + run_identity なら同一 digest」
    かつ
    「private_status_at_generation を digest preimage に含める」

    という矛盾を修正してください。

    少なくとも概念上、

    • stable resolution_key
    • generation snapshot の manifest_digest

    を分離してください。

    resolution_key は stable public identity のみから決定論的に生成します。

    generation 時点で変わり得る、

    • private_status_at_generation
    • reason_code
    • object key
    • object digest
    • expires_at

    等は generation snapshot / manifest digest 側へ bind してください。

    access 時の、

    • source disappeared
    • permission changed
    • digest mismatch
    • expired

    等の判定によって stable resolution key や generation snapshot を書き換えない contract にしてください。

    6. Expiry semantics

    expiry を deterministic に test できる程度まで最小限仕様化してください。

    expires_at: RFC3339 UTC | null

    程度の bounded field を基本案とし、

    • null = resolver 独自の expiry なし
    • expiry 判定は access 時のみ
    • background daemon / cleanup service 不要

    としてください。

    既存 repository validator / format checker を再利用し、新しい validation framework は追加しないでください。

    7. Local-file Stop Condition repair

    resolver 自身が local-only private storage を read/write することは core functionality として明示的に許可してください。

    Stop Condition で禁止するのは、

    ChatGPT / remote process から private local file へ直接 bridge する必要が生じた場合

    などの remote/private boundary violation に限定してください。

    resolver 自身の local file access を禁止しないでください。

    8. AC7 / security harness simplification

    untrusted instruction の semantic detection を新規実装する要求は削除してください。

    代わりに、

    • closed schema
    • additionalProperties: false
    • bounded enums / typed fields
    • free-form instruction field をそもそも持たない
    • repository 既存 public-safety validator / scanner を再利用

    で fail-closed boundary を作ってください。

    #2239 等と重複する generic prompt-injection/security scanner/harness を追加する contract にしないでください。

    9. v1 distribution boundary

    v1 は project Skill only としてください。

    今回、

    • plugins/agent-retrospective/... mirror
    • portable plugin implementation
    • Latitude raw trace cache
    • Latitude service の再問い合わせ
    • 「opaque Latitude ref から過去 raw trace を必ず復元できる」という保証

    は Out of Scope にしてください。

    v1 の generic resolver は、

    generation 時に local private source が既に存在する evidence のみ登録可能

    で構いません。

    Latitude evidence が not_materialized / unsupported_ref になることは contract 上の正常系として許可してください。

    portable deep-audit resolver が実際に必要になった場合は別 Issue としてください。

    Design constraints

    個人趣味開発なので、品質と実用性を優先しつつ、control-plane / security harness の追加は最小限にしてください。

    以下のような仕組みは、明確な既存要求がない限り追加しないでください。

    • WAL
    • transaction journal
    • lock service
    • background cleanup daemon
    • bespoke integrity database
    • 新しい canonical JSON infrastructure
    • 新しい generic security scanner
    • 新しい provider-specific cache framework

    可能なら、

    1 resolution_key = 1 manifest file

    のような単純な ownership model を優先してください。

    private manifest に absolute local path を保存せず、configured audit root からの opaque relative object_key 等で表現してください。

    Iteration behavior

    各 iteration で:

    1. canonical preflight / planner を実行
    2. required SubAgent investigation を完了まで待つ
    3. canonical root review を実行
    4. needs-fix / request_changes なら findings を Issue contract へ反映
    5. fresh preflight / fresh review を行う
    6. iteration budget が残っていれば自動継続

    してください。

    特に anchor comment 自体を一度反映しただけで終了せず、修正後の Issue 本文に対する fresh review を必ず実行してください。

    review の blocker を main session が恣意的に「対応済み」と判断して short-circuit しないでください。

    Success condition

    次をすべて満たした場合のみ refinement success としてください。

    success 時は最終状態を簡潔に報告してください。

    最低限:

    • iterations used
    • Issue body updated: yes/no
    • final review verdict/status/next_action
    • implementation_ready
    • remaining blockers
    • changed contract sections
    • SubAgents executed and their completion status
    • implementation / PR creation was not started

    を出してください。

    Stop conditions

    以下の場合のみ自律 loop を停止してください。

    • canonical human_judgment_required
    • max_iterations 到達後も blocker が残る
    • canonical environment/capability failure
    • trusted anchor と repository SSOT の間に機械的に解消不能な矛盾がある
    • required mutation が Auto mode / environment boundary により自律実行不能
    • refinement scope 外の implementation が不可避になる

    単なる REQUEST_CHANGES / needs-fix は、iteration budget が残っている限り停止理由ではありません。

    それでは、canonical issue-refinement-loop を開始し、required SubAgent の完了を待ちながら #2376 を implementation-ready まで refinement してください。

    この形なら、自律性を上げつつ canonical loop を壊さない構成です。特に「SubAgent を必ず待つ」「Step 2 の legacy reviewer を勝手に復活させない」「Auto mode が詰まっても bypass へ逃げない」の3点を明示しているのが重要です。

  8. removed
    state/blocked
    on Sep 5, 2026
  9. squne121 commented on Sep 5, 2026

    @squne121
    OwnerAuthor

    Issue Refinement Loop — 終了報告(iteration 1 / max 3)

    結果: approved(implementation-ready)

    trusted anchor comment(OWNER、#issuecomment-5551373964、判定 REQUEST_CHANGES / GO_AFTER_CONTRACT_REPAIR)が指摘した contract repair をすべて Issue 本文へ反映し、Step 2.5 semantic design review の fresh 独立実行で assessment: clear(findings 0件)を確認しました。

    反映した contract repair

    1. satisfied predecessor: 実装: #1939 Workstream 2 — completion transaction and reconciliation(stop reason taxonomy / runtime lane識別) #2489(CLOSED)/ PR feat: agent_session_manifest/v1 に runtime_lane/completion_outcome/completion_source を追加 (#2489) #2496(MERGED, 2026-09-05T04:09:53Z)を satisfied として記述し、state/blocked ラベルを除去。
    2. 実装: agent-retrospective に Latitude CLI runtime evidence enrichment を追加する #2375 usability observation: 実運用2〜3回評価の確認を implementation-entry hard gate から削除し、WS5実装後の usability observation(deferred runtime verification)へ降格。
    3. producer hook: scripts/run_retrospective.py を Allowed Paths に追加し、evidence_ref 生成/bind 時点の local sidecar registration producer hook を In Scope に明記。
    4. run identity 正規化: resolution key を run_id/base_sha/source_set_digest + typed evidence_ref に固定し、publication_digest は別の optional verification/binding として分離。
    5. determinism split: AC2 を stable resolution_key と generation snapshot の manifest_digest に分離。
    6. expiry semantics: expires_at: RFC3339 UTC | null の bounded field を追加(daemon/cleanup 不要)。
    7. Stop Condition 修正: local file access 禁止を「ChatGPT/remote process からの直接 bridge」に限定し、resolver 自身の local access を明示的に許可。
    8. AC7 簡略化: untrusted instruction の semantic detection を削除し、closed schema + 既存 public-safety validator 再利用へ縮小。
    9. v1 distribution boundary: project Skill only を明記し、plugin mirror / Latitude raw resolver を Out of Scope へ明記。

    Iterations used

    1(deterministic approve → semantic findings 9件 → rewrite → fresh deterministic approve → fresh semantic review assessment: clear)

    Final review

    • deterministic: verdict: approve / canonical_step2_route: step_2_5
    • semantic (fresh, 2回目): assessment: clear, findings: 0
    • joined effective_verdict: approve
    • dependency materialization gate: decision: proceed(no_hard_dependencies_confirmed_this_cycle)

    Implementation readiness

    implementation_ready: true。ただし本 refinement loop の scope により、実装・worktree/branch 作成・PR 作成・impl-review-loop の開始は行っていません。

    Remaining blockers

    なし(P0/P1/P2 いずれも解消済み)。

  10. squne121 commented on Sep 5, 2026

    @squne121
    OwnerAuthor

    Issue #2376 は、最新 refinement で implementation_ready: true、semantic review も findings 0、dependency gate も proceed になっています。したがって、追加 refinement ではなく impl-review-loop をそのまま開始するのが妥当です。

    実装方針は Issue の現行 contract を強く優先します。特に、run_retrospective.py の generation-time producer hook、resolution_key / manifest_digest の分離、available | unavailable の fail-closed、0600 + atomic write、project Skill only、既存 validator/canonical JSON の再利用が中心です。新しい scanner、plugin mirror、Latitude raw cache などへ拡張しないのが重要です。

    また、現在の impl-review-loop 自体が implementation-worker → test-runner → pr-reviewer の委譲型で、最終的に draft_pr_ready で止まり「PR の merge は人間判断」とする設計です。 Step 1 は worker に worktree 作成・実装・検証・PR 起票まで委譲する契約です。

    今回特に強く入れるべきなのは SubAgent completion barrier です。リポジトリの Common Completion Protocol は「result を取得し、さらに canonical task が terminal completed であることを確認して初めて routing する」と明記しています。timeout や途中通知を完了扱いしてはいけません。 Claude Code 側でも foreground subagent は親を完了まで block できます。また Auto mode は子にも継承されます。 ([Claude]1)

    なお、Claude Code の Auto mode は「Claude自身が承認を求めない」運用には適していますが、classifier が操作を拒否したり、拒否が一定回数続くと通常の permission prompt に戻ることはあります。したがって、プロンプトだけで絶対に UI 上の承認要求が発生しないことまでは保証できません。bypassPermissions への切替を指示するより、classifier denial は代替可能な正規経路で回復し、回復不能時のみ blocker として止める設計が適切です。 ([Claude]2)

    以下をそのまま Auto mode の対話的 Claude Code に渡す構成を推奨します。

    GitHub repository squne121/loop-protocol の Issue #2376 を対象に、repository canonical impl-review-loop を実行してください。

    Target:

    • repository: squne121/loop-protocol
    • Issue: #2376
    • URL: https://github.com/squne121/loop-protocol/issues/2376
    • mode: interactive Claude Code / Auto mode
    • max_iterations: 3

    Objective

    Issue #2376 の現行 live contract に従って、

    実装 → 独立検証 → PR review → REQUEST_CHANGES の修正反復

    を自律的に実行し、PR が repository canonical impl-review-loop の draft_pr_ready 条件を満たすところ、つまり merge 直前 まで進めてください。

    通常の途中承認は求めないでください。

    ただし以下は行わないでください。

    最終的に merge 可能な状態まで到達したら、そこで停止してください。


    1. 最初に canonical workflow を読む

    最初に少なくとも以下を current HEAD から読んでください。

    • .claude/skills/impl-review-loop/SKILL.md
    • .claude/skills/impl-review-loop/steps/preparation.md
    • .claude/skills/impl-review-loop/steps/step-1-implementation.md
    • .claude/skills/impl-review-loop/steps/step-2-verification.md
    • .claude/skills/impl-review-loop/steps/step-4-pr-review.md
    • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
    • .claude/skills/impl-review-loop/steps/step-5-mergeability-handling.md
    • .claude/skills/implement-issue/SKILL.md
    • Issue 実装: #1939 Workstream 5 — opaque public evidence/private local audit resolver を追加する #2376 の live body / comments / labels
    • Issue body の Required Design References のうち、実装判断に必要な current repository assets

    過去の handoff comment や artifact を implementation authorization として単独で信用しないでください。

    impl-review-loop の Root-Owned Synchronous Entry Transition を current repository implementation のとおり実行し、

    capability preflight
    → live Issue fetch
    → current-run issue-contract-review
    → live Issue 再取得
    → root entry routing
    → route が implementation 可の場合のみ Step 1

    を同一 root control flow 内で処理してください。

    Issue #2376 の最新 refinement result は参考情報として読んで構いませんが、live state と current-run canonical gate を優先してください。


    2. Human approval policy

    この run では、通常の implementation / verification / review / fix iteration の途中で人間承認を求めないでください。

    以下のような理由だけで止めないでください。

    • 「この実装方針で進めてよいですか」
    • 「テストを実行してよいですか」
    • 「PR を作成してよいですか」
    • 「レビュー修正を適用してよいですか」
    • 「コミットしてよいですか」
    • 「push してよいですか」
    • advisory artifact が missing / stale
    • SubAgent が単に human_review_required: true と自己申告した
    • reviewer が REQUEST_CHANGES を返した
    • CI failure が修正可能
    • branch が BEHIND で canonical update-branch route により回復可能
    • agent discovery failure が repository の bounded recovery route で回復可能

    これらは repository canonical loop の範囲で自律的に処理してください。

    Auto mode classifier がある操作を deny した場合、同じ危険操作を反復したり permission boundary を迂回したりせず、

    1. repository canonical な別経路で実現可能か確認する
    2. scope 内の安全な代替手段があればそれを使う
    3. 操作自体が不要なら省略する
    4. 本当に canonical workflow を完遂不能な場合のみ blocker として終了する

    という順序で処理してください。

    単なる classifier denial を「ユーザーの設計判断が必要」と読み替えないでください。


    3. SubAgent execution is mandatory

    root/main thread は control-plane / state tracking / routing に集中してください。

    repository canonical impl-review-loop が要求する以下の SubAgent を実際に使用してください。

    • Step 1: implementation-worker
    • Step 2: test-runner
    • Step 4: pr-reviewer
    • update-branch やその他の canonical mechanical delegation が必要なら、skill の指定 agent

    root thread が、SubAgent に委譲すべき implementation、独立 verification、PR review を代行して済ませないでください。

    Nested delegation prohibition

    SubAgent 自身には別の SubAgent を起動させないでください。

    SubAgent delegation は root/main thread が管理してください。

    Issue #2376 の Stop Conditions にある nested SubAgent delegation を発生させないでください。


    4. SubAgent completion barrier — 必ず作業完了を待つ

    これは重要です。

    SubAgent を起動した後、その SubAgent の作業完了を確認するまで次の workflow step へ進まないでください。

    repository の Common Completion Protocol を厳密に守ってください。

    各 dispatch について必ず:

    1. spawn_agent / Agent invocation 後に canonical task_name を保存する
    2. 対象 SubAgent の final result を待つ
    3. wait_agent が timeout または途中 mailbox activity を返しても完了扱いしない
    4. final result を実際に取得・消費する
    5. その後 list_agents 相当で canonical task が terminal completed であることを確認する
    6. final result と terminal completed の両方が揃った後にのみ routing する

    次は成功として扱わないでください。

    • timeout
    • progress notification
    • intermediate mailbox update
    • agent started
    • partial result
    • errored
    • interrupted
    • shutdown
    • not_found

    可能なら SubAgent は foreground/blocking execution としてください。

    background execution を使った場合も、root が別工程を先行してはいけません。
    対象 task の final result + terminal completion を確認するまで明示的に待ってください。

    複数の独立した read-only investigation を並列化することは構いませんが、

    Implementation → Verification → PR Review → Judgment

    という依存関係のある canonical phase を並列実行してはいけません。


    5. Issue #2376 の implementation contract を厳守する

    Issue body の live version を SSOT としてください。

    特に現在の設計意図を維持してください。

    Core implementation

    既存 typed evidence_ref

    • ref_type
    • source_id
    • resource_identity
    • projection_digest

    と既存 run_identity

    • run_id
    • base_sha
    • source_set_digest

    を再利用し、private local audit evidence resolver を追加する。

    run_retrospective.py には、public evidence_ref を generation/bind する時点で local private source が既に存在する evidence だけを登録する、小さい generation-time sidecar producer hook を追加する。

    resolver だけ作って producer が存在しない状態にしないこと。

    Identity

    stable identity と generation snapshot digest を明確に分離する。

    resolution_key は次の stable input だけから deterministic に導出する。

    • run_id
    • base_sha
    • source_set_digest
    • ref_type
    • source_id
    • resource_identity
    • projection_digest

    time-varying field を resolution_key preimage に入れない。

    generation snapshot は manifest_digest 側へ bind する。

    access-time の:

    • source disappeared
    • permission changed
    • digest mismatch
    • expired

    で resolution_key / manifest_digest を書き換えない。

    Availability

    resolver が emit する status は:

    • available
    • unavailable

    の2値だけ。

    missing / malformed / digest mismatch / permission mismatch / expired はすべて fail-closed unavailable。

    既存 sibling contract latitude_runtime_evidence/v1 の3値 semantics を変更しない。

    Storage

    local-only storage は resolver の core functionality として許可されている。

    必要な local read/write を「local file access 禁止」と誤解して止めないこと。

    write は current Issue contract の:

    tempfile.mkstemp() → write → os.replace()

    による atomic write と 0600 permission を満たす。

    private manifest に absolute local path を保存しない。

    configured audit root からの opaque relative object_key を使う。

    Expiry

    expires_at は RFC3339 UTC または null。

    null は resolver 独自 expiry なし。

    expiry は access-time lazy evaluation。

    background daemon / cleanup service は追加しない。

    Reuse existing infrastructure

    以下は既存実装を再利用する。

    • canonical JSON
    • RFC3339/date-time checker
    • public-safety validator
    • repository の既存 schema validation infrastructure

    以下は新規追加しない。

    • 新しい canonicalization infrastructure
    • 新しい generic security scanner
    • prompt-injection semantic scanner
    • WAL
    • transaction journal
    • lock service
    • background cleanup daemon
    • bespoke integrity DB
    • provider-specific cache framework

    Distribution boundary

    v1 は project Skill only。

    plugins/agent-retrospective/... mirror を作らない。

    Latitude raw trace cache / provider-specific resolver を追加しない。


    6. Allowed Paths

    Issue #2376 の live Allowed Paths を取得して、その集合を厳密に使ってください。

    現行 contract で想定されているのは少なくとも:

    • .claude/skills/agent-retrospective/SKILL.md
    • .claude/skills/agent-retrospective/schemas/retro_private_audit_index_v1.schema.json
    • .claude/skills/agent-retrospective/schemas/fixtures/retro_private_audit_index_v1.*.json
    • .claude/skills/agent-retrospective/scripts/private_audit_resolver.py
    • .claude/skills/agent-retrospective/scripts/run_retrospective.py
    • .claude/skills/agent-retrospective/scripts/tests/test_private_audit_resolver.py
    • .claude/skills/agent-retrospective/scripts/tests/test_public_safe_evidence_refs.py

    ただし、この prompt のコピーより live Issue body を優先してください。

    Allowed Paths 外の変更が本当に必要なら勝手に拡張せず、Issue の Stop Condition として扱ってください。


    7. Step 1 — implementation-worker

    canonical implementation-worker を起動し、.claude/skills/implement-issue/SKILL.md に従わせてください。

    worker には placeholder ではなく実値を渡してください。

    最低限:

    • Issue number: 2376
    • full Issue URL
    • current live Allowed Paths
    • current Issue contract
    • current iteration
    • fix_delta がある場合は serialized blockers
    • root が repository evidence を基に正規化した technical recommendation

    worker に:

    • canonical dedicated worktree/branch 作成
    • implementation
    • focused tests
    • commit
    • push
    • Draft PR creation

    まで実施させてください。

    終了後は Common Completion Protocol に従い、worker の final result と terminal completed を両方確認してください。


    8. Step 2 — independent verification

    implementation-worker 自身のテスト結果だけで PASS にしないでください。

    canonical test-runner SubAgent に独立検証を委譲してください。

    Issue #2376 の live Verification Commands を literal command として取得し、current candidate HEAD に対して実行・判定させてください。

    Issue body にある AC1〜AC8 をすべて検証対象としてください。

    特に:

    • producer hook が実際に resolver を解決可能にしていること
    • resolution_key / manifest_digest separation
    • fail-closed unavailable
    • atomic write / 0600
    • lazy expiry
    • existing canonical JSON reuse
    • existing safety validator reuse
    • public evidence_ref 単体から claim truth を立証する機能を追加していないこと
    • Allowed Paths compliance

    を確認してください。

    test-runner の final result と terminal completed を確認するまで PR review へ進まないでください。

    current-head adjudication が blocking なら Step 4 を起動せず canonical feedback route へ進んでください。


    9. Step 4 — PR review

    Step 4 current-head gate を canonical script / current repository implementation に従って実施してください。

    有効な current-head verification binding がある場合のみ pr-reviewer を起動してください。

    PR review の前に required CI checks を current reviewed head SHA に対して待機してください。

    CI が失敗した場合は可能な範囲で failed log を取得し、修正可能な blocker として loop に戻してください。

    pr-reviewer は current PR diff を live Issue contract と照合し、少なくとも:

    • Acceptance Criteria
    • Allowed Paths
    • Out of Scope
    • Stop Conditions
    • Verification evidence
    • current-head CI
    • unnecessary framework / overengineering
    • accidental public/private boundary regression
    • existing contract drift

    を敵対的に確認してください。

    pr-reviewer の final result と terminal completed を確認するまで Judgment に進まないでください。


    10. REQUEST_CHANGES は自動修正する

    pr-reviewer が REQUEST_CHANGES を返した場合、人間へ確認せず canonical loop を続行してください。

    blockers を structured fix_delta にし、次の未使用 iteration の implementation-worker に渡してください。

    修正後は必ず:

    Implementation
    → independent Verification
    → current-head gate
    → CI
    → PR Review

    を新しい HEAD に対してやり直してください。

    古い HEAD の verification / review evidence を使い回さないでください。

    max_iterations = 3 の範囲で自律反復してください。


    11. Mergeability recovery

    PR が BEHIND の場合、canonical route_to_update_branch を使用し、指定された worker delegation で branch を更新してください。

    更新後は HEAD が変わったものとして verification / review を再取得してください。

    actual Git conflict がない限り、単なる BEHIND を human escalation にしないでください。

    agent discovery failure についても、repository の Stage A → B → 必要なら C の bounded recovery が適用可能なら、それを先に実行してください。


    12. Stop Conditions

    勝手な approval gate は追加しないでください。

    停止するのは repository / Issue の canonical hard stop に限定してください。

    代表例:

    • Issue 実装: #1939 Workstream 5 — opaque public evidence/private local audit resolver を追加する #2376 の Allowed Paths 外変更が不可避
    • existing canonical schema contract を変更しないと実装不能
    • PUBLISH_REQUEST/publication envelope の変更が不可避
    • scope split / 新規 Issue が必要
    • nested SubAgent delegation が不可避
    • external service / privilege escalation が必要
    • ChatGPT/remote process から private local file への直接 bridge が必要
    • raw/private evidence、credential、secret、absolute local path を public artifact/GitHubへ出す必要がある
    • plugin mirror / portable resolver / Latitude raw cache が必要
    • actual Git conflict
    • explicit live human veto
    • canonical runtime recovery を尽くしても agent execution が genuinely impossible
    • max_iterations 到達

    SubAgent の単なる不安、recommendation、human_review_required: true 自己申告だけで root が停止してはいけません。
    最終停止判断は canonical root routing に従ってください。


    13. Success condition

    次の条件が current PR HEAD についてすべて成立するまで続行してください。

    canonical impl-review-loop が:

    IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready

    を成立させたら成功です。

    そこで停止してください。PR は merge しないでください。


    14. Final report

    途中で人間承認を求めず、現在実行可能な終端まで作業してください。

    最後に簡潔に以下を報告してください。

    さらに SubAgent ごとに:

    • canonical task name
    • agent type
    • purpose
    • final result received: yes/no
    • terminal completed confirmed: yes/no

    を報告してください。

    すべての SubAgent について final result と terminal completion を確認したことが分かるようにしてください。

    作業途中の通常判断については私の承認を待たず、自律的に canonical impl-review-loop を完遂してください。

    この形なら、単に「サブエージェントを使って」と書くより、リポジトリ自身の final result + terminal completed の二重確認を明文化しているため、今回の運用に合っています。

  11. squne121 commented on Sep 5, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-05)

    • PR: feat: opaque public evidence/private local audit resolverを追加する #2510
    • Worktree: .claude/worktrees/issue-2376-private-audit-resolver
    • Branch: worktree-issue-2376-private-audit-resolver
    • Verification: typecheck/lint/test/build 全PASS、AC1-AC8 VC 全PASS(.claude/skills/agent-retrospective/scripts/tests/ フルスイート733 test含む)
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  12. squne121 commented on Sep 5, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-09-05T14:15:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      pr_url: "https://github.com/squne121/loop-protocol/pull/2510"
      head_sha: "f43660c9ecc4289d060b09028b99baca7e774090"
      issue_number: 2376
      termination_reason: approved
      merge_ready: false
      iteration: 1
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations: []
  13. self-assigned this
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent/implementerarea/ai-opsenhancementphase/implementationtriage-required

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions