Skip to content

feat: baseline_vc_preflight に baseline-expect:fail escape hatch を追加する - #2516

Merged
squne121 merged 2 commits into
mainfrom
worktree-issue-2515-baseline-expect-escape-hatch
Sep 6, 2026
Merged

squne121 merged 2 commits into
mainfrom
worktree-issue-2515-baseline-expect-escape-hatch

Conversation

@squne121

@squne121 squne121 commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

受け入れ条件の達成状況

Issue #2515 が定めた受け入れ条件それぞれの達成状況は次のとおりです。

  • AC1: 既存ファイル内の未作成 class node-id を参照する VC に # baseline-expect: fail が付与されている場合、expected_baseline_fail(go 相当)に分類されることを新規テスト test_baseline_expect_fail_existing_file_missing_class_node_id_is_expected_fail で検証済み(PASS)。
  • AC2: 同じ class node-id で annotation が無い場合、既存どおり existing_file_missing_node_id_noncanonical / needs_fix を維持することを新規テスト test_existing_file_missing_class_node_id_without_annotation_still_blocked で回帰確認済み(PASS)。
  • AC3: 未作成 top-level 関数 node-id についても、annotation の有無で AC1/AC2 と同様の挙動になることを新規テスト test_baseline_expect_fail_existing_file_missing_function_node_id_is_expected_fail で確認済み(PASS)。
  • AC4: contract_readiness_check.run_baseline_vc_preflight()(実 subprocess 実行)+ map_preflight_result_to_errors() を通した production-shaped E2E で readiness status が needs_fix/human_judgment にならないことを新規テスト test_baseline_expect_fail_existing_file_missing_node_id_e2e_readiness_is_go で検証済み(PASS)。
  • AC5: .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py 全体(143 passed, 1 skipped)で既存回帰が無いことを確認済み。

検証コマンド結果

$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py -q
143 passed, 1 skipped in 183.40s

$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/test_contract_readiness.py -q
48 passed in 3.13s

(後者は downstream consumer の非破壊確認として追加実行。Issue #2515 の Allowed Paths には含まれない read-only 検証。)

Allowed Paths 遵守

  • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py(コア修正)
  • .claude/skills/issue-contract-review/scripts/tests/test_baseline_vc_preflight.py(新規テスト4件追加)
  • .claude/skills/issue-contract-review/scripts/tests/fixtures/baseline_expect_fail_existing_file_class_node_id.md(新規)
  • .claude/skills/issue-contract-review/scripts/tests/fixtures/baseline_expect_fail_existing_file_function_node_id.md(新規)
  • .claude/skills/issue-contract-review/scripts/tests/fixtures/existing_file_missing_class_node_id_no_annotation.md(新規)

上記3件の fixture ファイルは Issue #2515 本文の Scope Delta で Allowed Paths に追加済み(既存の run_preflight() E2E テスト慣例に従う test data ファイルであり、実装ロジックの変更ではない)。

Checks

  • pnpm typecheck
  • pnpm lint
  • pnpm test
  • pnpm build
  • 上記コマンドをすべてローカルで実行し、成功したことを確認してからチェックしています

Schema Change Applicability

  • decision: not_schema_change
  • reason: baseline_vc_preflight.py 内部の分類ロジック(既存の per-VC 結果 dict の category/decision/classification フィールドの値の一つを、既存の # baseline-expect: fail annotation 経由でのみ変更する)であり、producer-consumer 境界をまたぐ新しい machine-readable schema の追加・変更ではない。既存の annotations.baseline_expect フィールドの意味も変更しない。

Schema Consumer Inventory

N/A(not_schema_change のため)。

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
# baseline-expect: fail annotation が無い既存 VC の分類挙動を一切変更しない(回帰なし) yes なし test_existing_file_missing_class_node_id_without_annotation_still_blocked PASS、test_baseline_vc_preflight.py 全体 143 passed, 1 skipped N/A
annotation を明示的に書いた author の意図(既存ファイルへの新規 class/function 追加)以外の readiness 判定を緩めない yes existing_file_missing_node_id_noncanonical 以外の category・decision == "blocked" 以外の分岐は本 PR の対象外で無変更 該当分岐へのコード diff なし(baseline_vc_preflight.py の diff 参照) N/A
annotation を悪用した readiness bypass(他 category への横流用)を許可しない yes このガードは category/decision の完全一致条件のみで判定し、任意の category を許可しない コード diff の if (_category == "existing_file_missing_node_id_noncanonical" and _decision == "blocked"): 条件 N/A

Notes

…file missing node-id

existing_file_missing_node_id_noncanonical (Issue #1285/#1347/PR #1305) always
forced needs_fix for a pytest VC referencing a not-yet-created node-id (class
or function) inside an EXISTING allowed file, with the only fix_hint being
"move to a not-yet-created file". That has no resolution when the OWNER has
explicitly required the new test to live in the existing file (Issue #2152),
since vc_baseline_shape_compiler.py's autofix only covers top-level function
node-ids and only proposes not-yet-created files already in Allowed Paths.

An explicit author-declared `# baseline-expect: fail` annotation now overrides
this ambiguity heuristic and classifies the VC as expected_fail/go instead,
for both class and function node-ids. Without the annotation, prior behavior
is unchanged.

Closes #2515.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Preview URL

✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2516/

The preview will be removed when this PR is closed.

PR Body Japanese Check's "Check changed Markdown files" step scans every
changed *.md file (not just the PR body) for Japanese prose ratio, with no
exemption for test fixtures. The 3 new fixtures had zero prose outside the
bash fence, causing an aggregate_ratio: 0.000 failure. Adds one Japanese
sentence describing each fixture's purpose above the Verification Commands
heading, matching the existing fixture convention in this test suite.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.

実装: baseline_vc_preflight.py の existing_file_missing_node_id_noncanonical 分類に baseline-expect: fail escape hatch を追加する

1 participant