Skip to content

docs: profile/provider contract capability ADR を追加 (#1821) - #1847

Merged
squne121 merged 12 commits into
mainfrom
worktree-issue-1821-profile-provider-contract-capability-design
Jul 31, 2026
Merged

squne121 merged 12 commits into
mainfrom
worktree-issue-1821-profile-provider-contract-capability-design

Conversation

@squne121

Copy link
Copy Markdown
Owner

Summary

  • profile×provider 契約の設計判断を ADR 0006 として追加します。
  • profile/task intent、capability sets、credential permissions、safety enforcement、auth、operational state、routing policy を独立させます。
  • GitHub grant を endpoint/permission 単位で分離し、github_authoring を proposal/output mode として固定します。

Closes #1821(この Draft PR は Issue #1821 の ADR 成果を届けます)

設計判断

  • #1814 が OPEN の間は、mutation implemented、mutation verified、verified-write、auto-eligible の主張を禁止します。
  • schema v2、validator、fixture、catalog/docs 登録、consumer migration は本 PR の対象外とし、後続 implementation Issue の契約に委譲します。
  • 後続 Issue は migration を atomic cutover / generated projection / dual-read の一択で固定し、manual dual-write を禁止します。

Contract Snapshot(契約スナップショット)

Allowed Paths(許可パス)

  • docs/adr/0006-profile-provider-contract-capability-design.md のみを変更します。
  • current-head allowed paths gate: ok(変更ファイルは 1 件、許可パス違反は 0 件)。

Overlap Preflight(重複プリフライト)

  • route: proceed(競合候補はなく、実装を継続可能と判定)
  • evidence_sha256: sha256:b8ec58cb5bff6ae470bb06d9dd31c6b27d35aa4d86c8013b799d6828df7d5dd8(収集結果の完全性確認用)
  • decision_inputs_sha256: sha256:97ef1b6a4fb671d0c758e3a88a64ecb6593ed76323530953e46b0c0596ebd1a0(判定入力の束縛)

Checks

  • test -f docs/adr/0006-profile-provider-contract-capability-design.md(AC1: 必須の設計節を含む ADR ファイルの存在を確認)
  • test -f docs/adr/0006-profile-provider-contract-capability-design.md(AC2: capability grant 表を含む ADR ファイルの存在を確認)
  • test -f docs/adr/0006-profile-provider-contract-capability-design.md(AC3: github_authoring と 実装: AGY permission/hook boundary の hermetic evidence を整備する #1814 制約を含む ADR の存在を確認)
  • test -f docs/adr/0006-profile-provider-contract-capability-design.md(AC4: 後続 Issue 契約を含む ADR の存在を確認)
  • test -f docs/adr/0006-profile-provider-contract-capability-design.md(AC5: scope 外と後続ルーティングを含む ADR の存在を確認)
  • git diff --check(空白・改行の形式不備がないことを確認)

Schema Change Applicability

  • decision: not_schema_change
  • reason: 本 PR は将来の schema v2 実装契約を記述する ADR のみであり、既存 producer/consumer 境界の machine-readable schema は変更しません。

Schema Consumer Inventory

変更対象 schema: N/A(設計 ADR のみ)

before/after 差分: N/A(既存 schema の変更なし)

Consumer 列挙(rg コマンド例と結果): N/A(新規または既存 schema の producer/consumer 変更なし)

Consumer 更新状況: N/A(後続 implementation Issue が consumer inventory を作成する)

Compatibility Decision(互換性判断)

Safety Claim Matrix

Claim Implemented? Not controlled Evidence Follow-up
ADR は GitHub capability と proposal/output mode を分離する no credential grant、GitHub mutation、verified write は本 PR で制御しない Issue #1821 の AC1-AC5、ADR の #1814 guardrails 節 #1814
#1814 未完了中の write claim を禁止する設計境界 no 実際の権限変更、mutation 実装、実行時検証は本 PR の対象外 Issue #1821 AC3、ADR の capability grants 表 #1814

Notes

@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Preview URL

Preview removed (PR #1847 closed).

@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

Blockers

  • 保護された TEST_VERDICT_MACHINE/v2 producer artifact/receipt がありません。TEST_RUNNER_RESULT_V1 は status: SKIP、reason: missing_protected_producer_artifact であり、current-head・contract body SHA・diff・command・artifact readback の束縛を確認できません。
  • CI_VERDICT_SUMMARY_V1 は current HEAD で fail-closed です。PR Body Japanese Check が失敗し、python-test-core は未完了です。

Evidence

  • contract snapshot: Issue #1821 comment 5118677630 / body SHA sha256:4a3e0a71ce417e8d804398703cc69cb0b8da06ea1b19f58f3bf1d657ffcc4bd9
  • allowed paths review gate: ok(GitHub PR files API、変更 1 件、違反 0 件)
LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "7f21e810bc457ec24e89c80363013313e85c2ca1"
  merge_ready: false
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "UNSTABLE"
  blockers:
    - "protected_test_verdict_machine_v2_unavailable: TEST_RUNNER_RESULT_V1 status=SKIP reason=missing_protected_producer_artifact; current-head/body-sha/diff/command/artifact binding unavailable"
    - "ci_incomplete_or_failed: CI_VERDICT_SUMMARY_V1 current-head reports PR Body Japanese Check=failure and python-test-core=pending"
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
    changed_files_source: github_pull_request_files_api_with_previous_filename
    changed_files:
      - docs/adr/0006-profile-provider-contract-capability-design.md
  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: REQUEST_CHANGES

Blockers

  • 保護された TEST_VERDICT_MACHINE/v2 producer artifact/receipt がありません。current HEAD、PR body SHA、contract body SHA、diff、Verification Commands、artifact readback を束縛する TEST_RUNNER_RESULT_V1 を確認できないため、CI 成功だけで検証 PASS にはできません。

Evidence

  • current HEAD: 3c251bd72e39a11c0f82326577a8d00d4953371b
  • PR body SHA: sha256:2fd534ef8c1338e7538b3a726c1a305716496d0f2b7c9959aeeb416dd474dfa1
  • contract snapshot: Issue #1821 comment 5118677630 / body SHA sha256:4a3e0a71ce417e8d804398703cc69cb0b8da06ea1b19f58f3bf1d657ffcc4bd9
  • CI: run 30463981703 / ci_verdict_summary_v2 artifact 8729030642 / overall_status merge_ready
  • allowed paths review gate: ok(GitHub PR files API、変更 1 件、違反 0 件)
LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "3c251bd72e39a11c0f82326577a8d00d4953371b"
  merge_ready: false
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers:
    - "protected_test_verdict_machine_v2_unavailable: TEST_RUNNER_RESULT_V1 current-head/body-sha/diff/command/artifact binding is unavailable; CI evidence is not a substitute"
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
    changed_files_source: github_pull_request_files_api_with_previous_filename
    changed_files:
      - docs/adr/0006-profile-provider-contract-capability-design.md
  allowed_paths_gate_source: review_subagent

@squne121

Copy link
Copy Markdown
Owner Author

判定

REQUEST_CHANGES

対象は PR #1847 の current HEAD 3c251bd72e39a11c0f82326577a8d00d4953371b です。変更は ADR 0006 の1ファイルのみで、通常CIは全ジョブ成功しています。一方、直近のリポジトリ内レビューは、current HEAD・契約本文・差分・検証コマンドを束縛する保護済み TEST_VERDICT_MACHINE/v2 producer artifact/receipt が存在しないため、引き続き REQUEST_CHANGES としています。

LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "3c251bd72e39a11c0f82326577a8d00d4953371b"
  merge_ready: false
  regular_ci: green
  protected_verification: unresolved
  findings:
    P0: 4
    P1: 3
    P2: 1
  github_review_posted: false

github_authoring を proposal/output mode に限定したこと、manual dual-write を禁止したこと、schema・validator・fixture・consumer migration を現在のスコープ外と明示したことは妥当です。ただし、ADRが後続実装を安全に拘束できる設計粒度には達していません。


P0-1: 元Issueの中心課題である「profile×provider直交モデル」がADRに存在しない

Issue #1821 の目的は、現在の単一4値判定を、availability・parity・safety・auth・operational state 等の直交した次元へ分解し、profile、provider、capabilityを混同しない設計を固定することです。現在のv1は、実際に5 profile × 2 providerのセルを持ち、たとえば github_research/gemini は implemented、github_research/agy は repo policy により unsupported_by_design と記録しています。

しかしADRが定義しているのは、以下の抽象的な4分類です。

  • identity_profile_capability
  • provider_profile_capability
  • audit_profile_capability
  • routing_profile_capability

これらは実際の no_tools、proposal_only、grounded_research、local_asset_research、github_research との対応を持たず、GeminiとAGYのprovider差分も表現していません。さらに、後続schemaの必須フィールドも schema_id、version、capability、credential_scope、routing_state に留まり、availability、parity、provider-specific support、unsupported reason、evidence freshnessを拘束していません。

このままでは後続実装者が、以下をADR外で再設計することになります。

  • profileがcapability setを要求するのか、providerがprofileを実装するのか
  • github_research/agy を引き続きunsupportedにするのか
  • partial parityとimplementedをどう区別するのか
  • safety未検証だが機能実装済みの状態をどう表現するのか
  • providerごとのcredential、auth、runtime evidenceをどこへ束縛するのか

修正条件: ADR内に、少なくとも次の関係をnormativeなmachine-readable decision blockとして固定してください。

profiles:
  github_research:
    requested_capability_set: github.read/v1

capability_sets:
  github.read/v1:
    operations:
      - github.metadata.read
      - github.issues.read
      - github.pull_requests.read

provider_support:
  gemini:
    github_research:
      availability: implemented
      capability_set: github.read/v1
  agy:
    github_research:
      availability: unsupported
      unsupported_reason: repo_policy

claims:
  availability: {}
  parity: {}
  safety: {}
  auth: {}
  operational_state: {}
  routing: {}

抽象的な「capabilityの説明」ではなく、actual profile → versioned capability set → provider support → claim evidence の関係が必要です。


P0-2: GitHub Grants表が「API操作」「必要permission」「操作の副作用」「policy判断」を混同している

現在の表には構造上の誤りがあります。

workflows

actions / workflows を1行にまとめ、actions: read、deny、mutation: no としています。しかし、GitHub公式仕様ではworkflow一覧・参照にはActions read、workflow dispatch・enable・disableにはActions writeが必要です。参照と起動は別操作です。([GitHub Docs]1)

merge

merge行は pull-requests: write / contents: write、deny、mutation: no です。RESTのPull Request merge endpointについて、公式に示されているfine-grained permissionはContents writeです。また、sha により期待HEADを拘束でき、不一致時は409になります。別APIを想定してPull requests writeも必要とするなら、そのmethod/pathを明記しなければ過剰権限になります。([GitHub Docs]2)

さらに、policyがdenyであってもmergeという操作自体の副作用はmutatingです。grant-or-deny=deny だから mutation=no とするのは、次の二つを混同しています。

  • inherent_effect: mutating
  • policy_decision: deny

comments と reviews

Issue/PR conversation commentの作成にはIssues writeまたはPull requests writeが必要です。PR reviewの作成・submitにはPull requests writeが必要で、レビューは commit_id に束縛できます。conversation comment、review、inline review commentは同じ権限・同じ対象ではありません。([GitHub Docs]3)

修正条件: 1 operationを1行にし、少なくとも以下のフィールドを持たせてください。

operation_id: github.pull_request.merge/v1
api:
  method: PUT
  path: /repos/{owner}/{repo}/pulls/{pull_number}/merge
required_permissions:
  all_of:
    - contents: write
inherent_effect: mutating
policy_decision: deny
target_kind: pull_request
preconditions:
  expected_head_sha: required
provider_exposure: none

最低限、以下は別operationに分割すべきです。

  • repository metadata read
  • issue read
  • pull request read
  • issue comment write
  • PR conversation comment write
  • PR review write
  • issue metadata write
  • PR metadata write
  • contents write
  • workflow read
  • workflow dispatch
  • workflow enable/disable
  • pull request merge

P0-3: credential owner・authorization actor・execution actorが未定義で、現行のwrapper-side境界を弱め得る

ADRは provider_profile_capability が「最小スコープのcredential binding」を行うとしていますが、そのcredentialを誰が保持し、誰がAPIを実行し、provider/modelへ何が露出するかを定義していません。

現行の github_research は、wrapperがallowlist済み gh コマンドを実行し、Geminiはその結果だけを解釈します。GitHub write、file write、shell executionはprovider側へ渡さず、最終mutationはCodex側に残す設計です。

ADRの記述では、後続実装者が次のいずれを採用しても形式上適合してしまいます。

  • provider subprocessへtokenを渡す
  • providerがcredential brokerを直接呼ぶ
  • wrapperだけがtokenを保持し、providerはproposalしか返さない
  • long-lived tokenを複数resourceへ再利用する
  • approval時とapply時で異なるcredentialを使用する

GitHub App installation tokenはrepositoryとpermissionを絞り込め、通常1時間で失効します。OAuth 2.0 Security BCPもaccess tokenを特定resource・actionに制限し、各requestで対象操作への適合性を検証することを推奨しています。([GitHub Docs]4)

またADRのフローは resolve intent -> authorize -> present candidate -> return deterministic profile decision を1パスで行う一方、別節では Awaiting_approval と Applying を定義しています。approve後に対象PRのHEAD、本文、permission、policy、tokenが変化するTOCTOUを防ぐ再認可手順がありません。

修正条件: actorと段階を明確に分離してください。

  • request_actor
  • analysis_actor
  • authorization_decision_actor
  • approver
  • credential_broker
  • execution_actor
  • audit_actor

approval artifactには少なくとも次を束縛すべきです。

proposal_digest:
operation_id:
target_repository:
target_number:
parameters_digest:
expected_head_sha:
request_actor:
approver:
auth_principal:
permission_digest:
policy_version:
expires_at:
nonce:
single_use: true

apply直前にはlive readback、policy再評価、credential再評価、expected HEAD照合を必須にし、credential_exposed_to_provider: false を既定値にする必要があります。


P0-4: Failed ならmutation成果をrollbackできる、という状態機械が成立しない

ADRは、Failed 状態ではmutation成果をrollbackすると断定しています。

GitHub上のmutationは一般的なトランザクションではありません。たとえばマージ済みPRのrevertは元のmutationを取り消すのではなく、revert commitを含む新しいPRを作成する操作であり、競合時には個別commitのrevertが必要になる場合があります。([GitHub Docs]5)

同様に、以下は自動rollbackできないか、rollback自体が新しい副作用になります。

  • Issue/PR comment投稿
  • PR reviewのsubmit
  • workflow dispatch
  • labelやassigneeの変更
  • contents commit
  • merge
  • timeout後に成功/失敗が不明なAPI request

この状態機械では、API側では成功したがclientがtimeoutした場合、Failed として再試行し、comment、review、workflow run等を重複生成できます。

修正条件: Failed とside-effect状態を分離してください。

execution_state:
  - planned
  - awaiting_approval
  - applying
  - completed
  - failed
  - unknown
  - partially_applied
  - compensating
  - reconciled

effect_status:
  - none
  - observed
  - possibly_applied
  - confirmed_applied

compensation:
  supported: false
  operation_id: null
  status: not_applicable

idempotency:
  key:
  reconciliation_required:

Failed は「副作用なし」を意味してはならず、receipt readbackとreconciliationが完了するまで unknown または possibly_applied を保持すべきです。


P1-1: #1814のOPEN/CLOSED状態をwrite claimの安全条件にしているが、Issue状態は実装証拠ではない

ADRは、#1814がOPENの間だけmutation implemented、verified-write、auto-eligible等の主張を禁止しています。逆に読むと、#1814がcloseされれば主張可能になります。

しかし#1814の実体は、AGYのpermission/hook deny、実バイナリnegative E2E、sentinel side-effect不在、version gateを実装するIssueです。GitHub capability schema v2、GitHub write operation、approval artifact、consumer migrationを実装するIssueではありません。

現時点のmatrixでも github_research/agy は unsupported_by_design であり、#1814がcloseしても自動的にGitHubアクセスが実装されるわけではありません。

さらにPR本文は migration_or_followup: #1814 としていますが、ADR本文は「当該follow-up issue」とだけ記載し、schema v2実装Issueの番号を固定していません。exact identifier profile_provider_contract_matrix/v2 で検索した範囲では、別のimplementation Issueは確認できず、#1821自身しか該当していません。

修正条件:

  • issue_state == closed を安全条件にしない
  • 各claimを具体的なevidence predicateへ束縛する
  • schema v2実装用の別Issueを実際にmaterializeする
  • そのIssue番号をADRとPR本文に記録する
  • #1821をcloseする前にfollow-upの存在とcontract fingerprintをreadbackする

証拠には、最低でも次が必要です。

claim_path:
evidence_kind:
evidence_ref:
observed_at:
repo_sha:
provider_version:
auth_mode:
permission_policy_digest:
result:
expires_at:
reverify_when:

P1-2: 後続schema/validator契約がv1より弱く、矛盾状態を許す

現行v1 validatorは次をfail-closedで検査しています。

  • exact profile/provider集合

  • closed key set

  • missing/unknown key

  • 4値enum

  • non-empty evidence

  • duplicate YAML key

  • absolute path

  • .. traversal

  • repo外symlink

  • evidence fileの実在性

これに対してADRは、genericな5フィールドとpositive/negative fixture最低2件ずつしか要求していません。この条件では、以下の矛盾を取りこぼします。

  • availability: implemented かつ unsupported_reason != null
  • write capabilityかつguaranteed_read_only
  • write capabilityかつauto_eligible: true
  • parity: full だがreference provider/capabilityがない
  • auth availableだがauth method、required permissions、実行証跡がない
  • enforcement verifiedだがruntime evidenceがない
  • provider unsupportedだがroutingがauto-eligible
  • expired evidenceでverified claimを維持
  • unknown field
  • duplicate YAML key

Owner anchorでも、直交フィールド、claim単位のprovenance、具体的negative fixture、実follow-up Issue番号の記録が必要とされています。

JSON Schema Draft 2020-12にはconditional subschemaやunevaluatedProperties等を利用する仕組みがあります。ただし、YAML parserがduplicate keyを破棄した後ではJSON Schemaから検出できないため、現在のstrict loader相当も維持する必要があります。(JSON Schema)

また、現在のschema catalog entryはdefinition pathだけでなく、producer、consumers、detection patterns、required test commands、compatibility、migration、last verifiedまで保持します。ADRの「catalogへ登録する」だけでは、後続Issueが最小登録で済ませる余地があります。

修正条件: 「最低2件」ではなく、拒否すべきinvariantをADRで列挙し、JSON Schema、semantic validator、strict YAML loader、fixturesの責務を分けてください。


P1-3: AC1〜AC5の検証がすべてファイル存在確認で、内容を一切検証していない

Issue #1821のVerification Commandsは、AC1からAC5まで全て同一の次のコマンドです。

test -f docs/adr/0006-profile-provider-contract-capability-design.md

契約スナップショットでもAC2〜AC5はAC1のdedup_replayとなっています。そのため、空に近いADR、矛盾したADR、必要節のないADRでもファイルさえ存在すれば全ACがPASSします。

通常CIはcurrent HEADで成功していますが、そのCI成功はADRのsemantic correctnessを証明しません。また、直近レビューが要求するprotected producer receiptも未解決です。

修正条件: Issue contractを更新してfresh snapshotを再生成し、少なくとも次を検証してください。

  • frontmatterのschemaとstatus
  • 必須節の存在
  • normative machine-readable decision blockがちょうど1件
  • actual profile 5件とprovider 2件の参照
  • versioned capability set
  • GitHub operation IDのexact set
  • operationごとのeffect/permission/policyの分離
  • #1814がissue-state gateではなくevidence gateであること
  • concrete follow-up issue number
  • manual dual-write禁止
  • ADR templateの必須節
  • git diff --check
  • protected producerによるcurrent-head binding

P2: ADRとしての意思決定記録が未完成

リポジトリのADR templateは、単一案の場合でも Considered Options を記録し、Referencesに関連Issue・PR・外部一次情報・検証ログを含めることを要求しています。

ADR 0006にはConsidered Optionsがなく、ReferencesもIssue #1821、Issue #1814、ADR 0005だけです。Required Design Referencesで指定された agent-skill-boundaries.md、schema-governance.md、owner anchor、GitHub公式permission仕様、OAuth security model等が参照されていません。

また、タイトルは「承認設計」ですがfrontmatterは status: proposed、decision dateとeffective dateは未設定です。設計判断をIssue成果としてcloseするなら、acceptedへ遷移させる条件とdecision dateを固定すべきです。

ADR 0005は、候補案、reject理由、selected option、machine-readable decision、具体的なfollow-up Issue番号、close前materialization条件まで記録しています。同程度の決定密度が必要です。

検討案として最低限、以下を比較してください。

  1. 現行flat 4-value matrixの拡張
  2. profileごとのprovider-specific contract
  3. versioned capability registry+provider support projection
  4. endpoint permission matrixのみ
  5. generated projectionによるv1互換維持

その上で、採用案とreject理由を固定してください。


マージ前の必須到達条件

  1. actual profile、provider、capability set、直交claimのnormative modelをADRへ追加する。
  2. GitHub Grantsをoperation単位に再構成し、permission、inherent effect、policy decision、preconditionを分離する。
  3. credentialをproviderへ渡さないwrapper-side trust boundaryと、approval/apply時のactor分離を明記する。
  4. Failed = rollback済み を廃止し、unknown/partial effect/compensation/reconciliationを状態機械へ追加する。
  5. #1814のissue状態によるguardを、claim単位の検証証拠へ置換する。
  6. schema v2実装用follow-up Issueを実際に起票し、その番号をADRとPR本文に固定する。
  7. v1以上のclosed-world validation、cross-field invariant、claim-level provenanceを後続契約へ必須化する。
  8. Issue #1821のVerification Commandsをsemantic検証へ更新し、fresh contract snapshotを生成する。
  9. current HEADに束縛されたprotected TEST_VERDICT_MACHINE/v2 producer artifact/receiptをmaterializeする。
  10. Considered Options、一次情報References、ADR status/decision dateを補完する。

現状は「ACの字面には概ね適合するが、ADRの目的である後続実装の安全な拘束には失敗している」状態です。通常CIがgreenでも、この設計のままマージすべきではありません。

@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

Blocker

  • TEST_VERDICT_MACHINE/v2 の保護 producer receipt が current HEAD にはありません。PR コメント 5120132401 は旧 HEAD の証跡であり不採用です。TEST_RUNNER_RESULT_V1 は SKIP/UNAVAILABLE のため、current-head・PR body SHA・contract body SHA・diff・Verification Commands・artifact readback を束縛する PASS 証跡がありません。

Evidence

  • current HEAD: 35bdffeda579d362b72e308e39009fc51cd37030
  • PR body SHA: sha256:2fd534ef8c1338e7538b3a726c1a305716496d0f2b7c9959aeeb416dd474dfa1
  • contract snapshot: Issue #1821 comment 5118677630 / body SHA sha256:4a3e0a71ce417e8d804398703cc69cb0b8da06ea1b19f58f3bf1d657ffcc4bd9
  • CI: run 30467230547 / required checks PASS
  • allowed paths review gate: ok(GitHub PR files API、変更 1 件、違反 0 件)
LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "35bdffeda579d362b72e308e39009fc51cd37030"
  merge_ready: false
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers:
    - "protected_test_verdict_machine_v2_unavailable: TEST_RUNNER_RESULT_V1=SKIP/UNAVAILABLE; current-head/body-sha/contract/diff/command/artifact-readback binding absent; CI is not a substitute"
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
    changed_files_source: github_pull_request_files_api_with_previous_filename
    changed_files:
      - docs/adr/0006-profile-provider-contract-capability-design.md
  allowed_paths_gate_source: review_subagent

@squne121

Copy link
Copy Markdown
Owner Author

結論

#1849 の quarantine は TEST_VERDICT_MACHINE/v2 の必須化を完全には解除できていません。
一方、controlled review publisher の clean-status 検査は #1849 でも意図的に維持されています。したがって、2つの blocker は別々に扱うべきです。

現在の PR #1847 は、貼付結果の 35bdff… ではなく 0608ea00d8534fe36ab9750faca4dee9277a3f75 が current head です。main の #1849 を取り込んだ merge commitで、変更ファイルは ADR 1件だけ、mergeable、ただし Draft のままです。

current head に対する5つの workflow run はすべて success しています。したがって、貼付された 35bdff… 向け human_review_required は破棄し、0608ea… から再判定する必要があります。

推奨アクション

1. TEST_VERDICT blockerを「#1849 quarantine漏れ」として別Issue・別PRで修正する

#1849 は「artifact prerequisite chainを通常の実装、テスト、レビュー、公開条件から除外した」と宣言しています。しかし現行の Step 2 は、依然として protected producer receipt、materializer、dedicated publisher を current-head PASS の必須経路として定義し、--require-producer-receipt を要求しています。これは #1849 の意図と実装の不整合です。

#1847 は Allowed Paths が ADR 1ファイルに限定されているため、ハーネス修正を混入させてはいけません。以下を別のP0 follow-upで変更するのが妥当です。

  • .claude/skills/impl-review-loop/steps/step-2-verification.md
  • .claude/skills/impl-review-loop/SKILL.md
  • .claude/skills/impl-review-loop/scripts/adjudicate_vc_result.py
  • .claude/skills/pr-review-judge/SKILL.md
  • 関連する routing・adjudicator の回帰テスト

必要な新しい挙動は次です。

missing TEST_VERDICT_MACHINE/v2 receipt:
  severity: warning
  routing: continue
  human_review_required: false

canonical_verification:
  - current-head に対する Verification Commands の実行結果
  - current-head scoped CI
  - live PR head readback
  - Allowed Paths gate
  - PR review

TEST_VERDICT_MACHINE/v2:
  role: optional_advisory_evidence
  missing_or_unavailable: non_blocking

protected_test_verdict_producer_unavailable、protected_evidence_producer_missing、materializer_input_missing を termination reason に変換しない回帰テストも必要です。

現行の pr-review-judge 自体は、証拠優先順位を TEST_VERDICT_MACHINE、次点を head-scoped CI と定義しています。つまり「TEST_VERDICTがない場合は必ず停止」とは書かれておらず、Step 2側の強制要件を解除すれば、CI・実検証を使う経路へ整合させられます。

2. controlled review publisher は、当面「cleanな専用worktree」から実行する

こちらは #1849 の quarantine漏れとは異なります。#1849 は artifact prerequisiteを解除する一方で、clean status、live remote head、ancestry、ff-only、事後readbackは維持すると明記しています。したがって、clean-status failureは現在の設計上は期待された停止です。

publisher の _check_no_tracked_changes() は、publisherが増やした差分だけでなく、実行時点の git status --porcelain 全体を調べ、許可された artifact subtree 外に既存変更が1件でもあれば失敗します。

そのため、即時対応は次の通りです。

  1. scripts/agent-ops/verified_default_branch_ff_merge_exec.py
    と verified_ff_merge_exec.py の作業は、元の作業用worktreeに保持する。
  2. reset、checkout、削除、stashによる他作業の退避は行わない。
  3. PR docs: profile/provider contract capability ADR を追加 (#1821) #1847 の current head または更新後headから、cleanな専用linked worktreeを作る。
  4. verdict本文とartifactをそのworktree内で生成し、pr_review.publishを実行する。
  5. 投稿後に current head と review commit_id をreadbackする。

長期的には、publisherのpostconditionを「リポジトリ全体がclean」から「実行前後で、許可prefix外に新しい差分を導入していない」へ変更できます。ただしこれは #1849 が維持すると宣言した安全制御を変更するため、別の明示的なsafety Issueが必要です。

3. #1847 は receipt問題を除去しても、そのままマージしない

current head は #1849 を取り込んだだけで、ADR本体の実質的な設計内容は従前と同じです。PR timelineには、receiptとは独立した以下の設計上の指摘が残っています。

優先度順に修正すべき項目は次です。

  1. profile × provider の直交モデルを具体化する
    抽象的な capability 4分類ではなく、actual profile、versioned capability set、provider support、claim evidenceの関係を定義する。

  2. GitHub Grants表を分離する
    API operation、endpoint family、GitHub permission、side effect、repository policy decisionを別フィールドとして扱う。

  3. 認可主体を定義する
    credential owner、authorization actor、execution actor、providerへのcredential露出可否を分離し、credential_exposed_to_provider: false を既定にする。

  4. rollback断定を撤回する
    GitHub mutationは一般的なトランザクションではありません。Failed を「副作用なし」とせず、possibly_applied / unknown、readback、reconciliation、compensating actionを定義する。

  5. 実装: AGY permission/hook boundary の hermetic evidence を整備する #1814 のIssue状態を安全証拠にしない
    OPEN/CLOSEDではなく、claimごとの実装・検証証拠に束縛する。

  6. 後続schema v2契約を強化する
    closed-world validation、cross-field invariant、strict loader、claim-level provenance、positive/negative fixturesを明示する。

  7. Verification Commandsを意味検証へ変更する
    現状のAC1〜AC5はすべて同じ test -f で、内容を検査していません。Issue #1821本文も実際にこの構成です。

  8. ADRとして完成させる
    Considered Options、採用・不採用理由、一次資料、具体的follow-up Issue番号、status遷移条件、decision dateを追加する。

実行順序

推奨する順番は以下です。

  1. docs: profile/provider contract capability ADR を追加 (#1821) #1847 の 35bdff… 向け結果を stale として破棄。
  2. TEST_VERDICT必須化の quarantine漏れを別P0 Issue/PRで修正。
  3. その修正をmainへ反映。
  4. #1847を新mainへ同期し、headを再固定。
  5. ADRの実質的なP0/P1/P2指摘を docs: profile/provider contract capability ADR を追加 (#1821) #1847 内で修正。
  6. 意味検証可能なVerification CommandsへIssue #1821を更新。
  7. cleanな専用worktreeで検証・レビュー・review publish。
  8. current-headの APPROVE + merge_ready: true をreadback。
  9. Draft解除後、人間がsquash mergeを判断。

現在は「CI不合格」でも「receiptを作ればマージ可能」でもありません。正確には、quarantineの実装漏れとADR本体の設計不足が同時に存在しています。

@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

Blocker

  • 保護された TEST_VERDICT_MACHINE/v2 producer receipt が current HEAD にありません。コメント 5123463124 は technical proposal であり protected receipt ではありません。TEST_RUNNER_RESULT_V1 は SKIP/UNAVAILABLE のため、current-head・PR body SHA・contract body SHA・diff・Verification Commands・artifact readback を束縛する PASS 証跡がありません。

Contract / technical-proposal assessment

  • AC1–AC5 は static diff と contract snapshot に照らして充足しています。
  • コメントの提案 1(具体的な直交モデル)、3(認可主体)、4(rollback/reconciliation)、5(claim-level evidence)、8(ADR option/source/date)は現行 diff では未充足です。
  • 提案 2 は AC2 の endpoint/permission/grant/deny/rationale 表を満たす一方、side effect と repository policy の追加分離は未充足です。提案 6 は AC4 の Schema/validator/fixtures/catalog/consumer/migration を満たす一方、strict loader 等の追加条件は未充足です。提案 7 は Issue 本文の file-existence VC に対する follow-up です。
  • 上記 8 項目の追加詳細は source contract の必須 AC/Allowed Paths に含まれないため、本 review では scope 外 advisory とし、protected receipt blocker と混同しません。

Evidence

  • current HEAD: 0608ea00d8534fe36ab9750faca4dee9277a3f75
  • PR body SHA: sha256:2fd534ef8c1338e7538b3a726c1a305716496d0f2b7c9959aeeb416dd474dfa1
  • contract snapshot: Issue #1821 comment 5118677630 / body SHA sha256:4a3e0a71ce417e8d804398703cc69cb0b8da06ea1b19f58f3bf1d657ffcc4bd9
  • CI: run 30491067389 PASS / PR Body Japanese Check PASS
  • allowed paths review gate: ok(GitHub PR files API、変更 1 件、違反 0 件)
LOOP_VERDICT_V2:
  verdict: REQUEST_CHANGES
  reviewed_head_sha: "0608ea00d8534fe36ab9750faca4dee9277a3f75"
  merge_ready: false
  mergeability:
    mergeable: "MERGEABLE"
    merge_state_status: "CLEAN"
  blockers:
    - "protected_test_verdict_machine_v2_unavailable: TEST_RUNNER_RESULT_V1=SKIP/UNAVAILABLE; current-head/body-sha/contract/diff/command/artifact-readback binding absent; CI and technical proposal are not substitutes"
  required_auto_actions: []
  auto_fix_applied: []
  follow_up_issue_requests: []
  allowed_paths_gate:
    status: ok
    changed_files_source: github_pull_request_files_api_with_previous_filename
    changed_files:
      - docs/adr/0006-profile-provider-contract-capability-design.md
  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.

LOOP_VERDICT_V2

LOOP_VERDICT_V2:
verdict: APPROVE
reviewed_head_sha: a993c5473530cbb56217979721ed189d8c52a0ff
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 marked this pull request as ready for review July 31, 2026 11:15
@squne121
squne121 merged commit 41fe26e into main Jul 31, 2026
25 checks passed
@squne121
squne121 deleted the worktree-issue-1821-profile-provider-contract-capability-design branch July 31, 2026 11:15
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.

実装: profile×provider contract matrix の直交フィールド設計と GitHub capability tier の ADR 判断

1 participant