♻️ Split oversized modules into directory modules (stacked on #12) - #13
Merged
Conversation
Pure mechanical move of application/src/service/activitypub.rs into a directory module; no behavior change.
Pure mechanical move of driver/src/http_signing.rs into a directory module; no behavior change.
Pure mechanical move of application/src/service/account.rs into a directory module; no behavior change.
Pure mechanical move of server/src/route/account.rs into a directory module; no behavior change.
turtton
added a commit
that referenced
this pull request
Jul 20, 2026
## 概要 Issue #14 の延期リスト全件への対応。全て機械的分割・監査済み死コード削除であり、到達可能コードの挙動変更はありません。 close #14 ## 変更内容 ### 先行バグ修正(ベースライン clippy エラーの解消、ユーザー承認済み) - `94b9aaa` 🐛 SSRF フィルタの IPv6 documentation range (2001:db8::/32) チェックが恒 false になっていたバグを修正(application/driver の重複箇所両方、単体テスト追加) ### 分割(#13 と同一規約の directory module 化) - `4b3d826` adapter `processor/account.rs` (435行) → `account/{mod,command,query}.rs`(7つの公開パスは再エクスポートで維持) - `4ca9be6` server `route/activitypub.rs` (532行) → `activitypub/{mod,discovery,actor,collections,inbox}.rs` - `6431ddf` server `route/oauth2.rs` (897行) → `oauth2/{mod,login,consent}.rs` - `9eda8c6` driver `postgres/account.rs` (784行) → `account/{mod,row,tests}.rs`(SQL リテラルはバイト同一を検証済み。impl ブロックは分割せず row マッピングとテストを抽出) ### 利用監査の結果: 分割ではなく死コード削除 account_detail 導入により call site がゼロになっていた UseCase trait を削除(Issue の「利用監査の実施」トリガーに対応): - `14bab0c` `service/metadata.rs`: Get/Create/Update/DeleteMetadataUseCase 削除(420→110行)。`UpdateMetadata`/`rehydrate_metadata` は applier/account_detail が使用中のため保持 - `7c1aa22` `service/profile.rs`: Get/UpdateProfileUseCase 削除(326→116行)。`UpdateProfile`/`resolve_field_action_image_id` 等は保持 ### 対象外(Issue 記載の方針通り) - `server/src/handler.rs`・`kernel/src/entity/account.rs` — サイズ例外として分割しない - `server/tests/support/*.rs` — fixture は ceiling 適用外 - SSRF/DNS pinning ロジックの共通化 — architecture change のため別途設計 ## 検証 - `cargo build` / `cargo clippy --all-targets` / `cargo fmt --check`: 全て exit 0 - `cargo test`: 全スイート 0 失敗(PostgreSQL/Redis 起動済み環境。postgres account の DB テスト8件は実 DB で実行して green) - 移動テストの検出数: oauth2 10件・activitypub 4件ともに移動前後で一致、OpenAPI スナップショットテスト pass - diff 監査: 移動 + 2件の死コード削除のみ(SQL・route 定義・trait bounds の変更なし) - 第三者レビュー(read-only): APPROVE ## 補足 削除により `transfer/{metadata,profile}.rs` の DTO が dead-but-public になったが、スコープ外のため保持(後続クリーンアップ候補)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked PR — base は #12 (
feat/api-redesign)。#12 マージ後に base をmainへ retarget してください。#12 で報告した oversized file 問題のうち、Oracle 協議で「即分割有効」と判定された4ファイルを、純粋な機械的移動(振る舞い変更ゼロ・公開APIパス不変・pub 拡大なし)で directory module 化します。レビューはコミット単位でどうぞ。
9c1de30application/src/service/activitypub.rs9404377driver/src/http_signing.rsa48b60dapplication/src/service/account.rse9bc3ebserver/src/route/account.rs方針(Oracle 協議結果)
route/activitypub.rs・adapter/processor/account.rs・oauth2.rs・metadata/profile各 service・driver/postgres/*は着手トリガー付きで延期(follow-up issue を作成済み)handler.rs(DI registry)とkernel/entity/account.rs(単一集約)は「分割しない」判断をサイズ例外として記録Verification(全コミットで実施)
cargo build --all-targets: 警告ゼロ、cargo test: 248 passed / 0 failed(baseline と完全一致)openapi_spec_matches_committed_file通過、openapi.json 差分ゼロ(再生成なし)e2e/run-ap-e2e.sh全スイート: 21 passed / 0 failed(FF1+FF2 後・FF3 後の2回実施)