Skip to content

arch(phase2): de-inline the remaining modules — controllers, email, security, storage, observability, cache - #59

Merged
moveeeax merged 2 commits into
masterfrom
arch/phase2-deinline-rest
Aug 23, 2026
Merged

arch(phase2): de-inline the remaining modules — controllers, email, security, storage, observability, cache#59
moveeeax merged 2 commits into
masterfrom
arch/phase2-deinline-rest

Conversation

@moveeeax

Copy link
Copy Markdown
Owner

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 entirelygrep '#include "jobs/' src/email/*.hpp is 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 inline keywords 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.

…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.
@moveeeax
moveeeax merged commit 1e3d8d3 into master Aug 23, 2026
11 checks passed
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.

1 participant