arch(phase2): de-inline the remaining modules — controllers, email, security, storage, observability, cache - #59
Merged
Conversation
…ecurity, storage, observability, cache 22 header/body pairs join the app_core de-inline pattern (ADR 0003 as amended 2026-08-22; billing/Core/Config set the precedent): - api/: all 10 remaining controllers (Posts, Account, Admin, Auth, Upload, Jobs, ContentPages, ApiKey, Audit, Health). Route macros stay in the headers; json.hpp downgraded to json_fwd.hpp across the board. - email/: AccountEmails, GenericEmail, AccountEmailWorker, Templates. The last header-plane email->jobs includes are gone — jobs/Jobs.hpp now appears only in body files (Mailer.cpp set the pattern); inja/inja.hpp left the header plane with Templates.cpp. - security/: Auth, Idempotency, RateLimit (the three above the measured ~150-line body bar; Tokens measured ~126 and stays header-only with the other eight small files). - storage/Storage, observability/Observability + Trace, cache/Cache, database/Migrations. Templates and referenced inline globals stay in the headers; database/Database.hpp deliberately untouched. Headers: 6338 -> 2396 lines (-62%); 5118 lines of bodies now compile once into app_core instead of once per including TU. Consumers that relied on transitive includes got direct ones (2 src TUs, 8 test files). Behavior is move-only: token-multiset parity against HEAD verified per pair, zero string-literal drift. docs/module-deps.txt unchanged (the email->jobs edge is now a .cpp-plane edge, still declared); gate selftest 18/18.
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.
Completes the app_core de-inline across the codebase: 22 header/body pairs, headers 6338 → 2396 lines (−62%), 5118 lines of bodies now compile once.
Covers all ten controllers, the email module (the email→jobs cycle is now gone from the header plane entirely —
grep '#include "jobs/' src/email/*.hppis empty), security (Auth/Idempotency/RateLimit; Tokens measured at ~126 body lines and honestly left header-only with the other small ones), Storage, Observability+Trace (OTel SDK headers out of the header plane), Cache and Migrations.Database.hpp, domain/ and light utils stay header-only per the amended ADR 0003.Verification without local builds (build policy): token-multiset comparison of each old header vs new hpp+cpp — zero string-literal drift, only
inlinekeywords and detail-qualifiers differ; declaration/definition name cross-check; an include-closure scan over src/ and tests/ (two one-line safety includes added). Route macros byte-identical in headers (the routes gate greps them there).Gates all green, selftest 18/18 in-tree (19th case landed with #56 — rebased cleanly). Compile + the new integration-sanitizer legs prove it in this CI run.