docs: コード近接の人間向け仕様ドキュメント(README.html/README.md)を導入 (#6906)#6909
docs: コード近接の人間向け仕様ドキュメント(README.html/README.md)を導入 (#6906)#6909ttokoro20240902 wants to merge 13 commits into
Conversation
src/Eccube/ の各レイヤ根・高複雑サブシステムと一部 app/ の計27ディレクトリへ、 コードと同じ場所に README.html(人間向けの真の仕様書)と README.md(短い索引・AI 道標)を 配置する。README.html は data-section/data-customer で章立てし、顧客提出向けのフィルタ・ 静的サイト/PDF 派生(§8.2・後続 PR)の前提を整える。 - パイロット Service/PurchaseFlow を金型に全対象へ横展開(doc4 と重複するドメイン仕様はリンク参照) - AGENTS.md に 3 層の役割分担(README.html=人間向け仕様 / README.md=索引 / SKILL.md=AI 規約)と 参照トポロジ・テンプレート・§8.2 の後続扱いを追記し、索引表に 2 行追加 - app/Plugin/ は gitignore 対象のため README のみ追跡例外を追加 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough本PRは、EC-CUBEの機能ディレクトリごとにREADME.html仕様書とREADME.md短索引を追加するドキュメント整備です。AGENTS.mdとトップREADMEの導線、appおよびsrc/Eccube配下の各領域の説明、Plugin用READMEの除外設定を追加しています。 Changesコード近接ドキュメント整備
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.4 #6909 +/- ##
==========================================
+ Coverage 75.18% 75.66% +0.48%
==========================================
Files 520 541 +21
Lines 25629 26751 +1122
==========================================
+ Hits 19269 20241 +972
- Misses 6360 6510 +150
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 11
🤖 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/Plugin/README.html`:
- Around line 41-57: The section marked data-customer="true" in README.html
mixes customer-facing lifecycle text with internal developer notes about Git
management, sample plugins, and direct-development safety. Move those internal
paragraphs out of the customer section into a separate data-customer="false"
section, and keep only the customer-safe lifecycle description inside the
existing lifecycle block. Use the surrounding section structure and the
lifecycle/PluginManager references to relocate the content cleanly without
changing the customer-facing wording.
In `@src/Eccube/DependencyInjection/README.html`:
- Around line 50-67: The Compiler パス一覧 section is developer-only, but it is
currently marked as customer-facing. Update the section’s data-customer
attribute in the README HTML to false so the extractor classifies it correctly,
and keep the rest of the CompilerPass documentation unchanged.
In `@src/Eccube/Doctrine/README.html`:
- Around line 50-94: The Query and DBAL/ORM documentation sections are
developer-facing, but they are still marked as customer-facing. Update the
section metadata in the README markup so the Query section and the DBAL-related
section use data-customer="false" instead of true, keeping the
developer-oriented descriptions under the existing section blocks like query,
dbal-orm, QueryCustomizer, Queries, and SQLFilter.
In `@src/Eccube/Entity/README.html`:
- Around line 33-79: The section flags in the README are wrong for the
implementation-focused content: overview, entities, and data describe ORM
attributes, ArrayCollection, bcmath, and SaveEventSubscriber, so they must be
marked developer-only. Update the existing section markup to keep
customer-facing content on the appropriate sections and change the data-customer
attribute on these implementation sections from true to false, using the section
identifiers overview, entities, and data to locate them.
In `@src/Eccube/EventListener/README.html`:
- Around line 32-94: The README sections under EventListener are developer-only
implementation docs, so update the section markers for overview, kinds, and flow
to use data-customer="false" instead of true. Keep the content unchanged and
make the adjustment in the section tags that define these blocks so the
customer/developer classification matches the guidance.
In `@src/Eccube/Form/Type/README.html`:
- Around line 32-84: The `data-customer` flags in `README.html` are
misclassified: `overview`, `structure`, and `reuse` are developer-oriented
documentation, so update those sections from `data-customer="true"` to
`data-customer="false"`. Keep the customer-facing content only in sections
intended for end users, and preserve the existing `extension` section as
developer-only; use the section identifiers `overview`, `structure`, and `reuse`
to locate the affected blocks.
In `@src/Eccube/Plugin/README.html`:
- Around line 32-68: The README sections under overview and lifecycle are
developer-facing documentation for AbstractPluginManager, PluginService, and
migration(), so update those section markers to use data-customer="false"
instead of data-customer="true". Keep the existing content and structure intact,
and only adjust the data-customer attributes on the relevant section elements in
README.html.
In `@src/Eccube/Security/README.html`:
- Around line 79-81: `getUser()` が必ず非 null である前提を `^/mypage/`
全体に広げないように修正してください。`/mypage/login` と `/mypage/withdraw_complete`
のように匿名アクセスを許す例外があるため、`README.html` の説明は `ROLE_USER`
必須のアクションに限定して述べるか、例外となるパスを明記して誤解が起きないようにしてください。`getUser()` の保証範囲と `^/mypage/`
配下の認可条件の関係が分かる形にしてください。
In `@src/Eccube/Service/AgentCommerce/Catalog/README.html`:
- Around line 42-63: The dto/mapping content is currently exposed as
customer-facing even though it contains internal implementation details like
CatalogMapper, CatalogProvider, and EntityManager handling. Move the
developer-only mapping/specification content into a separate section marked
data-customer="false", or switch the existing dto/mapping sections to
developer-only and keep a shorter customer-facing summary elsewhere. Preserve
the existing data-section structure in README.html and keep the symbols
CatalogMapper, CatalogProvider, and ProductReferenceResolver grouped where they
are easiest to find.
In `@src/Eccube/Service/AgentCommerce/Security/README.html`:
- Around line 39-57: The auth and signing sections currently expose internal
implementation details that should not be customer-facing. Update the
README.html structure so `data-section="auth"` and `data-section="signing"` keep
only high-level, public-facing summaries under `data-customer="true"`, and move
the detailed implementation notes (such as `AccessTokenHandlerInterface`,
`UserBadge` attributes, JWK storage, key paths, and algorithm specifics) into
separate developer-only content marked `data-customer="false"`. Keep the
document self-contained and preserve the `data-section` organization while
reducing exposed internals.
In `@src/Eccube/Service/README.html`:
- Around line 43-46: Remove the stray closing paragraph tag from the note block
in README.html so the markup is valid self-contained HTML. Update the `<div
class="note">` section in the Service README content to keep the existing text
and PurchaseFlow link, but ensure the fragment closes only with the proper div
closure and no extra `</p>`.
🪄 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: fc2d36a7-f1a0-411c-addc-124ca256baee
📒 Files selected for processing (56)
.gitignoreAGENTS.mdapp/Customize/README.htmlapp/Customize/README.mdapp/DoctrineMigrations/README.htmlapp/DoctrineMigrations/README.mdapp/Plugin/README.htmlapp/Plugin/README.mdsrc/Eccube/Attribute/README.htmlsrc/Eccube/Attribute/README.mdsrc/Eccube/Command/README.htmlsrc/Eccube/Command/README.mdsrc/Eccube/Controller/Admin/Order/README.htmlsrc/Eccube/Controller/Admin/Order/README.mdsrc/Eccube/Controller/README.htmlsrc/Eccube/Controller/README.mdsrc/Eccube/DependencyInjection/README.htmlsrc/Eccube/DependencyInjection/README.mdsrc/Eccube/Doctrine/README.htmlsrc/Eccube/Doctrine/README.mdsrc/Eccube/Entity/README.htmlsrc/Eccube/Entity/README.mdsrc/Eccube/EventListener/README.htmlsrc/Eccube/EventListener/README.mdsrc/Eccube/Form/Type/README.htmlsrc/Eccube/Form/Type/README.mdsrc/Eccube/Plugin/README.htmlsrc/Eccube/Plugin/README.mdsrc/Eccube/Repository/README.htmlsrc/Eccube/Repository/README.mdsrc/Eccube/Security/README.htmlsrc/Eccube/Security/README.mdsrc/Eccube/Service/AgentCommerce/Catalog/README.htmlsrc/Eccube/Service/AgentCommerce/Catalog/README.mdsrc/Eccube/Service/AgentCommerce/CheckoutSession/README.htmlsrc/Eccube/Service/AgentCommerce/CheckoutSession/README.mdsrc/Eccube/Service/AgentCommerce/Discovery/README.htmlsrc/Eccube/Service/AgentCommerce/Discovery/README.mdsrc/Eccube/Service/AgentCommerce/Exception/README.htmlsrc/Eccube/Service/AgentCommerce/Exception/README.mdsrc/Eccube/Service/AgentCommerce/Fulfillment/README.htmlsrc/Eccube/Service/AgentCommerce/Fulfillment/README.mdsrc/Eccube/Service/AgentCommerce/Idempotency/README.htmlsrc/Eccube/Service/AgentCommerce/Idempotency/README.mdsrc/Eccube/Service/AgentCommerce/Payment/README.htmlsrc/Eccube/Service/AgentCommerce/Payment/README.mdsrc/Eccube/Service/AgentCommerce/README.htmlsrc/Eccube/Service/AgentCommerce/README.mdsrc/Eccube/Service/AgentCommerce/Security/README.htmlsrc/Eccube/Service/AgentCommerce/Security/README.mdsrc/Eccube/Service/PurchaseFlow/README.htmlsrc/Eccube/Service/PurchaseFlow/README.mdsrc/Eccube/Service/README.htmlsrc/Eccube/Service/README.mdsrc/Eccube/Twig/Extension/README.htmlsrc/Eccube/Twig/Extension/README.md
各機能ディレクトリに配置した 27 個の README.html への TOP ページをリポジトリルートへ置く。 自己完結 HTML でビルド不要、ブラウザで開いて目次から各ディレクトリの仕様へ辿れる。 README.md からポータルへのリンクと、AGENTS.md に入口の記述を追加。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- 全行同じ「README.html」だった仕様列を廃し、ディレクトリ名自体をリンクに - overview の「人間向けの真の仕様書」→「人間向けの仕様書」 - 併せてルート README のリンク切れ(bundle.js パス)も修正 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dtb_product_class.stock(表示用)と dtb_product_stock.stock(実体)の二重管理、 在庫引当時に両方を同時更新する点(StockReduceProcessor)を Entity 仕様へ明記。 ツールでは読み取れず事故りやすいドメイン知識を README.html 側で補足する。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
エージェントに担当ディレクトリの実コードを読ませ、ツールでは読み取れず間違えやすい事実を
各 README.html へ追記。全項目を file:line で裏取り済み。主な追記:
- Entity: 受注金額は OrderItem 明細(送料/手数料/値引き/税/ポイント)の合算
- Controller: flash 既定namespaceは front / isTokenValid は ECCUBE-CSRF-TOKEN ヘッダも受理
- Admin/Order: shipping_edit の {id} は Order ID / bulkDelete は物理削除 / DELIVERED は全出荷揃いで反映
- Repository: save()/delete() は flush しない / QueryCustomizer フックで検索拡張
- Service: CartService は SaleType ごとに複数 Cart / ログイン時マージ分割で購入停止
- Form: #[FormAppend] 属性で項目追加 / HTMLPurifier はフロントのみ
- Twig: サンドボックス違反は本番で握り潰し / safe_textmail は全角<>
- EventListener: PasswordNormalization の購読優先度 / ForwardOnly
- Plugin: enable/disable とサービスロードの非対称 / migration テーブルは小文字
- app/DoctrineMigrations: 管理テーブルは doctrine_migration_versions(旧称を訂正)
- AgentCommerce 各サブドメイン: 冪等キー・鍵ローテ・決済ハンドラ解決等の非自明な決定
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@src/Eccube/Controller/Admin/Order/README.html`:
- Line 83:
README.html内のbulkDelete()説明にあるコード表示で、HTMLHint違反となるPHP矢印の「>」を「->」へエスケープしてください。表示内容を維持するため、該当する「$em->remove($Order)」を「$em->remove($Order)」に変更します。
In `@src/Eccube/Controller/README.html`:
- Line 85:
README.htmlのCSRF説明内にあるコード表記「$this->isTokenValid()」の矢印をHTMLエンティティ「->」へ置き換え、HTMLHintのspec-char-escape違反を解消してください。
In `@src/Eccube/Service/AgentCommerce/Exception/README.html`:
- Line 56:
README.html内のAgentCheckoutExceptionの説明で、HTMLHint違反となる未エスケープの「errorCode->value」を「errorCode->value」に置き換えてください。
🪄 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: ac02aa59-8a58-475b-b0ce-e42931cf6706
📒 Files selected for processing (22)
app/Customize/README.htmlapp/DoctrineMigrations/README.htmlapp/Plugin/README.htmlsrc/Eccube/Command/README.htmlsrc/Eccube/Controller/Admin/Order/README.htmlsrc/Eccube/Controller/README.htmlsrc/Eccube/Entity/README.htmlsrc/Eccube/EventListener/README.htmlsrc/Eccube/Form/Type/README.htmlsrc/Eccube/Plugin/README.htmlsrc/Eccube/Repository/README.htmlsrc/Eccube/Service/AgentCommerce/Catalog/README.htmlsrc/Eccube/Service/AgentCommerce/CheckoutSession/README.htmlsrc/Eccube/Service/AgentCommerce/Discovery/README.htmlsrc/Eccube/Service/AgentCommerce/Exception/README.htmlsrc/Eccube/Service/AgentCommerce/Fulfillment/README.htmlsrc/Eccube/Service/AgentCommerce/Idempotency/README.htmlsrc/Eccube/Service/AgentCommerce/Payment/README.htmlsrc/Eccube/Service/AgentCommerce/README.htmlsrc/Eccube/Service/AgentCommerce/Security/README.htmlsrc/Eccube/Service/README.htmlsrc/Eccube/Twig/Extension/README.html
✅ Files skipped from review due to trivial changes (18)
- src/Eccube/Command/README.html
- src/Eccube/Service/AgentCommerce/Security/README.html
- src/Eccube/Service/AgentCommerce/Fulfillment/README.html
- src/Eccube/Service/AgentCommerce/Catalog/README.html
- app/Customize/README.html
- src/Eccube/Plugin/README.html
- src/Eccube/Service/AgentCommerce/Discovery/README.html
- src/Eccube/EventListener/README.html
- src/Eccube/Service/AgentCommerce/Idempotency/README.html
- src/Eccube/Service/AgentCommerce/Payment/README.html
- src/Eccube/Service/AgentCommerce/CheckoutSession/README.html
- app/Plugin/README.html
- src/Eccube/Service/README.html
- src/Eccube/Form/Type/README.html
- src/Eccube/Service/AgentCommerce/README.html
- src/Eccube/Repository/README.html
- src/Eccube/Entity/README.html
- src/Eccube/Twig/Extension/README.html
🚧 Files skipped from review as they are similar to previous changes (1)
- app/DoctrineMigrations/README.html
Form 配下は Type だけでなく Extension/Validator/EventListener/DataTransformer を持つが、 README が Form/Type/ に 1 段深く置かれ他サブを取りこぼしていた。他レイヤと同じくレイヤ根 src/Eccube/Form/ に README を集約し、5 サブディレクトリを俯瞰+各役割を実コードで裏取りして記述。 (Validator=Email/PasswordBlocklist/TwigLint、EventListener=PRE_SUBMIT 前処理、 DataTransformer=EntityToIdTransformer。カーネルの EventListener レイヤとの別物注記も追加) 旧 Form/Type/README.* は削除し、ルートポータルのリンクを Form/ へ更新。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
コアの複雑さの主因(拡張性のための indirection)を可視化するため、機構ごとに 拡張 seam / ドメイン / portability / 基盤 / 負債 のタグ(凡例つき)を追加。 - Doctrine: マップ表に「なぜ」列(Query/・Mapping Driver/ が純粋な拡張 seam) - Form: 構成表に「なぜ」列(拡張 seam は Extension/ の 1 つだけ) - Plugin(コア): ディレクトリ全体が拡張 seam である旨を明示 - Entity: データの持ち方を分類(在庫二重管理=負債の簡素化候補/拡張ポイント=seam) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
seam はレガシーコード用語で分かりにくいため、自明な「拡張ポイント」に統一。 バッジ・凡例・本文の全出現を置換(意味は同じ=プラグイン/Customize が割り込む口)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
隣の「目的/役割」列と紛らわしい「なぜ」を「区分」に統一。凡例見出しも 「区分の凡例(この機構は何のためにあるか)」へ揃えた。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
比喩をやめ「管理操作が購入と同じ PurchaseFlow 確定を呼び、在庫引当・採番・出荷通知メール の副作用が同時に走る」と具体的に記述。(EditController:158-159,216 / ShippingController:179-180,242) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
全 README を横断レビューし、初見で引っかかる表現を平易化(意味は不変): - AgentCommerce: 沈黙のすり抜け→検知されず割り当たる / 握り潰す→例外にせず既定値で処理・捕捉して破棄 / 焼き付けない→確定・固定しない / landing する→実装される / 基準線→既定 / 注文を汚さない→状態を変えない - Security: 撒く→付ける / 面的に・面で保護→プレフィックス単位でまとめて / 主装置→主たる仕組み - EventListener: 肝→要点 / 主戦場→主に行われる場所 - DI: 避難口→例外的なアクセス手段 / Doctrine: 面倒を見る→自動で行う / 割り込む→介入する - Form: 地図→全体像 / Customize: 型→パターン / Admin/Order: 動かす→更新する / Twig: 握り潰される→素通りする Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AGENTS.md は時制のない規約ハブに保つため、静的サイト化・本番公開先サブドメイン (docs.ec-cube.net/spec 等)・doc4 統合といったロードマップ/未確定の決定を除去。 §8.2 は「export コマンド+鮮度維持 CI」の規約・事実のみに縮小し、公開方針は Issue #6906 参照とした。 index 表の README.html 説明も同様に薄くし『真の』表記も除去。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…6906) CodeRabbit 指摘のうち客観的な HTML 妥当性の 4 件に対応。 静的サイト化(#6906 §8.2)で厳格パーサに通す際の崩れを防ぐ。 - Service/README.html: note ブロック内の余分な </p> を除去 - Controller/Admin/Order/README.html: $em->remove の > を > へ - Controller/README.html: $this->isTokenValid() の > を > へ - Service/AgentCommerce/Exception/README.html: errorCode->value の > を > へ Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
概要(Overview・Refs Issue)
Refs #6906(Phase A / 戦略資料 §8.1)。
src/Eccube/の各レイヤ根・高複雑サブシステムと一部app/の計 27 ディレクトリへ、コードと同じ場所に 2 ファイルを配置し、さらに全体の入口となる**ルートREADME.html(仕様書ポータル)**を追加します。README.html… 人間向けの仕様書(挙動・なぜ・図表)。<section data-section="…" data-customer="true|false">で章立てし、顧客提出時はdata-customer="true"の章だけ抽出できる。README.md… GitHub のディレクトリビューで自動表示される短い索引。README.html(人間向け仕様)と該当SKILL.md(AI 向け規約)への道標。README.html… 全README.htmlへのポータル(目次)。自己完結 HTML なのでビルド不要でブラウザから各ディレクトリの仕様へ辿れる。ルートREADME.mdからもリンク。3 層の役割分担(
README.html=人間向け仕様 /README.md=索引・AI 道標 /SKILL.md=AI 規約)と参照トポロジ・テンプレート・入口(ポータル)をAGENTS.mdに追記しました。方針(Policy)
src/Eccube/Service/PurchaseFlow/を金型に粒度・書式を固定し、全対象へ横展開。README.htmlには「ツールでは読み取れず・間違えやすい非自明な事実」に絞って記載する。Doctrine/DependencyInjection/Attribute/Service/AgentCommerce/)は SKILL リンクを省きREADME.htmlのみを指す。README.htmlは自己完結 HTML。§8.2 で共通 CSS を当てられるよう過度なインライン装飾を避け、クラス指定で統一。実装に関する補足(Appendix)
README.htmlには、担当ディレクトリの実コードで裏取りした非自明・事故りやすい事実を補筆(例: 在庫はProductClass/ProductStockの 2 テーブルに二重管理、受注金額はOrderItem明細の合算、admin_shipping_editの{id}は Order ID、save()/delete()は flush しない、#[FormAppend]でのフォーム項目追加、Twig サンドボックス違反は本番で握り潰し 等)。app/Plugin/*は.gitignore対象のため、README 2 ファイルのみ追跡例外を追加(既存の.gitkeep例外と同じ方式)。README.mdの既存リンク切れ(bundle.jsのパス誤り)を修正。テスト(Test)
README.html: 各<section>にdata-section/data-customer付与・相対リンク解決・ルートポータルが全README.htmlを列挙、を機械チェック(鮮度チェッカーは後続 docs: 仕様書の集約 export コマンドと鮮度チェック CI を追加 (#6906) #6910 で CI 化)。README.md: 相対リンク解決・文字化け(U+FFFD)なしを機械チェック。🤖 Generated with Claude Code