Commit Graph

1 Commits

Author SHA1 Message Date
Julien Gautier 2715a518bc docs(decisions): add ADR-0018 — environment configuration strategy
CI / commits (pull_request) Successful in 1m16s
CI / check (pull_request) Successful in 1m23s
CI / scan (pull_request) Successful in 1m27s
CI / a11y (pull_request) Successful in 1m33s
CI / perf (pull_request) Successful in 3m29s
Records the per-environment config strategy for both apps:

SPA — Angular `environment.ts` + project.json `fileReplacements`.
Build-time substitution; no runtime config fetch (rejected for
the LCP/TTFB cost it would add and the deploy-time HTML rewrite
the alternatives need). Concretely cleans up the hard-coded
URLs we left in observability/tracing.ts and home-status.service.
ts ("hard-coded for v1 — env-config when it lands" comments).

BFF — `process.env` + small per-key boot-time validators (the
shape `apps/portal-bff/src/config/check-database-url.ts`
already follows). `@nestjs/config` rejected as too heavy for the
current key count.

Audit log connection — formalises the `AUDIT_DATABASE_URL` split
that ADR-0013 §"Wired as features land" already pointed at: when
the env var is set, the AuditModule instantiates a second Prisma
client with audit_writer-only credentials (defense in depth);
when unset, the dev fallback (shared pool + `SET LOCAL ROLE
audit_writer` per transaction) keeps working. A boot-time UPDATE-
rejection self-test runs against the dedicated pool when
configured — refuses to start if the pool can mutate the audit
table.

Cross-references in the §Confirmation list pull together the
env-var-as-boot-gate items already pre-figured in ADR-0009 /
ADR-0010 / ADR-0012 / ADR-0013 / ADR-0014, so the validator
pattern is the single landing place when those features ship.

Doc index and CLAUDE.md updated; no code changes in this PR.
2026-05-10 04:56:22 +02:00