Skip to content

feat: issue-refinement-loop に anchor scope reframe comment schema を追加する #920

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "anchor scope reframe comment の機械可読 schema (ANCHOR_SCOPE_REFRAME_V1) を追加し、GitHub API 由来の author_association を信頼境界として、scope_delta_decision を生成する最小実装を固定する"
change_kind: code

Parent Issue

なし(standalone implementation issue)

Parent Goal Ref

なし

Background

scope_signal_guard は excluded_by_anchor_reframe=false の場合に human_escalation で停止するが、人間がどの形式で anchor comment を書けば excluded_by_anchor_reframe=true として扱われるかが未定義・未文書化である。

Issue #907 の停止では、OWNER が anchor comment を書いていたにもかかわらず、planner が excluded_by_anchor_reframe=false を返したことで loop が停止し、次のアクションが不明確になった。

参考: #907 anchor 決定コメント

anchor comment の現状分析 (#920 anchor comment):

Outcome

ANCHOR_SCOPE_REFRAME_V1 schema が存在し、OWNER/MEMBER/COLLABORATOR の GitHub API author_association を持つ anchor comment が schema validation を通過したとき、scope_delta_decision.status=approved_by_trusted_anchor(implementation_go=false、required_rerun 付き)が生成されることが pytest fixture で固定される。後方互換として excluded_by_anchor_reframe=true を出力する場合でも、primary contract は scope_delta_decision とする。

Current Validated Scope

  • ANCHOR_SCOPE_REFRAME_V1 schema の定義(必須フィールド・required・additionalProperties:false・enum)
  • scope-signal-guard.md への copy/paste 可能 template の追加
  • trusted anchor の判定ロジック(GitHub API author_association を SoT として使用)
  • scope_delta_decision artifact 生成(implementation_go=false + required_rerun 必須)
  • fail-closed fixture(untrusted author / wrong issue / wrong repo / multiple URL / malformed schema / quoted/fenced marker)
  • phase-sensitive semantics の固定(preflight/investigation/review では hard stop せず)

In Scope

  • .claude/skills/issue-refinement-loop/references/scope-signal-guard.md
    • ANCHOR_SCOPE_REFRAME_V1 schema の copy/paste template を追加する
    • plan_refinement_loop.py が期待する marker / field を文書化する
    • trusted anchor 判定の信頼境界(GitHub API author_association)を明記する
  • .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
    • raw anchor body と planner input の境界を明記する
    • normalized decision / hash / provenance のみ planner へ渡す仕様を追記する
  • .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py
    • _is_anchor_reframe_context が期待 marker を検出できる場合は既存実装を document する
    • 期待 schema が未実装の marker がある場合は最小限の deterministic parser を追加する
  • .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
    • GitHub API author_association を anchor trust 判定に使用する
  • .claude/skills/issue-refinement-loop/schemas/anchor_scope_reframe_v1.schema.json
    • required / additionalProperties:false / enum / null handling を固定する
  • .claude/skills/issue-refinement-loop/tests/
    • new_allowed_path_layer を明示的に許可する anchor comment fixture で excluded_by_anchor_reframe=true / scope_delta_decision.status=approved_by_trusted_anchor になること
    • anchor comment が対象 Issue 外の URL の場合は従来どおり fail-closed すること
    • untrusted author / wrong issue / wrong repo / multiple URL / malformed schema / quoted/fenced marker のすべてが fail-closed になること
    • phase-sensitive routing の fixture(preflight では hard stop せず、post_rewrite_check では hard stop すること)

Allowed Paths

  • .claude/skills/issue-refinement-loop/references/scope-signal-guard.md
  • .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
  • .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/schemas/anchor_scope_reframe_v1.schema.json
  • .claude/skills/issue-refinement-loop/schemas/refinement_loop_plan_v1.json
  • .claude/skills/issue-refinement-loop/tests/
  • .claude/skills/issue-refinement-loop/fixtures/

Acceptance Criteria

  • AC1: ANCHOR_SCOPE_REFRAME_V1 の copy/paste template が scope-signal-guard.md に存在し、target repo / issue_number / allowed_path_deltas / rationale / required_rerun を含む
  • AC2: template は schemas/anchor_scope_reframe_v1.schema.json で validation され、required / additionalProperties:false / enum / null handling が固定される
  • AC3: GitHub API 由来の author_association in OWNER|MEMBER|COLLABORATOR、target issue 一致、target repo 一致、単一 anchor URL の場合だけ trusted anchor とする
  • AC4: CONTRIBUTOR / NONE / missing metadata / wrong issue / wrong repo / multiple anchor URL / malformed schema / quoted marker / fenced-code marker は fail-closed
  • AC5: trusted anchor は implementation_go=false かつ required_rerun 付きの scope_delta_decision を生成する。scope 拡張の自動実装許可は禁止
  • AC6: planner input に raw anchor comment body を流さない。raw snapshot は artifact 境界に残し、planner へは normalized decision / hash / provenance のみ渡す
  • AC7: phase-sensitive semantics を固定する。preflight / investigation / review では hard stop せず、post_rewrite_check / decide_next_action でのみ hard stop 判定する
  • AC8: 後方互換 adapter として必要な場合だけ excluded_by_anchor_reframe=true を出すが、primary contract は scope_delta_decision.status=approved_by_trusted_anchor とする

Verification Commands

# AC1
$ rg -n "ANCHOR_SCOPE_REFRAME_V1" .claude/skills/issue-refinement-loop/references/scope-signal-guard.md

# AC2
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_schema.py -q

# AC3
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_preflight.py -q -k "trusted_anchor"

# AC4
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_preflight.py -q -k "fail_closed"

# AC5
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_preflight.py -q -k "scope_delta"

# AC6
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop.py -q -k "anchor_reframe or scope_delta"

# AC7
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_phase_sensitive.py -q

# AC8
# baseline-expect: pass
$ rg -n "excluded_by_anchor_reframe" .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py
$ pnpm typecheck
$ pnpm lint

Remaining Parent Gaps

なし(standalone issue)

Required Skills

  • Python / pytest(schema validation・fail-closed fixture)
  • JSON Schema Draft 2020-12(required・additionalProperties・enum・null)
  • GitHub REST API(issue comments author_association metadata)
  • issue-refinement-loop スキル実装(scope_signal_guard・phase gate・planner known_context)

Stop Conditions

  • AC1〜AC8 の全 pytest fixture が pass すること
  • pnpm typecheck / pnpm lint が pass すること
  • raw anchor comment body が planner input に含まれないこと(AC6 fixture)
  • phase-sensitive routing の regression がないこと(AC7 fixture)
  • run_refinement_preflight.py および plan_refinement_loop.py の Allowed Paths 外変更がないこと

Non-Goals

Out of Scope

  • anchor comment を自動生成するツールの追加
  • scope 拡張の自動実装許可
  • superseded_by_decision の anchor comment format
  • #1008 / #1010 が担う planner known_context 伝播・正規化 API の変更

Activity

  1. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    判定

    #920 は方向性は正しいが、現状の Issue 契約のまま実装すると危険です。
    「anchor comment に marker があれば excluded_by_anchor_reframe=true」という単純化に寄ると、#1010 / #1008 / #1013 / #1090 で分離されている安全境界を壊します。実装前に Issue 本文を更新し、“人間コメントによる scope delta approval” は実装許可ではなく、再チェック要求つきの構造化入力として扱う契約に直すべきです。

    #920 自体は open で、本文は「anchor reframe comment template を追加し、anchor_comment_url 経由で excluded_by_anchor_reframe=true になる fixture を固定する」Issue です。直接コメントはありません。

    主要な危険点

    1. #920 は現在の repo reality に対して古い

    #920 は scope-signal-guard.md / plan_refinement_loop.py / tests / schemas に閉じた修正として設計されていますが、後続の #1010 / PR #1043 で anchor_comment は run_refinement_preflight.py が GitHub issue comment API response から正規化する契約に移っています。#1043 は required metadata、enum、複数 anchor URL fail-closed、raw snapshot と planner input の境界を扱っています。

    このため、#920 で plan_refinement_loop.py が raw comment body から marker を直読みする実装に寄せるのは逆行です。現在の plan_refinement_loop.py は known_context.classification in ("feedback_update_required", "reframe_in_place") または known_context.anchor_comment_url && known_context.anchor_reframe で anchor reframe を見る実装になっており、raw comment marker parser ではありません。

    2. excluded_by_anchor_reframe=true は「実装してよい」ではない

    #1090 は #920 を blocker にしており、より新しい整理では ANCHOR_SCOPE_REFRAME / Scope Delta Approval / Allowed Paths Expansion Rationale を検出した場合でも、結果は proceed_with_notes であり、「contract-review rerun required、実装 go ではない」と定義しています。

    したがって #920 の Outcome / AC は、excluded_by_anchor_reframe=true だけで閉じるべきではありません。最低でも以下の語彙に変えるべきです。

    scope_delta_decision:
      status: approved_by_trusted_anchor
      implementation_go: false
      required_rerun:
        - contract_review
        - refinement_preflight

    3. author_association をコメント本文から信じる設計は不可

    GitHub issue comments API は comment response に id, url, html_url, body, user, created_at, updated_at, issue_url, author_association を返します。author_association は API 由来の metadata として扱うべきで、コメント本文に書かれた author_association: OWNER のような値を信じてはいけません。([GitHub Docs]1)

    #920 の AC4 は「OWNER 相当の author_association が必要」とだけ書いていますが、source of truth が GitHub API response であること、CONTRIBUTOR / NONE は fail-closed であること、off-repo / wrong issue / multiple anchor URL / stale snapshot を拒否することまで AC に入れるべきです。

    4. phase gate と衝突する可能性がある

    現在の scope-signal-guard.md は phase-sensitive です。preflight / investigation / review phase では decide_next_loop_action.py を呼ばず、scope_signal_guard.triggered=true でも hard stop ではありません。hard stop eligible なのは post_rewrite_check / decide_next_action です。

    #920 の fixture は「excluded_by_anchor_reframe=true になる」だけでは不足です。少なくとも phase 別に以下を固定すべきです。

    preflight:
      scope_signal_guard.triggered=true
      excluded_by_anchor_reframe=true
      next: continue_investigation
      decide_next_loop_action.py: not_called
    
    post_rewrite_check:
      scope_signal_guard.triggered=true
      excluded_by_anchor_reframe=false
      next: human_escalation
    

    なお #1030 のレビューでは、phase gate 実装時に approve verdict + max_iterations の既存動作を壊す out-of-scope regression が実際に指摘されています。#920 でも routing / phase / iteration に触るなら、同種 regression を明示的に防ぐ必要があります。

    外部実装調査からの改善点

    JSON Schema では properties に書いただけでは必須にならず、required が必要です。また additionalProperties: false を入れない限り未知 field は許可されます。([JSON Schema]2) (JSON Schema)
    enum には JSON の null を値として含められます。"null" という文字列ではなく、本物の null を許可する設計にすべきです。([JSON Schema]3)
    さらに Python の jsonschema は format keyword をデフォルトでは検証しません。date-time を enforcement claim にするなら FormatChecker を使う必要があります。([jsonschema]4)

    したがって #920 で schema を追加するなら、最低限こうするべきです。

    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "anchor_scope_reframe_v1.schema.json",
      "title": "ANCHOR_SCOPE_REFRAME_V1",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "target",
        "decision",
        "allowed_path_deltas",
        "rationale",
        "required_rerun"
      ],
      "properties": {
        "schema_version": {
          "const": "anchor_scope_reframe/v1"
        },
        "target": {
          "type": "object",
          "additionalProperties": false,
          "required": ["repo", "issue_number"],
          "properties": {
            "repo": { "type": "string", "const": "squne121/loop-protocol" },
            "issue_number": { "type": "integer", "minimum": 1 }
          }
        },
        "decision": {
          "enum": ["approve_scope_delta"]
        },
        "allowed_path_deltas": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["path", "reason"],
            "properties": {
              "path": { "type": "string", "minLength": 1 },
              "reason": { "type": "string", "minLength": 1 }
            }
          }
        },
        "rationale": { "type": "string", "minLength": 1 },
        "required_rerun": {
          "type": "array",
          "items": {
            "enum": ["contract_review", "refinement_preflight", "allowed_paths_gate"]
          },
          "minItems": 1,
          "uniqueItems": true
        }
      }
    }

    #920 本文への修正案

    Allowed Paths を修正

    現状の Allowed Paths は狭すぎます。#1010 / #1008 との境界を守るなら、plan_refinement_loop.py だけでなく preflight 正規化・schema・reference・fixtures を明示すべきです。

    ## Allowed Paths
    
    - `.claude/skills/issue-refinement-loop/references/scope-signal-guard.md`
    - `.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md`
    - `.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/schemas/anchor_scope_reframe_v1.schema.json`
    - `.claude/skills/issue-refinement-loop/schemas/refinement_loop_plan_v1.json`
    - `.claude/skills/issue-refinement-loop/tests/`
    - `.claude/skills/issue-refinement-loop/fixtures/`

    ただし、run_refinement_preflight.py まで入れるなら #1008 との責務重複を避けるため、#920 は「schema + normalized decision artifact 生成まで」、#1008 は「planner known_context への伝播」と切るのが安全です。#1008 は明示的に #920 に依存しており、trusted anchor comment を planner known_context に渡す責務を持っています。

    AC を差し替え

    ## Acceptance Criteria
    
    - [ ] AC1: `ANCHOR_SCOPE_REFRAME_V1` の copy/paste template が `scope-signal-guard.md` に存在し、target repo / issue_number / allowed_path_deltas / rationale / required_rerun を含む
    - [ ] AC2: template は `schemas/anchor_scope_reframe_v1.schema.json` で validation され、`required` / `additionalProperties:false` / enum / null handling が固定される
    - [ ] AC3: GitHub API 由来の `author_association in OWNER|MEMBER|COLLABORATOR`、target issue 一致、target repo 一致、単一 anchor URL の場合だけ trusted anchor とする
    - [ ] AC4: `CONTRIBUTOR` / `NONE` / missing metadata / wrong issue / wrong repo / multiple anchor URL / malformed schema / quoted marker / fenced-code marker は fail-closed
    - [ ] AC5: trusted anchor は `implementation_go=false` かつ `required_rerun` 付きの `scope_delta_decision` を生成する。scope 拡張の自動実装許可は禁止
    - [ ] AC6: planner input に raw anchor comment body を流さない。raw snapshot は artifact 境界に残し、planner へは normalized decision / hash / provenance のみ渡す
    - [ ] AC7: phase-sensitive semantics を固定する。preflight / investigation / review では hard stop せず、`post_rewrite_check` / `decide_next_action` でのみ hard stop 判定する
    - [ ] AC8: 後方互換 adapter として必要な場合だけ `excluded_by_anchor_reframe=true` を出すが、primary contract は `scope_delta_decision.status=approved_by_trusted_anchor` とする

    Verification Commands を強化

    # schema shape
    uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_schema.py -q
    
    # trusted / untrusted author, wrong issue, wrong repo, multiple URL, malformed schema
    uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_scope_reframe_preflight.py -q
    
    # planner consumes only normalized known_context, not raw comment body
    uv run pytest .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop.py -q -k "anchor_reframe or scope_delta"
    
    # phase-sensitive routing
    uv run pytest .claude/skills/issue-refinement-loop/tests/test_refinement_phase_gate.py -q -k "scope_signal_guard or anchor"
    
    # repo-wide gates
    pnpm typecheck
    pnpm lint

    pytest の --import-mode=importlib は sys.path を変更せず、test module 名の重複を避けられる一方で、test module 同士の直接 import には制約があります。#1100 で importlib mode を採用しているため、新規テストは conftest.py / helper 配置に注意が必要です。([pytestドキュメント]5)

    最終レビューコメント案

    REQUEST CHANGES
    
    #920 は必要な Issue ですが、現状の契約のまま実装すると危険です。
    
    主な問題は、anchor comment を `excluded_by_anchor_reframe=true` に直結させる設計が、#1010 の anchor_comment 正規化、#1008 の trusted anchor → planner known_context 伝播、#1013 の phase gate、#1090 の scope delta approval lane と衝突する点です。
    
    修正してください。
    
    1. `ANCHOR_SCOPE_REFRAME_V1` schema を追加し、marker 文字列ではなく schema-valid な scope delta approval として扱う。
    2. `author_association` は GitHub API response の metadata を SoT とし、コメント本文の自己申告を信じない。
    3. target repo / issue_number 一致、単一 anchor URL、trusted author、allowed_path_deltas 明示を必須にする。
    4. trusted anchor の効果は `implementation_go=false` + `required_rerun` 付きの `scope_delta_decision` とする。scope 拡張の自動実装許可は禁止。
    5. raw anchor body を planner input に流さない。planner へ渡すのは normalized decision / provenance / hash のみ。
    6. preflight / investigation / review phase では hard stop しない。`post_rewrite_check` / `decide_next_action` でのみ hard stop eligible とする。
    7. untrusted author、wrong issue、wrong repo、multiple URL、malformed schema、quoted marker、fenced-code marker、metadata 欠落はすべて fail-closed fixture で固定する。
    
    この修正を入れない場合、#920 は「人間判断を尊重する仕組み」ではなく「marker で scope_signal_guard を迂回する仕組み」になります。

    結論として、#920 は 実装前に契約更新が必要です。特に excluded_by_anchor_reframe を primary contract にしないこと、API metadata を信頼境界にすること、phase gate と raw body 境界を壊さないことが必須です。

  2. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor
    schema: LOOP_HANDOFF_RESULT_V1
    termination_reason: approved
    issue_number: 920
    iteration: 0
    verdict: approve
    summary: |
      Issue #920 の issue-refinement-loop が完了しました。
      anchor comment(#issuecomment-4761963707)で指示された契約修正をすべて適用し、
      reviewer が APPROVE 判定を下しました。
    changes_applied:
      - 必須セクション追加: Parent Issue, Parent Goal Ref, Current Validated Scope, Remaining Parent Gaps, Required Skills, Stop Conditions, Out of Scope
      - AC を AC1-AC8 に更新(scope_delta_decision primary contract / author_association SoT / phase-sensitive semantics)
      - Allowed Paths 拡張: anchor-comment-handling.md, run_refinement_preflight.py, anchor_scope_reframe_v1.schema.json, fixtures/
      - Outcome を scope_delta_decision primary contract に更新
      - Verification Commands 修正(LP016/VCS001/LP010 解消、baseline-expect: fail 追加)
      - goal_ref 更新(ANCHOR_SCOPE_REFRAME_V1 + GitHub API author_association + scope_delta_decision)
    preflight_result: pass
    next_action: impl-review-loop または issue-contract-review でこの Issue の実装着手が可能です
  3. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor
    schema: CONTRACT_REVIEW_RESULT_V1
    issue_number: 920
    status: blocked
    body_sha256: sha256:70d14168d81f5176db2e8cc3cf48dd86be4bd6200dcfbb42d8304153f1f894f3
    generated_at: 2026-06-21T12:50:00Z
    checks:
      template_compliance: pass
      state_label: pass
      allowed_paths_present: pass
      vc_present: pass
      stop_conditions_complete: pass
      product_spec_check:
        applicability: not_applicable
        decision: pass
      worktree_branch_collision: pass
      ac_verifiability: blocked
      vc_preflight:
        status: blocked
        summary:
          expected_fail: 5
          unexpected_pass: 0
          blocked: 1
          human_judgment: 3
          expected_pass: 3
          skipped: 0
        classifications:
          - ac: AC1
            exit_code: 1
            classification: expected_fail
            decision: go
          - ac: AC2
            raw_command: 'rg -n "required" .claude/skills/issue-refinement-loop/schemas/anchor_scope_reframe_v1.schema.json'
            exit_code: 2
            classification: human_judgment
            decision: human_judgment
            note: 'baseline-expect: fail はexit1を期待するがexit2(file not found)が返った。スキーマファイル未作成'
          - ac: AC2
            raw_command: 'rg -n "additionalProperties" ...schema.json'
            exit_code: 2
            classification: human_judgment
            decision: human_judgment
          - ac: AC2
            raw_command: 'uv run pytest tests/test_anchor_scope_reframe_schema.py -q'
            exit_code: 4
            classification: expected_fail
            decision: go
          - ac: AC3
            exit_code: 4
            classification: expected_fail
            decision: go
          - ac: AC4
            exit_code: 4
            classification: expected_fail
            decision: go
          - ac: AC5
            exit_code: 4
            classification: expected_fail
            decision: go
          - ac: AC6
            raw_command: 'uv run pytest test_plan_refinement_loop.py -q -k "anchor_reframe or scope_delta"'
            exit_code: 0
            classification: expected_pass
            decision: go
            note: '2 passed, 44 deselected'
          - ac: AC7
            raw_command: 'uv run pytest test_refinement_phase_gate.py -q -k "scope_signal_guard or anchor"'
            exit_code: 5
            classification: blocked
            category: vc_no_tests_collected
            decision: blocked
            note: 'test_refinement_phase_gate.py に 39 tests 存在するが -k フィルタが 0 件マッチ。exit5 = hard-block'
          - ac: AC8
            raw_command: 'rg -n "excluded_by_anchor_reframe" scripts/plan_refinement_loop.py'
            exit_code: null
            classification: human_judgment
            category: invalid_baseline_expect_annotation
            decision: human_judgment
            note: '"# baseline-expect: pass (exit0)" は無効アノテーション。"pass" に修正が必要'
          - ac: AC8
            raw_command: pnpm typecheck
            exit_code: 0
            classification: expected_pass
            decision: go
          - ac: AC8
            raw_command: pnpm lint
            exit_code: 0
            classification: expected_pass
            decision: go
      next_action: vc_fix_required
      blocked_reasons:
        - id: BLOCKED_AC7_EXIT5
          ac: AC7
          severity: hard_block
          description: >
            test_refinement_phase_gate.py は 39 tests 存在するが
            -k "scope_signal_guard or anchor" フィルタが 0 件マッチして exit5。
            既存ファイルへの -k フィルタ適用は baseline で exit5 = always blocked。
          fix: >
            新規テスト専用ファイル(例: test_anchor_phase_sensitive.py)を VC に使用する。
            uv run pytest .claude/skills/issue-refinement-loop/tests/test_anchor_phase_sensitive.py -q
            これにより exit4 (file not found) = expected_baseline_fail/go になる。
        - id: HUMAN_JUDGMENT_AC2_RG_EXIT2
          ac: AC2
          severity: annotation_fix
          description: >
            anchor_scope_reframe_v1.schema.json 未作成で rg exit2 (file not found)。
            baseline-expect: fail は exit1 を期待するため human_judgment。
          fix: >
            rg コマンドの target file が未作成の場合、baseline-expect アノテーションを削除するか
            pytest VC のみで検証する。
        - id: HUMAN_JUDGMENT_AC8_INVALID_ANNOTATION
          ac: AC8
          severity: annotation_fix
          description: '"# baseline-expect: pass (exit0)" は無効アノテーション構文'
          fix: '"# baseline-expect: pass" に修正する(括弧不要)'
  4. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor
    schema: CONTRACT_REVIEW_RESULT_V1
    issue_number: 920
    status: go
    body_sha256: sha256:e79b227d40ef0bd237114ff330d45f87baa6158e6822a4f8b85bf4dcc81c2fe8
    generated_at: 2026-06-21T12:56:00Z
    worktree: .claude/worktrees/issue-920-anchor-scope-reframe
    branch: worktree-issue-920-anchor-scope-reframe
    checks:
      template_compliance: pass
      state_label: pass
      allowed_paths_present: pass
      vc_present: pass
      stop_conditions_complete: pass
      product_spec_check:
        applicability: not_applicable
        decision: pass
      worktree_branch_collision: pass
      ac_verifiability: pass
      vc_preflight:
        status: pass
        summary:
          expected_fail: 6
          unexpected_pass: 0
          blocked: 0
          human_judgment: 0
          expected_pass: 4
          skipped: 0
        classifications:
          - ac: AC1
            raw_command: 'rg -n "ANCHOR_SCOPE_REFRAME_V1" .claude/skills/issue-refinement-loop/references/scope-signal-guard.md'
            exit_code: 1
            classification: expected_fail
            decision: go
            scope_class: baseline_fail_expected
          - ac: AC2
            raw_command: 'uv run pytest .../test_anchor_scope_reframe_schema.py -q'
            exit_code: 4
            classification: expected_fail
            decision: go
            scope_class: baseline_fail_expected
          - ac: AC3
            exit_code: 4
            classification: expected_fail
            decision: go
          - ac: AC4
            exit_code: 4
            classification: expected_fail
            decision: go
          - ac: AC5
            exit_code: 4
            classification: expected_fail
            decision: go
          - ac: AC6
            raw_command: 'uv run pytest test_plan_refinement_loop.py -q -k "anchor_reframe or scope_delta"'
            exit_code: 0
            classification: expected_pass
            decision: go
            note: '2 passed, 44 deselected'
          - ac: AC7
            raw_command: 'uv run pytest .../test_anchor_phase_sensitive.py -q'
            exit_code: 4
            classification: expected_fail
            decision: go
            scope_class: baseline_fail_expected
          - ac: AC8
            raw_command: 'rg -n "excluded_by_anchor_reframe" .../plan_refinement_loop.py'
            exit_code: 0
            classification: expected_pass
            decision: go
            note: '4 matches found (existing implementation)'
          - ac: AC8
            raw_command: pnpm typecheck
            exit_code: 0
            classification: expected_pass
            decision: go
          - ac: AC8
            raw_command: pnpm lint
            exit_code: 0
            classification: expected_pass
            decision: go
      next_action: implement_issue
      contract_snapshot:
        outcome: >
          ANCHOR_SCOPE_REFRAME_V1 schema が存在し、OWNER/MEMBER/COLLABORATOR の
          GitHub API author_association を持つ anchor comment が schema validation を通過したとき、
          scope_delta_decision.status=approved_by_trusted_anchor(implementation_go=false、required_rerun 付き)
          が生成されることが pytest fixture で固定される。
        acceptance_criteria:
          - 'AC1: ANCHOR_SCOPE_REFRAME_V1 template が scope-signal-guard.md に存在'
          - 'AC2: template は anchor_scope_reframe_v1.schema.json で validation される'
          - 'AC3: OWNER/MEMBER/COLLABORATOR のみ trusted anchor'
          - 'AC4: untrusted/wrong/malformed は fail-closed'
          - 'AC5: implementation_go=false + required_rerun 固定'
          - 'AC6: raw anchor body を planner に流さない'
          - 'AC7: phase-sensitive semantics (preflight=no hard stop, post_rewrite_check=hard stop)'
          - 'AC8: primary contract は scope_delta_decision'
        allowed_paths:
          - .claude/skills/issue-refinement-loop/references/scope-signal-guard.md
          - .claude/skills/issue-refinement-loop/references/anchor-comment-handling.md
          - .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/schemas/anchor_scope_reframe_v1.schema.json
          - .claude/skills/issue-refinement-loop/schemas/refinement_loop_plan_v1.json
          - .claude/skills/issue-refinement-loop/tests/
          - .claude/skills/issue-refinement-loop/fixtures/
        worktree: .claude/worktrees/issue-920-anchor-scope-reframe
        branch: worktree-issue-920-anchor-scope-reframe
    notes:
      - 'VC 修正: AC7 を test_refinement_phase_gate.py -k フィルタ(exit5 hard-block) から test_anchor_phase_sensitive.py(exit4) に変更'
      - 'VC 修正: AC2 の rg コマンド(未作成ファイルで exit2/human_judgment) を除去、pytest VC のみに統一'
      - 'VC 修正: AC8 の baseline-expect アノテーション pass (exit0) → pass に修正'
      - 'excluded_by_anchor_reframe は plan_refinement_loop.py に既存実装あり (4 matches, AC8 pass)'
  5. added 2 commits that reference this issue on Jun 21, 2026
  6. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup: 完了 (2026-06-21)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: post-merge-cleanup
      follow_up_issues:
        - request_dedupe_key: "follow-up:920:impl-anchor-trusted-context:#1008"
          status: reused_open
          issue:
            number: 1008
            url: https://github.com/squne121/loop-protocol/issues/1008
          reason: Issue #1008 は既存 OPEN — 新規起票不要
    
        - request_dedupe_key: "follow-up:920:scope-delta-escalation-lane:#1090"
          status: reused_open
          issue:
            number: 1090
            url: https://github.com/squne121/loop-protocol/issues/1090
          reason: Issue #1090 は既存 OPEN — 新規起票不要
    
      note_only_observations: []

    cleanup 内容:

    • worktree /.claude/worktrees/issue-920-anchor-scope-reframe 削除 ✓
    • ローカル branch worktree-issue-920-anchor-scope-reframe 削除 ✓
    • remote branch は GitHub auto-delete-on-merge で削除済み ✓
    • main を origin/main に同期 (3f2198a) ✓
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions