Skip to content

実装: issue-scoped PR を既存 lint:docs baseline で止めない #1103

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "issue-scoped PR が差分外の docs lint baseline failure で false block されないようにし、`tests/fixtures/issue-body/vc_unlabeled_fence.md` の intentional negative fixture 意図を保ったまま `pnpm run lint:docs` を main baseline で green に戻す"
change_kind: docs

Parent Issue

none(単独改善)

Parent Goal Ref

  • Goal: pnpm run lint:docs の既存 baseline failure を解消し、Issue scoped docs PR が Allowed Paths 外の既存 failure で止まらない状態にする
  • Desired Destination: tests/fixtures/issue-body/vc_unlabeled_fence.md が unlabeled fence の negative fixture としての意味を保ったまま、fixture-local な MD040 抑止で pnpm run lint:docs を通せる状態

Current Validated Scope

  • tests/fixtures/issue-body/vc_unlabeled_fence.md の opening fence は unlabeled のまま維持する
  • tests/fixtures/issue-body/vc_unlabeled_fence.md に fixture 意図を明示するコメントと、opening fence 直前の局所 MD040 抑止コメントを追加する
  • pnpm run lint:docs が clean checkout baseline で pass することを検証する

Remaining Parent Gaps

Outcome

pnpm run lint:docs が main baseline で pass し、issue-scoped docs PR が差分外の既存 fixture failure で false block されない。あわせて tests/fixtures/issue-body/vc_unlabeled_fence.md は intentional negative VC fixture としての unlabeled fence を維持している。

In Scope

  • tests/fixtures/issue-body/vc_unlabeled_fence.md に fixture intent コメントを追加する
  • opening fence 直前に fixture-local な markdownlint MD040 抑止コメントを追加する
  • opening fence を unlabeled のまま維持したうえで pnpm run lint:docs, pnpm typecheck, pnpm lint, pnpm test, pnpm build の実行と結果確認を行う

Out of Scope

Acceptance Criteria

  • AC1: pnpm run lint:docs が clean checkout の main 相当で pass する
  • AC2: tests/fixtures/issue-body/vc_unlabeled_fence.md に intentional negative VC fixture であることを示す説明コメントが存在する
  • AC3: tests/fixtures/issue-body/vc_unlabeled_fence.md に markdownlint-disable-next-line MD040 が存在する
  • AC4: tests/fixtures/issue-body/vc_unlabeled_fence.md の該当 excerpt で、fixture intent コメントと markdownlint-disable-next-line MD040 の直後に unlabeled opening fence が残っている
  • AC5: 実装: issue-scoped PR を既存 lint:docs baseline で止めない #1103 の実装差分が tests/fixtures/issue-body/vc_unlabeled_fence.md のみに収まっている
  • AC6: pnpm typecheck が pass する
  • AC7: pnpm lint が pass する
  • AC8: pnpm test が pass する
  • AC9: pnpm build が pass する

Verification Commands

# AC1
# preflight-scope: pr_review_only
$ pnpm run lint:docs
# AC2
# baseline-expect: pass
# preflight-scope: pr_review_only
$ rg -n "Intentional negative VC fixture" tests/fixtures/issue-body/vc_unlabeled_fence.md
# AC3
# baseline-expect: pass
# preflight-scope: pr_review_only
$ rg -n "markdownlint-disable-next-line MD040" tests/fixtures/issue-body/vc_unlabeled_fence.md
# AC4
# baseline-expect: pass
# preflight-scope: pr_review_only
$ sed -n '13,22p' tests/fixtures/issue-body/vc_unlabeled_fence.md
# AC5
# baseline-expect: pass
# preflight-scope: pr_review_only
$ git diff --name-only origin/main...HEAD
# AC6
$ pnpm typecheck
# AC7
$ pnpm lint
# AC8
$ pnpm test
# AC9
$ pnpm build

Allowed Paths

  • tests/fixtures/issue-body/vc_unlabeled_fence.md

Runtime Verification Applicability

  • decision: not_applicable
  • reason: docs lint / fixture-only issue であり、runtime surface や preview / manual play evidence を変更しない

Stop Conditions

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

Required Skills

なし

Scope Delta(任意)

N/A

Delivery Rule

1 Issue = 1 PR。worktree で作業する。Draft PR で開始し、AC 全件 PASS 後に ready for review にする。

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    docs
    on Jun 21, 2026
  2. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-21T09:22:27Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1103
      body_sha256: "sha256:ccebadc09cf9a1b002ae4a89bd4867f22e17abd63374cab06fb0610e41b8a75c"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: ensure_contract_snapshot_auto
  3. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    結論

    Issue #1103 の問題設定は正しいです。PR #1102 は #1094 の milestone docs sync だけを扱う PR で、pnpm run lint:docs が既存 baseline の tests/fixtures/issue-body/vc_unlabeled_fence.md:15 / MD040/fenced-code-language により失敗した、と PR 本文で明示しています。これは PR #1102 の Allowed Paths 外であり、#1103 として分離する判断は妥当です。

    ただし、#1103 のまま実装させると 誤修正に寄るリスクが高いです。特に .markdownlintignore が Allowed Paths に入っている点は危険です。現在の repo は markdownlint-cli2 を使っており、lint:md は markdownlint-cli2 '**/*.md' ... で実行されています。 markdownlint-cli2 公式 README は .markdownlintignore をサポートしないと明記しているため、.markdownlintignore を追加してもこの失敗は直らない可能性が高いです。([GitHub]1)

    敵対的レビュー

    Blocker 1: .markdownlintignore は修正先として不適切

    #1103 の Allowed Paths に .markdownlintignore が含まれていますが、現在の実体は .markdownlint-cli2.yaml と package.json の lint:md script です。.markdownlint-cli2.yaml では docs/**, .github/**, .claude/** などは ignore されていますが、tests/** は ignore されていません。 さらに MD040 は明示的に有効化されています。

    したがって、設定で直すなら本来は .markdownlint-cli2.yaml か package.json を触るべきです。ただし .markdownlint-cli2.yaml は #1103 の Allowed Paths に入っていません。現 Issue のまま進めるなら、設定変更ではなく fixture 側の局所抑止が最も安全です。

    Blocker 2: fence を bash に直すと fixture の意味を壊す

    vc_unlabeled_fence.md は名前どおり「unlabeled fence VC format の非 canonical fixture」です。実際に Verification Commands の fence は言語指定なしの triple backtick です。

    外部仕様上、MD040 は「fenced code block に language がない」場合に発火し、通常の修正は ```bash などの language specifier 追加です。([GitHub]2) しかし、この repo の VC grammar は unlabeled fence を明示的に拒否する設計で、vc_contract_syntax.py も「unlabeled fences are rejected」と述べ、parser は unlabeled fence を unlabeled_fence error として記録します。

    既存テストも「unlabeled fence は C4 fail / LP011 fail / preflight static blocked」として固定しています。 そのため ``` を ```bash にする修正は baseline green にはなっても、fixture の目的を破壊します。

    High: AC3 の検証が弱い

    #1103 の AC3 は gh pr list --search "#1094" ですが、これは #1094 / PR #1102 が存在することの確認に近く、#1103 の PR が #1094 / #1102 の docs 差分と混ざっていないことを保証しません。#1094 の scope は docs/dev/current-focus.md, docs/product/requirements.md, docs/product/playable-roadmap.md の milestone sync であり、#1103 とは明確に別です。([GitHub]3) PR #1102 もそれら docs と CLAUDE.md, .claude/rules/project-constitution.md を M4 前提へ同期する内容です。

    AC3 は git diff --name-only origin/main...HEAD または gh pr diff --name-only で、#1103 PR の変更ファイルが fixture-local か lint 設定だけに収まっていることを直接検査するべきです。

    Medium: PR #1102 preview comment はこの Issue の証跡に使わない

    PR #1102 には GitHub Pages preview comment がありますが、asset-level live check 未検証、Pages source 設定後に有効化、という注記付きです。 #1103 は docs lint baseline の Issue なので、preview URL や Pages runtime は AC 証跡に含めない方がよいです。

    推奨修正方針

    最善は fixture 内で MD040 だけを局所抑止し、unlabeled fence は維持することです。markdownlint は HTML comment で rule を disable-next-line できます。([GitHub]4)

    tests/fixtures/issue-body/vc_unlabeled_fence.md の opening fence 直前に以下を入れるのがよいです。

    <!-- Intentional negative VC fixture: the following fence must remain unlabeled to exercise unlabeled_fence / non-canonical VC handling. -->
    <!-- markdownlint-disable-next-line MD040 -->

    その直後の fence は 絶対に ```bash にしない。``` のままにします。

    この方式なら、markdownlint-cli2 の MD040 だけを当該行で抑止し、VC parser / review-issue / create-issue 系の「unlabeled fence を拒否する」仕様は保てます。lint:prose はそもそも tests/**/*.md を対象にしていないため、.textlintignore を触る必要もありません。

    Issue #1103 に入れるべき修正コメント案

    ## Review hardening note
    
    Do not fix `tests/fixtures/issue-body/vc_unlabeled_fence.md` by changing the opening fence from ``` to ```bash.
    
    This file is an intentional negative VC fixture. The expected behavior is that VC grammar checkers continue to classify the unlabeled fence as non-canonical / blocked. The docs lint failure should be resolved by a local markdownlint MD040 suppression comment immediately before the unlabeled fence, with an explanatory fixture-intent comment.
    
    Do not use `.markdownlintignore`: this repository uses `markdownlint-cli2`, and `.markdownlintignore` is not a supported ignore mechanism for markdownlint-cli2. If a config-level exclusion is chosen instead, update the Issue scope first to include `.markdownlint-cli2.yaml`; otherwise prefer fixture-local suppression.
    
    Strengthen AC3 by checking the actual PR diff:
    
    ```bash
    git diff --name-only origin/main...HEAD

    Expected changed files should be limited to tests/fixtures/issue-body/vc_unlabeled_fence.md unless the Issue contract is explicitly amended.

    
    ## 実装時の合格条件
    
    この Issue は実装可能ですが、merge 前に最低限これを確認してください。
    
    ```bash
    pnpm run lint:docs
    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build
    

    追加で、fixture の意味が壊れていないことを確認するなら次も入れるべきです。

    rg -n "Intentional negative VC fixture|markdownlint-disable-next-line MD040" tests/fixtures/issue-body/vc_unlabeled_fence.md
    rg -n '^```$' tests/fixtures/issue-body/vc_unlabeled_fence.md

    判定としては、#1103 は GO だが、.markdownlintignore 誘導と AC3 の弱さを修正してから実装させるべきです。

  4. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 完了(approved / 人間承認不要モード)

    anchor comment(https://github.com/squne121/loop-protocol/issues/1103#issuecomment-4761528600)を一次ソースとして、Issue #1103 の contract を live rewrite しました。

    反映した hardening

    • .markdownlintignore / .textlintignore / package.json / .markdownlint-cli2.yaml を remediation 候補から外し、fixture-local 修正へ scope を限定
    • tests/fixtures/issue-body/vc_unlabeled_fence.md の unlabeled fence を維持する方針を Current Validated Scope / In Scope / Outcome / AC に明記
    • AC/VC を markdownlint-disable-next-line MD040 と fixture intent コメントの確認へ寄せ、AC3 の弱い PR 存在確認を実 diff 検証へ差し替え
    • Runtime Verification Applicability を not_applicable として追加
    • change-specific VC は preflight-scope: pr_review_only に正規化し、baseline preflight false blocker を解消

    検証

    • contract_readiness_check.py --mode preflight-static --body-file .tmp_issue_1103_body.md → status: go
    • check_issue_contract.py --file .tmp_issue_1103_body.md --json → verdict: approve
    • check_vc_scope.py --issue-body-file .tmp_issue_1103_body.md → STATUS: PASS
    • run_contract_review_once.py --issue-number 1103 --repo squne121/loop-protocol --mode execute --skip-idempotency-check → status: go

    次アクション: issue-contract-review gate は通過済みなので、この Issue は impl-review-loop へ handoff 可能です。

    LOOP_HANDOFF_RESULT_V1:
      status: "impl_ready"
      routing_action: "run_impl_review_loop"
      contract_review:
        status: "go"
        gate_result: "fresh_go"
        latest_comment_url: "https://github.com/squne121/loop-protocol/issues/1103"
        generated_at: "2026-06-21T09:43:26Z"
        body_sha256: "sha256:5832a9744b2478b1f045fd388172d44ff1018187b9ba5eb9aa0c71859159ab81"
      metadata:
        title_prefix_ready: true
        phase_label_ready: true
      auto_fixes:
        result: "auto_fixed"
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-06-21T09:43:26Z"
      checked_body_sha256: "sha256:5832a9744b2478b1f045fd388172d44ff1018187b9ba5eb9aa0c71859159ab81"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []
  5. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    Contract Review Result

    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: "2026-06-21T09:49:00Z"
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/1103
      body_sha256: "sha256:5832a9744b2478b1f045fd388172d44ff1018187b9ba5eb9aa0c71859159ab81"
      checks:
        readiness: go
        blockers: pass
        product_spec: pass
        vc_preflight: pass
      source: manual_refresh_after_issue_refinement
  6. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-06-21T09:54:45Z)

    • PR: docs: suppress MD040 on unlabeled VC fixture #1107
    • Worktree: .claude/worktrees/issue-1103-issue-scoped-pr-lint-docs-baseline
    • Branch: worktree-issue-1103-issue-scoped-pr-lint-docs-baseline
    • Verification:
      • pnpm run lint:docs PASS
      • pnpm typecheck PASS
      • pnpm lint PASS
      • pnpm test PASS
      • pnpm build PASS
    • Changed files: tests/fixtures/issue-body/vc_unlabeled_fence.md
  7. squne121 commented on Jun 21, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-06-21T12:45:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      draft_pr_ready: true
      github_merge_ready: true
      github_merge_state_status: CLEAN
      merge_ready: true
      pr_url: "https://github.com/squne121/loop-protocol/pull/1107"
      head_sha: "9e7593362cddc1076131250b8b66a36356baae43"
      issue_number: 1103
      termination_reason: approved
      iteration: 0
      required_auto_actions: []
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations: []
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/implementerdocsenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions