Repository navigation
feat: add chatgpt retro context marker support (#1224) - #1251
Conversation
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1251/ The preview will be removed when this PR is closed. |
…hatgpt-retro-context-v1-marker-github-c
squne121
left a comment
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: PR body に AC/検証/Schema Consumer Inventory/Safety Claim Matrix を記載済み
- Allowed Paths: issue #1224 の body は current diff に合わせて更新済みだが、fresh
CONTRACT_REVIEW_RESULT_V1 status: gocomment が未再生成 - CI Verification: required checks は head
e0a7005723c991a8283c51832704ea4833ed7d1cで pass - 検証コマンド結果:
pnpm typecheck/pnpm lint/pnpm test/pnpm buildpass
Blockers
- issue #1224 の live body は current diff に合わせて更新済みだが、fresh body_sha256=
sha256:313ca2b7242a92043567fc4f54b3c6f628c830c259c0259603f365c283159a6eに対するCONTRACT_REVIEW_RESULT_V1 status: gosnapshot comment をrun_contract_review_once.py --mode executeが timeout で再生成できていない
LOOP_VERDICT_V2
verdict: REQUEST_CHANGES
reviewed_head_sha: "e0a7005723c991a8283c51832704ea4833ed7d1c"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers:
- "Fresh CONTRACT_REVIEW_RESULT_V1 go snapshot for body_sha256 sha256:313ca2b7242a92043567fc4f54b3c6f628c830c259c0259603f365c283159a6e is missing because run_contract_review_once.py --mode execute timed out twice."
required_auto_actions: []
auto_fix_applied:
- "Updated issue #1224 Allowed Paths to include scripts/lib/agent-run-report-validation.mjs and restored template Stop Conditions."
follow_up_issue_requests: []
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: PR body に AC 達成状況・Schema Consumer Inventory・Safety Claim Matrix を記載済み
- Allowed Paths: issue #1224 の current body と fresh contract snapshot が current diff に整合
- CI Verification: required checks は head
e0a7005723c991a8283c51832704ea4833ed7d1cで pass - 検証コマンド結果:
pnpm typecheck/pnpm lint/pnpm test/pnpm buildpass
Blockers
- なし
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "e0a7005723c991a8283c51832704ea4833ed7d1c"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied:
- "Updated issue #1224 Allowed Paths to include scripts/lib/agent-run-report-validation.mjs and restored template Stop Conditions."
- "Posted fresh CONTRACT_REVIEW_RESULT_V1 go snapshot for body_sha256 sha256:313ca2b7242a92043567fc4f54b3c6f628c830c259c0259603f365c283159a6e."
follow_up_issue_requests: []
判定: REQUEST_CHANGESPR #1251 は PR は draft/open で、8 files changed / +1346 / -10 の実装差分です。PR本文は schema 2種、marker helper、fixture-based resolver、marker-origin export を主張していますが、実装差分を見る限り live GitHub comment resolver ではなく JSON fixture 入力が中心です。 参照した関連文脈として、親 #1153 は private observation plane と public retrospective plane を分離し、GitHub 上へ raw transcript / full prompt / tool I/O / local path / secret を出さない設計です。#1224 はその Child D として、canonical JSON marker、digest chain、raw GitHub comment body resolver、prompt-injection boundary、expected output schema を固定する scope です。 既存資産としては #1018 の ChatGPT context bundle pipeline、#1000 の retro index workflow、#977 の safe GitHub comment posting helper があり、今回の PR はその上に ChatGPT 用 index-of-indexes を足す位置づけです。 Blocker 1: canonical JSON と言いながら、実装は pretty Markdown digest になっている
外部仕様と照合すると、RFC 8785 JCS は hash/signature の再現性のために JSON を invariant format にし、I-JSON subset、whitespace 非出力、recursive deterministic property sorting を要求します。([RFC Editor]1) したがって、現 PR の 影響: 同一意味の JSON でも key insertion order が異なるだけで digest が変わります。逆に「この digest は canonical JSON の digest である」と読む consumer が誤った信頼を置きます。 要求修正: Blocker 2: resolver が source-set digest を再計算していない
しかし、肝心の 攻撃シナリオ: 攻撃者または stale writer が、retro comment の digest marker と ChatGPT marker payload の 要求修正: resolver は Blocker 3: referenced payload を schema / semantic / public-safety で再検証していないresolver は さらに、resolver の 影響: 外部 GitHub comment を「valid marker っぽい body」として渡せば、内部 payload が current schema に不適合でも bundle source に入る可能性があります。ChatGPT connector boundary としては、これは fail-open です。 要求修正: dereference した各 payload に対して Blocker 4: marker ownership と payload ownership が不一致でも通る外側 comment marker は 攻撃シナリオ: comment の outer marker は 要求修正: payload 抽出直後に Blocker 5: stale write / supersede gate が optional で、古い writer が上書きできる
#1224 は 影響: 2つの agent が同じ target marker を更新した場合、古い writer が 要求修正: 既存 marker があり candidate digest が異なる場合、 Blocker 6: marker-origin mode は live GitHub resolver ではなく fixture mode
これは fixture-driven MVP としては意味がありますが、#1224 の「GitHub connector retro 境界」「raw GitHub comment body resolver」「comment pagination」契約とは別物です。既存 要求修正: PR scope を「fixture-only resolver」へ明確に縮小して #1224 の AC を満たさないことを明記するか、live mode を実装してください。live mode は Blocker 7: prompt-injection / marker breakout fixture が不足しているテストは helper round-trip、duplicate comment、supersede dry-run、retrospective result schema acceptance、および marker-mode happy path が中心です。 #1224 が要求する repo の 要求修正: 少なくとも次の negative fixtures を追加してください。 加えて、outer marker duplicate、digest marker duplicate、payload/outer ownership mismatch、stale supersede mismatch、pagination exhaustion、retro body mutation with unchanged digest marker、source-set missing comment を fail させるべきです。 High 1: retrospective result schema は output safety boundary として弱い
影響: ChatGPT output が 要求修正: High 2: marker target は PR を許すが、result schema と bundle header は issue 固定marker schema は GitHub API 的には pull request は issue でもあるため issue comments endpoint を使うこと自体は妥当です。([GitHub Docs]2) ただし contract 上 要求修正: retrospective result schema を High 3: prerequisite state が schema-only で、real pilot drift を防げない
関連 issue では、#1157 が real development session を blocked とし、#1220 は real telemetry 実走を out of scope にし、#1221 は synthetic evidence mode を前提にしています。 したがって、PR #1251 の marker は vendor docs や hook success から pilot approval を再推定してはいけません。 要求修正: High 4: CLI source mode の混在を拒否していない
影響: operator が marker fixture と stale local JSON sources を混ぜて渡した場合、コマンドは silent に marker mode を採用します。public-safe bundle の入力境界としては曖昧です。 要求修正: High 5: file-mode public safety scanner は依然として fail-open
要求修正: public bundle export では scanner import failure を Medium: 現在のテストは false-green を捕まえないmarker-mode test は retro comment を作るとき、 追加すべき focused tests: pnpm test tests/agent-logs/chatgpt-retro-context-marker.test.ts
pnpm test tests/agent-logs/chatgpt-context-marker-mode.test.tsこの2本に加えて、以下のケースを増やすべきです。 高品質化のための実装修正方針まず 次に canonical digest を一元化してください。 最後に #1245 へ残す範囲を明確化してください。#1245 は finalizer / Latitude / retention 導線を扱う follow-up issue であり、#1224 は marker contract / resolver / bundle boundary / output schema までです。PR #1251 が fixture-only MVPで閉じるなら、#1224 の AC を満たしたとは書かず、「live GitHub resolver と finalizer integration は #1245 に残す」と PR body と issue comment に明記するべきです。 レビューコメント案
|
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: PR body に AC 達成状況・Schema Consumer Inventory・Safety Claim Matrix を記載済み
- Allowed Paths: current diff は issue #1224 の Allowed Paths 内に収まり、fresh contract snapshot comment(body_sha256=sha256:313ca2b7242a92043567fc4f54b3c6f628c830c259c0259603f365c283159a6e)とも整合
- CI Verification: required checks は head 0d02395 で success
- 検証コマンド結果: pnpm lint / pnpm typecheck / pnpm test / pnpm build pass
Blockers
- なし
Non-blockers
- owner comment #issuecomment-4846061290 で指摘された canonical digest・ownership一致・source-set再計算・referenced payload再検証・mixed source mode 拒否・supersede gate 強制は current head で解消済み
LOOP_VERDICT_V2
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: PR body に AC 達成状況・Schema Consumer Inventory・Safety Claim Matrix を記載済み
- Allowed Paths: current diff は issue #1224 の Allowed Paths 内に収まり、fresh contract snapshot comment(body_sha256=sha256:313ca2b7242a92043567fc4f54b3c6f628c830c259c0259603f365c283159a6e)とも整合
- CI Verification: required checks は head 0d02395 で success
- 検証コマンド結果: pnpm lint / pnpm typecheck / pnpm test / pnpm build pass
Blockers
- なし
Non-blockers
- owner comment #issuecomment-4846061290 で指摘された canonical digest・ownership一致・source-set再計算・referenced payload再検証・mixed source mode 拒否・supersede gate 強制は current head で解消済み
LOOP_VERDICT_V2
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: PR body に AC 達成状況・Schema Consumer Inventory・Safety Claim Matrix を記載済み
- Allowed Paths: current diff は issue #1224 の Allowed Paths 内に収まり、fresh contract snapshot comment(body_sha256=sha256:313ca2b7242a92043567fc4f54b3c6f628c830c259c0259603f365c283159a6e)とも整合
- CI Verification: required checks は head 0d02395 で success
- 検証コマンド結果: pnpm lint / pnpm typecheck / pnpm test / pnpm build pass
Blockers
- なし
Non-blockers
- owner comment #issuecomment-4846061290 で指摘された canonical digest・ownership一致・source-set再計算・referenced payload再検証・mixed source mode 拒否・supersede gate 強制は current head で解消済み
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "0d0239576d25f9902ee94c43aef736ca0cfb8a6d"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied:
- "Switched CHATGPT_RETRO_CONTEXT_V1 payload digest generation to canonical JSON bytes."
- "Revalidated referenced run report and retro index payloads, ownership tuple, and recomputed source_set_digest from referenced comments."
- "Made marker update supersede guard mandatory and rejected mixed marker/legacy source modes."
- "Expanded marker-mode and negative-path tests; pnpm lint/typecheck/test/build all pass on head 0d02395."
follow_up_issue_requests: []
Summary / 概要
CHATGPT_RETRO_CONTEXT_V1用の closed schema 2種を追加し、public-safe な marker / retrospective result contract を固定export-chatgpt-contextに marker-origin mode を追加し、GitHub comment fixture から deterministic bundle を生成できるようにしたChecks / 検証
pnpm typecheckを実行して型検査を確認pnpm lintを実行して lint 通過を確認pnpm testを実行して既存テストと追加テストの通過を確認pnpm buildを実行して build 成功を確認Schema Change Applicability / schema 変更該当性
schema_changechatgpt_retro_context_marker/v1とchatgpt_retrospective_result/v1を新規追加し、既存 validator も新 marker schema を認識するよう変更したためSchema Consumer Inventory / schema consumer 棚卸しと参照先整理
この PR で追加した schema と、それを参照する consumer を日本語で棚卸しします。
変更対象 schema:
chatgpt_retro_context_marker/v1,chatgpt_retrospective_result/v1before/after 差分 / 変更前後の要約:
追加前は対象 schema が存在せず、追加後は marker と retrospective result の machine-readable contract を明示します。
Consumer 列挙(rg コマンド例と結果) / 参照箇所一覧:
参照箇所は helper、validator、schema 本体、fixture-driven test に限定されています。
Consumer 更新状況:
scripts/agent-logs/lib/chatgpt-retro-context-marker-helper.mjsscripts/lib/agent-run-report-validation.mjstests/agent-logs/chatgpt-retro-context-marker.test.tstests/agent-logs/chatgpt-context-marker-mode.test.tsdocs/schemas/chatgpt-retro-context-marker.schema.jsondocs/schemas/chatgpt-retrospective-result.schema.jsonCompatibility Decision / 互換性判断
互換性判断は additive change として扱い、既存 consumer を壊さない前提を日本語で明示します。
additivebackward_compatiblenoN/ASafety Claim Matrix / 安全主張マトリクス
安全境界に関する主張は、実装済みの fail-closed 範囲だけに限定して記載します。
pnpm test,tests/agent-logs/chatgpt-retro-context-marker.test.tspnpm test,tests/agent-logs/chatgpt-context-marker-mode.test.tspnpm typecheck,pnpm testNotes / 補足
関連 Issue と MVP 範囲、今回の AI 利用範囲を日本語で補足します。