Skip to content

実装: heading policy expected-key 導出を issue-form schema-aware parsing に強化 #678

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "#646"
goal_ref: "guard-japanese-prose と issue contract authoring の境界を SSOT 化し、heading policy expected-key 導出を issue-form schema-aware parsing に置き換えて checkbox option label 混入を機械的に防止する"
change_kind: code

Parent Issue

#646

Parent Goal Ref

Current Validated Scope

  • .claude/skills/create-issue/scripts/tests/test_heading_policy.py の template heading inventory helper を regex ベースから YAML schema-aware parsing に置き換え、.github/ISSUE_TEMPLATE/implementation.yml の body 配列を yaml.safe_load で解釈して expected-key 導出を行う
  • expected-key 導出は current template で issue body heading 化される top-level form element の attributes.label のみを対象にし、type: markdown 要素と nested checkboxes.options[].label のような option label は取り込まない
  • regression test を追加し、checkbox option label や非 submitted scaffolding text が expected-key set に混入しないことを固定する

Remaining Parent Gaps

Outcome

test_heading_policy.py の expected-key 導出が .github/ISSUE_TEMPLATE/implementation.yml の YAML schema-aware parsing に置き換わり、heading 化されない checkbox option label や markdown scaffolding text が expected-key set に混入しないことを regression test で固定した状態になっている。

In Scope

  • test_heading_policy.py の _extract_template_labels() を re.findall 依存から YAML schema-aware parsing(yaml.safe_load + dict["body"] list 走査)に置き換える
  • type: textarea / input / dropdown / checkboxes / upload の top-level attributes.label のみを expected-key 導出対象にし、type: markdown は skip、unknown type は ValueError で fail-fast にする
  • tmp_path に synthetic issue form YAML(type: checkboxes と options[].label を含む)を生成する regression test を追加する
  • yml_path が存在しない・YAML malformed・body が list でない場合に fail-fast するテストを追加する

Out of Scope

  • production HEADING_POLICY / prose_boundary_policy.py の意味変更
  • SCAFFOLDING_HEADINGS を production/shared SSOT に移す変更
  • implementation.yml 自体の構造変更
  • test_heading_policy.py 以外の validator / checker / hook への schema-aware parser 横展開

Acceptance Criteria

  • AC1: _extract_template_labels() 内で line-based label: regex(re.findall / re.search を使った label: 行スキャン)を使わない。yaml.safe_load() の戻り値から dict["body"] を list として走査する
  • AC2: expected-key 導出は type: textarea / input / dropdown / checkboxes / upload の top-level attributes.label のみを対象とし、type: markdown 要素は skip する。checkboxes.attributes.options[].label などの nested label は走査対象に含めない。unknown type は ValueError で fail-fast する
  • AC3: tmp_path に type: markdown・type: checkboxes(options[].label を含む)・type: textarea を含む synthetic issue form YAML を生成し、_extract_template_labels() が top-level non-markdown attributes.label のみを返すことを直接検証する regression test が追加されている
  • AC4: yml_path が存在しない場合・YAML malformed の場合・body が list でない場合に return [] でなく ValueError などで fail-fast することをテストで確認している
  • AC5: uv run pytest .claude/skills/create-issue/scripts/tests/ が PASS する

Verification Commands

# AC1
$ rg "yaml\.safe_load" .claude/skills/create-issue/scripts/tests/test_heading_policy.py

# AC2
$ rg "ValueError" .claude/skills/create-issue/scripts/tests/test_heading_policy.py

# AC3
$ rg "tmp_path" .claude/skills/create-issue/scripts/tests/test_heading_policy.py

# AC4
$ rg "pytest.raises(ValueError)" .claude/skills/create-issue/scripts/tests/test_heading_policy.py

# AC5
$ uv run pytest .claude/skills/create-issue/scripts/tests/

Allowed Paths

  • .claude/skills/create-issue/scripts/tests/test_heading_policy.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

Required Skills

  • Python / pytest

Scope Delta(任意)

N/A

Delivery Rule

