Repository navigation
fix: test_isolated_anchor_single_authority のtransient判定を構造化reason_codeベースに改修する - #2319
Conversation
…eベースに改修する (#2317) PR #2310 CI failure triage(run 32617957047)で発覚した、既存の broad substring OR-chain(`"rate_limited" in stdout or ... or ... in result.stderr`)が production 側の `BLOCKERS: GH_API_FAILURE` genuine failure を見落とし transient skip として false-green 化しうる問題を修正する。 - run_refinement_preflight.py: _build_compact_stdout() に、 status == "environment_failure" のときのみ REASON_CODE/SOURCE/OPERATION の3行を一貫して出力する最小限の追加を行う(#2257 AC4 未実装差分の解消)。 - test_isolated_anchor_single_authority.py: stdout の REASON_CODE: 行を 厳密パースし、値が closed set {rate_limited, upstream_environment_failure, transport_connectivity_failure} の完全一致の場合にのみ True を返す _is_transient_environment_failure_reason_code() predicate を新設し、 live subprocess テストの skip 判定を旧 substring OR-chain から置き換える。 stderr は判定ソースとして使用しない。 - test_refinement_preflight.py: formatter (_build_compact_stdout()) の contract unit test を追加する(既存 TestBuildCompactStdout に集約)。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URLPreview removed (PR #2319 closed). |
判定: REQUEST_CHANGESPR #2319 の中心方針は正しいです。 ただし、このまま merge は勧めません。P1 相当が3点あります。特に1点目は明確なテスト契約違反です。 P1 — 新規 formatter test が canonical schema に存在しない値を使っているこれは最も明確な blocker です。 追加された2箇所の formatter test は、 を使っています。 ところが canonical です。 しかも したがって現在のテストは「canonical result → compact stdout」の contract を検証していません。production では生成され得ない synthetic object に対して formatter が文字列を出せることを検証しているだけです。 修正は小さくて十分です。少なくとも positive fixture を、 "reason_code": "rate_limited",
"source": "credentialless_transport",
"operation": "read_issue",にしてください。さらに質を上げるなら P1 — transient parser が
|
OWNER REQUEST_CHANGES on PR #2319 (4 blockers): - Fix schema-invalid source/operation fixture values in the newly added formatter tests (github_api/fetch_issue -> credentialless_transport/ read_issue, the values valid for status: environment_failure per refinement_preflight_result/v1 schema). - Harden _stdout_indicates_transient_environment_failure() to also require STATUS: environment_failure to appear exactly once, in addition to the pre-existing REASON_CODE exactly-once check. - Mark the two real-network tests with @pytest.mark.github_live so they are excluded from the default python-test run, and generalize the marker's pyproject.toml description beyond "gh CLI write access" to cover unauthenticated live GitHub REST reads too. - Remove the near-duplicate formatter-contract tests and the _load_run_refinement_preflight_module() helper from test_isolated_anchor_single_authority.py; test_refinement_preflight.py already owns formatter contract testing. Co-Authored-By: Claude Sonnet 5 <[email protected]>
fix_delta iteration 1 (OWNER REQUEST_CHANGES)対応 head: P1: schema-invalid fixtures
P1: STATUS の exactly-once 厳格化
P1: github_live marker(Scope Delta)実ネットワーク呼び出しを行う2テスト( Scope Delta: P2: 重複テストの除去
検証結果
CI/test-lane 関連パスの変更(pyproject.toml マーカー記述変更)については、テストの実行時間やレーン構成に対する新規パフォーマンス主張は行っていない(テスト除外の正しさに関する修正のみ)。 このコメントは実装反映のみで、PR は Draft のまま・マージ操作は行っていない。 |
|
pr-review-judge の REQUEST_CHANGES(iteration 2, head 509a776)で挙げられた唯一の blocker(
コード変更は行っていない(本 iteration は PR 本文メタデータのみの修正)。head SHA は変わらないため、再レビューを依頼する。 |
Verdict: APPROVEMergeability
Blockersなし 確認事項(impl-review-loop iteration サマリ)
verdict: APPROVE
reviewed_head_sha: "6fd5a83e2f9229b156de89287fcc231df22a561e"
blockers: []
warnings: [] |
Summary
test_isolated_anchor_single_authority.pyの transient-failure skip 判定を、production が既に細分類済みの構造化reason_code(closed enum)ベースの判定へ改修した。旧来の broad substring OR-chain(stdout/stderr 双方の"rate_limited" in ...系)は、BLOCKERS: GH_API_FAILUREのみが存在する genuine failure を skip してしまう false-green リスクを持っていたため置き換えた。#2257 AC4が要求していたreason_code/source/operationの stdout 三値一貫投影の未実装差分を解消した(run_refinement_preflight.py::_build_compact_stdout()にstatus == "environment_failure"時のみREASON_CODE/SOURCE/OPERATIONの3行を出力する最小限の追加)。Scope Delta(範囲追加の申告)
pyproject.toml(Issue 実装: test_isolated_anchor_single_authority のtransient failure skip判定を構造化reason_codeベースに改修する #2317 の Allowed Paths には含まれていない)[tool.pytest.ini_options].markersのgithub_liveマーカーの docstring を、従来「real GitHub API write access(実際の GitHub API 書き込みアクセス)のみ」をカバーする記述から、「unauthenticated live GitHub REST/API reads(無認証の live GitHub REST/API 読み取り)」も含む記述へ一般化した。マーカー名・addoptsの除外条件(-m 'not github_live')は変更していない、docstring(説明文)のみの 1 行差分。@pytest.mark.github_liveを付与した 2 件の live-network テスト(scripts/agent-guards/tests/配下、blocker 3 の修正対応)を、default のpython-testCI ターゲットから正しく除外するために必要。マーカーの意味を実態(読み取り専用の live GitHub アクセスも含む)に合わせて拡張しないと、CI ドキュメント上の説明と実際の運用が乖離する。allowed_paths_review_gate.pyは live Issue 実装: test_isolated_anchor_single_authority のtransient failure skip判定を構造化reason_codeベースに改修する #2317 の Allowed Paths(scripts/agent-guards/tests/test_isolated_anchor_single_authority.py、.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py、.claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py)に対して機械的に判定するためstatus=fail_closedを返すが、本セクションの追加により reviewer が Scope Delta として明示的に評価できる状態にした。CI_TEST_PERFORMANCE_DECISION_V1(該当性確認)
pyproject.tomlはci-test-performanceSkill のpathsに一致するため、判断マトリクスに従い該当性を確認した。decision_scope:review_only(CI ワークフロー自体・依存関係バージョン・実行対象範囲の変更ではなく、既存マーカーの docstring 一般化のみ)lane_classification.python_unit.applicable:true(判断マトリクスでpyproject.tomlは python_unit 必須)evidence: 本 PR の Checks セクションに記載済みの以下のコマンドで既に検証済み(markers定義変更後もaddoptsの除外条件は不変のため、defaultpython-testターゲットの collect 件数・実行対象に変化なし)uv run pytest scripts/agent-guards/tests/test_isolated_anchor_single_authority.py -k "not live_subprocess and not credentialless_authority"→ 7 passeduv run pytest .claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py→ 87 passedlane_classification.fast_static/contract_artifact/integration: いずれもapplicable: false(判断マトリクスでpyproject.tomlは該当なし、かつ本変更は CI ワークフロー・schema・skill 定義を変更しない)CI_TEST_PERFORMANCE_ASSESSMENT_V2は非該当と判断した: 本変更はclaim.kind: none(高速化・性能改善・budget を主張しない、docstring のみの説明文変更)であり、performance_evidence.status: not_requiredとなるため、20-run baseline やruntime_delta等の性能証跡は不要。Checks
pnpm typecheck— Python 中心の変更のためスキップ(TS 変更なし)pnpm lint— Python 中心の変更のためスキップ(TS 変更なし)pnpm test— Python 中心の変更のためスキップ(TS 変更なし)pnpm build— Python 中心の変更のためスキップ(TS 変更なし)uv run pytest scripts/agent-guards/tests/test_isolated_anchor_single_authority.py -k "not live_subprocess and not credentialless_authority"→ 7 passeduv run pytest .claude/skills/issue-refinement-loop/tests/test_refinement_preflight.py→ 87 passeduv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py→ 24 passeduvx ruff check <changed files>→ All checks passedSchema Change Applicability
not_schema_changerun_refinement_preflight.pyの_build_compact_stdout()に対する変更は、既存のresultdict(producer 側では既にreason_code/source/operationキーを保持)の未投影フィールドを stdout に追加投影するのみであり、refinement_preflight_result/v1の JSON schema のキー集合・型は変更していない(実装: Claude-GPT issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する #2257 AC4 が元々要求していた stdout 投影の未実装差分を埋めるものであり、schema 自体の変更ではない)。Schema Consumer Inventory
N/A(
not_schema_changeのため)Visual Impact Declaration(視覚影響申告)
UI(DOM/CSS)変更を含まないため省略。
Safety Claim Matrix
test_transient_environment_failure_predicate_false_for_genuine_reason_codes/test_transient_environment_failure_predicate_false_without_reason_code_line/test_transient_environment_failure_predicate_false_for_duplicate_or_empty_reason_code(全 PASS、本 PR に含まれる決定論的 unit test)Notes