Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#2313"
goal_ref: "credentialless GitHub live positive control を `github_live` opt-in verification に分離し、required pytest / PR CI を shared-runner の GitHub API quota・network availability から独立させて deterministic にする(#2313 調査の推奨実装、#2361 OWNER review 反映)"
change_kind: codeParent Issue
Parent Goal Ref
- Goal:
test_credentialless_public_issue_read_succeedsをgithub_livemarker に適合させ、default(required)pytest 実行から除外し、stale な例外処理を fail-closed 契約と整合させる - Desired Destination:
scripts/agent-guards/tests/test_credentialless_github_read.pyと marker collection regression test の是正(調査: credentialless GitHub read の live AC を shared-runner API rate limit から分離して deterministic にする #2313 の調査結果を実装に落とす)
Runtime Verification Applicability
- decision: not_applicable
- reason: fault injection(monkeypatch による例外分岐の固定)と
pytest --collect-onlyによる marker deselect/collect 確認のみで decision-relevant な挙動を deterministic に検証でき、実ネットワークへの live 実行を merge gate(required CI)にしないため
Current Validated Scope
scripts/agent-guards/tests/test_credentialless_github_read.pyのtest_credentialless_public_issue_read_succeedsに@pytest.mark.github_liveを付与する- 同テストの例外処理を production transport(
scripts/agent-guards/github_credentialless_read.py)の現在の taxonomy(TransportConnectivityFailure/RateLimitedRejected/ForbiddenRejected/UnexpectedAuthenticationDependency/CanonicalResourceMissing/UpstreamEnvironmentFailure)に合わせて是正する .claude/skills/impl-review-loop/tests/test_credentialless_read_marker_nodeid_collection.py(新設)でtest_credentialless_github_read.py内のtest_credentialless_public_issue_read_succeeds[1]という exact nodeid の deselect/collect 挙動を検証できるようにする(既存のtest_github_live_marker_collection.pyの_collect()パターンを踏襲する)
Remaining Parent Gaps
- なし(調査: credentialless GitHub read の live AC を shared-runner API rate limit から分離して deterministic にする #2313 の推奨実装はこの Issue で完結する)
Outcome
scripts/agent-guards/tests/test_credentialless_github_read.py::test_credentialless_public_issue_read_succeeds に @pytest.mark.github_live が付与され default pytest 実行から deselect されること、同テストの例外処理が production transport(scripts/agent-guards/github_credentialless_read.py)の現在の taxonomy と整合し、TransportConnectivityFailure(DNS/egress)のみを SKIP、それ以外の構造化例外(RateLimitedRejected / ForbiddenRejected / UnexpectedAuthenticationDependency / CanonicalResourceMissing / UpstreamEnvironmentFailure)および _classify_http_error が分類しない raw/unknown urllib.error.HTTPError をすべて FAIL とすることが、新設の fault-injection ユニットテストファイル(scripts/agent-guards/tests/test_credentialless_read_exception_policy_matrix.py)で検証できること、および新設の marker collection regression test ファイル(.claude/skills/impl-review-loop/tests/test_credentialless_read_marker_nodeid_collection.py)が test_credentialless_public_issue_read_succeeds[1] という exact nodeid を対象に、default では deselect、-m github_live では collect されることを検証していることが、それぞれ commit され、対応する pytest 実行結果で確認できる状態を完了とする。
In Scope
scripts/agent-guards/tests/test_credentialless_github_read.py::test_credentialless_public_issue_read_succeedsに@pytest.mark.github_liveを追加する- 同テストの例外処理を、production transport(
scripts/agent-guards/github_credentialless_read.py)の現在の taxonomy に合わせて是正する:TransportConnectivityFailure(DNS/egress)のみ SKIP、RateLimitedRejected/ForbiddenRejected/UnexpectedAuthenticationDependency/CanonicalResourceMissing/UpstreamEnvironmentFailure、および_classify_http_errorが分類しない raw/unknownurllib.error.HTTPErrorはすべて FAIL とする。現行の broadexcept urllib.error.URLError/except OSErrorはTransportConnectivityFailure以外の理由で SKIP させない形に是正する。新設ファイルscripts/agent-guards/tests/test_credentialless_read_exception_policy_matrix.pyで、monkeypatch/subprocess-based fault-injection により各例外クラス(および raw/unmappedurllib.error.HTTPError)を注入し、期待される skip/fail 判定と一致することを検証する - 新設ファイル
.claude/skills/impl-review-loop/tests/test_credentialless_read_marker_nodeid_collection.pyで、test_credentialless_public_issue_read_succeeds[1]という exact nodeid を対象に、default では deselect、-m github_liveでは collect されることを検証できるようにする(既存の.claude/skills/impl-review-loop/tests/test_github_live_marker_collection.py(実装: ensure_contract_snapshot.py の materialized_go 経路で fingerprint PATCH が反映されないバグを修正する #1562 用)はそのまま維持し変更しない)
Out of Scope
- CI workflow の変更、新規 runner の追加
- authenticated broker の新規実装(GET-only repository-bound 含む)
- credential forwarding
- Issue 実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read) #2241 の
auth_required: false/ Out of Scope 判断の変更
Acceptance Criteria
- AC1:
test_credentialless_public_issue_read_succeedsに@pytest.mark.github_liveが付与されており、default pytest 実行(-m 'not github_live and not claude_live'相当)で deselect されることを検証できる - AC2:
scripts/agent-guards/tests/test_credentialless_read_exception_policy_matrix.py(新設)が、TransportConnectivityFailure(DNS/egress)のみ SKIP、RateLimitedRejected/ForbiddenRejected/UnexpectedAuthenticationDependency/CanonicalResourceMissing/UpstreamEnvironmentFailureおよび raw/unknownurllib.error.HTTPErrorはすべて FAIL とする fault-injection ユニットテストで検証しており、Issue 実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read) #2241 AC3 の fail-closed 契約と整合している - AC3:
.claude/skills/impl-review-loop/tests/test_credentialless_read_marker_nodeid_collection.py(新設)がtest_credentialless_public_issue_read_succeeds[1]という exact nodeid を対象に、default での deselect と-m github_liveでの collect の両方を検証している
Verification Commands
# AC1
$ grep -n "@pytest.mark.github_live" -A2 scripts/agent-guards/tests/test_credentialless_github_read.py
# AC2
$ uv run --locked pytest scripts/agent-guards/tests/test_credentialless_read_exception_policy_matrix.py -q
# AC3
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_credentialless_read_marker_nodeid_collection.py -qAllowed Paths
scripts/agent-guards/tests/test_credentialless_github_read.pyscripts/agent-guards/tests/test_credentialless_read_exception_policy_matrix.py.claude/skills/impl-review-loop/tests/test_credentialless_read_marker_nodeid_collection.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。特に対象テストの production transport 呼び出し先(
github_credentialless_read.py)の公開 API・例外型を変更する必要が生じた場合 - 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合。特に Issue 実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read) #2241 AC3 の fail-closed 契約(rate limit/HTTP error を fail させる設計意図)と矛盾する変更が必要になった場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。marker collection regression test の汎化が既存の他テストの marker 判定契約を壊す場合を含む
Required Skills
なし
Required Design References
- pyproject.toml(
github_livemarker 定義・addopts) - Issue 実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read) #2241(fail-closed 契約の原本)
- Issue 調査: credentialless GitHub read の live AC を shared-runner API rate limit から分離して deterministic にする #2313(本 Issue の起票元・調査結果)
- Issue 実装: Claude-GPT issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する #2257 / PR fix: issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する (#2257) #2260(403/429 の例外 taxonomy 改修。
ForbiddenRejected新設と rate-limit header evidence による分岐の原本) docs/dev/runtime-verification-policy.md(本 Issue の Runtime Verification Applicability 判断根拠).claude/skills/issue-refinement-loop/references/ac-vc-reflection.md(AC/VC の baseline fail 期待値と reflection guard の運用規約)
Delivery Rule
1 Issue = 1 PR とする。worktree で作業し、Draft PR を既定とする。
Notes for Reviewer
- 本 Issue は 調査: credentialless GitHub read の live AC を shared-runner API rate limit から分離して deterministic にする #2313(調査)の OWNER review comment(https://github.com/squne121/loop-protocol/issues/2313#issuecomment-5437857594)と codebase-investigator の独立検証結果に基づく follow-up implementation Issue。
- 関連 PR: 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2307(今回の flake が顕在化した PR)、fix: test_isolated_anchor_single_authority のtransient判定を構造化reason_codeベースに改修する #2319(
github_livemarker policy 導入) - 関連 Issue: 実装: Claude-GPT isolated session の minimum control-plane capability を保証する(uv toolchain resolution + credentialless GitHub read) #2241(fail-closed 契約の原本)、fix: Claude-GPT isolated session の trusted uv toolchain 解決を HOME 分離から独立させる (#2241) #2247(review 履歴)、実装: Claude-GPT issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する #2257 / PR fix: issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する (#2257) #2260(403/429 taxonomy 改修)
- 本 Issue 契約は OWNER review comment(https://github.com/squne121/loop-protocol/issues/2361#issuecomment-5440372647)の REQUEST_CHANGES(AC2 の false-green 余地、AC3 の件数ベース regression の弱さ、taxonomy の陳腐化、goal wording)を反映して改訂した。codebase-investigator による独立検証で、現行 production 実装(
github_credentialless_read.py)は既に 実装: Claude-GPT issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する #2257 / PR fix: issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する (#2257) #2260 の taxonomy を実装済みである一方、テスト側(test_credentialless_github_read.py)は marker 未付与・ForbiddenRejected未catch・broad catch 残存という 3 点の乖離があることを確認済み。 - AC2 / AC3 の検証先を、既存ファイル内への新規テスト関数追加ではなく新設ファイル(
test_credentialless_read_exception_policy_matrix.py/test_credentialless_read_marker_nodeid_collection.py)に変更した。これは deterministic reviewer(baseline_vc_preflightのVCP_EXISTING_FILE_MISSINルール、Issue 実装: VC baseline-fail 用 pytest command を canonical form に正規化して contract-review 往復を削減する #1285 / PR feat: VC baseline-fail pytest command を canonical form に正規化する compiler を追加 #1305)が「既存ファイルへの新規テスト関数」形の VC を non-canonical として reject したための機械的な是正であり、OWNER コメントの技術方針とは矛盾しない。この2ファイル追加分だけ Allowed Paths を拡張した(機能領域・アーキテクチャ層の追加ではなく、同一ディレクトリ内の sibling test file 追加)。
Activity
squne121 commentedon Aug 27, 2026
判定
REQUEST_CHANGES です。ただし、実装方針そのものはかなり良いです。
github_liveへ移して required CI から実 GitHub API 可用性を切り離す、CI workflow や新 runner、authenticated broker を増やさない、という方向はそのまま採用すべきです。現行pyproject.tomlは既にgithub_liveを default pytest から除外しており、Python test plan 側にもgithub_live/claude_liveを runtime-verification-only として扱う仕組みがあります。問題は AC2 の false-green 余地 と AC3 の regression test が弱いことです。この2点は実装前に Issue 本文を直した方がよいです。新しいハーネスやセキュリティ層は不要です。
Severity | 指摘 | 判定 -- | -- | -- P1 | AC2 の Verification Command が grep TransportConnectivityFailure だけで、skip/fail semantics を証明しない | 修正必須 P1 | marker regression が件数ベースで、対象 nodeid 自体が github_live かを保証しない | 修正必須 P2 | AC2 の taxonomy が #2257 / PR #2260 より古く、ForbiddenRejected と 429 を欠く | 修正推奨 P2 | 「live AC を deterministic にする」という goal が親レビューの結論とズレる | 文言修正推奨この形なら 2ファイルだけの小さな PR のまま、元の事故をかなり確実に封じられます。逆に dedicated CI lane や live retry、authenticated read を持ち込むのは、この Issue では品質向上より運用負荷の増加が大きいです。
総評としては、設計方針は APPROVE、Issue contract は REQUEST_CHANGES です。実装前に上の P1 2件だけ直せば、個人趣味開発としては十分に高品質で、過剰なガードも増やさないバランスになっています。
## 判定REQUEST_CHANGES です。ただし、実装方針そのものはかなり良いです。
github_liveへ移して required CI から実 GitHub API 可用性を切り離す、CI workflow や新 runner、authenticated broker を増やさない、という方向はそのまま採用すべきです。現行pyproject.tomlは既にgithub_liveを default pytest から除外しており、Python test plan 側にもgithub_live/claude_liveを runtime-verification-only として扱う仕組みがあります。問題は AC2 の false-green 余地 と AC3 の regression test が弱いことです。この2点は実装前に Issue 本文を直した方がよいです。新しいハーネスやセキュリティ層は不要です。
grep TransportConnectivityFailureだけで、skip/fail semantics を証明しないgithub_liveかを保証しないForbiddenRejectedと 429 を欠くP1 — AC2 は現状の VC だと false-green できます
現在の live test は、5xx の
UpstreamEnvironmentFailureをpytest.skip()し、URLError/OSErrorも skip しています。一方 production transport は DNS/connection/timeout をTransportConnectivityFailureに変換し、401/403/404/429/5xx を構造化例外へ分類しています。#2361 はここを直そうとしているので方向は正しいのですが、AC2 の Verification Command は単に、
grep -n "TransportConnectivityFailure" scripts/agent-guards/tests/test_credentialless_github_read.pyです。これでは例えば
TransportConnectivityFailureの catch を追加しつつ、既存のexcept urllib.error.URLError: pytest.skip(...)を残しても AC2 が PASS します。Issue 自身が要求している「HTTP error は fail、DNS/egress のみ skip」を証明していません。これは実害があります。Python 公式仕様上、
HTTPErrorはURLErrorの subclass、URLErrorはOSErrorの subclass です。したがって production の_classify_http_error()が構造化しない将来の HTTP status、例えば 400/422 等が rawHTTPErrorとして返った場合、broadURLError/OSErrorcatch が残っていれば HTTP failure を SKIP にしてしまいます。([Python documentation]1)ここは security harness を増やす必要はありません。
test_credentialless_github_read.py内に unmarked な小さな fault-injection regression を置き、live test の exception policy を直接検証するだけで十分です。最低限、次の matrix を固定すべきです。TransportConnectivityFailureRateLimitedRejectedForbiddenRejectedUnexpectedAuthenticationDependencyCanonicalResourceMissingUpstreamEnvironmentFailureHTTPError特に
except urllib.error.URLErrorとexcept OSErrorは live test から削除して、skip の入口をTransportConnectivityFailureだけにするのが最小で堅いです。残りはCredentiallessReadErrorをまとめて fail にしてもよく、その方が今後 taxonomy が増えても fail-closed になります。PR #2247 の元の OWNER review も、403/429、401、404、5xx を PASS/SKIP に昇格させず、DNS/egress と分離することを要求していました。つまりこれは新しい厳格化ではなく、既存契約を正しく回復するだけです。
P1 — marker regression は「件数」ではなく対象 nodeid を検証すべきです
現在の
.claude/skills/impl-review-loop/tests/test_github_live_marker_collection.pyは、#1562 用の別ファイルtest_ensure_contract_snapshot_fingerprint_patch.pyを_LIVE_TEST_FILEとしてハードコードし、default で"2 deselected"、-m github_liveで「2件以上 collected」を見ています。この方式を雑に拡張して aggregate count だけ見ると、今回の
test_credentialless_public_issue_read_succeeds[1]が marker 未付与でも、別の github_live tests が件数を満たして regression test が green になり得ます。今回まさに「marker policy は存在したが、このテストだけ付与漏れ」という事故なので、件数ベースでは再発防止として弱いです。PR #2319 で unauthenticated live GitHub read もgithub_liveの対象に既に一般化されています。ここも大きな generic policy engine は不要です。対象を exact nodeid で確認すれば済みます。
pytest は nodeid による個別 collection と
-mmarker selection を公式にサポートしており、対象が全部 deselect された場合の exit code 5 も正式な契約です。([pytestドキュメンテーション]2)したがって AC3 は「default → exact node が deselect / exit 5」「
-m github_live→ exact nodeid が collect / exit 0」を見るべきです。既存 #1562 用チェックは残し、対象ケースを1件追加する程度で十分です。P2 —
rate limit (403)は現在の taxonomy とずれています#2361 は AC2 で
RateLimitedRejectedと「rate limit(403)」を中心に書いていますが、これは現在の production contract より古いです。Issue #2257 / PR #2260 で、429 は rate limit、403 は rate-limit header evidence がある場合のみRateLimitedRejected、それ以外の 403 はForbiddenRejectedに改修されています。GitHub 公式仕様とも一致します。unauthenticated REST は IP 単位で 60 requests/hour ですが、rate limit 超過は 403 または 429 で、primary limit なら
x-ratelimit-remaining: 0、secondary limit ではretry-after等が判断材料になります。403 という status だけで rate-limit と断定すべきではありません。([GitHub Docs]3)したがって AC2 は「rate limit (403)」ではなく、概ね
RateLimitedRejected / ForbiddenRejected / UnexpectedAuthenticationDependency / CanonicalResourceMissing / UpstreamEnvironmentFailure は fail、TransportConnectivityFailure のみ skipと現在の class taxonomy で書く方がよいです。また
Required Design Referencesに Issue #2257 / PR #2260 を追加すべきです。#2241 と #2313 だけを読ませると、実装者が現在の 403 classification を見落とす可能性があります。P2 — deterministic にする対象を明確化した方がよいです
親 #2313 の OWNER review で重要なのは、「実 GitHub API を無認証で叩く live test 自体は deterministic にはならない。deterministic にすべきなのは required PR CI」という整理でした。
ところが #2361 の
goal_refはまだ「credentialless GitHub read の live AC を ... deterministic にする」と書かれています。ここは、
という意味に修正した方がよいです。live test は今後も 60 req/hour/IP の quota、GitHub outage、ネットワークに依存します。それ自体を deterministic と呼ぶと、後で dedicated runner や retry harness を追加する誤った動機になります。GitHub の unauthenticated rate limit 自体がこの外部依存を避けられないことを示しています。([GitHub Docs]3)
推奨する最小修正
Issue のスコープや Allowed Paths は増やさなくてよいです。CI workflow、新 runner、authenticated broker、credential forwarding、
strict-markers導入、scheduled canary も不要です。変更すべき契約は次の程度です。
TransportConnectivityFailureのみ SKIP。それ以外の structured HTTP failures は FAIL。ForbiddenRejectedと 429 も明記grepを廃止し、monkeypatch/fault injection による behavioral test に変更test_credentialless_public_issue_read_succeeds[1]exact nodeid を検証not_applicableは維持。ただし「静的コード確認」ではなく「fault injection + collect-only で deterministic に検証、実ネットワーク実行は merge gate にしない」とするこの形なら 2ファイルだけの小さな PR のまま、元の事故をかなり確実に封じられます。逆に dedicated CI lane や live retry、authenticated read を持ち込むのは、この Issue では品質向上より運用負荷の増加が大きいです。
総評としては、設計方針は APPROVE、Issue contract は REQUEST_CHANGES です。実装前に上の P1 2件だけ直せば、個人趣味開発としては十分に高品質で、過剰なガードも増やさないバランスになっています。
squne121 commentedon Aug 27, 2026
issue-refinement-loop: approved
scripts/agent-guards/tests/test_credentialless_read_exception_policy_matrix.py)参照へ変更.claude/skills/impl-review-loop/tests/test_credentialless_read_marker_nodeid_collection.py)参照へ変更ForbiddenRejected/ 429 常時 rate-limit 等、Issue 実装: Claude-GPT issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する #2257 / PR fix: issue-refinement preflight の anchor comment 取得を credentialless transport へ統一する (#2257) #2260 準拠)に更新docs/dev/runtime-verification-policy.md、.claude/skills/issue-refinement-loop/references/ac-vc-reflection.mdを追加ForbiddenRejected未catch・broad catch 残存・marker regression が対象テストを未カバー)はすべて現在のコードで実在する乖離であることを確認済みrun_root_review_pipeline.py): VERDICT: approve、blockers: 0semantic_review_applicable: false(checker_gap_count=0, severity_tagged_anchor_findings=[](anchor comment の見出しはP[0-9]+-[0-9]+形式ではないため対象外), cross_contract_change なし)のためスキップissue-contract-review/CONTRACT_REVIEW_RESULT_V1):status: go(readiness go, VC preflight pass, product_spec pass, declared_path_overlap advisory-only disjoint)FOLLOW_UP_MATERIALIZATION_RESULT_V1
squne121 commentedon Aug 27, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Aug 27, 2026
implement-issue: 実装完了 (2026-08-27T15:42:39Z)
.claude/worktrees/issue-2361-credentialless-github-live-markerworktree-issue-2361-credentialless-github-live-markersqune121 commentedon Aug 27, 2026
impl-review-loop: 完了 (2026-08-28T00:00:00Z)
fix: credentialless live positive control の exception-policy を Malfor…
fix: credentialless GitHub read live test を github_live marker に適合させ例…