# Architecture B — Implementation Approval **Status:** Approved with conditions **Approval date:** 2026-10-14 **Applies to:** `HealthAppRepositoryB` **Approved plan:** `ImplementationPlan/implementation-plan.md` and its supporting registers, as reviewed on 2026-10-14 **Approved target architecture:** `ArchitectureProposal/` at Git revision `3426236c6cfcece36e94642ae84d1843288f86d5` **Reference implementation:** `../HealthAppRepository/` at Git revision `2117236366130775214d9fd2611984d4348f2b79` ## Purpose and authority This document records the owner's explicit approval of the Architecture B implementation plan and resolves decisions Q1–Q5 in `ImplementationPlan/open-questions.md`. It authorizes implementation of the approved architectural design **subject to the conditions below**. It does not authorize the implementation agent to redefine functional requirements, redesign Architecture B independently, alter the reference repository, or undertake unrelated code-level or algorithmic optimization. For implementation, read this approval together with `AGENT.md`, the approved `ArchitectureProposal/`, and the applicable functional requirements in `Docs/Requirements/`. Where this approval expressly permits an architecture-dependent departure from an earlier deployment or failure-handling requirement, record the supersession and preserve the earlier wording as historical evidence. If a conflict is not resolved here, request approval before changing the affected behaviour. ## Approved decisions ### Q1 — Consolidated application and revised installation requirements **Approved.** Architecture B may replace the original independently deployable services with the consolidated single-application architecture specified in `ArchitectureProposal/`. The corresponding Architecture B revision of US-16 is approved, subject to retaining the application's required functional capabilities. Architecture-dependent internal-upstream HTTP failure responses may be replaced with the target architecture's failure semantics, including 503 for dependency or overload failures and 504 for deadline failures. Preserve failure-versus-absence distinctions, authorization, non-disclosure, and no-unauthorized-write behaviour. Retain the original architecture-specific tests as baseline evidence and document precisely why and how corresponding Architecture B tests differ; do not silently weaken functional assertions. ### Q2 — Existing repository files **Approved.** Preserve the existing `AGENT.md` and `AGENTOldOutdated.md` without modification as part of the implementation work, and exclude unrelated pre-existing changes from implementation commits. If either file requires intentional revision, request separate authorization. Keep implementation commits focused and traceable. ### Q3 — Mathematical and clinical behaviour **Approved with restrictions.** Reuse the original numerical calculations and preserve observable results, including formulas, rounding, ordering, tie-breaking, thresholds, and applicable interpretation behaviour. Relocating calculations into the approved module structure and separating responsibilities is permitted. Algorithm replacement and unrelated micro-optimizations are not permitted. Preserve existing clinical content and classifications for functional comparison. Record unsupported or uncertain clinical claims and their provenance. If a change to an externally observable clinical rule or classification is necessary, stop the affected work and request explicit approval. Passing existing tests does not by itself establish clinical validity. ### Q4 — Fresh database provisioning; no live migration **Approved.** Architecture B may use a new, independently provisioned PostgreSQL database with the schemas, roles, constraints, users, permissions, credentials, and configuration required by the approved architecture. The installer must set up those elements rather than expecting the user to configure them manually. No import or live migration of Architecture A production data is authorized or required. Do not access or modify an existing Architecture A database. Any later import of historical data requires a separate plan and approval. For comparisons, the two architectures must be initialized with equivalent, reproducible logical datasets. ### Q5 — Portable Linux installation and validation **Approved with modification to the proposed plan.** Do not restrict the installer design to Ubuntu 24.04 LTS. Provide a portable Linux installation process for explicitly documented supported systemd-based distributions, handling distribution-dependent dependencies where needed. Avoid unsupported claims of universal Linux compatibility. The installer must provision the application, required PostgreSQL database and roles (for local installation), protected credentials and configuration, locally generated HTTPS certificates where appropriate, and the systemd unit. Support both local PostgreSQL and a remote PostgreSQL deployment with proper certificate and hostname verification; remote mode must not unnecessarily install a local database. Perform an actual end-to-end installation test on at least one identified Linux distribution. Document the environment tested and distinguish verified distributions from those merely intended to be supported. The measurement environment for A and B must be controlled and documented separately. ## Implementation authorization and gates 1. **Begin with Stage 0.** Establish a B-local executable reference from the pinned source commit; run baseline build/tests when prerequisites are available. `../HealthAppRepository/` remains strictly read-only, including no builds or tests that write generated files there. 2. **Proceed incrementally** through the approved plan after Stage 0. Keep implementation changes necessary for Architecture B and preserve externally observable functional behaviour except for the expressly approved architecture-dependent differences above. 3. **Maintain evidence** in the implementation log, acceptance register, functional-equivalence register, and architecture-conformance register. Record actual commands/results, not merely intended tests. Document any changed test expectations against the corresponding original assertions. 4. **Request new approval** before any material architectural deviation, change to functional requirements or clinical output, unrelated algorithm replacement, live data migration, or use of the reference repository for writes. 5. **Completion requires evidence**, not just a successful build: functional tests, architectural conformance checks, independent deployment verification, and explicit reporting of any criteria that remain partially verified or unverified. ## Research safeguards Treat energy-related expectations as hypotheses. Do not state that Architecture B is more energy-efficient until it has been measured using a justified, controlled and reproducible comparison. Preserve the pinned input and target revisions and record the final implemented revision. Keep datasets, workloads and relevant external conditions equivalent where feasible; document deviations and confounders. ## Approval boundary This approval authorizes **implementation of Architecture B under the conditions above**. It does **not** approve future architectural redesigns, unsanctioned functionality changes, changes to Architecture A, clinical-rule changes, live production database transformations, or claims of energy savings.