Skip to content

再発防止: invalid baseline-expect annotation を body-author-fixable needs_fix として扱う #2760

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Issue #2728 で invalid baseline-expect annotation が body-author-fixable にもかかわらず contract_readiness_human_judgment へ昇格し issue-refinement-loop が operator intervention で停止した分類ギャップを解消する"
change_kind: code
dedupe_key: "follow-up:squne121/loop-protocol:issue-2728:invalid-baseline-expect-body-fixable-routing"

Parent Issue

なし(Issue #2728 の refinement 実行中に発見した standalone recurrence-prevention follow-up)。

Parent Goal Ref

Current Validated Scope

current main の .claude/skills/issue-contract-review/scripts/vc_contract_syntax.py は baseline-expect の許可値を pass|fail|deferred に限定し、不正値を __invalid__:<raw> sentinel として保持する。

current main の .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py はその sentinel を受けると、実行前に以下へ分類している。

  • classification = human_judgment
  • decision = human_judgment
  • category = invalid_baseline_expect_annotation

この不正値は Issue 本文の annotation を # baseline-expect: pass|fail|deferred のいずれかへ書き直せば解消するため、環境・tooling・timeout・未知状態ではなく body-author-fixable な contract defect である。

なお、annotation が完全に欠落した既存 baseline-pass VC は current contract_readiness_check.py が classification == unexpected_pass を defensive に needs_fix へ上書きするため、本 Issue の primary bug は「missing annotation 全般」ではなく invalid_baseline_expect_annotation の terminal human_judgment 化である。

Outcome

syntactically invalid な # baseline-expect: 値が、semantic/operator judgment を要求せず body-author-fixable な needs_fix として canonical Step 4 rewrite lane に送られる。

route_canonical_step2_result() の operator-intervention 契約は弱めない。upstream producer/readiness taxonomy を修正し、genuine な environment/tool/timeout/unknown human judgment は従来どおり fail-closed のまま維持する。

In Scope

  • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py
    • invalid_baseline_expect_annotation を body-author-fixable な blocked category として出力するよう変更する。
    • 不正 annotation を subprocess 実行前に拒否する既存挙動は維持する。
    • fix_hint は canonical grammar # baseline-expect: pass|fail|deferred への書き換えを明示する。
  • .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
    • invalid_baseline_expect_annotation を needs_fix として明示マッピングする。
    • autofixable / structured feedback は実装上妥当なら body-author-fixable として表現するが、LLM rewrite だけで十分なら deterministic auto-apply 自体は必須としない。
  • regression tests
    • invalid value が contract_readiness_human_judgment にならないこと。
    • root pipeline で canonical_step2_route == step_4 になること。
    • env_missing_dep / timeout / baseline_regression_failed / unknown 等の genuine human_judgment は operator intervention を維持すること。

Out of Scope

Acceptance Criteria

  • AC1: invalid # baseline-expect: <value> は subprocess 実行前に拒否されるが、result は body-author-fixable な blocked / invalid_baseline_expect_annotation(または同等の typed blocked category)として表現され、decision=human_judgment にならない。
  • AC2: contract_readiness_check.py は invalid_baseline_expect_annotation を needs_fix に集約し、contract_readiness_human_judgment を生成しない。
  • AC3: canonical root review pipeline の fixture で、実装: get_ci_failed_log.py の KNOWN_TOKEN_PATTERN を新形式 ghs_ App installation token に対応させる #2728 型の自由記述付き annotation が canonical_step2_route: step_4 に到達する。
  • AC4: genuine operator/environment categories(最低限 env_missing_dep / timeout / baseline_regression_failed / unknown)は従来どおり human_judgment/operator-intervention を維持する。
  • AC5: issue-contract-review / issue-refinement-loop の関連 pytest が PASS する。

Verification Commands

# AC1 / AC2
# baseline-expect: fail
$ rg -n "\"invalid_baseline_expect_annotation\".*\"needs_fix\"|invalid_baseline_expect_annotation.*blocked" .claude/skills/issue-contract-review/scripts/contract_readiness_check.py .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py
# AC3-AC5
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-contract-review/scripts/tests/ .claude/skills/issue-refinement-loop/scripts/tests/ -q

Allowed Paths

  • .claude/skills/issue-contract-review/scripts/baseline_vc_preflight.py
  • .claude/skills/issue-contract-review/scripts/contract_readiness_check.py
  • .claude/skills/issue-contract-review/scripts/tests/
  • .claude/skills/issue-refinement-loop/scripts/tests/

Required Design References

Notes for Reviewer

これは #899 の意図を覆すものではなく、その後も残っていた narrow taxonomy gap の successor regression fix である。

#2728 では AC1 の annotation 欠落そのものは current readiness consumer の unexpected_pass -> needs_fix defensive mapping で body-fixable に扱える。一方、AC2/AC3 の自由記述付き annotation は producer が明示的に human_judgment を生成するため aggregate を human_judgment へ押し上げ、terminal operator intervention を引き起こした。ここを区別して regression を固定する。

Source

Activity

  1. added
    agent/implementer
    enhancement
    follow-up
    phase/implementation
    on Sep 25, 2026
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/implementerenhancementfollow-upphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions