Skip to content

feat(agent-commerce): 結合 E2E を通常 CI に統合 + UCP discovery payment_handlers 自動広告 - #6872

Merged
dotani1111 merged 47 commits into
EC-CUBE:4.4from
nanasess:feature/agentic-commerce-e2e
Jul 29, 2026
Merged

feat(agent-commerce): 結合 E2E を通常 CI に統合 + UCP discovery payment_handlers 自動広告#6872
dotani1111 merged 47 commits into
EC-CUBE:4.4from
nanasess:feature/agentic-commerce-e2e

Conversation

@nanasess

@nanasess nanasess commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

概要

エージェントコマース (ACP / UCP) の 本体 ↔ プラグイン (eccube-api4 / sample-payment-plugin) 結合 E2E を通常 CI に統合する PR です。機能本体のスタック各 PR は既に 4.4 へマージ済みで、本 PR の正味差分は 結合 E2E の CI 統合 + UCP discovery の payment_handlers 自動広告 + エージェントシミュレータ です。

Important

** E2E ワークフローは現在 nanasess/(eccube-api4|sample-payment-plugin) の fork(feature/agentic-commerce)を参照しています。マージ完了後、参照 URL/ブランチを org へ差し替える別 PRします。

変更内容

結合 E2E を通常 CI に統合

  • agentic-commerce-e2e.ymlworkflow_call 対応の再利用可能ワークフロー化(workflow_dispatch は手動実行用に維持)。
  • main.ymlagentic-commerce-e2e ジョブを追加し、plugin-test と並列needs: [unit-test, e2e-test])で実行。success gate に含め必須チェック化。push / PR で自動実行される。
  • Job A(integration-smoke): 本体 + api44 + samplepayment44 を共存インストール + discovery 生存確認(PHP 8.2–8.5 × pgsql/mysql)。
  • Job B(checkout-e2e): OAuth2 認証 + create / update / complete を PHP エージェントシミュレータで検証(成功 / 3DS 中断・再開 / 拒否、run_payment=true)。

UCP discovery の payment_handlers 自動広告

  • UcpPaymentHandlerDiscoveryRegistry: 登録済み UCP 決済ハンドラから /.well-known/ucppayment_handlersゼロ設定で自動広告。プラグイン未登録時は空広告で core 単体でも安全。本 PR の結合 E2E がこの機能の受け入れ試験を兼ねる。

エージェントシミュレータ

  • e2e/agent/acp-checkout.php / e2e/agent/ucp-checkout.php: ACP / UCP の PHP 製シミュレータ。

検証

  • CI 全パス(rector / phpstan / php-cs-fixer / unit-test / e2e-test / plugin-test ∥ agentic-commerce-e2e / e2e-test-throttling / dockerbuild)。
  • ローカル PHPUnit(AgentCommerce スイート)294 tests / 1098 assertions / 0 failures(incomplete 13 は意図的)。
  • 結合 E2E(run_payment=true)で ACP / UCP の 成功 / 3DS 中断・再開 / 拒否 の全シナリオ通過。

マージ済みの機能本体 PR

区分 PR 状態
共通基盤 Phase 1a #6802 4.4 merged
Feed / Catalog / Discovery #6815 4.4 merged
CheckoutSession 中核 (Phase 1b) #6825 4.4 merged
ACP Checkout #6843 4.4 merged
UCP Checkout #6837 4.4 merged

依存プラグイン(ドラフト PR・org 移行予定)

Summary by CodeRabbit

  • New Features
    • ACP/UCP と決済ハンドラ連携を、discovery〜checkout〜complete まで結合E2Eで自動検証(E2Eエージェントを追加)。
    • UCP向けに決済ハンドラの discovery 用情報を自動生成して提供。
  • CI / Workflow
    • E2E 結合検証ジョブをパイプラインに追加し、完了後に後続処理が実行されるよう更新。
  • Tests
    • UCP決済ハンドラ収集の形式・必須項目・除外条件を検証するテストを追加。
  • Documentation
    • E2Eエージェントの手順と環境変数をREADMEに追記。

nanasess and others added 30 commits June 25, 2026 15:48
docblock 文言は protocol 中立版 (HEAD) を採用、services_test.yaml は ACP/UCP サービス登録の union (IdempotencyStore 重複除去)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
services.yaml は checkout/UCP サービスと catalog/feed/discovery サービスの union、keystore env は default::string 修飾版 (HEAD) を採用。composer.lock は acp(upstream同期)版に symfony/http-client を追補。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
本体 (ACP/UCP) + eccube-api4 + sample-payment-plugin の結合を検証する骨組み先行 E2E。

- .github/workflows/agentic-commerce-e2e.yml (workflow_dispatch):
  - Job A integration-smoke: 三者共存インストール + discovery 生存確認 (day1 green)
  - Job B checkout-e2e: client_credentials トークン + シミュレータ (api4#188 + 決済ハンドラまで skip ゲート)
- e2e/agent/acp-checkout.php: discovery スモーク (常時) + ACP checkout フロー (token 時)
- 両プラグインは公開フォークを VCS 経由で eccube:composer:require (api42 流儀)
- BaseInfo は result cache されるためフラグ反転後 cache:pool:clear --all が必須

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
公開フォークでも composer は GitHub API でバージョン解決/dist 取得を行い、CI 共有 IP の
レート制限でトークン認証が要求されるため、GITHUB_TOKEN を COMPOSER_AUTH で渡す。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fork のデフォルトブランチが旧名 (ec-cube/api・ec-cube/SamplePayment) のため、composer VCS
ドライバはデフォルトブランチから決まる名前で repo をキーし、新名 (api44/samplepayment44) の
feature ブランチを名前不一致でスキップしていた。対象ブランチを clone して path リポジトリで
参照し、clone 先 composer.json の名前で解決させる。league/oauth2 依存のため sodium 拡張も追加。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ec-cube/plugin-installer は composer.json の extra.id を必須参照する (通常は EC-CUBE store
API が供給)。api44 は extra.id を持たず path/VCS 直接インストールで Undefined array key "id"
となるため、clone した composer.json にダミー id を jq で注入する (fork 本体は改変しない)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
DI/autoload の三者共存は cache:warmup 成功で実証済み。enable 確認に使っていた
eccube:plugin:list は存在しないコマンドのため、dbal:run-sql で dtb_plugin を参照する。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
プラグイン有効化後に /.well-known/ucp が失敗する原因を切り分けるため、HTTP ステータスと
レスポンス本文・php -S サーバログを出力する (サーバ出力をファイルへ記録)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
codeception/router.php は GET に対し false を返すため、php-S の静的フォールバック挙動の
PHP version 差 (ローカル 8.5 は index.php へ通すが CI 8.3 は素の 404) で discovery が 404 に
なっていた。API のみで静的配信が不要なので front controller の index.php を直接 router にする。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
三者共存スモークを横展開。MySQL セットアップを条件付きで追加 (plugin-test.yml 準拠)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
api4#188 (client_credentials + AccessTokenHandler) の landing を受け、Job B のゲートを解放:
- OAuth2 鍵ペア生成 + client_credentials クライアント作成 + /token で実 JWT 取得
- シミュレータが Bearer トークンで create/update/get を実行し認証+セッション構築を検証
- complete (決済実行) は #3 決済ハンドラ待ちのため AGENT_E2E_PAYMENT_READY (run_payment 入力) で sub-gate
- encryption_key の実値設定・index.php router (Job A と同方針)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
インストール時に OAuth2 鍵が生成済みのことがあり generate-keypair が失敗するため、
--overwrite で確実に再生成する。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
league の create-client は先頭が name のため、2 引数だと secret が自動生成され invalid_client に
なっていた。3 引数 (英数字 identifier/secret) で発行し /token の client_id/secret と一致させる。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…er に

エージェント注文の支払方法割当が OrderHelper の sort_no 先頭自動割当に依存しており、
エージェント決済不可能な支払方法 (銀行振込等) が割り当たるとハンドラ未通過のまま確定する
「沈黙のすり抜け」が起き得た。handler_id 駆動の選択 seam をコアに集約して解消する。

- AgentPaymentMethodResolverInterface + DefaultAgentPaymentMethodResolver を追加。
  登録ハンドラが supports() する Payment のみを候補とし、handler_id 指定時はその
  ハンドラが扱う Payment を選択、該当無しは沈黙フォールバックせず null を返す。
  methodClass はコアに焼かず (将来 PSP の別 methodClass・複数プラグインに無改変対応)、
  interface→Default の alias で店舗ごとに app/Customize 差し替え可能。
- Registry::resolveByHandlerId() 追加 (ACP/UCP 横断・同一 handler_id 複数は例外で一意性強制)。
- AgentCheckoutPurchaseFlowAdapter::buildOrder で best-effort 解決 (見積の正常化)。
- ACP/UCP controller の complete で handler_id→Payment 割当、該当無しは payment_handler_not_found。
  これで completion の resolveForOrder が常にエージェントの選んだハンドラへ解決する。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sample-payment の決済ハンドラ実装を受け、Job B の complete を実検証する。

- acp-checkout.php に handler_id (card_tokenized) 駆動の complete を追加。
  (a) 正常系→completed、(b) 3DS 中断 (authentication_required) → authentication_result
  付き再開→completed、(c) 拒否トークン→not completed + messages[]。
  (b)(c) は handler_id が無視され既定 Payment ですり抜けると成立しないため、
  ハンドラ実行と resolver seam の回帰を守る負ケースになる。
- plugin:enable 後に sample CreditCard を全配送業者へ PaymentOption 紐付け
  (PluginManager は option を作らないため、findAllowedPayments に出ず解決が空になる)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
サポート対象 (PHP 8.2/8.3/8.4/8.5) に合わせ Job A の php マトリクスへ 8.5 を追加。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
エージェント注文は確定前に Shipping へ配送業者が割り当たらないため、
shipping.getDelivery() 起点だと候補が空になり handler_id 解決が payment_handler_not_found
で落ちていた (E2E complete 失敗)。通常購入の OrderHelper と同じく
Order::getSaleTypes() → DeliveryRepository::getDeliveries() → findAllowedPayments()
で解決するよう修正。

併せて E2E シミュレータの completeAcp に非 200 時の HTTP ステータス+本体ダンプを追加。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
resolver が payment_handler_not_found を返す原因切り分けのため、タグ付きハンドラ・
dtb_payment/payment_option/delivery の状態をダンプする (run_payment 時のみ)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
決済 complete の原因切り分けを高速反復するための一時変更。
Job A(integration-smoke)は通過済みのためスキップし、needs を外して
Checkout E2E(8.3/pgsql)のみ実行する。診断ステップの if(boolean 比較)も除去。
原因確定・complete 緑化後に Job A スキップと needs を復帰する。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…er 診断を付加

resolver が null を返す原因 (protocol/割当 payment/明細数) を simulator の 400 ダンプで
可視化する一時デバッグ。確定後に除去する。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
complete は別リクエストで注文を DB から再読込するが、エージェント注文は Shipping へ
配送業者が割り当たらず、再読込明細の product_class_id 次第で販売種別からの候補取得が
空になり得る。create の best-effort で割当済みの Payment を優先採用することで、候補再取得に
依存せず handler_id 適合を判定する。

併せて [TEMP] 注文明細の product_class_id 永続化を確認する診断ステップを追加。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI の complete が手数料明細のみの空注文になり確定しなかった原因は、fixtures の
ProductClass id=1 が visible=0 のダミー規格で purchase flow が商品明細を除去していたため。
シミュレータの AGENT_E2E_ITEM_ID を購入可能な id=2 に固定する。

併せて buildOrder→flush→clear→reload で商品明細・販売種別が保持されることを検証する
回帰テストを追加 (永続化自体は健全であることの担保)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Job B 緑化 (complete: 成功/3DS 中断・再開/拒否) を確認したため、診断目的の一時変更を戻す。
- Job A(integration-smoke)スキップを解除し needs: integration-smoke を復帰
- 配線診断・注文明細診断ステップを除去
- complete エラーメッセージの DEBUG 付加を除去

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ACP と対称に UCP checkout (create→get→update→complete) を外部 HTTP で検証する。
UCP は RFC 9421 署名 (CI は requireSignature=false) で OAuth2 非依存。complete は
handler_id=dev.ucp.payment.card 駆動で sample-payment の UCP ハンドラを通し、
成功→completed / escalation→requires_escalation / 拒否→not completed+messages[] を確認する。
Job B に実行ステップを追加 (run_payment ゲート)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
backport 先の各 PR ブランチ (EC-CUBE#6825/EC-CUBE#6843/EC-CUBE#6837) と実装を揃え drift を防ぐ。
getHandlerId() を base AgentCheckoutPaymentHandlerInterface に移動し、
Registry::resolveByHandlerId の ACP/UCP instanceof 判定を base メソッド突合へ置換する
(挙動は同一・登録ハンドラは全て base 実装)。base への getHandlerId() 追加に伴い
テストスタブにも実装を追加する。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
各 PR ブランチ (EC-CUBE#6825/EC-CUBE#6843/EC-CUBE#6837) と揃え、reload テストで Order を import 化し
assertNotNull を assertInstanceOf へ統一する。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
各 PR ブランチ (EC-CUBE#6825 等) と揃え、handler_id 駆動・sort_no 非依存の支払方法解決を
純ロジック (リポジトリモック+in-memory ハンドラ) で網羅する。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
決済ハンドラプラグインが UCP ハンドラ (agent_commerce.payment_handler タグ) を
1 つ登録するだけで、checkout 解決に加え discovery (/.well-known/ucp の
payment_handlers) にも自動で広告されるようにする (ゼロ設定 DX)。

- UcpPaymentHandlerDiscoveryRegistry を新規追加。AgentCheckoutPaymentHandlerRegistry
  ::ucpHandlers() から { handler_id: [{id, version}] } の最小エントリを生成し、
  eccube.agent_commerce.payment_handler_registry タグで EmptyPaymentHandlerRegistry
  に集約させる。
- UCP profile schema 準拠のため payment_handlers の値を「ハンドラオブジェクトの配列」
  に統一 (PaymentHandlerRegistryInterface::collect 等の戻り型を
  array<string, list<array<string, mixed>>> へ訂正)。
- available_instruments/config 等のリッチ descriptor はプラグインが自前の
  PaymentHandlerRegistryInterface を寄与する既存 seam で拡張可能。
- ユニットテスト追加 + E2E discovery スモークに dev.ucp.payment.card の自動広告検証を追加。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
各 PR ブランチ (EC-CUBE#6825 等) と揃え、CodeRabbit 指摘 (EC-CUBE#6843) の一部 (getPaymentMethod の
null 固定) を反映する。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
末尾が助詞「は」で終わりマトリクス値が続いて不自然だったジョブ名を修正し、
内容も現状 (sample-payment 決済ハンドラ実装済み) に合わせて
「complete は run_payment 指定時のみ」へ更新する。古い "#3 待ち" の記述も解消。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nanasess and others added 2 commits June 30, 2026 15:47
checkWebApiRequirements が「Api42 導入済み かつ sodium 拡張なし」で ec-cube/api42 を
自動削除していたため、config.platform.ext-sodium で導入できても直後に削除されてしまう。
api42 の実行時 (OAuth2 署名・検証) は RSA + openssl で sodium 関数を呼ばず、sodium 非対応の
共有レンタルサーバーでも動作するため、この自動削除を廃止する (EC-CUBE#6827)。

エンドポイントはインストーラ画面 (install/complete.twig) からの呼び出し互換のため残すが、
要件不適合による削除は行わない。未使用となった ComposerApiService 依存を除去する。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit d131fbb)
本 E2E は EC-CUBE 既定の FilesystemAdapter で動作し redis を使わないため、
setup-php の extensions 指定 (redis) を撤去する。必要な拡張は setup-php 既定で揃う。
sodium を外して共有レンタルサーバー相当環境を再現する方針 (EC-CUBE#6827) とも整合する。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.25%. Comparing base (1cfea14) to head (f1e32f7).

Additional details and impacted files
@@            Coverage Diff             @@
##              4.4    #6872      +/-   ##
==========================================
+ Coverage   77.11%   77.25%   +0.14%     
==========================================
  Files         547      548       +1     
  Lines       27163    27176      +13     
==========================================
+ Hits        20946    20996      +50     
+ Misses       6217     6180      -37     
Flag Coverage Δ
Unit 77.25% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

nanasess and others added 4 commits July 7, 2026 14:55
…erce-e2e

# Conflicts:
#	app/config/eccube/services.yaml
#	src/Eccube/Service/AgentCommerce/Payment/AgentCheckoutPaymentHandlerRegistry.php
#	src/Eccube/Service/AgentCommerce/Payment/AgentPaymentMethodResolverInterface.php
…erce-e2e

# Conflicts:
#	app/config/eccube/services_test.yaml
agentic-commerce-e2e.yml を workflow_call 対応の再利用可能ワークフローにし、
main.yml から plugin-test と並列 (needs: [unit-test, e2e-test]) で呼び出す。
success gate に追加して必須チェック化。push/PR で自動実行される。

- トリガを pull_request 直書きから workflow_call へ (workflow_dispatch は手動用に維持)
- inputs (api4_ref/sample_ref/run_payment) を両トリガに定義・既定は fork の
  feature/agentic-commerce・run_payment=true。自動実行時もフォールバックで解決
- 依存プラグインの fork 参照は EC-CUBE org 移行後に別 PR で差し替え予定

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nanasess nanasess changed the title [統合プレビュー・マージ不可] エージェントコマース (ACP/UCP) 全部入り + 結合 E2E feat(agent-commerce): 結合 E2E を通常 CI に統合 + UCP discovery payment_handlers 自動広告 Jul 9, 2026
@nanasess
nanasess marked this pull request as ready for review July 9, 2026 07:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
.github/workflows/agentic-commerce-e2e.yml (3)

11-39: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

push/PR 自動実行に備えて concurrency グループの追加を検討してください。

Job A は PHP×DB で 8 並列、加えて Job B が走ります。main.yml から push/PR で毎回呼ばれるため、連続 push 時に古い run が残ってランナー資源を消費します。ブランチ単位の concurrency グループで古い run をキャンセルすると効率的です。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/agentic-commerce-e2e.yml around lines 11 - 39, Add a
workflow-level concurrency group to agentic-commerce-e2e so push/PR-triggered
runs on the same branch cancel older in-flight executions. Update the workflow
around the existing workflow_dispatch and workflow_call setup to use a
branch-based concurrency key with cancel-in-progress enabled, keeping the two
jobs under the same throttling scope to avoid runner waste during repeated
pushes.

80-81: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

checkout に persist-credentials: false を設定して資格情報の残留を避けてください。

この後のステップで fork のプラグイン(api44 / samplepayment44)を clone・enable し、cache:warmup や composer スクリプトを通じてプラグインコードを実行します。actions/checkout が既定で GITHUB_TOKEN.git/config に残すため、実行される第三者コードから資格情報が読めてしまう露出面が生じます。discovery/checkout 検証はリポジトリ資格情報を必要としないので無効化を推奨します。Job B(Line 290-291)も同様です。

🛡️ 提案
       - name: Checkout
         uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10  # v6
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/agentic-commerce-e2e.yml around lines 80 - 81, The
Checkout steps in the workflow should disable credential persistence to prevent
GITHUB_TOKEN from being written into .git/config before running forked plugin
code. Update the actions/checkout usage in both the main job and Job B to set
persist-credentials to false, keeping discovery/checkout validation unchanged
since it does not require repository credentials. Locate the affected steps by
the Checkout action entries in the agentic-commerce-e2e workflow.

Source: Linters/SAST tools


72-77: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

mailcatcher イメージをダイジェスト(または明示タグ)で固定してください。

本ワークフローは他のアクションをすべて SHA でピン留めしていますが、schickling/mailcatcher は暗黙の latest で未固定です。上流イメージが更新されると CI が非再現的になり、サプライチェーン上のリスクにもなります。同じ指摘は Job B(Line 282-287)にも当てはまります。

♻️ 提案
       mailcatcher:
-        image: schickling/mailcatcher
+        image: schickling/mailcatcher@sha256:<digest>
         ports:
           - 1080:1080
           - 1025:1025
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/agentic-commerce-e2e.yml around lines 72 - 77, The
mailcatcher service is using an unpinned image reference, which should be fixed
to a digest or explicit tag. Update the schickling/mailcatcher image in the
mailcatcher service definition to a stable, versioned reference, and apply the
same change to the corresponding mailcatcher service in the other job so both
jobs use the same pinned image.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/agent/acp-checkout.php`:
- Around line 2-23: The ACP agent simulator file is missing the required EC-CUBE
license header at the top. Add the standard EC-CUBE license comment block before
the existing docblock in acp-checkout.php so the file starts with the mandated
header while keeping the current script documentation intact.

In `@e2e/agent/ucp-checkout.php`:
- Around line 2-21: The PHP file header is missing the required EC-CUBE license
notice, so add the standard EC-CUBE license header at the very top of this
script before the existing docblock. Update the file’s opening comment block in
ucp-checkout.php to match the project’s required license header format, keeping
the current UCP agent description below it.

---

Nitpick comments:
In @.github/workflows/agentic-commerce-e2e.yml:
- Around line 11-39: Add a workflow-level concurrency group to
agentic-commerce-e2e so push/PR-triggered runs on the same branch cancel older
in-flight executions. Update the workflow around the existing workflow_dispatch
and workflow_call setup to use a branch-based concurrency key with
cancel-in-progress enabled, keeping the two jobs under the same throttling scope
to avoid runner waste during repeated pushes.
- Around line 80-81: The Checkout steps in the workflow should disable
credential persistence to prevent GITHUB_TOKEN from being written into
.git/config before running forked plugin code. Update the actions/checkout usage
in both the main job and Job B to set persist-credentials to false, keeping
discovery/checkout validation unchanged since it does not require repository
credentials. Locate the affected steps by the Checkout action entries in the
agentic-commerce-e2e workflow.
- Around line 72-77: The mailcatcher service is using an unpinned image
reference, which should be fixed to a digest or explicit tag. Update the
schickling/mailcatcher image in the mailcatcher service definition to a stable,
versioned reference, and apply the same change to the corresponding mailcatcher
service in the other job so both jobs use the same pinned image.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ade71825-2691-4a6b-accc-8d17b7a06d8b

📥 Commits

Reviewing files that changed from the base of the PR and between 9527c32 and d598750.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • .github/workflows/agentic-commerce-e2e.yml
  • .github/workflows/main.yml
  • app/config/eccube/services.yaml
  • app/config/eccube/services_test.yaml
  • e2e/agent/README.md
  • e2e/agent/acp-checkout.php
  • e2e/agent/ucp-checkout.php
  • src/Eccube/Service/AgentCommerce/Discovery/EmptyPaymentHandlerRegistry.php
  • src/Eccube/Service/AgentCommerce/Discovery/PaymentHandlerRegistryInterface.php
  • src/Eccube/Service/AgentCommerce/Discovery/UcpPaymentHandlerDiscoveryRegistry.php
  • src/Eccube/Service/AgentCommerce/Discovery/UcpProfileBuilder.php
  • tests/Eccube/Tests/Service/AgentCommerce/Discovery/UcpPaymentHandlerDiscoveryRegistryTest.php

Comment thread e2e/agent/acp-checkout.php
Comment thread e2e/agent/ucp-checkout.php
- e2e/agent/{acp,ucp}-checkout.php に EC-CUBE 標準ライセンスヘッダーを追加
  (shebang → <?php → ヘッダー → 説明 docblock の順)
- README に ucp-checkout.php の記載を追加 (構成表・2 フェーズ説明・実行例・env)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/agent/README.md`:
- Around line 46-47: Update the ACP checkout command in the README to quote the
AGENT_E2E_TOKEN placeholder so shell parsing succeeds, and add
AGENT_E2E_PAYMENT_READY=true to enable the complete phase. Keep the example
directly copyable while preserving the existing BASE_URL and acp-checkout.php
invocation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 47ac4ece-a6cf-46b8-99de-e3eb519781a0

📥 Commits

Reviewing files that changed from the base of the PR and between d598750 and f95e584.

📒 Files selected for processing (3)
  • e2e/agent/README.md
  • e2e/agent/acp-checkout.php
  • e2e/agent/ucp-checkout.php
🚧 Files skipped from review as they are similar to previous changes (2)
  • e2e/agent/acp-checkout.php
  • e2e/agent/ucp-checkout.php

Comment thread e2e/agent/README.md
nanasess and others added 5 commits July 23, 2026 15:29
Entity の if(!class_exists()) ガード全廃 (EC-CUBE#6895) 後、プラグイン/Customize が
コア Entity を trait 拡張して Proxy (app/proxy/entity) が生成されている環境で、
prod 起動時に "Cannot redeclare class Eccube\Entity\Customer" で全リクエストが
500 になっていた。

原因は Doctrine の mapping driver が二重に登録されていること:

- Kernel::addEntityExtensionPass が src/Eccube/Entity を TraitProxyAttributeDriver
  で登録 (Proxy 済みクラスは再 require しない)
- doctrine.orm.auto_mapping が EccubeBundle を検出し、同じ src/Eccube/Entity を
  素の AttributeDriver でも登録する。こちらは ColocatedMappingDriver::getAllClassNames()
  で Entity ソースを無条件に require_once するため、Kernel::loadEntityProxies が
  先に Proxy を読み込んだ状態で二重宣言になる (旧: 各 Entity の class_exists ガードが吸収)

auto_mapping 全体を切るのではなく EccubeBundle の自動マッピングのみ無効化する
(他バンドルの auto_mapping は維持)。

検証 (ローカル・SQLite・APP_ENV=prod):
- 修正前: samplepayment44 を enable し Proxy が生成された状態で cache:clear /
  ビルトインサーバへのリクエストが redeclare fatal (CI の失敗と同一スタック)
- 修正後: cache:clear / warmup 成功、doctrine:mapping:info は修正前と同じ 82 entities
  (league/oauth2-server-bundle の 5 entity も維持)、e2e/agent の ACP discovery (7 assertions)
  と UCP checkout session (10 assertions) が PASS

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…E#6950 準拠)

PR EC-CUBE#6950 で全 workflow の actions/checkout に persist-credentials: false を
付与するハードニング (artipacked 対策) が入ったが、本 workflow は当時 4.4 に
存在しなかったため対象外だった。Job A / Job B の checkout 2 箇所に付与する。

本 workflow の checkout はコード取得のみで、以降に git の永続クレデンシャルを
使う経路はない (プラグインの clone は公開リポジトリ・composer は COMPOSER_AUTH)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/config/eccube/packages/doctrine.yaml`:
- Around line 33-36: Update the EccubeBundle auto-mapping explanation comment
near the Doctrine configuration to describe only the current cause: automatic
mapping must be disabled to avoid duplicate Entity registration. Remove the
inaccurate claims about TraitProxyAttributeDriver unconditionally requiring
Entity sources and the class_exists guard being removed; do not change
configuration or implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0159dee8-7a48-41d4-aac9-c1af1b1ea537

📥 Commits

Reviewing files that changed from the base of the PR and between 18266fe and 65c08fe.

📒 Files selected for processing (2)
  • .github/workflows/agentic-commerce-e2e.yml
  • app/config/eccube/packages/doctrine.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/agentic-commerce-e2e.yml

Comment thread app/config/eccube/packages/doctrine.yaml
nanasess and others added 2 commits July 25, 2026 17:08
EC-CUBE#6915 で `Plugin\` の PSR-4 自動登録が services.yaml から services.php へ移った
ことにより、services.yaml の `_instanceof` (ファイルスコープ) が決済プラグインの
具象ハンドラに届かなくなり、`agent_commerce.payment_handler` タグが付かなくなって
いた。

結果として `AgentCheckoutPaymentHandlerRegistry` が空になり、UCP discovery の
`payment_handlers` が `{}` を返して結合 E2E の Integration smoke が全マトリクスで
失敗していた (`checkout-e2e` は `needs` で skip)。

`PaymentMethodInterface` と同様に、コンテナ全体へ効く `Kernel::build()` の
`registerForAutoconfiguration()` でタグ付けする。

検証:
- 修正前後で `bin/console debug:container --tag=agent_commerce.payment_handler`
  が 0 件 → SamplePayment44 の ACP/UCP ハンドラ 2 件になることを確認
- ローカルの `/.well-known/ucp` が
  `payment_handlers: {"dev.ucp.payment.card":[{id, version}]}` を返すことを確認
- `AgentCheckoutPaymentHandlerInterface` の具象実装は src/・app/Customize に存在
  しないため、コアのサービス配線への影響はない

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…erce-e2e

# Conflicts:
#	.github/workflows/main.yml
@dotani1111
dotani1111 merged commit 0e69d5a into EC-CUBE:4.4 Jul 29, 2026
124 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants