widget/receiver: payload に sourceContext(repo/branch/commit)を追加する (#96 PR-A) - #108
Merged
Conversation
…PR-A) AI agent が feedback をソースコードに対応付けるための git 由来情報を payload に載せる。#96 のスライス PR-A(sourceContext の配線)。 issue body の agent-ready 再設計は PR-B で行う。 - widget: init オプション sourceContext({ repo, branch, commit, root, buildUrl, previewUrl })を正とし、<meta name="patchloop:*"> タグで フィールド単位に補完する resolveSourceContext を追加。init で一度だけ 解決し、buildPayload に載せる。PAYLOAD_SCHEMA_VERSION を 2 に bump - receiver: validateFeedbackPayload で optional な sourceContext を検証 (object であること・各フィールドが string であること)。store は JSON round-trip 設計のため変更不要 - README(日英): init オプションと payload 項目に sourceContext を追記 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LRdDjwxbAAaTMwwnzipkau
Owner
Author
🔍 レビュー依頼(→ Codex)
|
Owner
Author
📋 レビュー結果(by Codex)判定: ✅ merge 可(must 0 件) — 🟡 should への対応は依頼元判断 🔴 mustなし 🟡 should
依頼元の評価: 採用しない。 理由:
⚪ nitなし レビュアーの確認事項(転記)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
#96 のスライス PR-A。AI agent が feedback をソースコードに対応付けるための git 由来情報(sourceContext)を widget payload に載せ、receiver で検証・保存する。issue body の agent-ready 再設計は PR-B で行う。
設計(#96 で Codex と合意済み)
{ repo, branch, commit, root, buildUrl, previewUrl }(すべて optional string)<meta name="patchloop:repo|branch|commit|root|build-url|preview-url">からフィールド単位で補完変更内容
widget/src/source-context.js(新規):resolveSourceContext(configured, doc)。6 フィールドの whitelist、trim 済み非空 string のみ採用、全滅ならnullwidget/src/index.js:DEFAULTS.sourceContext、init で一度だけ解決、buildPayloadに配線。PAYLOAD_SCHEMA_VERSION1 → 2(コメントの契約どおり shape 変更で bump)server/receive.js:validateFeedbackPayloadに optional なsourceContextの shape 検証を追加(object・各フィールド string)。store は JSON round-trip のためスキーマ変更不要。DEFAULT_SCHEMA_VERSIONは「schemaVersion 無し=旧 payload」への補完なので 1 のままdist/patchloop-widget.js再ビルド検証
npm run check(lint + dist 同期 + 全 112 テスト)greenCloses 条件は #96 の受け入れ条件 1 のみ(2 は PR-B、3 はセッション作業)なので、この PR では #96 を close しない。
🤖 Generated with Claude Code
https://claude.ai/code/session_01LRdDjwxbAAaTMwwnzipkau