Repository navigation
fix(#1010): anchor_comment schema を docs required flow に一致させる - #1043
Conversation
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-1043/ The preview will be removed when this PR is closed. |
判定REQUEST CHANGES。 ただし、raw anchor comment body を planner input に流さないという安全境界に抜け道があります。Draft のまま修正すべきです。 確認した関連関係#1010 は 関連 Issue の責務分離は妥当です。#920 は anchor reframe comment template、#1008 は trusted anchor を planner 良い点
GitHub issue comment API から Blocker 1: string id で raw anchor body が planner input に漏れるschema は 修正は ID 型を正規化するのが最小です。 anchor_comment_ids: set[str] = set()
anchor_comment_ids.add(str(comment_payload["id"]))
...
comment_id = comment.get("id")
if comment_id is not None and str(comment_id) in anchor_comment_ids:
sanitized = dict(comment)
sanitized["body"] = "[redacted: anchor comment snapshot stored in artifact]"
planner_comments.append(sanitized)追加テストは必須です。 Blocker 2: artifact boundary test が live 経路を検証していない現在の 修正案: fixture の fixture["comments"] = [
{
"id": "5551001",
"body": "raw anchor body",
"html_url": "...",
"url": "...",
"user": {"login": "owner"},
"author_association": "OWNER",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"issue_url": "...",
}
]その上で Blocker 3: classification / fact-check が実質ダミー値
#1010 は routing や provenance を扱わず、#1008/#1011 に委譲する方針なので、ここで高度な分類器を実装しない判断は正しいです。ただし現状の値は下流が誤解しやすい。最低限、 "classification_reason": "defaulted_by_preflight_schema_normalization; semantic classification deferred to #1008/#1011"より堅い設計は、 Major 1:
|
|
レビュー指摘を反映しました。
ローカル再検証:
|
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable=MERGEABLE, merge_state_status=CLEAN
Evidence Check
- AC coverage: issue #1010 の anchor_comment schema tightening、planner input boundary、format/date-time enforcement、string id redaction を PR diff と追加回帰テストで確認
- Allowed Paths: 変更は
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.pyと.claude/skills/issue-refinement-loop/tests/**のみで contract 内 - CI Verification: head
51268393db82148be018e851e6daac6c27149294でci/agent-session-manifest/Check Japanese Content/deploy-pagesが success - 検証コマンド結果:
uv run pytest .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py .claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py .claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.py .claude/skills/issue-refinement-loop/tests/test_anchor_comment_*.py -qは108 passed
Blockers
- なし
Non-blockers
- Draft 状態のままですが、実装/検証上の blocker ではありません
LOOP_VERDICT_V2
verdict: APPROVE
reviewed_head_sha: "51268393db82148be018e851e6daac6c27149294"
merge_ready: true
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
Summary
この PR の変更概要です。
loop_state.schema.jsonのanchor_commentをdefinitions.anchor_commentに正規化し、required metadata と enum 制約を docs 契約に一致させました。run_refinement_preflight.pyで GitHub issue comment API response から schema-valid な normalized anchor state を生成し、複数 anchor URL・metadata 欠落・raw snapshot 境界違反を fail-closed で検出するようにしました。Checks
実施済みの主要検証です。
pnpm typecheckを実行し、型検査の通過を確認pnpm lintを実行し、lint の通過を確認pnpm testを実行し、repo 全体テストの通過を確認pnpm buildを実行し、ビルド成功を確認uv run pytest .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py .claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py .claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.py .claude/skills/issue-refinement-loop/tests/test_anchor_comment_*.py -qを実行し、anchor comment 回帰の通過を確認Schema Change Applicability
schema 変更有無の判定です。
.claude/skills/issue-refinement-loop/schemas/loop_state.schema.jsonのanchor_commentshape と required fields を変更し、producer-consumer 間の machine-readable contract を更新したためSchema Consumer Inventory
schema consumer への影響一覧です。
変更対象 schema:
loop_state.schema.json#/definitions/anchor_commentbefore/after 差分:
Consumer 列挙(rg コマンド例と結果):
rg -l "loop_state\\.schema\\.json|#/definitions/anchor_comment|anchor_comment_feedback|raw_issue_snapshot/v1|anchor_comment" .claude/skills/issue-refinement-loop .claude/skills/issue-refinement-loop/fixtures/loop_state_v1_fixture.json .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md .claude/skills/issue-refinement-loop/references/loop-state.md .claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py .claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py .claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py .claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.py .claude/skills/issue-refinement-loop/tests/test_anchor_comment_required_fields.py .claude/skills/issue-refinement-loop/tests/test_anchor_comment_scope_impact.py .claude/skills/issue-refinement-loop/tests/test_anchor_comment_classification_aliases.py .claude/skills/issue-refinement-loop/tests/test_anchor_comment_preflight_normalization.py .claude/skills/issue-refinement-loop/tests/test_anchor_comment_multiple_urls.py .claude/skills/issue-refinement-loop/tests/test_anchor_comment_artifact_boundary.pyConsumer 更新状況:
.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/fixtures/loop_state_v1_fixture.json.claude/skills/issue-refinement-loop/tests/test_anchor_comment_required_fields.py.claude/skills/issue-refinement-loop/tests/test_anchor_comment_scope_impact.pynullのみ許可する制約を固定.claude/skills/issue-refinement-loop/tests/test_anchor_comment_classification_aliases.py.claude/skills/issue-refinement-loop/tests/test_anchor_comment_preflight_normalization.py.claude/skills/issue-refinement-loop/tests/test_anchor_comment_multiple_urls.py.claude/skills/issue-refinement-loop/tests/test_anchor_comment_artifact_boundary.py.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/references/loop-state.mdanchor_commentが object である説明は維持され、required field 詳細は docs 正本に委譲済み.claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py.claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.pyanchor_comment_feedbackは planner input artifact には含まれるが、semantic consumption はまだ行っておらず #1008/#1011 側の責務.claude/skills/issue-refinement-loop/tests/test_loop_state_schema.py.claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_thin_entrypoint.pyCompatibility Decision
互換性判断を以下に記載します。
anchor_commentは required metadata とdate-timeformat を schema enforcement する形に tightened され、旧 shape の loop state artifact はそのままでは validation を通らないSafety Claim Matrix
安全境界に関する主張と検証証跡です。
uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_comment_artifact_boundary.py -qで raw snapshot と planner input の分離を検証uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_comment_multiple_urls.py -qでANCHOR_COMMENT_MULTIPLE_UNSUPPORTEDを検証uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_comment_preflight_normalization.py -qと.../test_anchor_comment_required_fields.py -qNotes
補足情報です。
status: goに正規化し、worktree 上で検証しました。