# ADR 0002: Environment infrastructure lifted to the framework (BaseUrl, server data-environment, env badge) — cross-reference ## Status Accepted (2026-07-15) — cross-reference; the full decision record lives in the consumer repo (see below). ## Cross-reference **Primary ADR:** `FruitBankHybridApp/docs/adr/0002-environment-infrastructure-to-framework.md` ([relative link](../../../../../Mango/Source/FruitBankHybridApp/docs/adr/0002-environment-infrastructure-to-framework.md) — workspace layout dependent) Same NNNN as the primary by design (adr-author skill, multi-repo rule: "under the same NNNN if possible") — this is why 0002 is used here instead of max+1. ## Scope on this repo's side The decision moves app-agnostic environment infrastructure from the consumer (FruitBank) into this framework, executed stepwise (per-step review): - **AyCode.Core** — `AcEnv.BaseUrl` (✅ done, 2026-07-15) and `AcEnv.IsProdDb` (+ `Set`/`Hydrated`/`Changed` event; planned): single-source, fail-fast state; axis-separated naming (`IsProdDb` = data environment ≠ `IsProdBuild` = build config). - **AyCode.Services** — framework-reserved tags in `AcSignalRTags` (query 90020 / announce 90021, GridLayout-roaming precedent) + environment machinery in `AcSignalRClientBase` (first-connect gate, `EnsureEnvironmentAsync`, fail-closed raw query, announce interception; **opt-in** via `EnvironmentFeatureEnabled => false` default). - **AyCode.Services.Server** — hub-base push-on-connect announce from `AcEnv.IsProdDb` (best-effort). - **AyCode.Blazor.Components** — `IAcAppTitleService` + browser implementation + `` component. Consumer-side remains: domain constants, DB-catalog classification call-site, query endpoint implementation (framework tag), MAUI title implementation, app name. Consumer facades delegate to `AcEnv` (zero-break migration). ## Related - Related ADRs: primary record (see Cross-reference above). - Related TODOs/Issues: `ACCORE-LOG-T-N2D8` (AcEnv.SetConfiguration synergy), `ACCORE-LOG-T-D7S3`, `ACCORE-SBP-T-T5R2`, `ACBLAZOR-GRID-T-E3B6`.