Background

PR #675 の review comment で、今回の near-equivalence test hardening は merge 可能だが、implementation.yml 由来の expected-key 導出が regex に依存している点は follow-up として残すべきと指摘された。現状の regex は top-level form element と nested option label を区別せず、将来的に checkboxes.options[].label や別 form type が追加された場合、heading 化されない label を expected-key set に混入させる余地がある。follow-up では expected-key 導出を YAML schema-aware parsing に寄せ、issue body heading として materialize される label だけを deterministic に拾う。

関連:

Runtime Verification Applicability

  • decision: not_applicable
  • 判定: not_applicable
  • 理由: 本 Issue は test_heading_policy.py の static test helper と regression test のみを扱い、runtime 起動・通信・プロセス連携を要求しない

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    area/ai-ops
    follow-up
    state/blocked
    on Jun 5, 2026
  2. squne121 commented on Jun 5, 2026

    @squne121
    OwnerAuthor

    結論

    Issue #678 は妥当。むしろ PR #675 を通すなら、直後に必ず潰すべき follow-up。
    ただし、現行の #678 の AC はまだ甘いです。敵対的に見ると、実装者が yaml.safe_load を呼ぶだけで、実質的には regex 依存や nested label 混入を残したまま AC を満たせる余地があります。

    判定は 「着手可。ただし Issue 本文を少し締めてから実装」 です。


    背景整理

    #678 の目的は、test_heading_policy.py の expected-key 導出を .github/ISSUE_TEMPLATE/implementation.yml の regex 探索から YAML schema-aware parsing に置き換え、checkboxes.options[].label のような Issue body 見出しにならない label を HEADING_POLICY の expected key に混入させないことです。Issue 本文でも、現状 regex が top-level form element と nested option label を区別できない、と明記されています。([GitHub]1)

    この問題は #646 の親目的にも合っています。#646 は prose / machine-readable / heading / tmp draft / public output などの分類を SSOT 化し、guard・validator・checker・loop が同じ分類結果を使うことを目標にしています。([GitHub]2)

    PR #675 は #671 の near-equivalence 強化で、HEADING_POLICY の key 集合が「template label ∪ scaffolding heading ∪ ALLOWED_EXTRAS」と exact match するようにしていますが、差分上は _extract_template_labels() がまだ re.findall(r'^\s+label:\s+(.+)$', ...) に依存しています。([GitHub]3)
    したがって #678 は、#675 のレビュー残課題として自然です。


    外部仕様との照合

    GitHub Issue Forms は YAML で定義され、フォーム入力は issue body の Markdown に変換されます。([GitHub Docs]4)
    GitHub の form schema では、body 要素の type は markdown, textarea, input, dropdown, checkboxes, upload などで、markdown は「表示されるが submit されない」要素です。([GitHub Docs]5)

    重要なのは checkboxes です。checkboxes には top-level の attributes.label があり、さらに attributes.options[].label があります。GitHub docs は option 側の label を「option の identifier/display text」として説明しています。([GitHub Docs]5)
    つまり、Issue body のセクション見出しとして扱うべき候補は top-level form element の attributes.label であって、options[].label ではありません。

    また、PyYAML は既に dev dependency に入っているので、#678 の Allowed Paths を test_heading_policy.py のみに絞っても依存追加は不要です。pyproject.toml の dev group に pyyaml>=6.0 が入っています。([GitHub]6)


    Blocker 1: AC1 が「safe_load を使ったふり」を防げない

    #678 の AC1 は「yaml.safe_load で parse し、regex ではなく schema-aware に body を走査」としていますが、検証コマンドは rg "yaml\.safe_load|body" だけです。([GitHub]1)
    これは弱いです。実装者は yaml.safe_load(text) を 1 行追加しつつ、既存の re.findall() を残せます。

    要求すべき修正:

    AC1 を強化:
    - `_extract_template_labels()` 内で `re.findall` / line-based `label:` regex を使わない。
    - `yaml.safe_load()` の戻り値から `dict["body"]` を取得し、list[dict] として走査する。
    - malformed YAML、body 欠落、body が list でない場合は silent return [] ではなく AssertionError / ValueError で fail-fast する。
    

    特に現行 helper はファイルが存在しない場合に return [] します。([GitHub]7)
    テストの SSOT helper でこれは危険です。テンプレパス誤りを「label なし」として扱うと、near-equivalence 側の失敗理由が曖昧になります。


    Blocker 2: 「current template」依存だと regression test が空振りする

    #678 は checkboxes option label の混入防止を regression test にするとしています。([GitHub]1)
    しかし、現時点の implementation.yml 表示上、現在テンプレには type: checkboxes / options: が見当たりません。GitHub 表示でも type: checkboxes は検索ヒットしませんでした。([GitHub]8)

    つまり、実装者が current template だけを読んで「option label が混入しない」と主張しても、単に option label が存在しないだけです。

    要求すべき修正:

    AC3 を強化:
    - tmp_path に synthetic issue form YAML を生成し、
      - type: markdown
      - type: textarea/input/dropdown/checkboxes/upload
      - checkboxes.attributes.options[].label
      - dropdown.attributes.options
      を含めた fixture で `_extract_template_labels()` を直接検証する。
    - expected は top-level non-markdown body element の `attributes.label` のみ。
    - markdown.attributes.value、checkboxes.options[].label、dropdown.options は含まれないことを assert する。
    

    この修正なら、将来 implementation.yml に checkboxes がまだ無くても regression として意味があります。


    Blocker 3: 対象 type の定義が少し曖昧

    #678 は「current template で issue body heading 化される top-level form element の attributes.label のみ」と書いています。([GitHub]1)
    方向は正しいですが、実装指示としてはまだ曖昧です。

    GitHub schema 上は textarea, input, dropdown, checkboxes, upload はユーザー入力系で、markdown は submit されない表示専用です。([GitHub Docs]5)
    したがって helper のロジックは、少なくとも次のどちらかに固定した方がいいです。

    推奨は後者です。

    SUBMITTED_BODY_ELEMENT_TYPES = {
        "textarea",
        "input",
        "dropdown",
        "checkboxes",
        "upload",
    }

    そして、

    for element in form["body"]:
        if element.get("type") not in SUBMITTED_BODY_ELEMENT_TYPES:
            continue
        label = element.get("attributes", {}).get("label")

    とする。

    「type: markdown 以外なら全部拾う」でも現状は動きますが、GitHub Forms は public preview とされており仕様変更余地があります。([GitHub Docs]4)
    将来未知 type が追加されたとき、勝手に prose-exemption surface を広げるより、unknown type は fail-fast または明示 skip のほうが安全です。


    Blocker 4: #671 / PR #675 との順序制御は正しいが、Issue 側の状態遷移が必要

    #678 は blocked-by #671 を維持し、#671 / PR #675 の merge 後に着手すると明記しています。([GitHub]1)
    これは正しいです。同一ファイル test_heading_policy.py を触るため、並行実装すると衝突しやすい。

    ただし、PR #675 の差分では _extract_template_labels() がまだ regex のままです。([GitHub]3)
    したがって #678 は #675 の merge 後に、#675 の実装を置き換える Issue として扱うべきです。#675 に追加レビューを出して #678 分まで同時にやらせると、#671 のスコープが膨らみます。

    推奨:


    実装方針案

    test_heading_policy.py の helper は、この程度まで絞るのが安全です。

    import yaml
    
    SUBMITTED_FORM_TYPES = {
        "textarea",
        "input",
        "dropdown",
        "checkboxes",
        "upload",
    }
    
    def _extract_template_labels(yml_path: Path) -> list[str]:
        form = yaml.safe_load(yml_path.read_text(encoding="utf-8"))
    
        if not isinstance(form, dict):
            raise ValueError("issue form YAML root must be a mapping")
    
        body = form.get("body")
        if not isinstance(body, list):
            raise ValueError("issue form body must be a list")
    
        labels: list[str] = []
    
        for index, element in enumerate(body):
            if not isinstance(element, dict):
                raise ValueError(f"body[{index}] must be a mapping")
    
            element_type = element.get("type")
    
            if element_type == "markdown":
                continue
    
            if element_type not in SUBMITTED_FORM_TYPES:
                raise ValueError(f"unsupported issue form element type: {element_type!r}")
    
            attributes = element.get("attributes")
            if not isinstance(attributes, dict):
                raise ValueError(f"body[{index}].attributes must be a mapping")
    
            label = attributes.get("label")
            if not isinstance(label, str) or not label.strip():
                raise ValueError(f"body[{index}].attributes.label must be a non-empty string")
    
            labels.append(label)
    
        return labels

    ポイントは、nested dict/list を再帰探索しないことです。options[].label を除外したいなら、再帰しないのが最も堅いです。


    追加すべき regression test

    def test_extract_template_labels_ignores_non_heading_schema_labels(tmp_path):
        yml = tmp_path / "issue-form.yml"
        yml.write_text(
            """
    name: Test
    body:
      - type: markdown
        attributes:
          value: "## Not Submitted Markdown Heading"
      - type: textarea
        id: outcome
        attributes:
          label: Outcome
      - type: checkboxes
        id: checks
        attributes:
          label: Acceptance Checklist
          options:
            - label: Option Label Must Not Become Heading
              required: true
      - type: dropdown
        id: kind
        attributes:
          label: Change Kind
          options:
            - docs
            - code
    """,
            encoding="utf-8",
        )
    
        assert _extract_template_labels(yml) == [
            "Outcome",
            "Acceptance Checklist",
            "Change Kind",
        ]

    これで #678 の本質である「schema-aware」「markdown 非 submit」「nested option label 除外」が固定されます。


    Issue 本文への修正案

    そのままコメントするなら、以下で十分です。

    #678 の方向性は妥当。ただし AC を少し締めたい。
    
    Blocker:
    1. AC1 の `rg "yaml\.safe_load|body"` だけでは、`safe_load` を呼びつつ既存 `re.findall(r'^\s+label:')` を残す実装を通せる。`_extract_template_labels()` 内で line-based label regex を使わないことを AC に明記してほしい。
    2. 現 current template には checkboxes/options が無いため、current template だけを読む regression では nested option label 除外を検証できない。`tmp_path` synthetic issue form YAML を使い、`type: markdown`, `type: checkboxes`, `checkboxes.attributes.options[].label`, `dropdown.attributes.options` を含めた fixture で検証することを AC3 に追加してほしい。
    3. 対象 type は GitHub Issue Forms schema に合わせて `textarea/input/dropdown/checkboxes/upload` の top-level `attributes.label` に限定し、`markdown` は skip、unknown type は fail-fast する方針を固定してほしい。
    4. malformed YAML / `body` 欠落 / `body` が list でない場合に silent `[]` を返すのは禁止。テスト helper の SSOT なので fail-fast すべき。
    
    実装は `test_heading_policy.py` のみで足りる。PyYAML は dev dependency に既にあるため依存追加は不要。

    最終評価

    Approve with changes.

    #678 は #646 の SSOT 化方針に沿っており、#671/#675 の残課題を潰す Issue として妥当です。
    ただし、現状のままだと「regex 依存をやめたこと」と「nested label を除外できること」を機械的に保証しきれていません。

    実装前に AC を上記のように締めるべきです。特に synthetic YAML regression test は必須です。これがない #678 PR は、見かけ上は通っても再発防止として弱いです。

  3. removed
    state/blocked
    on Jun 5, 2026
  4. squne121 commented on Jun 5, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop が完了しました。anchor comment(#issuecomment-4636419611)の 4 つの blocker を全て Issue 本文に反映し、check_issue_contract.py で approve を確認しました。

    LOOP_HANDOFF_RESULT_V1:
      schema_version: 1
      issue_number: 678
      termination_reason: approved
      final_verdict: approve
      iterations_completed: 1
      loop_policy_max_iterations: 3
    
      anchor_comment:
        url: "https://github.com/squne121/loop-protocol/issues/678#issuecomment-4636419611"
        final_classification: applied
        verified_claims:
          - "AC1: re.findall/re.search 禁止 + yaml.safe_load dict[body] list 走査を明示"
          - "AC2: type whitelist + markdown skip + nested label 除外 + unknown type ValueError fail-fast"
          - "AC3: tmp_path synthetic YAML fixture で options[].label 除外を直接検証"
          - "AC4: yml_path 不在・malformed・body list でない場合の fail-fast テスト追加"
          - "Delivery Rule: #675 マージ済みのため blocking なし に更新"
          - "state/blocked ラベル削除"
    
      improvements_applied:
        - section: "Acceptance Criteria"
          change: "AC1-AC3 強化。AC4 (fail-fast) 追加。旧 AC4 を AC5 に繰り下げ"
        - section: "Verification Commands"
          change: "AC1-AC5 に対応した 5 コマンドに更新"
        - section: "In Scope"
          change: "YAML schema-aware parsing・type whitelist・synthetic fixture・fail-fast を具体化"
        - section: "Delivery Rule"
          change: "blocked-by #671 を削除。#675 マージ済みのため blocking なし に更新"
        - label: "state/blocked"
          change: "削除(#675 は main にマージ済みのため stale)"
    
      handoff_routing:
        next_skill: issue-contract-review
        note: "issue-contract-review で go 判定後に implement-issue または impl-review-loop で実装着手"
  5. squne121 commented on Jun 6, 2026

    @squne121
    OwnerAuthor

    コントラクトレビュー結果: BLOCKED (2026-06-06T00:04:27Z)

    不足項目

    VC preflight が blocked です。AC1〜AC4 の rg コマンドが broad_search_path_unbounded に分類されました。根本原因は以下の 2 点です。

    原因 1: Allowed Paths のバッククォート(#683 既知バグ)

    Allowed Paths セクションのパスにバッククォートが含まれています。extract_allowed_paths() がバッククォートを除去しないため、VC のパスとの比較が不一致になり false positive が発生します。

    修正方法:Allowed Paths のバッククォートを削除する。

    変更前 → 変更後:

    - - `.claude/skills/create-issue/scripts/tests/test_heading_policy.py`
    + - .claude/skills/create-issue/scripts/tests/test_heading_policy.py

    原因 2: AC マーカーに説明文が混入

    # AC1: yaml.safe_load を使っている のように説明文がマーカーに含まれており、パーサー regex ^\s*#\s*AC(\d+)\s*:?\s*$ にマッチしないため AC_UNKNOWN になります。

    修正方法:説明文を削除して # AC1 のみにする。

    - # AC1: yaml.safe_load を使っている
    + # AC1
      $ rg "yaml\.safe_load" .claude/skills/create-issue/scripts/tests/test_heading_policy.py

    AC2〜AC4 も同様に修正が必要です。

    推奨アクション

    Issue 本文の以下 2 点を修正後、issue-contract-review 678 を再実行してください。

    1. ## Allowed Paths セクション:バッククォート削除
    2. ## Verification Commands セクション:# AC1: ... → # AC1

    CONTRACT_REVIEW_RESULT_V1:
      status: blocked
      generated_at: "2026-06-06T00:04:27Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/678
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: false
          vc_failed_as_expected: 0
          vc_passed_unexpectedly: 0
          vc_unrunnable: 4
          vc_expected_pass: 1
          vc_skipped: 0
          classifications:
            - {ac: AC_UNKNOWN, category: broad_search_path_unbounded, decision: blocked}
            - {ac: AC_UNKNOWN, category: broad_search_path_unbounded, decision: blocked}
            - {ac: AC_UNKNOWN, category: broad_search_path_unbounded, decision: blocked}
            - {ac: AC_UNKNOWN, category: broad_search_path_unbounded, decision: blocked}
            - {ac: AC5, category: regression_gate, decision: go}
        ac_verifiability: pass
        product_spec_check: {applicability: not_applicable, decision: pass}
        worktree_branch_collision: clear
      next_action: propose_refinement_loop
      blocked_reasons:
        - check: vc_preflight
          category: broad_search_path_unbounded
          root_cause: "Allowed Paths バッククォート残存(#683) + AC マーカー説明文混入"
          affected_acs: [AC1, AC2, AC3, AC4]
          fix_path: simple_contract_hygiene_fix
      body_sha256: "sha256:a2a2755e3c0ce7bff80b52f8b250facd2a6ec2e5dea7b8d9f1a21c914b61771f"
  6. squne121 commented on Jun 6, 2026

    @squne121
    OwnerAuthor

    コントラクトスナップショット (2026-06-06T00:52:22Z)

    判定: go — 着手可能。

    • Outcome: test_heading_policy.py の expected-key 導出が .github/ISSUE_TEMPLATE/implementation.yml の YAML schema-aware parsing に置き換わり、checkbox option label や markdown scaffolding text が expected-key set に混入しないことを regression test で固定した状態になっている。
    • AC1: _extract_template_labels() が yaml.safe_load() + dict["body"] list 走査を使う
    • AC2: type: markdown skip・unknown type は ValueError で fail-fast する
    • AC3: tmp_path に synthetic issue form YAML を生成する regression test が追加される
    • AC4: yml_path 不在・YAML malformed・body が list でない場合の fail-fast テストが存在する
    • AC5: uv run pytest .claude/skills/create-issue/scripts/tests/ が PASS する
    • Verification Commands: AC1〜AC4 rg 系(baseline fail 確認済み)、AC5 pytest(regression gate pass 確認済み)
    • Allowed Paths: .claude/skills/create-issue/scripts/tests/test_heading_policy.py
    • Worktree: .claude/worktrees/issue-678-heading-policy-schema-aware-parsing
    • Branch: worktree-issue-678-heading-policy-schema-aware-parsing
    • VC preflight: baseline fail = 4, 想定外 pass = 0, 実行不可 = 0, regression gate pass = 1
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-06T00:52:22Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/678
      body_sha256: "sha256:3a6228322c0de17e977f70ae65fcec1d0f2d0555836f1d7c66616b4e5912165c"
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 4
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 1
          vc_skipped: 0
          classifications:
            - {ac: AC1, category: expected_baseline_fail, decision: go}
            - {ac: AC2, category: expected_baseline_fail, decision: go}
            - {ac: AC3, category: expected_baseline_fail, decision: go}
            - {ac: AC4, category: expected_baseline_fail, decision: go}
            - {ac: AC5, category: regression_gate, decision: go}
        ac_verifiability: pass
        product_spec_check: {applicability: not_applicable, decision: pass}
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
  7. squne121 commented on Jun 6, 2026

    @squne121
    OwnerAuthor

    コントラクトスナップショット v2 (2026-06-06T00:54:26Z)

    判定: go — SHA 修正版。VC パターン修正後の正しいボディ SHA を使用。

    • Outcome: test_heading_policy.py の expected-key 導出が YAML schema-aware parsing に置き換わり、regression test で固定された状態
    • AC1: _extract_template_labels() が yaml.safe_load() + dict["body"] list 走査を使う
    • AC2: ValueError が test に含まれる(markdown skip / fail-fast)
    • AC3: tmp_path を使った synthetic fixture が存在する
    • AC4: pytest.raises(ValueError) が存在する(fail-fast テスト)
    • AC5: uv run pytest .claude/skills/create-issue/scripts/tests/ が PASS する
    • Allowed Paths: .claude/skills/create-issue/scripts/tests/test_heading_policy.py
    • Worktree: .claude/worktrees/issue-678-heading-policy-schema-aware-parsing
    • Branch: worktree-issue-678-heading-policy-schema-aware-parsing
    • VC preflight: baseline fail = 4, 想定外 pass = 0, 実行不可 = 0, regression gate pass = 1
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-06T00:54:26Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/678
      body_sha256: "sha256:5e29e66876e17ef46828ff09e26d001c6b231b91fc690d763486512c902a28eb"
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 4
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_expected_pass: 1
          vc_skipped: 0
          classifications:
            - {ac: AC1, category: expected_baseline_fail, decision: go}
            - {ac: AC2, category: expected_baseline_fail, decision: go}
            - {ac: AC3, category: expected_baseline_fail, decision: go}
            - {ac: AC4, category: expected_baseline_fail, decision: go}
            - {ac: AC5, category: regression_gate, decision: go}
        ac_verifiability: pass
        product_spec_check: {applicability: not_applicable, decision: pass}
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
  8. squne121 commented on Jun 6, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了

    実装が完了しました。ドラフト PR を起票しました。

    主な変更内容として、_extract_template_labels() を正規表現ベースから YAML スキーマ対応パーシングに置き換えました。これにより、チェックボックスのオプションラベルや マークダウン系の足場テキストが expected-key set に混入しない設計に改善されました。YAML の body 配列を yaml.safe_load で走査し、マークダウン型の要素はスキップ、未知の型は ValueError で即座に失敗する実装です。回帰テストと fail-fast テストを追加し、挙動を固定しました。

    検証結果は全項目 PASS でした。型チェック・リント・テスト・ビルドおよび pytest の 276 件が合格しました。後続作業は PR レビュー → マージ → クリーンアップの順で進めます。

    IMPLEMENT_RESULT_V1:
      status: ok
      generated_at: 2026-06-06T01:02:00Z
      generated_by: implement-issue
      issue_url: https://github.com/squne121/loop-protocol/issues/678
      pr_url: https://github.com/squne121/loop-protocol/pull/686
      worktree: .claude/worktrees/issue-678-heading-policy-schema-aware-parsing
      branch: worktree-issue-678-heading-policy-schema-aware-parsing
      verification:
        typecheck: pass
        lint: pass
        test:
          passed: 371
          failed: 0
          files: 18
        build: pass
        pytest:
          passed: 276
          failed: 0
      allowed_paths_compliance: true
      warnings: []
      errors: []
  9. squne121 commented on Jun 6, 2026

    @squne121
    OwnerAuthor

    impl-review-loop 完了: Issue #678 (2026-06-06T01:13:57Z)

    結果: Draft PR 準備完了 / マージ待ち

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      issue_number: 678
      status: draft_pr_ready
      merge_ready: true
      pr_url: https://github.com/squne121/loop-protocol/pull/686
      pr_number: 686
      head_sha: 4305887bf923e4e682df0c06467942990ecd4453
      iterations_used: 1
      termination_reason: approved
      loop_verdict:
        verdict: APPROVE
        merge_ready: true
        required_auto_actions: []
      next_action: human_merge_pr_686
  10. squne121 commented on Jun 6, 2026

    @squne121
    OwnerAuthor

    impl-review-loop 完了(最終): Issue #678 (2026-06-06T04:53:24Z)

    結果: Draft PR 準備完了 / マージ待ち

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      issue_number: 678
      status: draft_pr_ready
      merge_ready: true
      pr_url: https://github.com/squne121/loop-protocol/pull/686
      pr_number: 686
      head_sha: 9d729c5ec175c78026b28ce4870792d4c04b3bfc
      iterations_used: 2
      termination_reason: approved
      loop_verdict:
        verdict: APPROVE
        merge_ready: true
        required_auto_actions: []
      next_action: human_merge_pr_686
  11. added a commit that references this issue on Jun 6, 2026
  12. squne121 commented on Jun 6, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup 完了 (2026-06-06T04:58:58Z)

    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: post-merge-cleanup
      follow_up_issues: []
      note_only_observations:
        - summary: "gone branch worktree-issue-647-... は issue #647 が OPEN のため削除保留"
        - summary: "parent #646 は delivery-rollup mode で子 Issue (#656/#657/#682/#685) が未クローズのためオープン維持"
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

    agent/implementerarea/ai-opsenhancementfollow-upphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions