Skip to content

feat: add roadmap reference validator - #1264

Merged
squne121 merged 7 commits into
mainfrom
worktree-issue-1183-playable-roadmap-fenced-yaml-block-path-
Jul 1, 2026
Merged

squne121 merged 7 commits into
mainfrom
worktree-issue-1183-playable-roadmap-fenced-yaml-block-path-

Conversation

@squne121

@squne121 squne121 commented Jul 1, 2026 •

Copy link
Copy Markdown
Owner

概要

  • roadmap 用 validator を新規追加し、fenced YAML の parse 失敗、duplicate key、path grammar 不正、stale alias を自動検出できるようにした
  • docs lint 経路に validator を接続し、yaml 依存と lockfile を追加して継続実行できる状態にした
  • docs/product/playable-roadmap.md の既存 fenced YAML を正規化し、default target の validator 実行が成功するようにした
  • fixture と test harness を追加し、正常系と異常系の両方を再現できるようにした
  • 既存 ci workflow の lint job に pnpm lint:docs を追加し、required CI 経路でも roadmap validator の回帰を検出できるようにした

受け入れ条件の達成状況

  • AC1 scripts/validate-roadmap-refs.mjs を追加し、package.json に validate:roadmap-refs を登録
  • AC2 docs/product/playable-roadmap.md の yaml / yml fenced block を抽出し、frontmatter を対象外化
  • AC3 yaml parser で parse error / duplicate key を non-zero exit に統一
  • AC4 spec_prerequisites / spec_destination を存在時 string array として検証し、duplicate item を fail
  • AC5 spec_destination の path — description grammar と path safety 検証を実装
  • AC6 M2 の spec_prerequisites / spec_destination に expected set と regular-file existence を強制
  • AC7 stale alias docs/product/features/movement.md / docs/product/features/projectile.md を fail
  • AC8 yaml を direct devDependency として lock まで反映
  • AC9 fixture による success/failure ケースを追加
  • AC10 --file <path> override を test harness で検証
  • AC11 lint:docs に validate:roadmap-refs を組み込み
  • AC12 既存 ci workflow の lint job で pnpm lint:docs が走り、required CI 経路でも validator 回帰を検出できる
  • AC13 docs/product/playable-roadmap.md の既存 fenced YAML を正規化し、default target の validator を成功させた

検証コマンド結果

- PASS: pnpm test -- tests/docs/validate-roadmap-refs.test.mjs
- PASS: node scripts/validate-roadmap-refs.mjs
- PASS: pnpm lint:docs
- PASS: current PR head の required checks (`typecheck` / `lint` / `test` / `build` / `python-test` / `validate-generated-artifact`)

CI テスト性能判断

以下は reviewer 向けの機械可読エビデンスで、内容は現行 head の CI 変更範囲に対応しています。

CI_TEST_PERFORMANCE_DECISION_V1:
  schema: CI_TEST_PERFORMANCE_DECISION_V1
  issue_number: 1183
  pr_number: 1264
  decision_scope: ci_change
  changed_paths:
    - .github/workflows/ci.yml
    - scripts/validate-roadmap-refs.mjs
    - package.json
    - pnpm-lock.yaml
    - docs/product/playable-roadmap.md
    - tests/docs/validate-roadmap-refs.test.mjs
    - tests/fixtures/roadmap-refs/absolute-path.md
    - tests/fixtures/roadmap-refs/directory.md
    - tests/fixtures/roadmap-refs/duplicate-destination.md
    - tests/fixtures/roadmap-refs/empty-description.md
    - tests/fixtures/roadmap-refs/fragment.md
    - tests/fixtures/roadmap-refs/url.md
    - tests/fixtures/roadmap-refs/duplicate-key.md
    - tests/fixtures/roadmap-refs/malformed-yaml.md
    - tests/fixtures/roadmap-refs/missing-target.md
    - tests/fixtures/roadmap-refs/obsolete-movement-projectile-split.md
    - tests/fixtures/roadmap-refs/root-escape.md
    - tests/fixtures/roadmap-refs/stale-alias.md
    - tests/fixtures/roadmap-refs/valid.md
  lane_classification:
    fast_static:
      applicable: true
      evidence:
        - ".github/workflows/ci.yml changed"
        - "validator / package script wiring changed"
      required_commands:
        - pnpm lint
        - pnpm lint:docs
        - pnpm typecheck
    python_unit:
      applicable: true
      evidence:
        - ".github/workflows/ci.yml changed"
        - "tests/docs/validate-roadmap-refs.test.mjs and fixture coverage changed"
      required_commands:
        - pnpm test -- tests/docs/validate-roadmap-refs.test.mjs
        - python-test
    contract_artifact:
      applicable: true
      evidence:
        - ".github/workflows/ci.yml changed"
        - "validator contract and fixture-driven evidence changed"
      required_commands:
        - validate-generated-artifact
        - check-hook-integrity
    integration:
      applicable: true
      evidence:
        - ".github/workflows/ci.yml changed"
        - "deploy preview and e2e lanes are affected by required CI workflow edits"
      required_commands:
        - build
        - e2e
        - deploy-pr
  baseline_inputs:
    ci_runtime_baseline_v1_available: true
    run_count: 0
    p50_p95_ready: false
  artifact_consistency:
    ci_test_selection_v1_checked: false
    missing_pytest_args: []
  risk_flags:
    - baseline_insufficient
  reviewer_gate:
    approve_allowed: true
    required_evidence:
      - TEST_VERDICT_MACHINE
      - CI_CHECK_RUN_SCOPED
    approve_denied_reason: null
  follow_up_required:
    - null

Allowed Paths 遵守

  • 変更ファイルは .github/workflows/ci.yml, scripts/validate-roadmap-refs.mjs, package.json, pnpm-lock.yaml, docs/product/playable-roadmap.md, tests/docs/validate-roadmap-refs.test.mjs, tests/fixtures/roadmap-refs/ のみに限定
  • Allowed Paths 外の変更なし

実施チェック

  • pnpm test -- tests/docs/validate-roadmap-refs.test.mjs を実行して PASS
  • node scripts/validate-roadmap-refs.mjs を実行して PASS
  • pnpm lint:docs を実行して PASS
  • pnpm typecheck は required CI head success で確認済み
  • pnpm build は required CI head success で確認済み

スキーマ変更該当性

  • decision: not_schema_change
  • reason: producer-consumer 境界の machine-readable schema は追加・変更しておらず、roadmap 文書の YAML 検証ロジック、CI lint wiring、docs SSOT の整形のみを扱うため

スキーマ利用側棚卸し

N/A
reason: 今回は schema_change ではなく、schema consumer inventory の更新対象はないため

Safety Claim Matrix(安全性影響)

N/A
reason: .claude/** や権限・サンドボックス境界には変更がなく、validator / docs / package script / CI lint wiring のみを変更しているため

補足

@squne121

squne121 commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: BEHIND
  branch_behind_main: true
  baseline_only: false
  verification_commands_pass: 3
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: "pnpm test -- tests/docs/validate-roadmap-refs.test.mjs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "Vitest: 88 files / 1276 tests passed"
    - ac: AC2
      command: "node scripts/validate-roadmap-refs.mjs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "Default target docs/product/playable-roadmap.md validated successfully"
    - ac: AC3
      command: "pnpm lint:docs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "markdownlint, textlint, and roadmap validator all passed"

@squne121
squne121 marked this pull request as ready for review July 1, 2026 17:27

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOOP_VERDICT_V2

verdict: REQUEST_CHANGES
reviewed_head_sha: "482593a02a3bd873dfa6089c7aa959538754a191"
merge_ready: false
mergeability:
mergeable: "MERGEABLE"
merge_state_status: "BEHIND"
blockers:

  • "required CI is failing on the reviewed head: ci_verdict_summary.py returned status=failed with failed_checks=[lint, deploy-pr, PR Body Japanese Check]"
  • "required lint/deploy lane is blocked by tests/docs/validate-roadmap-refs.test.mjs:13 where process is not defined; deploy-pr annotation reports Run pnpm lint on that file and process is not defined"
  • "required PR Body Japanese Check failed in the Check changed Markdown files step on the reviewed head; the PR changes multiple .md fixtures under tests/fixtures/roadmap-refs/ and the required Japanese-content gate is currently red"
    required_auto_actions:
  • kind: update_branch
    executor: implementation-worker
    skill: implement-issue.update_branch
    blocking_merge_ready: true
    mechanical: true
    expected_head_sha: "482593a02a3bd873dfa6089c7aa959538754a191"
    auto_fix_applied: []
    follow_up_issue_requests: []
    allowed_paths_gate:
    status: ok
    allowed_paths_gate_source: review_subagent

@github-actions

github-actions Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1264 closed).

@squne121

squne121 commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: BLOCKED
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 3
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: "pnpm test -- tests/docs/validate-roadmap-refs.test.mjs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "88 files, 1276 tests passed"
    - ac: AC2
      command: "node scripts/validate-roadmap-refs.mjs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "roadmap references are valid"
    - ac: AC3
      command: "pnpm lint:docs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "markdownlint/textlint/validate:roadmap-refs all passed"

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, merge_state_status=CLEAN

Evidence Check

  • AC coverage: PR 本文の ## 受け入れ条件の達成状況 で #1183 の AC1-AC12 が current contract に対して埋まっていることを確認
  • Allowed Paths: changed files は scripts/validate-roadmap-refs.mjs、package.json、pnpm-lock.yaml、docs/product/playable-roadmap.md、tests/docs/validate-roadmap-refs.test.mjs、tests/fixtures/roadmap-refs/** のみで、#1183 の current Allowed Paths 内
  • CI Verification: ci_verdict_summary.py を current head baa3e333917db8fa33df62e11531105161586d04 で live 実行し、required checks は status=all_pass。stale な旧 review / 旧 TEST_VERDICT は根拠から除外
  • 検証コマンド結果: PR 本文の pnpm test -- tests/docs/validate-roadmap-refs.test.mjs、node scripts/validate-roadmap-refs.mjs、pnpm lint:docs は current head の CI success と整合

Blockers

  • なし

Non-blockers

  • tests/fixtures/roadmap-refs/malformed.md は malformed-yaml.md と重複気味だが、current contract の達成や merge-ready 判定は阻害しない

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: "baa3e333917db8fa33df62e11531105161586d04"
merge_ready: true
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
  status: ok
allowed_paths_gate_source: review_subagent

@squne121

squne121 commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

TEST_VERDICT_MACHINE:
issue_number: 1183
pr_number: 1264
current_head: baa3e33
worktree: /home/squne/projects/LOOP_PROTOCOL/.claude/worktrees/issue-1183-playable-roadmap-fenced-yaml-block-path-
commands:
- id: AC1
command: test -f scripts/validate-roadmap-refs.mjs
exit_code: 0
verdict: PASS
- id: AC2
command: rg -n 'milestone_id: M2' docs/product/playable-roadmap.md
exit_code: 0
verdict: PASS
- id: AC3
command: rg -n '"yaml"' package.json
exit_code: 0
verdict: PASS
- id: AC4
command: test -f tests/docs/validate-roadmap-refs.test.mjs
exit_code: 0
verdict: PASS
- id: AC5
command: test -d tests/fixtures/roadmap-refs
exit_code: 0
verdict: PASS
- id: AC6
command: rg -n 'docs/product/features/movement-projectile.md' docs/product/playable-roadmap.md
exit_code: 0
verdict: PASS
- id: AC7
command: test -f tests/fixtures/roadmap-refs/obsolete-movement-projectile-split.md
exit_code: 0
verdict: PASS
- id: AC8
command: rg -n '"validate:roadmap-refs"' package.json
exit_code: 0
verdict: PASS
- id: AC9
command: test -f tests/fixtures/roadmap-refs/valid.md
exit_code: 0
verdict: PASS
- id: AC10
command: test -f tests/fixtures/roadmap-refs/malformed-yaml.md
exit_code: 0
verdict: PASS
- id: AC11
command: rg -n 'validate:roadmap-refs' package.json
exit_code: 0
verdict: PASS
- id: AC12
command: rg -n '^ - victory: ' docs/product/playable-roadmap.md
exit_code: 1
verdict: FAIL
summary:
passed: 11
failed: 1
skipped: 0
note: current head では AC12 が一致せず、Verification Commands 全体は fail 判定です。

@squne121

squne121 commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

TEST_VERDICT_MACHINE:
issue_number: 1183
pr_number: 1264
current_head: baa3e33
worktree: /home/squne/projects/LOOP_PROTOCOL/.claude/worktrees/issue-1183-playable-roadmap-fenced-yaml-block-path-
verdict: PASS
summary:
passed: 12
failed: 0
skipped: 0
commands:
- id: AC1
command: test -f scripts/validate-roadmap-refs.mjs
exit_code: 0
verdict: PASS
- id: AC2
command: rg -n 'milestone_id: M2' docs/product/playable-roadmap.md
exit_code: 0
verdict: PASS
- id: AC3
command: rg -n '"yaml"' package.json
exit_code: 0
verdict: PASS
- id: AC4
command: test -f tests/docs/validate-roadmap-refs.test.mjs
exit_code: 0
verdict: PASS
- id: AC5
command: test -d tests/fixtures/roadmap-refs
exit_code: 0
verdict: PASS
- id: AC6
command: rg -n 'docs/product/features/movement-projectile.md' docs/product/playable-roadmap.md
exit_code: 0
verdict: PASS
- id: AC7
command: test -f tests/fixtures/roadmap-refs/obsolete-movement-projectile-split.md
exit_code: 0
verdict: PASS
- id: AC8
command: rg -n '"validate:roadmap-refs"' package.json
exit_code: 0
verdict: PASS
- id: AC9
command: test -f tests/fixtures/roadmap-refs/valid.md
exit_code: 0
verdict: PASS
- id: AC10
command: test -f tests/fixtures/roadmap-refs/malformed-yaml.md
exit_code: 0
verdict: PASS
- id: AC11
command: rg -n 'validate:roadmap-refs' package.json
exit_code: 0
verdict: PASS
- id: AC12
command: rg -n "^ - 'victory: `" docs/product/playable-roadmap.md
exit_code: 0
verdict: PASS
note: updated AC12 で current head を再検証し、全 Verification Commands が PASS でした。

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, merge_state_status=CLEAN

Evidence Check

  • AC coverage: #1183 の current contract 更新後も、PR 本文の ## 受け入れ条件の達成状況 は AC1-AC12 を継続して満たしている
  • Verification Commands: current contract の AC12 sentinel は rg -n "^ - 'victory: \\" docs/product/playable-roadmap.mdに更新されており、PR 差分で追加された single-quotedvictory:` 行と整合する
  • Allowed Paths: changed files は scripts/validate-roadmap-refs.mjs、package.json、pnpm-lock.yaml、docs/product/playable-roadmap.md、tests/docs/validate-roadmap-refs.test.mjs、tests/fixtures/roadmap-refs/** のみで、#1183 の current Allowed Paths 内
  • Required checks: main の branch protection required contexts は typecheck / lint / test / build / python-test / validate-generated-artifact。current head baa3e333917db8fa33df62e11531105161586d04 の status rollup ですべて SUCCESS を live 確認

Blockers

  • なし

Non-blockers

  • ci_verdict_summary.py は issue 更新後に再実行された non-required PR Body Japanese Check の skipped duplicate を failed と数えたが、branch protection の required contexts には含まれず、mergeStateStatus=CLEAN と current head rollup は整合している

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: "baa3e333917db8fa33df62e11531105161586d04"
merge_ready: true
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
  status: ok
allowed_paths_gate_source: review_subagent

@squne121

squne121 commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES。
current head では CI success / 既存レビュー APPROVE まで到達している点は確認しましたが、この PR の目的は単なる validator 追加ではなく、playable-roadmap.md の fenced YAML reference integrity を false-green なく 固定することです。現状は主要 happy path は満たしている一方、AC5 / AC12 / 継続実行経路にまだ false-green が残ります。

PR #1264 は feat: add roadmap reference validator として open、current head は baa3e333917db8fa33df62e11531105161586d04、変更は 13 files / +520 / -15 です。PR 本文上は scripts/validate-roadmap-refs.mjs 追加、lint:docs 接続、yaml 依存追加、fixture/test harness 追加、docs/product/playable-roadmap.md の YAML 正規化を主張しています。

参照した文脈

関連 Issue #1183 は、PR #1180 の follow-up として、roadmap fenced YAML の parse / duplicate key / field type / path grammar / repo-relative boundary を検証し、M2 のみ expected set / regular-file existence / stale alias を hard fail する契約です。ライフサイクル status や normative authority は out of scope と明記されています。

関連 #1167 / PR #1180 は、M2 の旧 movement.md / projectile.md 参照を movement-projectile.md に正規化した path-level 修復で、movement-projectile.md の draft → accepted 判断と roadmap validator は follow-up 扱いでした。

関連 #1171 は、M2 close_conditions を sortie.md の正本定義へ寄せる docs-only 修正で、専用 validator は #1183 の責務として残しています。

current head の workflow runs は ci / deploy-pages / Japanese content check 等が success です。 ただし green CI は以下の validator 品質欠陥を否定しません。


Blocking findings

P0: AC5 の path safety が M2 以外で false-green になる

Issue #1183 の AC5 は、spec_destination の各要素について path — description grammar から path を抽出し、ASCII hyphen / fragment / URL / absolute path / empty path / .. escape / directory / symlink を fail にする契約です。

しかし実装では requireStrictExistence = parsed.milestone_id === 'M2' で、M2 以外は requireRegularFile: false になります。 その結果、ensureSafePath() は missing path を M2 以外では許容し、さらに final の regular-file 判定も requireRegularFile が true の時だけ実行されます。

これは M3〜M5 の future destination を existence hard fail しないという契約とは別問題です。存在必須にしないことと、既存 directory / symlink / unsafe path を許すことは違います。例えば M3 に次が入っても、現在の構造だと directory rejection が保証されません。

spec_destination:
  - docs/product/features/ — directory should fail

Node.js の path.isAbsolute() 自体も traversal mitigation としては不十分で、公式 docs は path.isAbsolute() が安全な traversal 対策ではないと明記しています。root containment は resolve() 後に relative() を使って repo root 外へ出ていないことを検査する形に寄せるべきです。([Node.js]1)

修正要求:

  • path lexical safety / repo containment / directory / symlink rejection は 全 milestone に適用する。
  • regular-file existence hard fail は M2 のみ に限定する。
  • relative(REPO_ROOT, candidate) を使い、rel === '' || rel.startsWith('..') || isAbsolute(rel) を fail にする。
  • directory-target.md / fragment.md / url.md / absolute-path.md / empty-path.md / symlink-path 相当の negative fixture を追加する。

P1: default target 成功が test harness で検証されていない

PR 本文は default target の validator 成功を主張していますが、test harness の default test は status が null でないことと、出力に "roadmap" が含まれることしか見ていません。

つまり、node scripts/validate-roadmap-refs.mjs が default docs/product/playable-roadmap.md で失敗しても、stderr に roadmap reference validation failed のような文字列が出ればテストは通ります。これは AC12 の regression guard として弱すぎます。

修正要求:

it('GIVEN no flags WHEN validator runs THEN validates default roadmap file successfully', () => {
  const result = runValidator([])

  expect(result.status).toBe(0)
  expect(result.stdout).toContain('[OK]')
  expect(result.stderr).toBe('')
})

さらに pnpm run validate:roadmap-refs 経由でも 1 本 smoke してください。今の test は raw script invocation だけで、package script wiring の regression を直接検出しません。


P1: lint:docs に接続しただけで、required CI の docs lint 経路には乗っていない

package.json では lint:docs が lint:md && lint:prose && validate:roadmap-refs になっており、package script としての接続は確認できます。 ただし current CI の required っぽい lint job は .github/workflows/ci.yml 上で pnpm lint を実行しているだけで、pnpm lint:docs は実行していません。

この PR の配布物は Pages preview ではなく、repo 内 validator script + package script + CI guard です。lint:docs に接続した、という自己申告だけでは継続実行の保証として不十分です。現在は Vitest 経由で validator script の一部が走るため完全に無防備ではありませんが、docs lint 経路そのものの regression guard ではありません。

GitHub Actions では branch/path filter で required workflow が skip されると checks が Pending のまま残る場合があります。別 workflow を path-filtered required check にするより、既存の常時起動 ci の lint job 内で pnpm lint:docs を実行する方が安全です。([GitHub Docs]2)

修正要求:

- name: Lint (timed)
  id: timed-lint
  run: |
    run_timed pnpm_lint pnpm lint
    run_timed pnpm_lint_docs pnpm lint:docs

この workflow は既に permissions: contents: read なので、validator 実行に必要な権限最小化の方向とも整合しています。 GitHub 公式 docs も GITHUB_TOKEN の permissions は必要最小限へ制限することを推奨しています。([GitHub Docs]3)


Non-blocking but should fix

P2: fenced code block 抽出が CommonMark ではなく独自 regex

実装は次の regex で fenced YAML を抽出しています。

/```(?:yaml|yml)\r?\n([\s\S]*?)\r?\n```/g

これは現行ファイルには効きますが、CommonMark の fenced code block 仕様とはズレます。CommonMark では backtick だけでなく tilde fence もあり、opening / closing fence は最大 3 spaces indent 可能、closing fence は同じ文字種で opening 以上の長さ、closing 後に spaces/tabs を許容し、info string は trimmed されます。([CommonMark仕様]4)

現契約が「Markdown fenced YAML block 全件抽出」なら、Markdown parser を使うか、CommonMark 4.5 に沿った line scanner にしてください。最低限、次の fixture を追加すべきです。

   ```yaml
milestone_id: M3
milestone_id: M3
milestone_id: M3
literal ```yaml should not be parsed as a new fence

逆に、この validator が「現行 roadmap の exact unindented ```yaml / ```yml だけ」を対象にするなら、Issue / README / script comment の表現をその狭い contract に下げるべきです。

---

### P2: `path — description` grammar がまだ緩い

`extractDestinationPath()` は最初の `' — '` より前を path として返すだけです。description が空でも、二つ目の ` — ` があっても通ります。

現状で通り得る例:

```yaml
spec_destination:
  - docs/product/features/sortie.md — 
  - docs/product/features/sortie.md — desc — extra

また duplicate 検出は配列 item の完全一致だけなので、同じ path に別 description を付けた重複は non-M2 で通ります。 M2 は expected set で捕捉されますが、M3〜M5 の grammar/path-level validation としては弱いです。

修正要求:

const DESTINATION_RE =
  /^(?<path>docs\/product\/features\/[A-Za-z0-9._/-]+\.md) — (?<description>\S.*)$/u

加えて、抽出後 path の duplicate を全 milestone で fail にしてください。


P2: yaml.parse() で fail-fast しており、reviewability が低い

parse(raw, { uniqueKeys: true, strict: true }) 自体は duplicate key 検出の方向として妥当です。yaml の uniqueKeys は duplicate map key 検出用の option で、strict も parse option として扱われます。([Eemeli]5)

ただし yaml パッケージは parseDocument() / parseAllDocuments() で document の errors / warnings を保持でき、エラー位置や warning を review しやすくできます。([Eemeli]5) 今の parse() は実装が簡単な反面、最初に throw した parse error に寄りやすく、複数 block / 複数問題の報告品質が落ちます。

これは blocker ではありませんが、validator を「配布物」として高品質化するなら parseDocument() に寄せ、block#index + milestone_id + line/col を出してください。


P2: 成功メッセージが保証範囲を過大に読ませる

現在の success output は単に次です。

[OK] roadmap references are valid: <path>

しかし #1183 は lifecycle status / normative authority / semantic consistency を out of scope にしています。実際、Product Spec Lifecycle では draft は “not yet the normative reference”、accepted は normative と定義されています。 M2 expected destination のうち movement-projectile.md と sortie.md は current head でも status: draft です。

さらに roadmap 自体も、spec_destination は安定仕様が固まった時点で docs/product/features/<feature>.md に昇格し、昇格前は roadmap 記述が暫定スコープ定義として機能すると説明しています。

修正要求:

[OK] roadmap fenced YAML reference checks passed
checked: YAML parse, duplicate keys, field types, path grammar, M2 expected regular-file references
not checked: product-spec lifecycle status, normative authority, semantic consistency

P2: docs/product/playable-roadmap.md の traceability が stale に見える

この PR は docs/product/playable-roadmap.md の fenced YAML を実際に変更しています。M2 close_conditions は YAML parse のため single-quoted string に正規化されています。 しかし frontmatter は last_updated_by_issue: 1171 のままです。

構文正規化だけなので product semantics は変えていない、という整理は可能です。ただし repository の過去文脈では #1167 / #1171 が roadmap 変更時に issue trace を更新しており、この PR だけ据え置くと監査時に “この YAML 正規化はどの Issue 由来か” が追いにくいです。

修正要求: last_updated_by_issue: 1183 に更新するか、PR 本文に「syntax-only normalization のため frontmatter issue は semantic last update として 1171 のまま維持」と明示してください。


P2: CLI が positional arg を黙殺する

normalizeArgs() は unknown --flag は捕捉しますが、positional arg は無視します。

node scripts/validate-roadmap-refs.mjs tests/fixtures/roadmap-refs/missing-target.md

この入力は user error として fail すべきですが、現状は default roadmap を検証する挙動になり得ます。CLI 配布物としては危険です。

修正要求: --file 以外の positional arg は [ERR] unknown argument で exit 2。


P2: fixture が重複・未検証

malformed.md と malformed-yaml.md は実質同じ malformed colon 欠落 fixture です。
obsolete-movement-projectile-split.md と stale-alias.md も同じ M3 movement.md stale alias fixture です。

さらに test harness は malformed-yaml.md と stale-alias.md だけを使い、重複 fixture 側を検証していません。

修正要求: 重複 fixture は削除するか、役割を分けてください。例:

  • malformed-yaml.md: parse error
  • duplicate-key.md: duplicate key
  • obsolete-movement-projectile-split.md: M2 spec_prerequisites stale alias
  • stale-alias.md: M2 spec_destination stale alias
  • planned-destination-missing.md: M3 missing planned path allowed
  • directory-destination.md: all milestone directory fail
  • duplicate-destination-path.md: same path / different description fail

良い点

  • yaml は direct devDependency として追加され、validate:roadmap-refs script と lint:docs script chain は package.json 上で成立しています。
  • M2 の expected set は明示され、movement-projectile.md / combat-core.md / sortie.md に固定されています。
  • stale alias denylist は movement.md / projectile.md を hard fail する形で実装されています。
  • frontmatter 除外と fenced YAML/YML fixture は最低限入っています。valid fixture は frontmatter 除外、M2 exact refs、M3 yml block を含んでいます。
  • 旧 review で出ていた process is not defined は、test file 側で node:process import が追加されており解消されています。

最小修正セット

この PR を merge-ready にする最低ラインは次です。

  1. ensureSafePath() を「全 milestone 共通の path safety」と「M2 の existence hard fail」に分離する。
  2. default target test を status === 0 にする。
  3. CI の既存 lint job に pnpm lint:docs か pnpm validate:roadmap-refs を追加する。
  4. directory / fragment / URL / absolute / duplicate path / empty description の fixture を追加する。
  5. success output を path-level validator の保証範囲に限定する。

これを入れれば、#1183 の本質である “grep false-green の再発防止” にかなり近づきます。現状のままだと、CI green / APPROVE が付いていても、validator 自体がまだ false-green を作れます。

@squne121

squne121 commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author
TEST_VERDICT:
  result: PASS
  mergeable: MERGEABLE
  merge_state_status: CLEAN
  branch_behind_main: false
  baseline_only: false
  verification_commands_pass: 13
  verification_commands_fail: 0
  verification_skipped_count: 0
  runtime_ac_results:
    - ac: AC1
      command: "test -f scripts/validate-roadmap-refs.mjs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "present"
    - ac: AC2
      command: "rg -n 'milestone_id: M2' docs/product/playable-roadmap.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "58:milestone_id: M2"
    - ac: AC3
      command: "rg -n '"yaml"' package.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '65:    "yaml": "^2.8.1"'
    - ac: AC4
      command: "test -f tests/docs/validate-roadmap-refs.test.mjs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "present"
    - ac: AC5
      command: "test -d tests/fixtures/roadmap-refs"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "present"
    - ac: AC6
      command: "rg -n 'docs/product/features/movement-projectile.md' docs/product/playable-roadmap.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "74:spec_prerequisites and 93:spec_destination"
    - ac: AC7
      command: "test -f tests/fixtures/roadmap-refs/obsolete-movement-projectile-split.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "present"
    - ac: AC8
      command: "rg -n '"validate:roadmap-refs"' package.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '14:    "validate:roadmap-refs": "node scripts/validate-roadmap-refs.mjs",'
    - ac: AC9
      command: "test -f tests/fixtures/roadmap-refs/valid.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "present"
    - ac: AC10
      command: "test -f tests/fixtures/roadmap-refs/malformed-yaml.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "present"
    - ac: AC11
      command: "rg -n validate:roadmap-refs package.json"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '13: lint:docs includes validate-refs; 14: validate script present'
    - ac: AC12
      command: "rg -n 'pnpm lint:docs|validate:roadmap-refs' .github/workflows/ci.yml"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: '193: run_timed pnpm_lint_docs pnpm lint:docs'
    - ac: AC13
      command: "rg -n "^  - 'victory: `" docs/product/playable-roadmap.md"
      exit_code: 0
      status: pass
      fallback_detected: false
      artifact_present: not_required
      human_review_required: false
      stop_condition_triggered: false
      notes: "77: victory clause present"

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES

Mergeability

  • mergeable=MERGEABLE, merge_state_status=CLEAN

Evidence Check

  • Contract snapshot: linked issue #1183 の current contract は #1183 (comment) を正本として参照し、PR の changed files は Allowed Paths 内に収まっていることを live 確認
  • Required checks: current head 19d85a2e84e05852608255d1f571c86e441a0fe8 に対して branch protection required contexts typecheck / lint / test / build / python-test / validate-generated-artifact がすべて SUCCESS、mergeable=MERGEABLE、mergeStateStatus=CLEAN を live 確認
  • Verification evidence: TEST_VERDICT_MACHINE と ci_verdict_summary.py --expected-head-sha 19d85a2e84e05852608255d1f571c86e441a0fe8 は current head 一致で PASS を確認

Blockers

  • .github/workflows/ci.yml を変更している CI 関連 PR ですが、PR 本文・PR comments / reviews・取得可能 artifact 証跡のいずれにも CI_TEST_PERFORMANCE_DECISION_V1 が見当たりません。ci-test-performance reviewer gate 上、この head に対する lane classification / baseline inputs / reviewer gate 根拠が欠けているため fail-closed で差し戻します。
  • PR 本文の ## 受け入れ条件の達成状況 が current contract に追随していません。current issue body は AC1-AC13 で、AC12 は既存 ci workflow lint job で validator 実行が走ること、AC13 は default target 成功ですが、PR 本文は AC1-AC12 しかなく current AC12 の明示根拠が欠落しています。current contract に対する AC coverage を PR body で更新してください。

LOOP_VERDICT_V2

verdict: REQUEST_CHANGES
reviewed_head_sha: "19d85a2e84e05852608255d1f571c86e441a0fe8"
merge_ready: false
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "CLEAN"
blockers:
  - ".github/workflows/ci.yml changed, but no CI_TEST_PERFORMANCE_DECISION_V1 evidence was found for the reviewed head in the PR body, comments/reviews, or accessible artifacts"
  - "PR body AC coverage is stale against linked issue #1183 current contract: current AC12/AC13 are not reflected explicitly in ## 受け入れ条件の達成状況"
required_auto_actions:
  - kind: update_pr_body_hygiene
    executor: implementation-worker
    skill: open-pr.update_pr
    blocking_merge_ready: true
    mechanical: true
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
  status: ok
allowed_paths_gate_source: review_subagent

@squne121 squne121 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Mergeability

  • mergeable=MERGEABLE, merge_state_status=CLEAN

Evidence Check

  • Contract snapshot: linked issue #1183 の current contract は #1183 (comment) を正本として参照し、PR の changed files 20 件は current Allowed Paths 内に収まっていることを live 確認
  • AC coverage: PR 本文の ## 受け入れ条件の達成状況 が current contract の AC1-AC13 を明示的にカバーし、AC12 は既存 ci workflow lint job で pnpm lint:docs 実行、AC13 は default target validator success を反映している
  • Verification evidence: current head 19d85a2e84e05852608255d1f571c86e441a0fe8 に対する TEST_VERDICT_MACHINE コメント #1264 (comment) で verification_commands_pass=13 / verification_commands_fail=0 / verification_skipped_count=0 を確認
  • Required checks: current head の branch protection required contexts typecheck / lint / test / build / python-test / validate-generated-artifact はすべて SUCCESS、mergeable=MERGEABLE、mergeStateStatus=CLEAN を live 確認
  • CI performance evidence: PR 本文に CI_TEST_PERFORMANCE_DECISION_V1 が追加済みで、.github/workflows/ci.yml 変更に対する lane classification / baseline inputs / reviewer gate 根拠が current head にひも付いている

Blockers

  • なし

Non-blockers

  • ci_verdict_summary.py は current head review 中の GitHub run 詳細取得でハングしたため、skill 許容の fallback として live gh pr checks / mergeability / fresh TEST_VERDICT_MACHINE / current PR body を突き合わせて判定した

LOOP_VERDICT_V2

verdict: APPROVE
reviewed_head_sha: "19d85a2e84e05852608255d1f571c86e441a0fe8"
merge_ready: true
mergeability:
  mergeable: "MERGEABLE"
  merge_state_status: "CLEAN"
blockers: []
required_auto_actions: []
auto_fix_applied: []
follow_up_issue_requests: []
allowed_paths_gate:
  status: ok
allowed_paths_gate_source: review_subagent

@squne121
squne121 merged commit 85b7526 into main Jul 1, 2026
33 of 34 checks passed
@squne121
squne121 deleted the worktree-issue-1183-playable-roadmap-fenced-yaml-block-path- branch July 1, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

実装: playable-roadmap の fenced YAML block / path existence validator を追加する

1 participant