Deliver portable native Architecture B deployment and final verification

This commit is contained in:
Steffen committed 2026-10-14 16:32:20 +02:00
1 parent f451b55de1
commit 36740d2492
85 files changed
+10303 -290

No files matched your search

+3
View File
@@ -5,3 +5,6 @@
*.env *.env
!*.env.example !*.env.example
ImplementationPlan/evidence/*.log ImplementationPlan/evidence/*.log
**/__pycache__/
*.pyc
+1 -1
View File
@@ -1 +1 @@
<Solution><Folder Name="/src/"><Project Path="src/Modules/Overview/Overview.csproj"/><Project Path="src/Modules/Analytics/Analytics.csproj"/><Project Path="src/Modules/Observations/Observations.csproj"/><Project Path="src/HealthApp.Infrastructure/HealthApp.Infrastructure.csproj"/><Project Path="src/Modules/Profile/Profile.csproj"/><Project Path="src/HealthApp/HealthApp.csproj" /><Project Path="src/HealthApp.Contracts/HealthApp.Contracts.csproj" /><Project Path="src/Modules/Guidance/Guidance.csproj" /></Folder><Folder Name="/tests/"><Project Path="tests/HealthApp.AcceptanceTests/HealthApp.AcceptanceTests.csproj" /></Folder></Solution> <Solution><Folder Name="/deploy/"><Project Path="deploy/HealthApp.Provisioning/HealthApp.Provisioning.csproj"/></Folder><Folder Name="/src/"><Project Path="src/Modules/Overview/Overview.csproj"/><Project Path="src/Modules/Analytics/Analytics.csproj"/><Project Path="src/Modules/Observations/Observations.csproj"/><Project Path="src/HealthApp.Infrastructure/HealthApp.Infrastructure.csproj"/><Project Path="src/Modules/Profile/Profile.csproj"/><Project Path="src/HealthApp/HealthApp.csproj" /><Project Path="src/HealthApp.Contracts/HealthApp.Contracts.csproj" /><Project Path="src/Modules/Guidance/Guidance.csproj" /></Folder><Folder Name="/tests/"><Project Path="tests/HealthApp.DeploymentTests/HealthApp.DeploymentTests.csproj"/><Project Path="tests/HealthApp.AcceptanceTests/HealthApp.AcceptanceTests.csproj" /></Folder></Solution>
+149 -149
View File
@@ -1,152 +1,152 @@
# Acceptance preservation register # Acceptance preservation and verification register
Prepared 2026-10-14. All 146 criterion IDs/titles and required outcomes below are retained from the pinned target traceability document. Planned suite allocations refer to the original source and guide adaptation; they do not establish passing coverage. Preserve outline examples, refine exact methods and results during implementation, and add missing assertions without weakening existing ones. US-16 is separately governed by Q1 and the full criterion mapping in `ArchitectureProposal/us16-revision.md`. All 146 original common/US-01–US-15 entries and outline outcomes are retained. Links identify concrete executed B test methods; theory examples expand into multiple TRX cases. Functional assertions were reviewed against the required outcomes. Native revised US-16 evidence is separately in architecture-conformance.md. Clinical interpretation validity is distinguished from preserved deterministic behaviour under approval Q3; no new clinical review is claimed. Final test run evidence is summarized in evidence/final-verification.json.
| Criterion / title | Required outcomes / outline cases | Planned source suites | Verification | | Criterion / title | Required outcomes / outline cases | Executed B test methods | Verification |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| 00-AC-01: Include both boundaries | both boundary observations contribute; observations outside the period do not contribute. Outline cases: operation: history, numerical insight, trend assessment, overview insight | ObservationHistoryTests; ContextFilteredHistoryTests; ContextSelectedInsightTests; HealthTrendTests; HealthOverviewTests | Not verified; exact methods/results pending | | 00-AC-01: Include both boundaries | both boundary observations contribute; observations outside the period do not contribute. Outline cases: operation: history, numerical insight, trend assessment, overview insight | [ContextFilteredHistoryTests.Filtered_history_preserves_patient_scope_inclusive_boundaries_and_equal_bounds](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L127); [ContextSelectedInsightTests.Filtered_insight_preserves_patient_scope_inclusive_bounds_and_equal_instants](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L159); [HealthTrendTests.Inclusive_patient_period_and_equal_offset_instants_apply_before_sufficiency](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L290); [HealthOverviewTests.Overview_preserves_profile_latest_context_and_selected_insight_with_different_bases](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L57) | Verified functional assertions; executed cases in final TRX |
| 00-AC-02: Equal bounds are valid | the period is accepted; only observations at that instant are selected; the operation applies its own data-sufficiency rules. Outline cases: operation: history, numerical insight, trend assessment, overview insight | ObservationHistoryTests; ContextFilteredHistoryTests; ContextSelectedInsightTests; HealthTrendTests; HealthOverviewTests | Not verified; exact methods/results pending | | 00-AC-02: Equal bounds are valid | the period is accepted; only observations at that instant are selected; the operation applies its own data-sufficiency rules. Outline cases: operation: history, numerical insight, trend assessment, overview insight | [ContextFilteredHistoryTests.Filtered_history_preserves_patient_scope_inclusive_boundaries_and_equal_bounds](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L127); [ContextSelectedInsightTests.Filtered_insight_preserves_patient_scope_inclusive_bounds_and_equal_instants](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L159); [HealthTrendTests.Inclusive_patient_period_and_equal_offset_instants_apply_before_sufficiency](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L290); [HealthOverviewTests.Equal_offset_instants_are_valid_and_single_observation_insight_is_sufficient](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L143) | Verified functional assertions; executed cases in final TRX |
| 00-AC-03: Reject reversed bounds | the request is rejected. Outline cases: operation: history, numerical insight, trend assessment, overview insight | ObservationHistoryTests; ContextFilteredHistoryTests; ContextSelectedInsightTests; HealthTrendTests; HealthOverviewTests | Not verified; exact methods/results pending | | 00-AC-03: Reject reversed bounds | the request is rejected. Outline cases: operation: history, numerical insight, trend assessment, overview insight | [ObservationHistoryTests.Invalid_or_missing_period_is_rejected_without_changing_observations](../tests/HealthApp.AcceptanceTests/ObservationHistoryTests.cs#L90); [HealthInsightTests.Invalid_or_missing_period_is_rejected](../tests/HealthApp.AcceptanceTests/HealthInsightTests.cs#L119); [HealthTrendTests.Invalid_period_or_selection_is_rejected_with_explanation](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L385); [HealthOverviewTests.Invalid_period_or_context_is_rejected_with_details](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L188) | Verified functional assertions; executed cases in final TRX |
| 01-AC-01: Create a patient with valid information | the patient profile is created successfully; a patient identifier is assigned; the identifier is associated with the authenticated account | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-01: Create a patient with valid information | the patient profile is created successfully; a patient identifier is assigned; the identifier is associated with the authenticated account | [CreatePatientTests.Valid_profile_is_assigned_an_identifier_and_can_be_retrieved_after_restart](../tests/HealthApp.AcceptanceTests/CreatePatientTests.cs#L16) | Verified functional assertions; executed cases in final TRX |
| 01-AC-02: A patient name is required | the patient profile is rejected | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-02: A patient name is required | the patient profile is rejected | [CreatePatientTests.Missing_required_information_is_rejected_without_persisting](../tests/HealthApp.AcceptanceTests/CreatePatientTests.cs#L54) | Verified functional assertions; executed cases in final TRX |
| 01-AC-03: A date of birth is required | the patient profile is rejected | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-03: A date of birth is required | the patient profile is rejected | [CreatePatientTests.Missing_required_information_is_rejected_without_persisting](../tests/HealthApp.AcceptanceTests/CreatePatientTests.cs#L54) | Verified functional assertions; executed cases in final TRX |
| 01-AC-04: Reject a second profile | the request reports that a profile already exists; no second profile is created and the association is unchanged | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-04: Reject a second profile | the request reports that a profile already exists; no second profile is created and the association is unchanged | [PatientAuthenticationTests.Profile_creation_retries_and_concurrency_preserve_one_persistent_association](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L143) | Verified functional assertions; executed cases in final TRX |
| 01-AC-05: Persistent account association | the same associated profile is returned | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-05: Persistent account association | the same associated profile is returned | [PatientAuthenticationTests.Profile_creation_retries_and_concurrency_preserve_one_persistent_association](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L143) | Verified functional assertions; executed cases in final TRX |
| 01-AC-06: Retry after a successful creation response was lost | the result indicates that the profile already exists; no duplicate profile or replacement association is created | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-06: Retry after a successful creation response was lost | the result indicates that the profile already exists; no duplicate profile or replacement association is created | [ProfileLifecycleTests.Concurrent_creation_lost_response_and_restart_preserve_one_accessible_profile](../tests/HealthApp.AcceptanceTests/ProfileLifecycleTests.cs#L14) | Verified functional assertions; executed cases in final TRX |
| 01-AC-07: Concurrent initial creation | at most one profile is created and associated with the account; no request reports a second profile as created | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-07: Concurrent initial creation | at most one profile is created and associated with the account; no request reports a second profile as created | [PatientAuthenticationTests.Profile_creation_retries_and_concurrency_preserve_one_persistent_association](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L143) | Verified functional assertions; executed cases in final TRX |
| 01-AC-08: Recovery after interrupted creation | the operation recovers to one accessible associated profile or reports that creation remains incomplete; it neither produces duplicate profiles nor reports an inaccessible profile as successfully created | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-08: Recovery after interrupted creation | the operation recovers to one accessible associated profile or reports that creation remains incomplete; it neither produces duplicate profiles nor reports an inaccessible profile as successfully created | [PatientAuthenticationTests.Database_failure_rolls_back_profile_and_association_together](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L208); [PatientAuthenticationTests.Failed_creation_can_be_retried_without_an_orphan_profile](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L166) | Verified functional assertions; executed cases in final TRX |
| 01-AC-09: Unauthenticated initial creation | the request is rejected and no profile is created | CreatePatientTests; PatientAuthenticationTests | Not verified; exact methods/results pending | | 01-AC-09: Unauthenticated initial creation | the request is rejected and no profile is created | [PatientAuthenticationTests.Missing_and_invalid_tokens_reject_every_existing_patient_operation](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L75) | Verified functional assertions; executed cases in final TRX |
| 02-AC-01: Retrieve an existing patient | the patient profile is returned; the returned patient identifier matches the requested patient; the patient's name is included; the patient's date of birth is included; the patient's contact information is included | CreatePatientTests; ProfessionalAccessTests | Not verified; exact methods/results pending | | 02-AC-01: Retrieve an existing patient | the patient profile is returned; the returned patient identifier matches the requested patient; the patient's name is included; the patient's date of birth is included; the patient's contact information is included | [CreatePatientTests.Valid_profile_is_assigned_an_identifier_and_can_be_retrieved_after_restart](../tests/HealthApp.AcceptanceTests/CreatePatientTests.cs#L16) | Verified functional assertions; executed cases in final TRX |
| 02-AC-02: Request a patient that does not exist | the request reports that the patient does not exist | CreatePatientTests; ProfessionalAccessTests | Not verified; exact methods/results pending | | 02-AC-02: Request a patient that does not exist | the request reports that the patient does not exist | [CreatePatientTests.Unknown_identifier_returns_not_found](../tests/HealthApp.AcceptanceTests/CreatePatientTests.cs#L96) | Verified functional assertions; executed cases in final TRX |
| 03-AC-01: Update an existing patient | the update succeeds; the patient identifier is unchanged; the patient profile contains contact information "new@example.test" | UpdatePatientTests | Not verified; exact methods/results pending | | 03-AC-01: Update an existing patient | the update succeeds; the patient identifier is unchanged; the patient profile contains contact information "new@example.test" | [UpdatePatientTests.Updated_profile_preserves_identity_and_date_of_birth_and_survives_restart](../tests/HealthApp.AcceptanceTests/UpdatePatientTests.cs#L13) | Verified functional assertions; executed cases in final TRX |
| 03-AC-02: Update a patient that does not exist | the update is rejected; no new patient is created | UpdatePatientTests | Not verified; exact methods/results pending | | 03-AC-02: Update a patient that does not exist | the update is rejected; no new patient is created | [UpdatePatientTests.Updating_a_missing_patient_is_rejected_without_creating_a_profile](../tests/HealthApp.AcceptanceTests/UpdatePatientTests.cs#L39) | Verified functional assertions; executed cases in final TRX |
| 04-AC-01: Record a valid observation | the observation is accepted; an observation identifier is assigned; the observation is associated with the patient; the observation can be retrieved later | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-01: Record a valid observation | the observation is accepted; an observation identifier is assigned; the observation is associated with the patient; the observation can be retrieved later | [RecordObservationTests.Valid_observation_is_assigned_an_identifier_associated_with_the_patient_and_retrievable_after_restart](../tests/HealthApp.AcceptanceTests/RecordObservationTests.cs#L28) | Verified functional assertions; executed cases in final TRX |
| 04-AC-02: Record an observation without optional fields | the observation is accepted | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-02: Record an observation without optional fields | the observation is accepted | [RecordObservationTests.Optional_fields_can_be_omitted_and_identifiers_are_distinct](../tests/HealthApp.AcceptanceTests/RecordObservationTests.cs#L58) | Verified functional assertions; executed cases in final TRX |
| 04-AC-03: Reject an observation containing a non-positive measured value | the observation is rejected. Outline cases: columns (systolic, diastolic, pulse); cases (0, 82, 68), (-1, 82, 68), (128, 0, 68), (128, -1, 68), (128, 82, 0), (128, 82, -1) | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-03: Reject an observation containing a non-positive measured value | the observation is rejected. Outline cases: columns (systolic, diastolic, pulse); cases (0, 82, 68), (-1, 82, 68), (128, 0, 68), (128, -1, 68), (128, 82, 0), (128, 82, -1) | [RecordObservationTests.Non_positive_values_are_rejected_without_saving](../tests/HealthApp.AcceptanceTests/RecordObservationTests.cs#L80) | Verified functional assertions; executed cases in final TRX |
| 04-AC-04: Reject an observation without a measurement timestamp | the observation is rejected | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-04: Reject an observation without a measurement timestamp | the observation is rejected | [RecordObservationTests.Missing_or_malformed_information_is_rejected_without_saving](../tests/HealthApp.AcceptanceTests/RecordObservationTests.cs#L104) | Verified functional assertions; executed cases in final TRX |
| 04-AC-05: Record an observation for a patient that does not exist | the observation is rejected | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-05: Record an observation for a patient that does not exist | the observation is rejected | [RecordObservationTests.Missing_patient_is_rejected_without_saving](../tests/HealthApp.AcceptanceTests/RecordObservationTests.cs#L118) | Verified functional assertions; executed cases in final TRX |
| 04-AC-06: Record setting and condition independently | observation creation succeeds | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-06: Record setting and condition independently | observation creation succeeds | [RecordMeasurementContextTests.Setting_and_activity_are_independent_and_departures_from_guidance_are_valid](../tests/HealthApp.AcceptanceTests/RecordMeasurementContextTests.cs#L80) | Verified functional assertions; executed cases in final TRX |
| 04-AC-07: Record partial context | observation creation succeeds | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-07: Record partial context | observation creation succeeds | [RecordMeasurementContextTests.Partial_and_absent_context_remain_unknown_without_reinterpreting_legacy_text](../tests/HealthApp.AcceptanceTests/RecordMeasurementContextTests.cs#L101) | Verified functional assertions; executed cases in final TRX |
| 04-AC-08: Retain support for absent context | observation creation succeeds | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-08: Retain support for absent context | observation creation succeeds | [RecordMeasurementContextTests.Partial_and_absent_context_remain_unknown_without_reinterpreting_legacy_text](../tests/HealthApp.AcceptanceTests/RecordMeasurementContextTests.cs#L101) | Verified functional assertions; executed cases in final TRX |
| 04-AC-09: Record departure from routine | observation creation succeeds | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-09: Record departure from routine | observation creation succeeds | [RecordMeasurementContextTests.Setting_and_activity_are_independent_and_departures_from_guidance_are_valid](../tests/HealthApp.AcceptanceTests/RecordMeasurementContextTests.cs#L80) | Verified functional assertions; executed cases in final TRX |
| 04-AC-10: Reject unsupported category | the operation is rejected with an explanation of the invalid category | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-10: Reject unsupported category | the operation is rejected with an explanation of the invalid category | [RecordMeasurementContextTests.Invalid_context_is_rejected_with_validation_details_without_saving](../tests/HealthApp.AcceptanceTests/RecordMeasurementContextTests.cs#L150) | Verified functional assertions; executed cases in final TRX |
| 04-AC-11: Retrieve previously saved context | the returned observation contains those saved details associated with that observation | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-11: Retrieve previously saved context | the returned observation contains those saved details associated with that observation | [RecordMeasurementContextTests.Complete_context_is_saved_with_the_correct_values_and_retrievable_after_restart](../tests/HealthApp.AcceptanceTests/RecordMeasurementContextTests.cs#L40) | Verified functional assertions; executed cases in final TRX |
| 04-AC-12: Reject another patient’s context submission | the operation is rejected | RecordObservationTests; RecordMeasurementContextTests | Not verified; exact methods/results pending | | 04-AC-12: Reject another patient’s context submission | the operation is rejected | [RecordMeasurementContextTests.Context_is_protected_against_other_patient_reads_and_submissions_and_professional_writes](../tests/HealthApp.AcceptanceTests/RecordMeasurementContextTests.cs#L165) | Verified functional assertions; executed cases in final TRX |
| 05-AC-01: Retrieve an existing observation | the observation is returned; the systolic value is 128; the diastolic value is 82; the pulse value is 68 | ViewObservationContextTests; PatientAuthenticationTests; ProfessionalAccessTests | Not verified; exact methods/results pending | | 05-AC-01: Retrieve an existing observation | the observation is returned; the systolic value is 128; the diastolic value is 82; the pulse value is 68 | [ViewObservationContextTests.Complete_saved_context_is_returned_with_its_measurements_and_timestamp_after_restart](../tests/HealthApp.AcceptanceTests/ViewObservationContextTests.cs#L66) | Verified functional assertions; executed cases in final TRX |
| 05-AC-02: Retrieve an observation that does not exist | the request reports that the observation does not exist | ViewObservationContextTests; PatientAuthenticationTests; ProfessionalAccessTests | Not verified; exact methods/results pending | | 05-AC-02: Retrieve an observation that does not exist | the request reports that the observation does not exist | [ViewObservationContextTests.Missing_observation_reports_not_found_without_disclosing_saved_context](../tests/HealthApp.AcceptanceTests/ViewObservationContextTests.cs#L122) | Verified functional assertions; executed cases in final TRX |
| 05-AC-03: Return complete saved context | its saved context is returned with its numerical measurements and timestamp | ViewObservationContextTests; PatientAuthenticationTests; ProfessionalAccessTests | Not verified; exact methods/results pending | | 05-AC-03: Return complete saved context | its saved context is returned with its numerical measurements and timestamp | [ViewObservationContextTests.Complete_saved_context_is_returned_with_its_measurements_and_timestamp_after_restart](../tests/HealthApp.AcceptanceTests/ViewObservationContextTests.cs#L66) | Verified functional assertions; executed cases in final TRX |
| 05-AC-04: Return partial context | Clinic is returned as the setting; activity condition is represented as unknown | ViewObservationContextTests; PatientAuthenticationTests; ProfessionalAccessTests | Not verified; exact methods/results pending | | 05-AC-04: Return partial context | Clinic is returned as the setting; activity condition is represented as unknown | [ViewObservationContextTests.Partial_saved_context_distinguishes_known_setting_from_unknown_condition_and_details](../tests/HealthApp.AcceptanceTests/ViewObservationContextTests.cs#L97) | Verified functional assertions; executed cases in final TRX |
| 05-AC-05: Preserve historical free text | the original text is returned; no definite setting or activity condition is invented | ViewObservationContextTests; PatientAuthenticationTests; ProfessionalAccessTests | Not verified; exact methods/results pending | | 05-AC-05: Preserve historical free text | the original text is returned; no definite setting or activity condition is invented | [ViewObservationContextTests.Historical_free_text_is_returned_without_inventing_setting_or_activity](../tests/HealthApp.AcceptanceTests/ViewObservationContextTests.cs#L109) | Verified functional assertions; executed cases in final TRX |
| 05-AC-06: Protect context | access is rejected; its context is not disclosed | ViewObservationContextTests; PatientAuthenticationTests; ProfessionalAccessTests | Not verified; exact methods/results pending | | 05-AC-06: Protect context | access is rejected; its context is not disclosed | [ViewObservationContextTests.Unauthorised_callers_cannot_read_observation_context](../tests/HealthApp.AcceptanceTests/ViewObservationContextTests.cs#L132) | Verified functional assertions; executed cases in final TRX |
| 06-AC-01: Return the most recent observation | the observation measured at "2026-09-12T08:00:00" is returned | LatestObservationTests | Not verified; exact methods/results pending | | 06-AC-01: Return the most recent observation | the observation measured at "2026-09-12T08:00:00" is returned | [LatestObservationTests.Latest_is_selected_by_measurement_time_for_the_requested_patient_after_restart](../tests/HealthApp.AcceptanceTests/LatestObservationTests.cs#L43) | Verified functional assertions; executed cases in final TRX |
| 06-AC-02: Patient has no observations | the result indicates that no observation is available | LatestObservationTests | Not verified; exact methods/results pending | | 06-AC-02: Patient has no observations | the result indicates that no observation is available | [LatestObservationTests.Patient_without_observations_returns_not_found_even_when_another_patient_has_observations](../tests/HealthApp.AcceptanceTests/LatestObservationTests.cs#L61) | Verified functional assertions; executed cases in final TRX |
| 06-AC-03: Return context of latest observation | the newer observation is returned with its after-activity context | LatestObservationTests | Not verified; exact methods/results pending | | 06-AC-03: Return context of latest observation | the newer observation is returned with its after-activity context | [LatestObservationTests.Newer_after_activity_observation_is_returned_with_its_own_context](../tests/HealthApp.AcceptanceTests/LatestObservationTests.cs#L113) | Verified functional assertions; executed cases in final TRX |
| 06-AC-04: Do not substitute a more complete observation | the latest observation is returned; its context is represented as unknown | LatestObservationTests | Not verified; exact methods/results pending | | 06-AC-04: Do not substitute a more complete observation | the latest observation is returned; its context is represented as unknown | [LatestObservationTests.Missing_context_does_not_replace_latest_with_an_older_complete_observation](../tests/HealthApp.AcceptanceTests/LatestObservationTests.cs#L126) | Verified functional assertions; executed cases in final TRX |
| 06-AC-05: Preserve timestamp tie selection | the second observation is returned with its own setting | LatestObservationTests | Not verified; exact methods/results pending | | 06-AC-05: Preserve timestamp tie selection | the second observation is returned with its own setting | [LatestObservationTests.Measurement_timestamp_ties_use_original_recording_time_and_ignore_later_edits](../tests/HealthApp.AcceptanceTests/LatestObservationTests.cs#L148) | Verified functional assertions; executed cases in final TRX |
| 06-AC-06: No observations | the system reports that no observation is available | LatestObservationTests | Not verified; exact methods/results pending | | 06-AC-06: No observations | the system reports that no observation is available | [LatestObservationTests.Patient_without_observations_returns_not_found_even_when_another_patient_has_observations](../tests/HealthApp.AcceptanceTests/LatestObservationTests.cs#L61) | Verified functional assertions; executed cases in final TRX |
| 06-AC-07: Resolve a complete timestamp tie reproducibly | the same observation is returned under the documented final tie rule | LatestObservationTests | Not verified; exact methods/results pending | | 06-AC-07: Resolve a complete timestamp tie reproducibly | the same observation is returned under the documented final tie rule | [LatestObservationTests.Complete_timestamp_ties_choose_greatest_identifier_reproducibly_across_restart](../tests/HealthApp.AcceptanceTests/LatestObservationTests.cs#L171) | Verified functional assertions; executed cases in final TRX |
| 07-AC-01: Retrieve observations within a period | exactly 1 observation is returned; the returned observation was measured at "2026-09-05T08:00:00" | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-01: Retrieve observations within a period | exactly 1 observation is returned; the returned observation was measured at "2026-09-05T08:00:00" | [ObservationHistoryTests.Selected_period_returns_only_the_matching_observation_after_restart](../tests/HealthApp.AcceptanceTests/ObservationHistoryTests.cs#L45) | Verified functional assertions; executed cases in final TRX |
| 07-AC-02: Return observations in chronological order | the observations are returned in chronological order by measurement timestamp | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-02: Return observations in chronological order | the observations are returned in chronological order by measurement timestamp | [ObservationHistoryTests.Results_are_chronological_and_include_both_period_boundaries](../tests/HealthApp.AcceptanceTests/ObservationHistoryTests.cs#L60) | Verified functional assertions; executed cases in final TRX |
| 07-AC-03: No observations exist within the requested period | an empty observation collection is returned | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-03: No observations exist within the requested period | an empty observation collection is returned | [ObservationHistoryTests.No_matching_observations_returns_an_empty_array](../tests/HealthApp.AcceptanceTests/ObservationHistoryTests.cs#L74) | Verified functional assertions; executed cases in final TRX |
| 07-AC-04: Reject an invalid period | the request is rejected | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-04: Reject an invalid period | the request is rejected | [ObservationHistoryTests.Invalid_or_missing_period_is_rejected_without_changing_observations](../tests/HealthApp.AcceptanceTests/ObservationHistoryTests.cs#L90) | Verified functional assertions; executed cases in final TRX |
| 07-AC-05: Select home observations | only home observations within the period are returned with their context | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-05: Select home observations | only home observations within the period are returned with their context | [ContextFilteredHistoryTests.Independent_and_combined_selections_return_matching_context_and_metadata](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L58) | Verified functional assertions; executed cases in final TRX |
| 07-AC-06: Combine setting and activity | only home-resting observations are returned | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-06: Combine setting and activity | only home-resting observations are returned | [ContextFilteredHistoryTests.Independent_and_combined_selections_return_matching_context_and_metadata](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L58) | Verified functional assertions; executed cases in final TRX |
| 07-AC-07: Select unknown context | only observations with unknown setting are returned | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-07: Select unknown context | only observations with unknown setting are returned | [ContextFilteredHistoryTests.Unknown_selections_match_unknown_categories_without_interpreting_legacy_text](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L83) | Verified functional assertions; executed cases in final TRX |
| 07-AC-08: No selection excludes nothing on context alone | all those observations are returned in ascending measurement-time order | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-08: No selection excludes nothing on context alone | all those observations are returned in ascending measurement-time order | [ContextFilteredHistoryTests.No_selection_retains_all_contexts_in_chronological_order_after_restart](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L100) | Verified functional assertions; executed cases in final TRX |
| 07-AC-09: No matching observations | an empty collection is returned | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-09: No matching observations | an empty collection is returned | [ContextFilteredHistoryTests.Empty_filtered_history_is_an_empty_array_with_applied_selection_metadata](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L115) | Verified functional assertions; executed cases in final TRX |
| 07-AC-10: Reject unsupported selection | the request is rejected with an explanation | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-10: Reject unsupported selection | the request is rejected with an explanation | [ContextFilteredHistoryTests.Unsupported_selections_are_rejected_without_changing_observations](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L148) | Verified functional assertions; executed cases in final TRX |
| 07-AC-11: Preserve patient and boundary rules | both boundary observations are returned; the outside-period and other-patient observations are excluded | ObservationHistoryTests; ContextFilteredHistoryTests | Not verified; exact methods/results pending | | 07-AC-11: Preserve patient and boundary rules | both boundary observations are returned; the outside-period and other-patient observations are excluded | [ContextFilteredHistoryTests.Filtered_history_preserves_patient_scope_inclusive_boundaries_and_equal_bounds](../tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs#L127) | Verified functional assertions; executed cases in final TRX |
| 08-AC-01: Correct an existing observation | the update succeeds; the observation identifier is unchanged; the observation contains systolic value 128 | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-01: Correct an existing observation | the update succeeds; the observation identifier is unchanged; the observation contains systolic value 128 | [UpdateObservationTests.Correction_preserves_other_information_and_is_visible_in_all_retrievals_after_restart](../tests/HealthApp.AcceptanceTests/UpdateObservationTests.cs#L39) | Verified functional assertions; executed cases in final TRX |
| 08-AC-02: Reject an update containing a non-positive measured value | the update is rejected. Outline cases: columns (systolic, diastolic, pulse); cases (0, 82, 68), (128, 0, 68), (128, 82, 0) | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-02: Reject an update containing a non-positive measured value | the update is rejected. Outline cases: columns (systolic, diastolic, pulse); cases (0, 82, 68), (128, 0, 68), (128, 82, 0) | [UpdateObservationTests.Non_positive_values_are_rejected_without_changing_observation](../tests/HealthApp.AcceptanceTests/UpdateObservationTests.cs#L82) | Verified functional assertions; executed cases in final TRX |
| 08-AC-03: Update an observation that does not exist | the update is rejected | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-03: Update an observation that does not exist | the update is rejected | [UpdateObservationTests.Missing_observation_is_rejected_without_inserting_a_new_observation](../tests/HealthApp.AcceptanceTests/UpdateObservationTests.cs#L114) | Verified functional assertions; executed cases in final TRX |
| 08-AC-04: Add context to historical observation | the update succeeds | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-04: Add context to historical observation | the update succeeds | [PatchObservationTests.Context_can_be_added_to_a_historical_observation_without_changing_its_measurements](../tests/HealthApp.AcceptanceTests/PatchObservationTests.cs#L55) | Verified functional assertions; executed cases in final TRX |
| 08-AC-05: Correct one context value | the update succeeds | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-05: Correct one context value | the update succeeds | [PatchObservationTests.Correcting_one_context_field_preserves_omitted_data_and_changes_selection_after_restart](../tests/HealthApp.AcceptanceTests/PatchObservationTests.cs#L65) | Verified functional assertions; executed cases in final TRX |
| 08-AC-06: Clear optional context | the update succeeds | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-06: Clear optional context | the update succeeds | [PatchObservationTests.Individual_optional_fields_can_be_corrected_or_cleared_without_erasing_other_context](../tests/HealthApp.AcceptanceTests/PatchObservationTests.cs#L85) | Verified functional assertions; executed cases in final TRX |
| 08-AC-07: Retrieve partially corrected observation | Clinic is returned; the original numerical values, timestamp, activity condition, and note are returned unchanged | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-07: Retrieve partially corrected observation | Clinic is returned; the original numerical values, timestamp, activity condition, and note are returned unchanged | [PatchObservationTests.Correcting_one_context_field_preserves_omitted_data_and_changes_selection_after_restart](../tests/HealthApp.AcceptanceTests/PatchObservationTests.cs#L65) | Verified functional assertions; executed cases in final TRX |
| 08-AC-08: Reject invalid context correction | the update is rejected | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-08: Reject invalid context correction | the update is rejected | [PatchObservationTests.Invalid_patches_reject_the_whole_update_without_changes](../tests/HealthApp.AcceptanceTests/PatchObservationTests.cs#L170) | Verified functional assertions; executed cases in final TRX |
| 08-AC-09: Nonexistent observation | the update is rejected | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-09: Nonexistent observation | the update is rejected | [PatchObservationTests.Missing_observation_is_not_created_by_a_context_patch](../tests/HealthApp.AcceptanceTests/PatchObservationTests.cs#L201) | Verified functional assertions; executed cases in final TRX |
| 08-AC-10: Unauthorised correction | the operation is rejected | UpdateObservationTests; PatchObservationTests | Not verified; exact methods/results pending | | 08-AC-10: Unauthorised correction | the operation is rejected | [PatchObservationTests.Other_patients_professionals_and_unauthenticated_clients_cannot_patch_context](../tests/HealthApp.AcceptanceTests/PatchObservationTests.cs#L212) | Verified functional assertions; executed cases in final TRX |
| 09-AC-01: Delete an existing observation | the deletion succeeds; the observation can no longer be retrieved; the observation no longer appears in the patient's observation history | DeleteObservationTests; DeleteContextualisedObservationTests | Not verified; exact methods/results pending | | 09-AC-01: Delete an existing observation | the deletion succeeds; the observation can no longer be retrieved; the observation no longer appears in the patient's observation history | [DeleteObservationTests.Deleted_observation_stays_absent_after_restart_and_other_observations_are_preserved](../tests/HealthApp.AcceptanceTests/DeleteObservationTests.cs#L45) | Verified functional assertions; executed cases in final TRX |
| 09-AC-02: Delete an observation that does not exist | the request reports that the observation does not exist | DeleteObservationTests; DeleteContextualisedObservationTests | Not verified; exact methods/results pending | | 09-AC-02: Delete an observation that does not exist | the request reports that the observation does not exist | [DeleteObservationTests.Missing_observation_returns_not_found_without_changing_existing_data](../tests/HealthApp.AcceptanceTests/DeleteObservationTests.cs#L85) | Verified functional assertions; executed cases in final TRX |
| 09-AC-03: Delete contextualised observation | deletion succeeds | DeleteObservationTests; DeleteContextualisedObservationTests | Not verified; exact methods/results pending | | 09-AC-03: Delete contextualised observation | deletion succeeds | [DeleteContextualisedObservationTests.Deleted_context_stays_absent_from_retrieval_filtered_history_and_latest_after_restart](../tests/HealthApp.AcceptanceTests/DeleteContextualisedObservationTests.cs#L59) | Verified functional assertions; executed cases in final TRX |
| 09-AC-04: History excludes previously deleted observation | the deleted observation and its context are absent; the remaining matching observations are returned | DeleteObservationTests; DeleteContextualisedObservationTests | Not verified; exact methods/results pending | | 09-AC-04: History excludes previously deleted observation | the deleted observation and its context are absent; the remaining matching observations are returned | [DeleteContextualisedObservationTests.Deleted_context_stays_absent_from_retrieval_filtered_history_and_latest_after_restart](../tests/HealthApp.AcceptanceTests/DeleteContextualisedObservationTests.cs#L59) | Verified functional assertions; executed cases in final TRX |
| 09-AC-05: Assessment excludes deleted data | the deleted values and context do not contribute to the result | DeleteObservationTests; DeleteContextualisedObservationTests | Not verified; exact methods/results pending | | 09-AC-05: Assessment excludes deleted data | the deleted values and context do not contribute to the result | [DeleteContextualisedObservationTests.New_numerical_summary_excludes_deleted_values_and_retains_current_remaining_observations](../tests/HealthApp.AcceptanceTests/DeleteContextualisedObservationTests.cs#L82); [HealthTrendTests.Corrected_values_context_and_deletions_are_used_on_every_request_after_restart](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L352) | Verified functional assertions; executed cases in final TRX |
| 09-AC-06: Reject unauthorised deletion | the operation is rejected | DeleteObservationTests; DeleteContextualisedObservationTests | Not verified; exact methods/results pending | | 09-AC-06: Reject unauthorised deletion | the operation is rejected | [DeleteContextualisedObservationTests.Unauthorised_deletions_preserve_the_observation_and_all_context](../tests/HealthApp.AcceptanceTests/DeleteContextualisedObservationTests.cs#L120) | Verified functional assertions; executed cases in final TRX |
| 10-AC-01: Calculate averages for a period | the average systolic value is 125; the average diastolic value is 82; the average pulse value is 65 | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-01: Calculate averages for a period | the average systolic value is 125; the average diastolic value is 82; the average pulse value is 65 | [HealthInsightTests.Averages_use_only_the_requested_patient_and_period_after_restart](../tests/HealthApp.AcceptanceTests/HealthInsightTests.cs#L43) | Verified functional assertions; executed cases in final TRX |
| 10-AC-02: Calculate minimum and maximum blood-pressure values | the minimum systolic value is 118; the maximum systolic value is 130; the minimum diastolic value is 76; the maximum diastolic value is 84 | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-02: Calculate minimum and maximum blood-pressure values | the minimum systolic value is 118; the maximum systolic value is 130; the minimum diastolic value is 76; the maximum diastolic value is 84 | [HealthInsightTests.Minimum_and_maximum_values_are_calculated](../tests/HealthApp.AcceptanceTests/HealthInsightTests.cs#L62) | Verified functional assertions; executed cases in final TRX |
| 10-AC-03: Insight uses only observations in the requested period | only observations within the requested period contribute to the calculated values | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-03: Insight uses only observations in the requested period | only observations within the requested period contribute to the calculated values | [HealthInsightTests.Averages_use_only_the_requested_patient_and_period_after_restart](../tests/HealthApp.AcceptanceTests/HealthInsightTests.cs#L43) | Verified functional assertions; executed cases in final TRX |
| 10-AC-04: No observations exist in the requested period | the result indicates that insufficient observation data is available for calculation | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-04: No observations exist in the requested period | the result indicates that insufficient observation data is available for calculation | [HealthInsightTests.No_matching_observations_reports_insufficient_data](../tests/HealthApp.AcceptanceTests/HealthInsightTests.cs#L101) | Verified functional assertions; executed cases in final TRX |
| 10-AC-05: Reject an invalid insight period | the request is rejected | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-05: Reject an invalid insight period | the request is rejected | [HealthInsightTests.Invalid_or_missing_period_is_rejected](../tests/HealthApp.AcceptanceTests/HealthInsightTests.cs#L119) | Verified functional assertions; executed cases in final TRX |
| 10-AC-06: Calculate from selected context only | average systolic pressure is 125.00; the result identifies Home, At rest, and two contributing observations | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-06: Calculate from selected context only | average systolic pressure is 125.00; the result identifies Home, At rest, and two contributing observations | [ContextSelectedInsightTests.Independent_and_combined_selections_use_only_matching_observations_and_report_their_basis](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L51) | Verified functional assertions; executed cases in final TRX |
| 10-AC-07: No filter preserves pooled calculation | all eligible observations contribute to the existing numerical calculations; the mixed or unknown context is made apparent | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-07: No filter preserves pooled calculation | all eligible observations contribute to the existing numerical calculations; the mixed or unknown context is made apparent | [ContextSelectedInsightTests.Unfiltered_insight_includes_unknown_context_and_explains_mixed_and_missing_conditions](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L76) | Verified functional assertions; executed cases in final TRX |
| 10-AC-08: One selected observation | each mean equals that observation’s corresponding value; each blood-pressure minimum and maximum equals its corresponding value | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-08: One selected observation | each mean equals that observation’s corresponding value; each blood-pressure minimum and maximum equals its corresponding value | [ContextSelectedInsightTests.Unknown_selection_is_explicit_and_legacy_narrative_does_not_create_known_membership](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L97) | Verified functional assertions; executed cases in final TRX |
| 10-AC-09: No matching observations | the system reports that no insight can be calculated for the selection | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-09: No matching observations | the system reports that no insight can be calculated for the selection | [ContextSelectedInsightTests.Corrections_clearing_and_deletion_change_membership_and_fresh_summary_results_after_restart](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L134) | Verified functional assertions; executed cases in final TRX |
| 10-AC-10: Correction changes membership | that observation does not contribute to the home-only calculation | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-10: Correction changes membership | that observation does not contribute to the home-only calculation | [ContextSelectedInsightTests.Corrections_clearing_and_deletion_change_membership_and_fresh_summary_results_after_restart](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L134) | Verified functional assertions; executed cases in final TRX |
| 10-AC-11: Reject unsupported selection | the request is rejected with an explanation | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-11: Reject unsupported selection | the request is rejected with an explanation | [ContextSelectedInsightTests.Unsupported_selection_is_rejected_with_validation_details](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L178) | Verified functional assertions; executed cases in final TRX |
| 10-AC-12: Round a halfway mean upwards | the average systolic value is 120.13 | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-12: Round a halfway mean upwards | the average systolic value is 120.13 | [ContextSelectedInsightTests.Means_round_only_the_final_value_to_two_decimals_with_half_up_rounding](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L118) | Verified functional assertions; executed cases in final TRX |
| 10-AC-13: Round a repeating fractional mean | the average systolic value is 120.33 | HealthInsightTests; ContextSelectedInsightTests | Not verified; exact methods/results pending | | 10-AC-13: Round a repeating fractional mean | the average systolic value is 120.33 | [ContextSelectedInsightTests.Means_round_only_the_final_value_to_two_decimals_with_half_up_rounding](../tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs#L118) | Verified functional assertions; executed cases in final TRX |
| 11-AC-01: Calculate a trend from observations | a trend result is returned; the trend is derived only from observations within the requested period | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-01: Calculate a trend from observations | a trend result is returned; the trend is derived only from observations within the requested period | [HealthTrendTests.Full_period_direction_and_separate_units_and_levels](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L27); [HealthTrendTests.Inclusive_patient_period_and_equal_offset_instants_apply_before_sufficiency](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L290) | Verified functional assertions; executed cases in final TRX |
| 11-AC-02: No observations exist for trend calculation | the result indicates that insufficient observation data is available for trend calculation | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-02: No observations exist for trend calculation | the result indicates that insufficient observation data is available for trend calculation | [HealthTrendTests.Empty_and_single_series_report_each_unavailable_part](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L223) | Verified functional assertions; executed cases in final TRX |
| 11-AC-03: Reject an invalid trend period | the request is rejected | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-03: Reject an invalid trend period | the request is rejected | [HealthTrendTests.Invalid_period_or_selection_is_rejected_with_explanation](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L385) | Verified functional assertions; executed cases in final TRX |
| 11-AC-04: Assess a comparable selection | separate systolic, diastolic, and pulse assessments are returned; the result identifies the selection, contributing count, and recorded basis for comparability | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-04: Assess a comparable selection | separate systolic, diastolic, and pulse assessments are returned; the result identifies the selection, contributing count, and recorded basis for comparability | [HealthTrendTests.Full_period_direction_and_separate_units_and_levels](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L27) | Verified functional assertions; executed cases in final TRX |
| 11-AC-05: Different conditions remain visible | the result identifies the differing conditions; explains limitations on interpreting their combined trajectory | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-05: Different conditions remain visible | the result identifies the differing conditions; explains limitations on interpreting their combined trajectory | [HealthTrendTests.Different_conditions_and_preparation_are_visible_and_limit_combined_trajectory](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L187) | Verified functional assertions; executed cases in final TRX |
| 11-AC-06: Unknown details limit comparability | the explanation identifies the known similarities and missing details; does not certify that all measurement conditions were identical | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-06: Unknown details limit comparability | the explanation identifies the known similarities and missing details; does not certify that all measurement conditions were identical | [HealthTrendTests.Known_categories_with_missing_preparation_support_limited_reference_comparison](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L150) | Verified functional assertions; executed cases in final TRX |
| 11-AC-07: Missing context preserves numerical information | supported numerical direction and variation are returned; the limitations on clinical interpretation and comparability are explained | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-07: Missing context preserves numerical information | supported numerical direction and variation are returned; the limitations on clinical interpretation and comparability are explained | [HealthTrendTests.Missing_context_preserves_numerical_direction_but_not_resting_interpretation](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L137) | Verified functional assertions; executed cases in final TRX |
| 11-AC-08: Conflicting descriptions | the conflict is identified; an unsupported resting interpretation is not asserted | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-08: Conflicting descriptions | the conflict is identified; an unsupported resting interpretation is not asserted | [HealthTrendTests.Conflicting_rest_narrative_withholds_resting_interpretation](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L176) | Verified functional assertions; executed cases in final TRX |
| 11-AC-09: Compare labelled selections | each result identifies its own selection and contributing observations; a difference between settings alone is not labelled improvement or deterioration over time | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-09: Compare labelled selections | each result identifies its own selection and contributing observations; a difference between settings alone is not labelled improvement or deterioration over time | [HealthTrendTests.Labelled_home_and_clinic_selections_and_independent_dimensions_use_only_matches](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L312) | Verified functional assertions; executed cases in final TRX |
| 11-AC-10: Insufficient selected series | the result reports insufficient observations for temporal direction; does not use excluded observations to manufacture a trend | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-10: Insufficient selected series | the result reports insufficient observations for temporal direction; does not use excluded observations to manufacture a trend | [HealthTrendTests.Unknown_empty_and_one_selected_observation_do_not_borrow_excluded_data](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L335) | Verified functional assertions; executed cases in final TRX |
| 11-AC-11: No temporal separation | temporal direction is reported as unavailable | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-11: No temporal separation | temporal direction is reported as unavailable | [HealthTrendTests.Timestamp_ties_do_not_manufacture_direction_or_hide_descriptive_range](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L211) | Verified functional assertions; executed cases in final TRX |
| 11-AC-12: No matching data | the result reports that no matching observations are available | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-12: No matching data | the result reports that no matching observations are available | [HealthTrendTests.Unknown_empty_and_one_selected_observation_do_not_borrow_excluded_data](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L335) | Verified functional assertions; executed cases in final TRX |
| 11-AC-13: Updated context is used | that observation no longer contributes to the result | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-13: Updated context is used | that observation no longer contributes to the result | [HealthTrendTests.Corrected_values_context_and_deletions_are_used_on_every_request_after_restart](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L352) | Verified functional assertions; executed cases in final TRX |
| 11-AC-14: Reject invalid selection | the request is rejected with an explanation | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-14: Reject invalid selection | the request is rejected with an explanation | [HealthTrendTests.Invalid_period_or_selection_is_rejected_with_explanation](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L385) | Verified functional assertions; executed cases in final TRX |
| 11-AC-15: AC-11-A | the result presents each measurement separately; identifies its unit, observed level, direction, and variation | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-15: AC-11-A | the result presents each measurement separately; identifies its unit, observed level, direction, and variation | [HealthTrendTests.Full_period_direction_and_separate_units_and_levels](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L27) | Verified functional assertions; executed cases in final TRX |
| 11-AC-16: AC-11-B | only observations for that patient within the selected period contribute to the result | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-16: AC-11-B | only observations for that patient within the selected period contribute to the result | [HealthTrendTests.Inclusive_patient_period_and_equal_offset_instants_apply_before_sufficiency](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L290) | Verified functional assertions; executed cases in final TRX |
| 11-AC-17: AC-11-C | the result identifies the corresponding direction; bases that assessment on measurements throughout the period | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-17: AC-11-C | the result identifies the corresponding direction; bases that assessment on measurements throughout the period | [HealthTrendTests.Full_period_direction_and_separate_units_and_levels](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L27) | Verified functional assertions; executed cases in final TRX |
| 11-AC-18: AC-11-D | the result describes the intermediate variation; does not describe the period as clinically stable merely because its endpoints are similar | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-18: AC-11-D | the result describes the intermediate variation; does not describe the period as clinically stable merely because its endpoints are similar | [HealthTrendTests.Equal_endpoints_do_not_hide_intermediate_excursion_or_reversal](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L45) | Verified functional assertions; executed cases in final TRX |
| 11-AC-19: AC-11-E | the explanation describes the reversal or mixed development; does not imply that all measurements follow one consistent direction | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-19: AC-11-E | the explanation describes the reversal or mixed development; does not imply that all measurements follow one consistent direction | [HealthTrendTests.Overall_decrease_can_coexist_with_reversals_and_large_variation](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L58) | Verified functional assertions; executed cases in final TRX |
| 11-AC-20: AC-11-F | the explanation identifies their position relative to the reference values; does not describe them as healthy solely because their variation is limited | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-20: AC-11-F | the explanation identifies their position relative to the reference values; does not describe them as healthy solely because their variation is limited | [HealthTrendTests.Low_variation_outside_reference_is_not_healthy](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L69) | Verified functional assertions; executed cases in final TRX |
| 11-AC-21: AC-11-G | the explanation describes that development and its basis; distinguishes improvement from having reached an appropriate level | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-21: AC-11-G | the explanation describes that development and its basis; distinguishes improvement from having reached an appropriate level | [HealthTrendTests.Favourable_pressure_decrease_can_still_be_high_while_falling_pulse_is_concerning](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L79); [HealthTrendTests.Moving_low_pulse_up_or_high_pulse_down_is_not_automatically_concerning](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L92) | Partially verified: preserved outputs/provenance pass; independent clinical support not verified (Q3) |
| 11-AC-22: AC-11-H | the explanation describes the concern and its basis; does not treat a decrease as favourable solely because the values are falling | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-22: AC-11-H | the explanation describes the concern and its basis; does not treat a decrease as favourable solely because the values are falling | [HealthTrendTests.Favourable_pressure_decrease_can_still_be_high_while_falling_pulse_is_concerning](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L79) | Partially verified: preserved outputs/provenance pass; independent clinical support not verified (Q3) |
| 11-AC-23: AC-11-I | the result explains the interpretation of each affected measurement; does not force them into a single favourable or concerning classification | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-23: AC-11-I | the result explains the interpretation of each affected measurement; does not force them into a single favourable or concerning classification | [HealthTrendTests.Favourable_pressure_decrease_can_still_be_high_while_falling_pulse_is_concerning](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L79) | Partially verified: preserved outputs/provenance pass; independent clinical support not verified (Q3) |
| 11-AC-24: AC-11-J | the result presents the supported numerical information; explains that the clinical interpretation is limited by missing context | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-24: AC-11-J | the result presents the supported numerical information; explains that the clinical interpretation is limited by missing context | [HealthTrendTests.Missing_context_preserves_numerical_direction_but_not_resting_interpretation](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L137) | Verified functional assertions; executed cases in final TRX |
| 11-AC-25: AC-11-K | the result explicitly reports that direction cannot be determined; does not substitute an increasing, decreasing, or unchanged conclusion | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-25: AC-11-K | the result explicitly reports that direction cannot be determined; does not substitute an increasing, decreasing, or unchanged conclusion | [HealthTrendTests.Empty_and_single_series_report_each_unavailable_part](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L223) | Verified functional assertions; executed cases in final TRX |
| 11-AC-26: AC-11-L | the result identifies the reference values used; does not present a general reference threshold as an individual treatment target | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-26: AC-11-L | the result identifies the reference values used; does not present a general reference threshold as an individual treatment target | [HealthTrendTests.References_are_setting_specific_sourced_and_not_treatment_targets](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L113) | Partially verified: preserved outputs/provenance pass; independent clinical support not verified (Q3) |
| 11-AC-27: AC-11-M | the assessment remains unchanged | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-27: AC-11-M | the assessment remains unchanged | [HealthTrendTests.Retrieval_and_identifier_order_do_not_change_results_including_ties](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L237) | Verified functional assertions; executed cases in final TRX |
| 11-AC-28: AC-11-N | the result reflects the current observations | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-28: AC-11-N | the result reflects the current observations | [HealthTrendTests.Corrected_values_context_and_deletions_are_used_on_every_request_after_restart](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L352) | Verified functional assertions; executed cases in final TRX |
| 11-AC-29: Supported reference comparison despite incomplete preparation details | the supported reference comparison is provided; the explanation identifies the remaining limits without rejecting all clinical interpretation | HealthTrendTests | Not verified; exact methods/results pending | | 11-AC-29: Supported reference comparison despite incomplete preparation details | the supported reference comparison is provided; the explanation identifies the remaining limits without rejecting all clinical interpretation | [HealthTrendTests.Known_categories_with_missing_preparation_support_limited_reference_comparison](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L150); [HealthTrendTests.Missing_optional_circumstances_do_not_block_supported_comparison](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L164) | Partially verified: preserved outputs/provenance pass; independent clinical support not verified (Q3) |
| 12-AC-01: View an overview for a patient with observations | the patient's profile is included; the latest blood-pressure observation is included; the calculated health insight is included | HealthOverviewTests | Not verified; exact methods/results pending | | 12-AC-01: View an overview for a patient with observations | the patient's profile is included; the latest blood-pressure observation is included; the calculated health insight is included | [HealthOverviewTests.Overview_preserves_profile_latest_context_and_selected_insight_with_different_bases](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L57) | Verified functional assertions; executed cases in final TRX |
| 12-AC-02: View an overview for a patient without observations | the patient's profile is included; no latest blood-pressure observation is returned; the overview indicates that no calculated health insight is available | HealthOverviewTests | Not verified; exact methods/results pending | | 12-AC-02: View an overview for a patient without observations | the patient's profile is included; no latest blood-pressure observation is returned; the overview indicates that no calculated health insight is available | [HealthOverviewTests.No_observations_returns_profile_and_explicit_insight_absence](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L96) | Verified functional assertions; executed cases in final TRX |
| 12-AC-03: Request an overview for a patient that does not exist | the request reports that the patient does not exist | HealthOverviewTests | Not verified; exact methods/results pending | | 12-AC-03: Request an overview for a patient that does not exist | the request reports that the patient does not exist | [HealthOverviewTests.Assigned_missing_patient_reports_absence_without_exposing_other_patients](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L197) | Verified functional assertions; executed cases in final TRX |
| 12-AC-04: Reject an invalid overview period | the request is rejected | HealthOverviewTests | Not verified; exact methods/results pending | | 12-AC-04: Reject an invalid overview period | the request is rejected | [HealthOverviewTests.Invalid_period_or_context_is_rejected_with_details](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L188) | Verified functional assertions; executed cases in final TRX |
| 12-AC-05: Latest context and insight selection differ | the latest after-activity observation and its context are returned; the insight uses only matching home-resting observations; the result distinguishes their different bases | HealthOverviewTests | Not verified; exact methods/results pending | | 12-AC-05: Latest context and insight selection differ | the latest after-activity observation and its context are returned; the insight uses only matching home-resting observations; the result distinguishes their different bases | [HealthOverviewTests.Overview_preserves_profile_latest_context_and_selected_insight_with_different_bases](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L57) | Verified functional assertions; executed cases in final TRX |
| 12-AC-06: No matching insight observations | the profile and latest observation remain available; the absence of insight for the selection is explained | HealthOverviewTests | Not verified; exact methods/results pending | | 12-AC-06: No matching insight observations | the profile and latest observation remain available; the absence of insight for the selection is explained | [HealthOverviewTests.Empty_selected_insight_preserves_profile_latest_and_applied_selection](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L110) | Verified functional assertions; executed cases in final TRX |
| 12-AC-07: Unknown context remains unknown | its context is represented as unknown; no context is copied from other observations | HealthOverviewTests | Not verified; exact methods/results pending | | 12-AC-07: Unknown context remains unknown | its context is represented as unknown; no context is copied from other observations | [HealthOverviewTests.Unfiltered_pooled_insight_preserves_mixed_and_unknown_context_explanations](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L124) | Verified functional assertions; executed cases in final TRX |
| 12-AC-08: Default overview preserves context limitations | the original pooled insight is returned; its mixed-context explanation is included | HealthOverviewTests | Not verified; exact methods/results pending | | 12-AC-08: Default overview preserves context limitations | the original pooled insight is returned; its mixed-context explanation is included | [HealthOverviewTests.Unfiltered_pooled_insight_preserves_mixed_and_unknown_context_explanations](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L124) | Verified functional assertions; executed cases in final TRX |
| 13-AC-01: Successful authentication | the system recognises my account and Patient role; recognises its associated patient profile if one has been created | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-01: Successful authentication | the system recognises my account and Patient role; recognises its associated patient profile if one has been created | [PatientAuthenticationTests.Login_without_profile_returns_normalized_identity_and_no_patient_data](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L37) | Verified functional assertions; executed cases in final TRX |
| 13-AC-02: Access to my own information | access is permitted; the operation follows its existing acceptance criteria | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-02: Access to my own information | access is permitted; the operation follows its existing acceptance criteria | [PatientAuthenticationTests.Own_observations_and_insights_are_available_but_another_patients_reads_and_writes_are_rejected](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L92) | Verified functional assertions; executed cases in final TRX |
| 13-AC-03: Invalid credentials | authentication is rejected; the response does not reveal which part of the credentials was incorrect | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-03: Invalid credentials | authentication is rejected; the response does not reveal which part of the credentials was incorrect | [PatientAuthenticationTests.Invalid_account_and_invalid_password_have_same_rejection](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L54) | Verified functional assertions; executed cases in final TRX |
| 13-AC-04: Missing authentication | the request is rejected; no patient information is returned or changed | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-04: Missing authentication | the request is rejected; no patient information is returned or changed | [PatientAuthenticationTests.Missing_and_invalid_tokens_reject_every_existing_patient_operation](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L75) | Verified functional assertions; executed cases in final TRX |
| 13-AC-05: Invalid authentication information | the request is rejected; no patient information is returned or changed | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-05: Invalid authentication information | the request is rejected; no patient information is returned or changed | [PatientAuthenticationTests.Missing_and_invalid_tokens_reject_every_existing_patient_operation](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L75) | Verified functional assertions; executed cases in final TRX |
| 13-AC-06: Access to another patient’s information | access is rejected; none of that patient’s information is returned or changed | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-06: Access to another patient’s information | access is rejected; none of that patient’s information is returned or changed | [PatientAuthenticationTests.Own_observations_and_insights_are_available_but_another_patients_reads_and_writes_are_rejected](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L92) | Verified functional assertions; executed cases in final TRX |
| 13-AC-07: Own information does not yet exist | the system follows the existing behaviour for missing information; does not return another patient’s information | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-07: Own information does not yet exist | the system follows the existing behaviour for missing information; does not return another patient’s information | [PatientAuthenticationTests.Login_without_profile_returns_normalized_identity_and_no_patient_data](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L37) | Verified functional assertions; executed cases in final TRX |
| 13-AC-08: Login before profile creation | authentication succeeds and recognises my account and Patient role; I may create my initial profile under US-01; I gain no access to another patient’s information | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-08: Login before profile creation | authentication succeeds and recognises my account and Patient role; I may create my initial profile under US-01; I gain no access to another patient’s information | [PatientAuthenticationTests.Login_without_profile_returns_normalized_identity_and_no_patient_data](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L37) | Verified functional assertions; executed cases in final TRX |
| 13-AC-09: Expired authentication | the request is rejected; no patient information is returned or changed | PatientAuthenticationTests; AuthenticationIntegrationTests | Not verified; exact methods/results pending | | 13-AC-09: Expired authentication | the request is rejected; no patient information is returned or changed | [PatientAuthenticationTests.Expired_token_is_rejected_and_login_produces_a_fresh_token](../tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs#L181) | Verified functional assertions; executed cases in final TRX |
| 14-AC-01: Successful authentication | the system recognises my identity and healthcare professional role | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-01: Successful authentication | the system recognises my identity and healthcare professional role | [ProfessionalAccessTests.Login_recognizes_professional_identity_and_does_not_put_assignments_in_the_token_response](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L59) | Verified functional assertions; executed cases in final TRX |
| 14-AC-02: View assigned patients | the system returns only patients assigned to me | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-02: View assigned patients | the system returns only patients assigned to me | [ProfessionalAccessTests.Professionals_list_only_their_own_assignments_and_can_share_patients](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L72) | Verified functional assertions; executed cases in final TRX |
| 14-AC-03: View an assigned patient’s information | access is permitted; the requested information is returned according to the existing retrieval requirements | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-03: View an assigned patient’s information | access is permitted; the requested information is returned according to the existing retrieval requirements | [ProfessionalAccessTests.Assigned_profiles_observations_context_history_latest_and_insights_are_readable](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L99); [HealthOverviewTests.Overview_requires_owner_or_assigned_professional_and_blocks_direct_bypass](../tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs#L210); [HealthTrendTests.Trend_access_requires_authentication_ownership_or_professional_assignment](../tests/HealthApp.AcceptanceTests/HealthTrendTests.cs#L394) | Verified functional assertions; executed cases in final TRX |
| 14-AC-04: No assigned patients | the system indicates that no patients are assigned; does not return other patients | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-04: No assigned patients | the system indicates that no patients are assigned; does not return other patients | [ProfessionalAccessTests.Professionals_list_only_their_own_assignments_and_can_share_patients](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L72) | Verified functional assertions; executed cases in final TRX |
| 14-AC-05: Patient information does not yet exist | the system follows the existing behaviour for missing information | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-05: Patient information does not yet exist | the system follows the existing behaviour for missing information | [ProfessionalAccessTests.Missing_information_for_assigned_patients_follows_existing_retrieval_behaviour](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L143) | Verified functional assertions; executed cases in final TRX |
| 14-AC-06: Access to an unassigned patient | access is rejected; no information about that patient is returned | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-06: Access to an unassigned patient | access is rejected; no information about that patient is returned | [ProfessionalAccessTests.Unassigned_patients_and_observations_are_rejected_even_with_a_supplied_assigned_patient_id](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L122) | Verified functional assertions; executed cases in final TRX |
| 14-AC-07: Attempt to change patient information | the operation is rejected; the patient information remains unchanged | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-07: Attempt to change patient information | the operation is rejected; the patient information remains unchanged | [ProfessionalAccessTests.Professionals_cannot_create_update_or_delete_any_patient_information](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L166) | Verified functional assertions; executed cases in final TRX |
| 14-AC-08: Invalid credentials | authentication is rejected; the response does not reveal which part of the credentials was incorrect | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-08: Invalid credentials | authentication is rejected; the response does not reveal which part of the credentials was incorrect | [ProfessionalAccessTests.Incorrect_professional_secret_and_unknown_account_have_identical_login_rejections](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L225) | Verified functional assertions; executed cases in final TRX |
| 14-AC-09: Missing or invalid authentication | the request is rejected; no patient information is returned | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-09: Missing or invalid authentication | the request is rejected; no patient information is returned | [ProfessionalAccessTests.Missing_invalid_and_expired_tokens_do_not_disclose_assignments_or_patient_data](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L201) | Verified functional assertions; executed cases in final TRX |
| 14-AC-10: Patient account attempts professional access | access is rejected; my existing access to my own information is unaffected | ProfessionalAccessTests | Not verified; exact methods/results pending | | 14-AC-10: Patient account attempts professional access | access is rejected; my existing access to my own information is unaffected | [ProfessionalAccessTests.Patient_cannot_list_professional_assignments_and_retains_own_access](../tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs#L235) | Verified functional assertions; executed cases in final TRX |
| 15-AC-01: Access guidance before first observation | preparation, measurement, and recording instructions are available; the source, applicability, and review date are identified | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-01: Access guidance before first observation | preparation, measurement, and recording instructions are available; the source, applicability, and review date are identified | [MeasurementGuidanceTests.Public_guidance_without_patient_records_is_labelled_and_has_ordered_sourced_instructions](../tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs#L45) | Verified functional assertions; executed cases in final TRX |
| 15-AC-02: Home measurement guidance | the instructions cover rest, equipment and cuff, positioning, repeated readings, and recording conditions; any numeric instructions follow the identified Danish or European guidance | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-02: Home measurement guidance | the instructions cover rest, equipment and cuff, positioning, repeated readings, and recording conditions; any numeric instructions follow the identified Danish or European guidance | [MeasurementGuidanceTests.Public_guidance_without_patient_records_is_labelled_and_has_ordered_sourced_instructions](../tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs#L45) | Partially verified: preserved outputs/provenance pass; independent clinical support not verified (Q3) |
| 15-AC-03: Unknown setting | its supported setting is identified; no measurement setting is saved or assumed on the user’s behalf | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-03: Unknown setting | its supported setting is identified; no measurement setting is saved or assumed on the user’s behalf | [MeasurementGuidanceTests.Public_guidance_without_patient_records_is_labelled_and_has_ordered_sourced_instructions](../tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs#L45) | Verified functional assertions; executed cases in final TRX |
| 15-AC-04: Different measurement conditions | the guidance distinguishes it from a resting measurement; explains recording the actual conditions without relabelling the result as resting | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-04: Different measurement conditions | the guidance distinguishes it from a resting measurement; explains recording the actual conditions without relabelling the result as resting | [MeasurementGuidanceTests.Activity_is_not_relabelled_as_rest_or_certified](../tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs#L80) | Verified functional assertions; executed cases in final TRX |
| 15-AC-05: Pulse context | it explains recording the pulse value and relevant activity condition; does not describe the single pulse value as a rhythm assessment | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-05: Pulse context | it explains recording the pulse value and relevant activity condition; does not describe the single pulse value as a rhythm assessment | [MeasurementGuidanceTests.Public_guidance_without_patient_records_is_labelled_and_has_ordered_sourced_instructions](../tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs#L45) | Verified functional assertions; executed cases in final TRX |
| 15-AC-06: Guidance does not certify compliance | no observation is saved or altered; following the procedure is not recorded automatically | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-06: Guidance does not certify compliance | no observation is saved or altered; following the procedure is not recorded automatically | [MeasurementGuidanceTests.Public_guidance_without_patient_records_is_labelled_and_has_ordered_sourced_instructions](../tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs#L45); [ConformanceTests.Final_solution_has_one_web_host_and_no_reference_project_or_internal_business_http](../tests/HealthApp.AcceptanceTests/ConformanceTests.cs#L25) | Verified functional assertions; executed cases in final TRX |
| 15-AC-07: Guidance is optional | creation succeeds | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-07: Guidance is optional | creation succeeds | [RecordObservationTests.Valid_observation_is_assigned_an_identifier_associated_with_the_patient_and_retrievable_after_restart](../tests/HealthApp.AcceptanceTests/RecordObservationTests.cs#L28) | Verified functional assertions; executed cases in final TRX |
| 15-AC-08: Guidance unavailable | its unavailability is explained; unsupported instructions are not presented as verified guidance | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-08: Guidance unavailable | its unavailability is explained; unsupported instructions are not presented as verified guidance | [MeasurementGuidanceTests.Unsupported_guidance_is_explicitly_unavailable_without_unverified_instructions](../tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs#L96) | Verified functional assertions; executed cases in final TRX |
| 15-AC-09: General guidance without login | the general guidance is available; no patient-specific information or assignment list is returned | MeasurementGuidanceTests; RecordObservationTests | Not verified; exact methods/results pending | | 15-AC-09: General guidance without login | the general guidance is available; no patient-specific information or assignment list is returned | [MeasurementGuidanceTests.Public_guidance_without_patient_records_is_labelled_and_has_ordered_sourced_instructions](../tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs#L45) | Verified functional assertions; executed cases in final TRX |
@@ -0,0 +1,5 @@
{
"approvalCommit": "20ab461c0194b3098504eabc96e9852a61356953",
"file": "Docs/ApprovalRequirements/architecture-b-implementation-approval.md",
"sha256": "b07f4eeea182047a71562140f44086cd43625fbca64e437d322f0eefbd5243de"
}
+34 -14
View File
@@ -1,18 +1,38 @@
# Architecture conformance register # Architecture B conformance evidence
Prepared 2026-10-14. **Implementation not started; all implementation evidence is not verified.** Allocation is a plan, not conformance proof. Authoritative target: `ArchitectureProposal/software-architecture.md` at `3426236c6cfcece36e94642ae84d1843288f86d5`. Approved target revision `3426236c6cfcece36e94642ae84d1843288f86d5`; reference `2117236366130775214d9fd2611984d4348f2b79`. Approval Q1–Q5 governs supersessions and limits. No unapproved architectural deviation was introduced.
| Target | Required implementation evidence | Status | | Target | Implemented evidence | Verification |
| --- | --- | --- | | --- | --- | --- |
| ADR-01 / components | One process/listener; module facades/private repositories; acyclic dependency checks; no internal HTTP/callbacks | Not verified | | ADR-01 / logical components | One Web SDK host; five module libraries; immutable Contracts; private persistence; no business HTTP clients/callbacks. Final solution excludes pinned reference | Verified: ConformanceTests, Release build/publish, single native app unit/PID |
| ADR-02 / ownership | One DB, Profile/Observation schemas/history/owners, restricted FK, constraints/index, DML-only runtime grants | Not verified | | ADR-02 / data ownership | `profile.patient`, `observations.observation`; per-schema migration version; two NOLOGIN schema owners; restricted patient FK; positive/category/rest/time/account constraints; patient/time/original/UUID index; DML runtime role | Verified: migrations twice, FK/check rejection, runtime DDL denial, actual installer role/readiness check. Schemas remain logical ownership, not compromise isolation |
| ADR-03 / creation sequence | Unique non-null account association, trusted identity, race/rollback/restart/lost-response tests, commit-before-success | Not verified | | ADR-03 / creation sequence | Trusted account, atomic single-row durable association, unique non-null account, conflict recovery and `/me` | Verified: original lifecycle assertions, simultaneous creation, trigger rollback, retry/lost response, restart/access |
| ADR-04 / access | Framework tokens/expiry/persistent keys; actual-owner/assignment policy; no bypass routes/service keys; secret/TLS protections | Not verified | | ADR-04 / access boundary | Framework opaque tickets with issue/expiry, 30-minute default, persistent scoped keys; normalized identities/policies; actual owner and assignments before validation/serialization; internal routes absent; no service-key trust | Verified: full patient/professional suites, expired/tampered/spoofed identity, provider replacement, real HTTPS/native restart |
| ADR-05 / read sequence | Repeatable-read from authorization through capture; coherent overview; release before computation/transfer; current next-request reads; no result store/cache | Not verified | | ADR-05 / read sequence | Shared repeatable-read from access lookup through immutable capture; Overview captures profile/latest/selected series, selects series once; releases before mathematical evaluation/transfer; no result cache/store | Verified: controlled concurrent commit test proves old coherent snapshot/new next request and released transaction |
| ADR-06 / Analytics/Guidance | Preserved documented mathematics, separated clinical policy/catalog, claim-specific review/provenance, numerical sufficiency and context/narrative limits | Not verified | | ADR-06 / Analytics/Guidance | Original Summary/Trend formulas and clinical branching retained; numerical/clinical policies separated; versioned Guidance reference/claim provenance; full-period/tie/sufficiency rules and disclosed narrative limits | Verified functional calculations/classifications/provenance. Independent clinical validity remains not verified, explicitly preserved under Q3 |
| ADR-07 / context | Flattened owned fields, Unknown/AND/clear/omission/text invariants; locked atomic writes with owner recheck | Not verified | | ADR-07 / context lifecycle | Flattened observation-owned fields; independent AND/Unknown selections; original prose; omission/set/clear and whole-context clear; owner-scoped locked mutation/delete | Verified: original context/patch/delete suites plus controlled concurrent disjoint patches and schema default assertions |
| ADR-08 / deployment/install sequence | Single app unit and identity; local/remote DB; generated settings/roles/certificates; transient installer; real PID/HTTPS/workflow/restart proof | Not verified | | ADR-08 / native deployment | Fresh independently provisioned database; generated credentials/config/certificates/keys; transient provisioner; one dedicated systemd app; local or hostname-verified TLS DB | Verified actual Debian 12 systemd local/remote installation in isolated Linux environments; other families intended with command-contract tests, native execution not verified |
| §8 operational boundary | Safe status mapping, no false absence, no-store, sanitized logs, deadline/rollback/cancellation, bounded admission/pool | Not verified | | §8 failures/resources | Bounded pooled connections and independent assessment admission; cancellation/deadline/rollback; no-store; sanitized logging; failure/absence distinctions; full untruncated history | Verified: deadline leaves state unchanged, 503/Retry-After budget and guidance independence, DB failures never become empty results; synchronous numerical methods retain boundary cancellation checks |
| §9 readiness/remote placement | Usable DB/content/key readiness, public guidance on DB outage, verified DB TLS/name, no unnecessary local DB install | Not verified | | §9 readiness/security | Protected config/private key/key ring; authenticated liveness/readiness; verified DB CA/hostname; no unnecessary local DB in remote mode; no overwrite | Verified: native certificate workflows, wrong hostname rejection, file-mode/overwrite checks and operational tests. Automatic certificate renewal/HA/production recovery remain outside scope |
Approved deviations: none. Pending incompatibility approvals: Q1 in [open-questions.md](open-questions.md). Any new necessary deviation requires explanation and approval before implementation. ## Revised US-16, approved Q1/Q5
Original clauses remain unchanged in Docs and original architecture tests remain in Reference. The approved proposal revision supplies the replacement acceptance meaning.
| Criterion | B evidence / status |
| --- | --- |
| AC-16-A | Complete app selected as the deployment unit; feature-service selection intentionally superseded. Native app install verified |
| AC-16-B | Modules one app process; PostgreSQL separately managed. App stop leaves DB ready, verified |
| AC-16-C | Complete one-app deployment, one HTTPS edge, typed internal calls. Native workflow verified |
| AC-16-D | Protected app/module configuration and independently configured DB endpoint, generated automatically; local/remote verified |
| AC-16-E | Same app supports separate verified-TLS PostgreSQL host; no feature-service distribution. Separate-host-namespace remote workflow and hostname rejection verified |
| AC-16-F | App and DB have independent lifecycles; features start/stop together. PID/restart/DB-during-stop verified |
| AC-16-G | One DB with distinct schema/migration ownership and DML role; no derived-result persistence. Grants/constraints/readiness verified |
| AC-16-H | Same module/communication/persistence responsibilities for both placements. Both native placements verified |
| AC-16-I | Actual app PID, trusted HTTPS, configured DB, representative synthetic operations, independent stop/restart and new PID verified |
Generated-password/roles, protected secret storage, certificate/trust/replacement, distribution dependency detection, migration, systemd enable/start, failure-stage diagnostics and overwrite protection are implemented. APT/DNF/pacman remote-mode tests prove local PostgreSQL commands are excluded; actual Debian remote installation confirms absence. Existing rules are retained when a scoped local SCRAM entry is added for the new B DB/role.
## Evidence limits
Native environments are disposable Debian 12 systemd instances sharing Manjaro kernel 7.1.13-2-MANJARO, not bare-metal/VM or measurement environments. .NET 10.0.13 / local PG 15.19 and remote PG 18.6 were recorded. Fedora/RHEL, Ubuntu, Debian 13 and Arch/Manjaro native installation remain intended/unverified despite adapter command tests. Clinical references/classifications are preserved with uncertainty/provenance, not newly clinically certified. Arbitrary narrative/negation is not understood beyond the unchanged detector and disclosed limits. Large full-history materialization and whole-process/DB-role failure/compromise scope remain approved tradeoffs, without capacity or HA claims. No live A import occurred; no energy improvement is claimed.
@@ -89,3 +89,7 @@ Captured 2026-10-14. `Docs/Requirements` governs functionality; `ArchitecturePro
## Diagram inspection ## Diagram inspection
All editable Draw.io files were parsed; target labels and relationships were inspected, including all four sequence pages. No GUI rendering or round-trip validation was performed in this preparation. Target diagrams describe modules, immutable values, one database with restricted FK, two deployment placements and authorized shared snapshots; no internal HTTP or separately installable feature services. Historical JPEGs were inventoried rather than treated as current structure. All editable Draw.io files were parsed; target labels and relationships were inspected, including all four sequence pages. No GUI rendering or round-trip validation was performed in this preparation. Target diagrams describe modules, immutable values, one database with restricted FK, two deployment placements and authorized shared snapshots; no internal HTTP or separately installable feature services. Historical JPEGs were inventoried rather than treated as current structure.
## Added authoritative approval
`Docs/ApprovalRequirements/architecture-b-implementation-approval.md` was supplied by the owner at commit `20ab461c0194b3098504eabc96e9852a61356953`, read completely, and preserved. Its separate SHA-256 record is approval-baseline.json. It approves Q1–Q5, explicitly modifies Linux portability, requires unchanged clinical outputs, excludes live A data access/import, and authorizes incremental implementation. It supersedes the earlier pending-approval statuses, not the preserved input documents.
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<TestRun id="b3cfbae8-0502-40d4-a545-0aeac88b6909" name="@Sil3ntDragon 2026-10-14 12:53:53" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Times creation="2026-10-14T12:53:53.3726245+02:00" queuing="2026-10-14T12:53:53.3726245+02:00" start="2026-10-14T12:53:52.4158384+02:00" finish="2026-10-14T12:53:53.3766952+02:00" />
<TestSettings name="default" id="bb3160b3-977c-4c7b-a604-038817770a41">
<Deployment runDeploymentRoot="_Sil3ntDragon_2026-10-14_12_53_53" />
</TestSettings>
<Results>
<UnitTestResult executionId="446703fe-b93e-4b9d-9ead-abeaa93c02ee" testId="1138db71-91fe-4d3d-87aa-4d70e896e482" testName="HealthApp.DeploymentTests.ProvisioningTests.Preparation_generates_scoped_protected_material_and_refuses_overwrite" computerName="Sil3ntDragon" duration="00:00:00.3435432" startTime="2026-10-14T12:53:52.9408288+02:00" endTime="2026-10-14T12:53:53.2836124+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="446703fe-b93e-4b9d-9ead-abeaa93c02ee" />
<UnitTestResult executionId="18fdae8c-e334-4f24-b280-029be0f1dfa7" testId="d50eb471-4403-2ca0-c097-2d1409d5a29a" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0193720" startTime="2026-10-14T12:53:52.8116113+02:00" endTime="2026-10-14T12:53:52.8362365+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="18fdae8c-e334-4f24-b280-029be0f1dfa7" />
<UnitTestResult executionId="f1336792-e568-4280-9949-9a5ab38983a4" testId="a70cdec8-9c14-82c1-b445-a929f0efa801" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0359129" startTime="2026-10-14T12:53:52.9049684+02:00" endTime="2026-10-14T12:53:52.9390527+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="f1336792-e568-4280-9949-9a5ab38983a4" />
<UnitTestResult executionId="c64c6a83-9c47-4425-af8b-68e2b5bad01d" testId="33c90384-f3c6-faca-dce1-d760ff21850a" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0106683" startTime="2026-10-14T12:53:52.8699706+02:00" endTime="2026-10-14T12:53:52.8809201+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="c64c6a83-9c47-4425-af8b-68e2b5bad01d" />
<UnitTestResult executionId="3f38165d-45bc-4c86-a448-d90815cee771" testId="0bc3017d-a346-6f78-15f4-a592a7649d7d" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0121428" startTime="2026-10-14T12:53:52.8579391+02:00" endTime="2026-10-14T12:53:52.8698546+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="3f38165d-45bc-4c86-a448-d90815cee771" />
<UnitTestResult executionId="88036fb0-a492-4bea-b41f-4676edf0a426" testId="d6fb777f-1940-8a0e-ae1f-9246110dbf75" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0208021" startTime="2026-10-14T12:53:52.8412364+02:00" endTime="2026-10-14T12:53:52.8575313+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="88036fb0-a492-4bea-b41f-4676edf0a426" />
<UnitTestResult executionId="20853d04-1e39-4383-a293-ad4f2268ae52" testId="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0176719" startTime="2026-10-14T12:53:52.8811849+02:00" endTime="2026-10-14T12:53:52.9048285+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="20853d04-1e39-4383-a293-ad4f2268ae52" />
</Results>
<TestDefinitions>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="0bc3017d-a346-6f78-15f4-a592a7649d7d">
<Execution id="3f38165d-45bc-4c86-a448-d90815cee771" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569">
<Execution id="20853d04-1e39-4383-a293-ad4f2268ae52" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Preparation_generates_scoped_protected_material_and_refuses_overwrite" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="1138db71-91fe-4d3d-87aa-4d70e896e482">
<Execution id="446703fe-b93e-4b9d-9ead-abeaa93c02ee" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Preparation_generates_scoped_protected_material_and_refuses_overwrite" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="a70cdec8-9c14-82c1-b445-a929f0efa801">
<Execution id="f1336792-e568-4280-9949-9a5ab38983a4" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="33c90384-f3c6-faca-dce1-d760ff21850a">
<Execution id="c64c6a83-9c47-4425-af8b-68e2b5bad01d" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="d50eb471-4403-2ca0-c097-2d1409d5a29a">
<Execution id="18fdae8c-e334-4f24-b280-029be0f1dfa7" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="d6fb777f-1940-8a0e-ae1f-9246110dbf75">
<Execution id="88036fb0-a492-4bea-b41f-4676edf0a426" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
</TestDefinitions>
<TestEntries>
<TestEntry testId="1138db71-91fe-4d3d-87aa-4d70e896e482" executionId="446703fe-b93e-4b9d-9ead-abeaa93c02ee" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="d50eb471-4403-2ca0-c097-2d1409d5a29a" executionId="18fdae8c-e334-4f24-b280-029be0f1dfa7" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="a70cdec8-9c14-82c1-b445-a929f0efa801" executionId="f1336792-e568-4280-9949-9a5ab38983a4" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="33c90384-f3c6-faca-dce1-d760ff21850a" executionId="c64c6a83-9c47-4425-af8b-68e2b5bad01d" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="0bc3017d-a346-6f78-15f4-a592a7649d7d" executionId="3f38165d-45bc-4c86-a448-d90815cee771" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="d6fb777f-1940-8a0e-ae1f-9246110dbf75" executionId="88036fb0-a492-4bea-b41f-4676edf0a426" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569" executionId="20853d04-1e39-4383-a293-ad4f2268ae52" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
</TestEntries>
<TestLists>
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestList name="All Loaded Results" id="19431567-8539-422a-85d7-44ee4e166bda" />
</TestLists>
<ResultSummary outcome="Completed">
<Counters total="7" executed="7" passed="7" failed="0" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
<Output>
<StdOut>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.5+1b188a7b0a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.04] Discovering: HealthApp.DeploymentTests
[xUnit.net 00:00:00.08] Discovered: HealthApp.DeploymentTests
[xUnit.net 00:00:00.09] Starting: HealthApp.DeploymentTests
[xUnit.net 00:00:00.58] Finished: HealthApp.DeploymentTests
</StdOut>
</Output>
</ResultSummary>
</TestRun>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<TestRun id="354f8ac4-ab57-4bcd-9cdb-3adbd530b8d0" name="@Sil3ntDragon 2026-10-14 13:27:15" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Times creation="2026-10-14T13:27:15.3568261+02:00" queuing="2026-10-14T13:27:15.3568262+02:00" start="2026-10-14T13:27:14.0554956+02:00" finish="2026-10-14T13:27:15.3604571+02:00" />
<TestSettings name="default" id="c3722b17-0066-4185-b10c-e3add37f7652">
<Deployment runDeploymentRoot="_Sil3ntDragon_2026-10-14_13_27_15" />
</TestSettings>
<Results>
<UnitTestResult executionId="8c72b7d8-68e9-479a-b4fb-3638dbf3438a" testId="d6fb777f-1940-8a0e-ae1f-9246110dbf75" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0213936" startTime="2026-10-14T13:27:14.8784870+02:00" endTime="2026-10-14T13:27:14.8955257+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="8c72b7d8-68e9-479a-b4fb-3638dbf3438a" />
<UnitTestResult executionId="456e9f43-bfdf-4005-ba75-9c0a71fb4599" testId="d50eb471-4403-2ca0-c097-2d1409d5a29a" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0218142" startTime="2026-10-14T13:27:14.8462243+02:00" endTime="2026-10-14T13:27:14.8734416+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="456e9f43-bfdf-4005-ba75-9c0a71fb4599" />
<UnitTestResult executionId="ee0d1cd6-9bcb-47a4-8f98-fcd37266cccc" testId="1138db71-91fe-4d3d-87aa-4d70e896e482" testName="HealthApp.DeploymentTests.ProvisioningTests.Preparation_generates_scoped_protected_material_and_refuses_overwrite" computerName="Sil3ntDragon" duration="00:00:00.3188274" startTime="2026-10-14T13:27:14.9569097+02:00" endTime="2026-10-14T13:27:15.2756610+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="ee0d1cd6-9bcb-47a4-8f98-fcd37266cccc" />
<UnitTestResult executionId="b6e18dab-9522-4186-a898-89d0a0aedade" testId="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0174908" startTime="2026-10-14T13:27:14.9222015+02:00" endTime="2026-10-14T13:27:14.9426622+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="b6e18dab-9522-4186-a898-89d0a0aedade" />
<UnitTestResult executionId="45c4bc07-6f10-4e98-a177-4bcb1e7ec4ca" testId="33c90384-f3c6-faca-dce1-d760ff21850a" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0129871" startTime="2026-10-14T13:27:14.9089494+02:00" endTime="2026-10-14T13:27:14.9220563+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="45c4bc07-6f10-4e98-a177-4bcb1e7ec4ca" />
<UnitTestResult executionId="437c657a-7f86-45c8-a760-09c566719d90" testId="a70cdec8-9c14-82c1-b445-a929f0efa801" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0125431" startTime="2026-10-14T13:27:14.9428006+02:00" endTime="2026-10-14T13:27:14.9558503+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="437c657a-7f86-45c8-a760-09c566719d90" />
<UnitTestResult executionId="91ee7430-a62c-4fe6-b25d-1a03d906e830" testId="0bc3017d-a346-6f78-15f4-a592a7649d7d" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0130086" startTime="2026-10-14T13:27:14.8961079+02:00" endTime="2026-10-14T13:27:14.9087887+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="91ee7430-a62c-4fe6-b25d-1a03d906e830" />
</Results>
<TestDefinitions>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="0bc3017d-a346-6f78-15f4-a592a7649d7d">
<Execution id="91ee7430-a62c-4fe6-b25d-1a03d906e830" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569">
<Execution id="b6e18dab-9522-4186-a898-89d0a0aedade" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Preparation_generates_scoped_protected_material_and_refuses_overwrite" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="1138db71-91fe-4d3d-87aa-4d70e896e482">
<Execution id="ee0d1cd6-9bcb-47a4-8f98-fcd37266cccc" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Preparation_generates_scoped_protected_material_and_refuses_overwrite" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="a70cdec8-9c14-82c1-b445-a929f0efa801">
<Execution id="437c657a-7f86-45c8-a760-09c566719d90" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="33c90384-f3c6-faca-dce1-d760ff21850a">
<Execution id="45c4bc07-6f10-4e98-a177-4bcb1e7ec4ca" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="d50eb471-4403-2ca0-c097-2d1409d5a29a">
<Execution id="456e9f43-bfdf-4005-ba75-9c0a71fb4599" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="d6fb777f-1940-8a0e-ae1f-9246110dbf75">
<Execution id="8c72b7d8-68e9-479a-b4fb-3638dbf3438a" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
</TestDefinitions>
<TestEntries>
<TestEntry testId="d6fb777f-1940-8a0e-ae1f-9246110dbf75" executionId="8c72b7d8-68e9-479a-b4fb-3638dbf3438a" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="d50eb471-4403-2ca0-c097-2d1409d5a29a" executionId="456e9f43-bfdf-4005-ba75-9c0a71fb4599" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="1138db71-91fe-4d3d-87aa-4d70e896e482" executionId="ee0d1cd6-9bcb-47a4-8f98-fcd37266cccc" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569" executionId="b6e18dab-9522-4186-a898-89d0a0aedade" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="33c90384-f3c6-faca-dce1-d760ff21850a" executionId="45c4bc07-6f10-4e98-a177-4bcb1e7ec4ca" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="a70cdec8-9c14-82c1-b445-a929f0efa801" executionId="437c657a-7f86-45c8-a760-09c566719d90" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="0bc3017d-a346-6f78-15f4-a592a7649d7d" executionId="91ee7430-a62c-4fe6-b25d-1a03d906e830" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
</TestEntries>
<TestLists>
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestList name="All Loaded Results" id="19431567-8539-422a-85d7-44ee4e166bda" />
</TestLists>
<ResultSummary outcome="Completed">
<Counters total="7" executed="7" passed="7" failed="0" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
<Output>
<StdOut>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.5+1b188a7b0a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.04] Discovering: HealthApp.DeploymentTests
[xUnit.net 00:00:00.07] Discovered: HealthApp.DeploymentTests
[xUnit.net 00:00:00.09] Starting: HealthApp.DeploymentTests
[xUnit.net 00:00:00.54] Finished: HealthApp.DeploymentTests
</StdOut>
</Output>
</ResultSummary>
</TestRun>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<TestRun id="b0c4b14e-9eaf-441b-94bc-395dd6ef6a97" name="@Sil3ntDragon 2026-10-14 16:23:02" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Times creation="2026-10-14T16:23:02.8806715+02:00" queuing="2026-10-14T16:23:02.8806716+02:00" start="2026-10-14T16:23:02.1249212+02:00" finish="2026-10-14T16:23:02.8845746+02:00" />
<TestSettings name="default" id="ed01096f-1cc8-4485-a369-85f68aa8352c">
<Deployment runDeploymentRoot="_Sil3ntDragon_2026-10-14_16_23_02" />
</TestSettings>
<Results>
<UnitTestResult executionId="020a7601-b912-4c05-a9d6-ba59a406bc74" testId="a70cdec8-9c14-82c1-b445-a929f0efa801" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0095899" startTime="2026-10-14T16:23:02.5256264+02:00" endTime="2026-10-14T16:23:02.5358198+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="020a7601-b912-4c05-a9d6-ba59a406bc74" />
<UnitTestResult executionId="777a5635-0cf9-4698-ab7e-4efd472b67a9" testId="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0084320" startTime="2026-10-14T16:23:02.5169445+02:00" endTime="2026-10-14T16:23:02.5255210+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="777a5635-0cf9-4698-ab7e-4efd472b67a9" />
<UnitTestResult executionId="7f476dad-24cf-471c-a2ba-5d12f53a6be1" testId="1138db71-91fe-4d3d-87aa-4d70e896e482" testName="HealthApp.DeploymentTests.ProvisioningTests.Preparation_generates_scoped_protected_material_and_refuses_overwrite" computerName="Sil3ntDragon" duration="00:00:00.2662087" startTime="2026-10-14T16:23:02.5366266+02:00" endTime="2026-10-14T16:23:02.8025287+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="7f476dad-24cf-471c-a2ba-5d12f53a6be1" />
<UnitTestResult executionId="40487235-142b-447f-9ef6-22574770af7a" testId="0bc3017d-a346-6f78-15f4-a592a7649d7d" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0115336" startTime="2026-10-14T16:23:02.4946112+02:00" endTime="2026-10-14T16:23:02.5058498+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="40487235-142b-447f-9ef6-22574770af7a" />
<UnitTestResult executionId="71df97b7-16eb-4a34-8d95-bc0bfb9202bf" testId="d50eb471-4403-2ca0-c097-2d1409d5a29a" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: False)" computerName="Sil3ntDragon" duration="00:00:00.0154230" startTime="2026-10-14T16:23:02.4557926+02:00" endTime="2026-10-14T16:23:02.4760720+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="71df97b7-16eb-4a34-8d95-bc0bfb9202bf" />
<UnitTestResult executionId="81d0cfeb-ed06-48a5-bc24-76f8e22b4400" testId="33c90384-f3c6-faca-dce1-d760ff21850a" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0106220" startTime="2026-10-14T16:23:02.5059619+02:00" endTime="2026-10-14T16:23:02.5168207+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="81d0cfeb-ed06-48a5-bc24-76f8e22b4400" />
<UnitTestResult executionId="c6eefd41-ff1a-4b0d-8c44-60faeecf2ba2" testId="d6fb777f-1940-8a0e-ae1f-9246110dbf75" testName="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: True)" computerName="Sil3ntDragon" duration="00:00:00.0173967" startTime="2026-10-14T16:23:02.4807079+02:00" endTime="2026-10-14T16:23:02.4940941+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="c6eefd41-ff1a-4b0d-8c44-60faeecf2ba2" />
</Results>
<TestDefinitions>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="0bc3017d-a346-6f78-15f4-a592a7649d7d">
<Execution id="40487235-142b-447f-9ef6-22574770af7a" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;manjaro&quot;, version: &quot;rolling&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569">
<Execution id="777a5635-0cf9-4698-ab7e-4efd472b67a9" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Preparation_generates_scoped_protected_material_and_refuses_overwrite" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="1138db71-91fe-4d3d-87aa-4d70e896e482">
<Execution id="7f476dad-24cf-471c-a2ba-5d12f53a6be1" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Preparation_generates_scoped_protected_material_and_refuses_overwrite" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="a70cdec8-9c14-82c1-b445-a929f0efa801">
<Execution id="020a7601-b912-4c05-a9d6-ba59a406bc74" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="33c90384-f3c6-faca-dce1-d760ff21850a">
<Execution id="81d0cfeb-ed06-48a5-bc24-76f8e22b4400" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;fedora&quot;, version: &quot;43&quot;, local: False)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="d50eb471-4403-2ca0-c097-2d1409d5a29a">
<Execution id="71df97b7-16eb-4a34-8d95-bc0bfb9202bf" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
<UnitTest name="HealthApp.DeploymentTests.ProvisioningTests.Distribution_adapters_install_local_persistence_only_when_selected(distribution: &quot;debian&quot;, version: &quot;12&quot;, local: True)" storage="/home/steffen/nextcloud/documents/master thesis/healthapprepositoryb/tests/healthapp.deploymenttests/bin/release/net10.0/healthapp.deploymenttests.dll" id="d6fb777f-1940-8a0e-ae1f-9246110dbf75">
<Execution id="c6eefd41-ff1a-4b0d-8c44-60faeecf2ba2" />
<TestMethod codeBase="/home/steffen/Nextcloud/Documents/Master Thesis/HealthAppRepositoryB/tests/HealthApp.DeploymentTests/bin/Release/net10.0/HealthApp.DeploymentTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="HealthApp.DeploymentTests.ProvisioningTests" name="Distribution_adapters_install_local_persistence_only_when_selected" />
</UnitTest>
</TestDefinitions>
<TestEntries>
<TestEntry testId="a70cdec8-9c14-82c1-b445-a929f0efa801" executionId="020a7601-b912-4c05-a9d6-ba59a406bc74" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="5bb2c169-2dfa-1a5a-d38d-a3a65e0e9569" executionId="777a5635-0cf9-4698-ab7e-4efd472b67a9" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="1138db71-91fe-4d3d-87aa-4d70e896e482" executionId="7f476dad-24cf-471c-a2ba-5d12f53a6be1" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="0bc3017d-a346-6f78-15f4-a592a7649d7d" executionId="40487235-142b-447f-9ef6-22574770af7a" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="d50eb471-4403-2ca0-c097-2d1409d5a29a" executionId="71df97b7-16eb-4a34-8d95-bc0bfb9202bf" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="33c90384-f3c6-faca-dce1-d760ff21850a" executionId="81d0cfeb-ed06-48a5-bc24-76f8e22b4400" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="d6fb777f-1940-8a0e-ae1f-9246110dbf75" executionId="c6eefd41-ff1a-4b0d-8c44-60faeecf2ba2" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
</TestEntries>
<TestLists>
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestList name="All Loaded Results" id="19431567-8539-422a-85d7-44ee4e166bda" />
</TestLists>
<ResultSummary outcome="Completed">
<Counters total="7" executed="7" passed="7" failed="0" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
<Output>
<StdOut>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.5+1b188a7b0a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.04] Discovering: HealthApp.DeploymentTests
[xUnit.net 00:00:00.06] Discovered: HealthApp.DeploymentTests
[xUnit.net 00:00:00.07] Starting: HealthApp.DeploymentTests
[xUnit.net 00:00:00.44] Finished: HealthApp.DeploymentTests
</StdOut>
</Output>
</ResultSummary>
</TestRun>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,250 @@
{
"date": "2026-10-14",
"sourceRevision": "2117236366130775214d9fd2611984d4348f2b79",
"targetRevision": "3426236c6cfcece36e94642ae84d1843288f86d5",
"approvalRevision": "20ab461c0194b3098504eabc96e9852a61356953",
"implementedCodeRevision": "recorded after code checkpoint commit",
"baselineTests": {
"passed": 299,
"failed": 0,
"skipped": 0
},
"finalBuild": {
"configuration": "Release",
"warnings": 0,
"errors": 0
},
"finalTests": [
{
"file": "ImplementationPlan/evidence/b-trx/_Sil3ntDragon_2026-10-14_16_23_02.trx",
"counters": {
"total": "7",
"executed": "7",
"passed": "7",
"failed": "0",
"error": "0",
"timeout": "0",
"aborted": "0",
"inconclusive": "0",
"passedButRunAborted": "0",
"notRunnable": "0",
"notExecuted": "0",
"disconnected": "0",
"warning": "0",
"completed": "0",
"inProgress": "0",
"pending": "0"
}
},
{
"file": "ImplementationPlan/evidence/b-trx/_Sil3ntDragon_2026-10-14_16_23_02[1].trx",
"counters": {
"total": "276",
"executed": "276",
"passed": "276",
"failed": "0",
"error": "0",
"timeout": "0",
"aborted": "0",
"inconclusive": "0",
"passedButRunAborted": "0",
"notRunnable": "0",
"notExecuted": "0",
"disconnected": "0",
"warning": "0",
"completed": "0",
"inProgress": "0",
"pending": "0"
}
}
],
"finalTotalPassed": 283,
"acceptanceEntries": {
"mapped": 146,
"functionalVerified": 140,
"clinicalPartiallyVerified": 6
},
"nativeLocal": {
"environment": "PRETTY_NAME=\"Debian GNU/Linux 12 (bookworm)\"\nNAME=\"Debian GNU/Linux\"\nVERSION_ID=\"12\"\nVERSION=\"12 (bookworm)\"\nVERSION_CODENAME=bookworm\nID=debian\nHOME_URL=\"https://www.debian.org/\"\nSUPPORT_URL=\"https://www.debian.org/support\"\nBUG_REPORT_URL=\"https://bugs.debian.org/\"\n",
"runtime": "Microsoft.AspNetCore.App 10.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]\nMicrosoft.NETCore.App 10.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]\n",
"applicationPID": "3282",
"databaseStatus": "/var/run/postgresql:5432 - accepting connections",
"result": "passed",
"overwriteRejected": true,
"runtimeConfigMode": "640 root healthapp-b",
"isolation": "Disposable privileged systemd Linux container; native installer/unit/services executed; not physical-host or measurement evidence"
},
"nativeRemote": {
"environment": "PRETTY_NAME=\"Debian GNU/Linux 12 (bookworm)\"\nNAME=\"Debian GNU/Linux\"\nVERSION_ID=\"12\"\nVERSION=\"12 (bookworm)\"\nVERSION_CODENAME=bookworm\nID=debian\nHOME_URL=\"https://www.debian.org/\"\nSUPPORT_URL=\"https://www.debian.org/support\"\nBUG_REPORT_URL=\"https://bugs.debian.org/\"\n",
"runtime": "Microsoft.AspNetCore.App 10.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]\nMicrosoft.NETCore.App 10.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]\n",
"database": "PostgreSQL 18.6 separate container/host namespace; TLS certificate SAN b-database",
"sslMode": "VerifyFull",
"wrongHostnameRejected": true,
"localPostgresInstalled": false,
"result": "passed",
"runtimeConfigMode": "640 root healthapp-b",
"isolation": "Separate disposable systemd app and TLS DB containers; no Architecture A database access; not measurement-host evidence"
},
"preservation": {
"inputHashesMatch": true,
"instructionHashesMatch": true,
"referenceFilesMatch": 142,
"originalWorkingTreeClean": true,
"architectureADataAccessed": false
},
"sourceFileSha256": {
"src/HealthApp/Controllers/AuthenticationController.cs": "2f1c58f0c91dd9b3600f8ff6b38f029b55963a0fe8b8cb10aee590afbfe7d191",
"src/HealthApp/Controllers/HealthOverviewController.cs": "f57c824acf2d40ebea350d4f841cbb20fa423fb4b94a73e5faf688f8e84c4a40",
"src/HealthApp/Controllers/InsightsController.cs": "2938aefa87b21c2bb49ab98420654e2452149339154c5df439b000b5706f0fdb",
"src/HealthApp/Controllers/MeasurementGuidanceController.cs": "05cb4eab5b1c5f6fccd3fbc9a3012a7c359a7c2f8912d745a2afed0c21f00923",
"src/HealthApp/Controllers/ObservationController.cs": "f473c8ea4a83f70ee9acde12335ab6ede1ce5b81407959da2f9c5be349242cc6",
"src/HealthApp/Controllers/PatientController.cs": "c411429e4a4f0ccd915ab3c464f3e969f635f165d2ee6ec9941cfa9dda1e31f4",
"src/HealthApp/Controllers/ProfessionalController.cs": "2b73ec65320436d5b898b13a462fe24eb6adb1e25b3233b294aa748b03155fad",
"src/HealthApp/HealthApp.csproj": "4ecc63649e1732047ad6231cc9e9bf60ba7612093bf54b62019aa01ffd7158df",
"src/HealthApp/Program.cs": "4ca7c9432644e8e13db2a64c4de930bc919421dab86c16c4000d3fa606e20d45",
"src/HealthApp/Security/AccessPolicy.cs": "f9572d457ce960ac958cc14f912d947ce6f182fbcf679a03e822164cf9215e22",
"src/HealthApp/Security/ProfessionalAssignments.cs": "4afa06b7498e0e9c8028c7858cddca0b29caed6b60b7aea3db4e50ee911efa53",
"src/HealthApp/Security/PrototypeAccounts.cs": "ebeb71b3955db41e05389cdad20a6dfda2ac394ab5d1d77164987e7a71028622",
"src/HealthApp/Security/RequestBoundaryMiddleware.cs": "21ad8bab3d282dae34ca466a2efad25d88a89a4425c12eb9b0a72009e09fee7c",
"src/HealthApp.Contracts/AnalyticsFacades.cs": "c18e5b06eed9433f68dc4b05d84542d08001385e56e24745424f3a463c48f483",
"src/HealthApp.Contracts/AuthorizedPatientContext.cs": "76730b1f40f2a47d4354f9882f6e07bd05b0fa293af375db1763b308d7de8010",
"src/HealthApp.Contracts/ClinicalRuleProvenance.cs": "788de4b769cd03288c03c693f1870c377974b1a1c64f6cfd047e88e8036404f5",
"src/HealthApp.Contracts/ContextSelection.cs": "6368c56eeb81a38c47e61fb75f4316d51d92f3796779673413447267cf21f067",
"src/HealthApp.Contracts/CreatePatientRequest.cs": "8189ef656a915e678ef5fbb6eb3d7270b086cbc66f04d893c6dba6b692cf4d43",
"src/HealthApp.Contracts/HealthApp.Contracts.csproj": "b7412db9b99568e8c78143b2ef1aca5af0b1686d98d2c7fd1ff8b7b2564b8a9d",
"src/HealthApp.Contracts/HealthInsight.cs": "131b66c4b8b80222b9b081dd5add45e1849000127151ca7feb15a7f1805a25c5",
"src/HealthApp.Contracts/HealthOverviewDto.cs": "0b8fab13249ab8588fe441ac010a10a9dac794de1135f6226ad9435b67622303",
"src/HealthApp.Contracts/MeasurementContext.cs": "02a6ba328661ffb271891808a353d9d87791dabd0f8e56eb9445f7420cb334b0",
"src/HealthApp.Contracts/MeasurementContextPatch.cs": "1aff952166ad851d6a538d35442242ba5e2b5e6bad215b9975624b0b46e03b5b",
"src/HealthApp.Contracts/ObservationDto.cs": "cf71b5ff3e7fef9cdcec0d76422c7ad1ab68f3d8821e82f2ccb902ded06b17e0",
"src/HealthApp.Contracts/ObservationFacades.cs": "2dac8fcc37f55556ccc9272275454e498755bbbdfb799dcfda60f640dc82ff25",
"src/HealthApp.Contracts/PatchObservationRequest.cs": "5f212133cbd6b4b8408bcc57255c6439d7b272c82768902b985c088f9a8344e1",
"src/HealthApp.Contracts/PatientDto.cs": "391a3cb88505aee002b001ff8bba534d508626d9038cd9600ae088bd2f62e178",
"src/HealthApp.Contracts/RecordObservationRequest.cs": "85008ac86b29ec4d7b24abff8b8f15adad4e3b24d6a92023789a969bc49ecc37",
"src/HealthApp.Contracts/TrendAssessment.cs": "5525c317690091ffd62292a64b5efaa269f3a53276353ab7e0d99374d782888f",
"src/HealthApp.Contracts/UpdateObservationRequest.cs": "f873acbc47ae7660aed06b83552a28ee4c38f805451cadfebf0d2b91de73bfbd",
"src/HealthApp.Contracts/UpdatePatientRequest.cs": "a6ac1c72ecac6290f22fd065a91c6adc795c4d6f1e33d6d27be41a0ff0cee713",
"src/HealthApp.Infrastructure/HealthApp.Infrastructure.csproj": "0928f24c1d6ba2a34c882e089de26f55f35858f7edf15afacf30a416afeb70da",
"src/HealthApp.Infrastructure/RequestTransaction.cs": "e6a85512c1bdfe7fc5381f954cbe8b6740501207e6ad24ba705db766faca7994",
"src/Modules/Analytics/Analytics.csproj": "6b98f81ea2730f93d778d9e544faf85a4219dc596cb30caaa13253acb9217d5e",
"src/Modules/Analytics/AnalyticsFacade.cs": "45f75df083cf0bbf9d75d45b297a8ff218a0de71c6e78def833b658ba4f67e57",
"src/Modules/Analytics/AssemblyInfo.cs": "ebce47e2dbe8b618bf608f974211697db2f9ed4cdb74d2fefaeb9342f19d2978",
"src/Modules/Analytics/ClinicalPolicy.cs": "0579e379d9a314edfdab4bdeac6ebe230401046f835100052d9c574fda3cf040",
"src/Modules/Analytics/SummaryPolicy.cs": "b6720517c4487022bb90ea35ac3c5c393e6925812722e06ab1d2af58d0fc2562",
"src/Modules/Analytics/TrendPolicy.cs": "b38fffa1e9410c961d9f033f499f957ec35b8c873aad693b0e4a93991ba39e5f",
"src/Modules/Guidance/Guidance.csproj": "861ea2e0a59fcdb91ca297e2743c569b8154898a3f21fda9c764debc63fcfa41",
"src/Modules/Guidance/GuidanceQueries.cs": "de16f581d9924a7aaf39761158dfde7ccc95070eeb3861ebcc63d0c952a8bb17",
"src/Modules/Guidance/ReviewedReferenceCatalog.cs": "d8527b459c7ad0f3856afb91cb25587299927c8e4bdcbcb0b14679a0d93794e9",
"src/Modules/Observations/AssemblyInfo.cs": "ebce47e2dbe8b618bf608f974211697db2f9ed4cdb74d2fefaeb9342f19d2978",
"src/Modules/Observations/Domain/BloodPressureObservation.cs": "5147ce1785f754359a6b23529ca02db40266768ae1c4d4ba86fd47dde0fea8da",
"src/Modules/Observations/Migrations/001-observations.sql": "f0b77fe9d3e374557cc2c1edca7dcfdb388a8fa9454dbe69e50a1e6ce4651817",
"src/Modules/Observations/ObservationFacade.cs": "3adfb1de8f9ba8d0b8bc562cf9b766f1ef270039a341f9e7cafc3208f1edeb85",
"src/Modules/Observations/Observations.csproj": "6b98f81ea2730f93d778d9e544faf85a4219dc596cb30caaa13253acb9217d5e",
"src/Modules/Observations/Persistence/ObservationDbContext.cs": "a3d01ed387b343767121c2a8b911fe2dbfd4da5ad1cde0692b585c901fc81155",
"src/Modules/Overview/Overview.csproj": "861ea2e0a59fcdb91ca297e2743c569b8154898a3f21fda9c764debc63fcfa41",
"src/Modules/Overview/OverviewFacade.cs": "69925884c4d8e487408b446496e3e243032e51e27704981ea89ac821731bcbb2",
"src/Modules/Profile/AssemblyInfo.cs": "ebce47e2dbe8b618bf608f974211697db2f9ed4cdb74d2fefaeb9342f19d2978",
"src/Modules/Profile/Domain/Patient.cs": "0aceabc7e269ff3f00a617987790cd71ae5ac7716751fc6a82224fe1ddef737d",
"src/Modules/Profile/Migrations/001-profile.sql": "fc2cac4c965d2a1e28f3a837bbce78b889ac65d56468e52524cb14b672662660",
"src/Modules/Profile/Persistence/PatientDbContext.cs": "5919d5faa0f223650d4ec16a6c3c5a54458cfdf70e2b4a7efa2d6cc21c76a690",
"src/Modules/Profile/Profile.csproj": "6b98f81ea2730f93d778d9e544faf85a4219dc596cb30caaa13253acb9217d5e",
"src/Modules/Profile/ProfileFacade.cs": "c3d46a921f1861abbc77f60cef1f34cda7e82fe83ef64ff8c628859ebe5330c3",
"src/TRENDS.md": "7b987403073ad4d4894287c7cac7fc542d6251e7241445d559e9c24ec27cf809",
"deploy/HealthApp.Provisioning/HealthApp.Provisioning.csproj": "23ee60031a40d85fdfd7d9af08b316012daf399f9f5788c7bd6a9078c12a32bc",
"deploy/HealthApp.Provisioning/Installation.cs": "14e0f6fc539f1796cde395cdca112d36062810e54e638e20681f4eaaf3f76a34",
"deploy/HealthApp.Provisioning/Program.cs": "1f7c6493b4916d3887a1b6f59625685c5e6904def311a0a98c3112791d3b40a9",
"deploy/INSTALLATION.md": "43e381629f4591c49853da91e8c43454b9068836c637a9c2652022b3d4c71391",
"deploy/appsettings.example.json": "63352e440f873cbe2414f459eaed39ede2f6343ef694643671a660993af5c815",
"deploy/build-release.sh": "62ce01b4cf1dbf97db2346a24617e219f7c2803afb2e3ce6a03509acfab1b117",
"deploy/installer/bootstrap.sh": "ff77323066e0e08bb1aeb059da69a8da1aa9414d5eeb93db37fd3f195c8656a1",
"deploy/installer/install.sh": "d1ecf7f7aba14744422891ebd622a0bd6462e8f067851ee599e5ac824d0b56df",
"deploy/systemd/healthapp-b.service": "41dcdfa953d35710367fe84c3c43cba2bf72ced681c989eede9de12fe4b18adc",
"tests/HealthApp.AcceptanceTests/AuthenticationIntegrationTests.cs": "e7af7779d24981f86d82c1fb7fa2bc3c9cc78d0c36a48cb9e67e3f691d1bbe44",
"tests/HealthApp.AcceptanceTests/ConformanceTests.cs": "3823f83f25e1cca1f06c27485e166504fe443c1feb17b0655a5b7cbf65c5f699",
"tests/HealthApp.AcceptanceTests/ContextFilteredHistoryTests.cs": "3eadcb8473e0cd1f0df6a367dc490798ac551bb2ffa4af82b53c9981624c8db9",
"tests/HealthApp.AcceptanceTests/ContextSelectedInsightTests.cs": "ff67d93991202661155b1676ee19b3258cd15c510aaddd940f81ee2e3c8a9229",
"tests/HealthApp.AcceptanceTests/CreatePatientTests.cs": "8fffa446a01959731289799fa1e14ffb25248915089ad1b3b9f25fb687fded52",
"tests/HealthApp.AcceptanceTests/DeleteContextualisedObservationTests.cs": "1c3bbfab934d41428001b6d1d181cf7f08c90eb99ebcc9933ba48c334299c0d7",
"tests/HealthApp.AcceptanceTests/DeleteObservationTests.cs": "a3eaaf6bf14fe18e07f6e75fc0b414d906b37d1ba636e231d8218a58027b38fe",
"tests/HealthApp.AcceptanceTests/FoundationTests.cs": "71df3c6ef3bdc165a717d0e4cd0af024dfe4e55b5adb5eeda1fc41c24725d897",
"tests/HealthApp.AcceptanceTests/GlobalUsings.cs": "48b09638b804452944adcd5e70c9381670b6af24fdc681b7532624e6dfdc15b5",
"tests/HealthApp.AcceptanceTests/HealthApp.AcceptanceTests.csproj": "15c8581595bb7c477c528f7b2a6c7671491a11f526e260c78efbbe3eb5dbc20f",
"tests/HealthApp.AcceptanceTests/HealthInsightTests.cs": "aa1f3ec51f1072b6c165517b9510149666449c494ea8527b66fc95e047be7815",
"tests/HealthApp.AcceptanceTests/HealthOverviewTests.cs": "df772f0d79b8ec7331b113d1d43b15e23e137dfa05c138bbbbe97f69d48e87b9",
"tests/HealthApp.AcceptanceTests/HealthTrendTests.cs": "cb9f62039ff099551e20ae75969a9eb5d7c4f96a9d702033e319c719ce982e09",
"tests/HealthApp.AcceptanceTests/LatestObservationTests.cs": "9d815836f94d74a85c6764d23a4f7ef7b840290af18be88918bd39ac01223c7e",
"tests/HealthApp.AcceptanceTests/MeasurementContextMigrationTests.cs": "d401a2c9ace967412cc55b3f482333e6d521739b59cf1f8efba8273a11209be9",
"tests/HealthApp.AcceptanceTests/MeasurementGuidanceTests.cs": "80e527e632891f63e54288ba1d420beec7f2cdff08e03f0558cb76f5687bd2b2",
"tests/HealthApp.AcceptanceTests/ObservationApiFixture.cs": "c61f837d0a930027bede1e67d4792d9e7d7e408466e18fab8a7b726175685ca4",
"tests/HealthApp.AcceptanceTests/ObservationConcurrencyTests.cs": "09d516babae8ef2685babb1a5f16019d033ac1dcdfebc7c12f4d6201bc622f62",
"tests/HealthApp.AcceptanceTests/ObservationHistoryTests.cs": "73e11a578e9a9e34489cdf38840692e239c5013e0903f14852524236828e3d70",
"tests/HealthApp.AcceptanceTests/OperationalTests.cs": "799e0c1c1b18d51efac2e6ff16c0ee68b10594dfeb1dd5376e4f1481d481aff7",
"tests/HealthApp.AcceptanceTests/PatchObservationTests.cs": "a4096b2d3c5046b948e96dc79e40c302c46c8e64704e2f77069fb8ea984e6d48",
"tests/HealthApp.AcceptanceTests/PatientApiFixture.cs": "665d2b1955dd3c03a5d11330bd9dafae3942cfde1f4e9d413c5dbd4b970b3e2d",
"tests/HealthApp.AcceptanceTests/PatientAuthenticationTests.cs": "b6130edc59e800312b9a8e4a2f3b084c36fe4230b36a9e8ee9159791c1ecdf30",
"tests/HealthApp.AcceptanceTests/ProfessionalAccessTests.cs": "9fbeff0cc2a02cbb2587f9f9bec08dc6e623b3d59a833f8be7d5e7823807d743",
"tests/HealthApp.AcceptanceTests/ProfileLifecycleTests.cs": "3f00b214300a44930ba5707b52cdd7f2f335b155cf131ccb65ef2b4baa4ad647",
"tests/HealthApp.AcceptanceTests/RecordMeasurementContextTests.cs": "bde451e9aee2a9097f0bd41622f967e2b8fccc3db5809c29d261995114931165",
"tests/HealthApp.AcceptanceTests/RecordObservationTests.cs": "1cd5f551712a4f592dadbe2cbf772c9f1fdb7953d938971771af74c0760be90f",
"tests/HealthApp.AcceptanceTests/SnapshotTests.cs": "287e96f3ec808dbc9831a17243660fd611251521939a2f1f42d46f076810db1c",
"tests/HealthApp.AcceptanceTests/Support/AuthenticatedTestClient.cs": "be81a81d5264ac8b06ec4ccf66b8d9653c3249c0f5db2abd894e035c6a0d4c97",
"tests/HealthApp.AcceptanceTests/UpdateObservationTests.cs": "7ff2a356e9ac385237a9043d56659ba3ae819c6710e1aaa4f5945a243ac1a736",
"tests/HealthApp.AcceptanceTests/UpdatePatientTests.cs": "a5f3765146a0a28fbb26ee08caceec7722358dec01659399736b227653fdab10",
"tests/HealthApp.AcceptanceTests/ViewObservationContextTests.cs": "e356b4b34c078edf3902cb38796ac4ac6597eca026a423b16e7e754bfaf5e104",
"tests/HealthApp.DeploymentTests/HealthApp.DeploymentTests.csproj": "4f5ff1a801773f09dc10a37e1a4ef55096ec2a5c3823976a08643bf5a7ed5330",
"tests/HealthApp.DeploymentTests/ProvisioningTests.cs": "ebc5d2247693863f05122bb15255d82bdcc56267cd4573b6c0c5cc766831eef8",
"tools/comparison/dataset.json": "240b2d19292dcc6178a94e7c60bb4e0a6f3df9441abf147ea10308b19fcf5686",
"tools/comparison/initialize.py": "b45ba8defb1cf1ddeb290b34c123fbf30a37db8b2180c9b0f7877ca99c76faf4",
"tools/native-install-test/Dockerfile": "1420907951a8b74dca7fb55483d9f9a554d84e203f6f7f3c565580e0e4aba952",
"tools/native-install-test/README.md": "7e3f15bfb3873924818f6e503aca2be3eea68e2230c15fb55ac3ae655840a080",
"tools/native-install-test/local.py": "326ba644a9867226f7111fce7ea07475a8871a74fe96bb67a89b1f74f72f3cf1",
"tools/native-install-test/remote.py": "d56114b60eb4f62558ee82f65c49246240861631de0f8cedce714db7726e24f1",
"tools/run-disposable-tests.py": "7b43367af34772e1bd2c8ea6d86bf434822547d7e5e7af591d7465072165fe51"
},
"publishedBundleSha256": {
"INSTALLATION.md": "43e381629f4591c49853da91e8c43454b9068836c637a9c2652022b3d4c71391",
"app/Analytics.dll": "9ba3dcc112fecf1ff8a87d4aa0e48d9815811f8d5fa562119743fa96c4b1c144",
"app/Analytics.pdb": "9ae30993b4df39772fc069dc6347d7b4ab06e7e4e7bdb4ce7473976bd4828986",
"app/Guidance.dll": "adbe0085ee522d9aaf3a507c3151a4dfdd567818489884f4cb206afdf63b8cca",
"app/Guidance.pdb": "15f79f862123d686c0df0ef836a3ddd02de8bbbff30f5f47f810bca98a959949",
"app/HealthApp": "dc854c961a474ae8e6d00a2953f23952c34359b0ec2a3b1b7cebc833b29df1f0",
"app/HealthApp.Contracts.dll": "c653b5650c4b5785a8c0d4bfeefd7964f0e7543d0d0fbbb737e16757455159ea",
"app/HealthApp.Contracts.pdb": "09a4ae52a7c220e653c010c57bed4fbbb749f9d1ee56fd6c9df40c8ea24ad5b2",
"app/HealthApp.Infrastructure.dll": "df72ab62d595aef3ef28fbe0a65810980ce10ed26b4e731e66a98ab4ff63c918",
"app/HealthApp.Infrastructure.pdb": "782286cb66b8650e64c1f2674636df5858038eb95ae866d8e716436e53e69a16",
"app/HealthApp.deps.json": "4374d4c98e7f7676910f95268c2092c45af2759fcb68063f00c3f618c33aa97d",
"app/HealthApp.dll": "a81dab8f6ab9e692af7bd1773604672da5cad93f817e65e76c29901efc0239a8",
"app/HealthApp.pdb": "0182041f06a453e72fdf8dfad475606a0acd5b54b7041985981363ed22ddab07",
"app/HealthApp.runtimeconfig.json": "eff38a9750f7cca2407b1d639a963d56ffea92088e6da971bbbfa74e3dcd7224",
"app/HealthApp.staticwebassets.endpoints.json": "c1686417e8d5c31bba969f12b6f3d2b35e6609adb5ca42f212261a3a02771aac",
"app/Microsoft.EntityFrameworkCore.Abstractions.dll": "74bc17c936d66ea090b6a5b4cc4307d2154c9692e57edd4c55d68dd4a99c11b6",
"app/Microsoft.EntityFrameworkCore.Relational.dll": "a1e4f36208650b15b75a4b01a5821d61d5be417ac2e86ec3c65e2560a87e0d7d",
"app/Microsoft.EntityFrameworkCore.dll": "f5b1703d608e241314952b2ede8dcdd1b8d8adda8c91a13cb7e6b1007414cef4",
"app/Npgsql.EntityFrameworkCore.PostgreSQL.dll": "94fcf66e8e953fdb02c40c72ca89821dd5eed5324d4c0f12a7219ea8cd3d5a5e",
"app/Npgsql.dll": "e2bcafe1660fe4543fe9dfcabed972ec8d32259e5ea8009462ce1de23c7034c2",
"app/Observations.dll": "66fb464bbb8a881aad7305a5d0f386e6a033de58c2e53bc32cce3634f279d62b",
"app/Observations.pdb": "2a43670ee91c8f441d5cd08e53a687bfad648f6f78bec6e51df2babaac274f83",
"app/Overview.dll": "a4cad3efd6a06234869b315c3dbe18000b286318b602f50f573c710a2a2250a1",
"app/Overview.pdb": "74480ee95fdc9e7196097f88392f1d4f0338523483fd1bb3acd04c4a14445764",
"app/Profile.dll": "420c55582b28ba3e9af272db40901844c8022beccf66fa7fc64ea527918c8d7d",
"app/Profile.pdb": "b1db8ff0bab13b4ed7dcfca3867604f8eb42bd9981934b85766271abbf05ea24",
"app/web.config": "aab3b9908e70dcec7c084d99e2a03759183731a781f17f7c8d0971ea1fa27f76",
"bootstrap.sh": "ff77323066e0e08bb1aeb059da69a8da1aa9414d5eeb93db37fd3f195c8656a1",
"healthapp-b.service": "41dcdfa953d35710367fe84c3c43cba2bf72ced681c989eede9de12fe4b18adc",
"install.sh": "d1ecf7f7aba14744422891ebd622a0bd6462e8f067851ee599e5ac824d0b56df",
"migrations/Observations/001-observations.sql": "f0b77fe9d3e374557cc2c1edca7dcfdb388a8fa9454dbe69e50a1e6ce4651817",
"migrations/Profile/001-profile.sql": "fc2cac4c965d2a1e28f3a837bbce78b889ac65d56468e52524cb14b672662660",
"provisioner/HealthApp.Provisioning": "b14ae66e100af269d58de56f715576969f47b1bc800162f10b8be7ee60f9cdfe",
"provisioner/HealthApp.Provisioning.deps.json": "a9d67943244c2cfb7c597e2f9c9ad403d3950c12ecd80194d501af2382b25479",
"provisioner/HealthApp.Provisioning.dll": "bb45d13e9264b859605c72d354b2da87655f73ed032b0bd42442d059a4757700",
"provisioner/HealthApp.Provisioning.pdb": "cb0170760d28f2332e37ac72cb91fdef70f32566354a1f43904d7b60f9e5ed81",
"provisioner/HealthApp.Provisioning.runtimeconfig.json": "f8bd1713a3691d58eb332a71675f129385b91e852b66e7b6761cae1f34d4efd2",
"provisioner/Npgsql.dll": "e2bcafe1660fe4543fe9dfcabed972ec8d32259e5ea8009462ce1de23c7034c2"
},
"limits": [
"Other intended distributions not natively verified",
"Independent clinical validity not established; outputs preserved under Q3",
"Native Linux environments isolated/containerized, not measurement-host evidence",
"No A import or energy measurement"
]
}
@@ -0,0 +1,11 @@
{
"environment": "PRETTY_NAME=\"Debian GNU/Linux 12 (bookworm)\"\nNAME=\"Debian GNU/Linux\"\nVERSION_ID=\"12\"\nVERSION=\"12 (bookworm)\"\nVERSION_CODENAME=bookworm\nID=debian\nHOME_URL=\"https://www.debian.org/\"\nSUPPORT_URL=\"https://www.debian.org/support\"\nBUG_REPORT_URL=\"https://bugs.debian.org/\"\n",
"runtime": "Microsoft.AspNetCore.App 10.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]\nMicrosoft.NETCore.App 10.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]\n",
"database": "PostgreSQL 18.6 separate container/host namespace; TLS certificate SAN b-database",
"sslMode": "VerifyFull",
"wrongHostnameRejected": true,
"localPostgresInstalled": false,
"result": "passed",
"runtimeConfigMode": "640 root healthapp-b",
"isolation": "Separate disposable systemd app and TLS DB containers; no Architecture A database access; not measurement-host evidence"
}
@@ -0,0 +1,10 @@
{
"environment": "PRETTY_NAME=\"Debian GNU/Linux 12 (bookworm)\"\nNAME=\"Debian GNU/Linux\"\nVERSION_ID=\"12\"\nVERSION=\"12 (bookworm)\"\nVERSION_CODENAME=bookworm\nID=debian\nHOME_URL=\"https://www.debian.org/\"\nSUPPORT_URL=\"https://www.debian.org/support\"\nBUG_REPORT_URL=\"https://bugs.debian.org/\"\n",
"runtime": "Microsoft.AspNetCore.App 10.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]\nMicrosoft.NETCore.App 10.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]\n",
"applicationPID": "3282",
"databaseStatus": "/var/run/postgresql:5432 - accepting connections",
"result": "passed",
"overwriteRejected": true,
"runtimeConfigMode": "640 root healthapp-b",
"isolation": "Disposable privileged systemd Linux container; native installer/unit/services executed; not physical-host or measurement evidence"
}
+7 -1
View File
@@ -1,6 +1,6 @@
# Functional preservation and verification plan # Functional preservation and verification plan
Prepared 2026-10-14. **Architecture A baseline: 299 automated cases passed in the B-local reference. Architecture B behaviour remains not verified until its adapted tests run.** This establishes reference evidence, not clinical validation. This register is a preservation plan. [Acceptance register](acceptance-register.md) carries all 146 common/US-01–US-15 criterion IDs/outcomes from the target traceability table; outline cases are retained. During implementation map each entry to exact executable test methods, expanded examples and results. Prepared 2026-10-14. **Architecture A baseline: 299 automated cases passed. Architecture B final solution: 283 cases passed, no failures/skips, plus actual native local/remote installation evidence.** This establishes reference evidence, not clinical validation. This register records the implemented preservation and its verification limits. [Acceptance register](acceptance-register.md) carries all 146 common/US-01–US-15 criterion IDs/outcomes from the target traceability table; outline cases are retained. Each entry now links concrete executed methods; theory expansions are recorded in TRX.
| Requirement | Original suites / evidence | Preserve and verify | | Requirement | Original suites / evidence | Preserve and verify |
| --- | --- | --- | | --- | --- | --- |
@@ -39,3 +39,9 @@ Run isolated baseline reference tests first after SDK/DB provisioning, then affe
Clinical reference/content review is separate from numerical/API tests; a passing string assertion does not prove clinical support. Existing sources/review dates are provenance, not a new review performed here. Finite conflict detection does not prove arbitrary text comprehension. Seek approval before necessary clinical classification changes. No source behavioural mismatch is silently accepted over authoritative requirements. Clinical reference/content review is separate from numerical/API tests; a passing string assertion does not prove clinical support. Existing sources/review dates are provenance, not a new review performed here. Finite conflict detection does not prove arbitrary text comprehension. Seek approval before necessary clinical classification changes. No source behavioural mismatch is silently accepted over authoritative requirements.
Final outcome classifications: **verified** (executed supporting checks and criterion assertions), **partially verified** (some evidence but explicit gaps, such as native/clinical review), **not verified** (unexecuted/no adequate evidence). No current test-pass, deployment-pass, strict-equivalence or energy-efficiency claim. Final outcome classifications: **verified** (executed supporting checks and criterion assertions), **partially verified** (some evidence but explicit gaps, such as native/clinical review), **not verified** (unexecuted/no adequate evidence). No current test-pass, deployment-pass, strict-equivalence or energy-efficiency claim.
## Final outcomes
Release build/publish passed without warnings/errors. Functional/conformance suite: 276 passed; provisioning/adapter suite: 7 passed. Original source assertions remain, with architecture-dependent fixture/status replacements precisely recorded in test-adaptations.md. Both native Debian 12 local and verified-TLS remote placements passed representative workflows and independent app restart. Final command/artifact/hash evidence is in evidence/final-verification.json.
All 146 common/US-01–US-15 entries have concrete method mappings: 140 verified functional entries and 6 partially verified entries whose deterministic outputs/provenance pass but independent clinical support is not established. This distinction implements Q3; no clinical classification was silently disabled or changed. General narrative understanding, universal platform support, production/clinical certification, live historical import and strict byte-for-byte response equivalence are not claimed. Revised US-16 is verified at its approved app/database granularity on the identified native environment.
+10
View File
@@ -47,3 +47,13 @@ Overview composes typed Profile, Observation and Analytics queries; profile/late
### Stage 6 checkpoint — passed ### Stage 6 checkpoint — passed
Bounded pooled DB source, configurable health/assessment admission and deadlines, cancellation/rollback, release-before-result filter, sanitized dependency errors/no-store, authenticated liveness/readiness and fail-closed remote VerifyFull requirement. Deterministic locked-write deadline leaves profile unchanged; exhausted assessment budget returns 503+Retry-After while public guidance works; DB outage readiness is 503 while guidance/login remain usable. Restored original replacement-handler same-normalized-identity own/other assertions using real B profiles rather than obsolete HTTP stub. Fresh-schema context-default test retains all original value/text/Unknown assertions, with explicit synthetic associated patient for FK and no live migration. Module conformance checks pass. 276/276 tests passed; zero warnings/errors. Stage 5 commit `cc7f871`. Native deployment verification remains pending. Bounded pooled DB source, configurable health/assessment admission and deadlines, cancellation/rollback, release-before-result filter, sanitized dependency errors/no-store, authenticated liveness/readiness and fail-closed remote VerifyFull requirement. Deterministic locked-write deadline leaves profile unchanged; exhausted assessment budget returns 503+Retry-After while public guidance works; DB outage readiness is 503 while guidance/login remain usable. Restored original replacement-handler same-normalized-identity own/other assertions using real B profiles rather than obsolete HTTP stub. Fresh-schema context-default test retains all original value/text/Unknown assertions, with explicit synthetic associated patient for FK and no live migration. Module conformance checks pass. 276/276 tests passed; zero warnings/errors. Stage 5 commit `cc7f871`. Native deployment verification remains pending.
### Stage 7 — portable installer checkpoint
Independent release app/provisioner/schema scripts and native systemd unit. APT/DNF/pacman adapters, local/remote persistence separation, generated protected accounts/certificates/config/keys, separate NOLOGIN migration owners and DML runtime role, explicit native lifecycle verification and no-overwrite. Tested actual Debian 12 systemd local and separate verified-TLS PostgreSQL deployment, wrong-host rejection and absence of local PostgreSQL in remote mode. Runtime 10.0.13, local PG 15.19 / remote PG 18.6; test container environments are not measurement/physical-host evidence. 283 solution tests pass (276 functional/conformance; 7 provisioning/adapter), zero warnings/errors. Final audit strengthens database constraints, records ticket issue instant, scoped local SCRAM authentication and source/content provenance; final verification follows. Stage 6 commit `f451b55`.
### Stage 8 — concluding verification
Final Release build: zero warnings/errors; final solution suites: 283 passed, 0 failed/skipped. Independent final release published to `/tmp/healthapp-b-final-release`. Both actual native Debian 12 local/remote installations passed with final scoped SCRAM provisioning, protected runtime config mode `640 root healthapp-b`, app/DB independent stop/restart, no-overwrite rejection, VerifyFull/wrong hostname rejection and no local PostgreSQL in remote mode. Native evidence summaries and reproducible test harnesses retained.
All 146 acceptance entries link concrete executable methods; clinical support is explicitly partial for six entries while deterministic output/provenance assertions pass. No unapproved architecture, numerical or clinical-output deviation. No A data access/import. Read-only input/instruction SHA-256 checks passed, all 142 pinned reference files equal original source, original Git HEAD/status unchanged. Formatting applied only to newly implemented B projects; originals preserved. Added exact single-observation extrema assertions, without relaxing originals. Final package/source/test evidence recorded in final-verification.json; source code revision recorded after commit.
+6 -2
View File
@@ -37,7 +37,7 @@ The original solution has five `net10.0` ASP.NET Core applications, a transient
| Context | EF owned value already flattened into observation row | Reuse fields, unknown/null/omission semantics; no separate context entity or inference | | Context | EF owned value already flattened into observation row | Reuse fields, unknown/null/omission semantics; no separate context entity or inference |
| Writes | EF patch loads/saves row without explicit row locking; deletes by observation ID | Transaction with actual-owner recheck and row lock; validate proposed changes atomically; preserve concurrent disjoint patches | | Writes | EF patch loads/saves row without explicit row locking; deletes by observation ID | Transaction with actual-owner recheck and row lock; validate proposed changes atomically; preserve concurrent disjoint patches |
| Reads | Independently timed ownership and source reads; overview sequential HTTP composition | Shared repeatable-read snapshot from ownership lookup through capture; release before calculation and transmission | | Reads | Independently timed ownership and source reads; overview sequential HTTP composition | Shared repeatable-read snapshot from ownership lookup through capture; release before calculation and transmission |
| Ordering/time | Latest measurement/creation/UUID; history measurement/UUID; UTC clock encoding in timestamp without timezone | Preserve UTC encoding/wire behaviour; verify PostgreSQL unsigned UUID-byte ordering explicitly, rather than substitute .NET Guid ordering | | Ordering/time | Latest measurement/creation/UUID; history measurement/UUID; UTC clock encoding in timestamp without timezone | Preserve UTC encoding/wire behaviour; verify PostgreSQL unsigned UUID-byte ordering explicitly, rather than sort raw platform-endian GUID bytes |
| Analytics | Fresh summaries/trends; compiled combined numerical/context/clinical implementation | Reuse numerical formulas; separate SummaryPolicy, TrendPolicy, ClinicalPolicy and reference catalog; no result store/cache | | Analytics | Fresh summaries/trends; compiled combined numerical/context/clinical implementation | Reuse numerical formulas; separate SummaryPolicy, TrendPolicy, ClinicalPolicy and reference catalog; no result store/cache |
| Guidance | Static home guidance in gateway controller; clinic/other explained unavailable | Move existing content to versioned Guidance-owned bundle/catalog; preserve applicability and public availability during DB outages | | Guidance | Static home guidance in gateway controller; clinic/other explained unavailable | Move existing content to versioned Guidance-owned bundle/catalog; preserve applicability and public availability during DB outages |
| Resources/failures | No shared bounded request policy; upstream HTTP failures 502/504 | Shared bounded pool, configurable admission/deadline/cancellation; 503 dependency/overload, 504 deadline, 500 unexpected failure | | Resources/failures | No shared bounded request policy; upstream HTTP failures 502/504 | Shared bounded pool, configurable admission/deadline/cancellation; 503 dependency/overload, 504 deadline, 500 unexpected failure |
@@ -89,7 +89,7 @@ Clinical catalog extraction must preserve existing source URLs/review metadata a
Fresh installation: one dedicated PostgreSQL database; `profile.patient` and `observations.observation` (physical name aligned with proposal). Preserve public identifiers and values regardless of table rename. Account association unique, non-null and immutable via module commands. Restricted patient FK; flattened context; positive numerical/category/rest checks and required timestamps. Profile owner creates only Profile objects; Observation owner creates only Observation objects, with the narrowly necessary REFERENCES grant. Runtime role has needed SELECT/INSERT/UPDATE and Observation DELETE, schema USAGE, no DDL/admin/role membership. Module migration histories stay owned separately. No generated insight/trend/overview tables. Runtime never invokes migrations. Fresh installation: one dedicated PostgreSQL database; `profile.patient` and `observations.observation` (physical name aligned with proposal). Preserve public identifiers and values regardless of table rename. Account association unique, non-null and immutable via module commands. Restricted patient FK; flattened context; positive numerical/category/rest checks and required timestamps. Profile owner creates only Profile objects; Observation owner creates only Observation objects, with the narrowly necessary REFERENCES grant. Runtime role has needed SELECT/INSERT/UPDATE and Observation DELETE, schema USAGE, no DDL/admin/role membership. Module migration histories stay owned separately. No generated insight/trend/overview tables. Runtime never invokes migrations.
Keep legacy UTC-clock timestamp encoding if needed for byte-compatible public timestamps; normalize all input instants consistently. Document UUID network-byte tie order and test IDs whose .NET Guid comparison order differs. Retain existing decimal means and optional rest-duration unit (minutes). Keep legacy UTC-clock timestamp encoding if needed for byte-compatible public timestamps; normalize all input instants consistently. Document UUID network-byte tie order and test fixed UUIDs that distinguish network-byte ordering from little-endian byte-array sorting. Retain existing decimal means and optional rest-duration unit (minutes).
Approved Q4 scope is independently provisioned fresh B databases and equivalent reproducible synthetic datasets, **no import or live migration required or authorized**. A future migration procedure remains documentation only. No source database access or source repository mutation is authorized. If import is required, add an offline administrative import step from administrator-provided snapshots, with separate approval of dataset and account mappings. Preflight missing/duplicate accounts, orphan observations, unsupported categories/non-positive values and timestamp interpretation; reject ambiguous input without silently discarding/reassigning data. Preserve IDs, account IDs, original/update/measurement instants, raw values, complete/partial/unknown context, text/notes and predefined assignments. Validate counts and fields against snapshots. Retain source snapshots and take backups; never run an automatic destructive conversion in place. Approved Q4 scope is independently provisioned fresh B databases and equivalent reproducible synthetic datasets, **no import or live migration required or authorized**. A future migration procedure remains documentation only. No source database access or source repository mutation is authorized. If import is required, add an offline administrative import step from administrator-provided snapshots, with separate approval of dataset and account mappings. Preflight missing/duplicate accounts, orphan observations, unsupported categories/non-positive values and timestamp interpretation; reject ambiguous input without silently discarding/reassigning data. Preserve IDs, account IDs, original/update/measurement instants, raw values, complete/partial/unknown context, text/notes and predefined assignments. Validate counts and fields against snapshots. Retain source snapshots and take backups; never run an automatic destructive conversion in place.
@@ -138,3 +138,7 @@ Main risks: combined process/role blast radius; shared connection/EF transaction
Mitigation is explicit ownership and transaction tests, unchanged functional assertion intent, import preflight/no live conversion, preserved formulas/content provenance, focused review before any changed classification, native verification and candid limits. No workload/HA/backup SLA is invented. No energy-efficiency benefit is claimed. Mitigation is explicit ownership and transaction tests, unchanged functional assertion intent, import preflight/no live conversion, preserved formulas/content provenance, focused review before any changed classification, native verification and candid limits. No workload/HA/backup SLA is invented. No energy-efficiency benefit is claimed.
Approval received: Q1 revised US-16/dependency errors; Q2 preserved instruction files; Q3 unchanged mathematics, thresholds and clinical outputs with uncertainty disclosure; Q4 fresh provisioning only; Q5 portable distribution-aware Linux installer and actual native verification. See [approval register](open-questions.md). Further approval is required only for material actions outside these boundaries. Approval received: Q1 revised US-16/dependency errors; Q2 preserved instruction files; Q3 unchanged mathematics, thresholds and clinical outputs with uncertainty disclosure; Q4 fresh provisioning only; Q5 portable distribution-aware Linux installer and actual native verification. See [approval register](open-questions.md). Further approval is required only for material actions outside these boundaries.
## Execution outcome — 2026-10-14
Approved stages 0–8 implemented and engineering verification completed. Baseline 299/299 tests; B 283/283 tests; Release build/publish clean; actual native Debian 12 systemd local/remote installation and independent restart passed. All 146 acceptance entries mapped to concrete executed methods; six retain explicitly partial independent clinical support under Q3. Other intended distributions have adapter tests but no native execution claim. No unapproved deviation, A database access/import, source/input/instruction mutation, or energy-efficiency claim. See final-verification.json and the conformance/equivalence registers for exact evidence and limits.
+14
View File
@@ -0,0 +1,14 @@
# Verification environments versus measurement environment
No energy measurements were performed. Test/deployment execution establishes engineering evidence only.
| Run | Recorded environment |
| --- | --- |
| Architecture A pinned baseline | B-local reference, SDK 10.0.100 / runtime 10.0.0, fresh disposable PostgreSQL 18.6, Manjaro x86_64 host |
| Architecture B automated suites | Same SDK/runtime and disposable PostgreSQL 18.6; original story fixtures adapted to one application/schema topology |
| Local native B installation | Debian 12 bookworm userspace with actual systemd, shared Manjaro kernel 7.1.13-2-MANJARO, .NET/ASP.NET 10.0.13 installed from feed, PostgreSQL 15.19 installed locally; isolated privileged Linux test container, no host data mounts |
| Remote native B installation | Separate Debian 12 systemd app environment and PostgreSQL 18.6 instance, verified TLS/hostname, .NET/ASP.NET 10.0.13; local PostgreSQL absent; wrong hostname rejected |
Native test environments are not physical-host or measurement-host evidence. A and B energy comparison must separately control hosting/kernel/runtime/database versions, equivalent data, workload/selection/account-role mix, assignments, HTTPS and token lifetime/login frequency, concurrency, active/idle periods and background processes. Runtime/DB differences above are disclosed and cannot be treated as a controlled energy comparison.
`tools/comparison/dataset.json` provides equivalent deterministic logical profile/measurement/context inputs. `initialize.py` initializes only fresh independently provisioned comparison instances through verified HTTPS and records dataset hash/assigned IDs. It is not an importer, was not run against Architecture A, and refuses an existing output manifest. Generated UUIDs and original recording times differ; measurement instants are distinct so those differences do not determine latest/trend outcomes in this dataset. Complete timestamp-tie behaviour is tested separately with fixed IDs/times. Larger workloads and assignment fixtures require explicit reproducible experiment setup. Secrets/keys never enter manifests.
+1 -1
View File
@@ -10,4 +10,4 @@ Approved with conditions 2026-10-14. Authority: [full approval](../Docs/Approval
| Q4 | Independently provision fresh B DB, schemas/roles/credentials/config automatically. No A database access, import or live migration. Equivalent reproducible logical datasets for comparisons | Approved | | Q4 | Independently provision fresh B DB, schemas/roles/credentials/config automatically. No A database access, import or live migration. Equivalent reproducible logical datasets for comparisons | Approved |
| Q5 | Portable systemd Linux installer with documented distribution-specific dependencies; local and verified-TLS/hostname remote PostgreSQL; no unnecessary local DB in remote mode. At least one actual identified native installation; intended versus verified support distinguished | Approved with modification | | Q5 | Portable systemd Linux installer with documented distribution-specific dependencies; local and verified-TLS/hostname remote PostgreSQL; no unnecessary local DB in remote mode. At least one actual identified native installation; intended versus verified support distinguished | Approved with modification |
No unresolved architectural decision currently blocks Stage 0. Execution prerequisites (SDK 10, isolated PostgreSQL and native systemd administrative environment) are being established. No universal Linux, clinical-validation, production-readiness or energy-saving claims are authorized. Further approval only for material architectural/functional/clinical deviations, algorithm replacements or live migrations. No unresolved architectural decision currently blocks Stage 0. Execution prerequisites are established: SDK 10.0.100, fresh disposable PostgreSQL, and isolated Debian 12 native systemd local/remote verification environments. Other native distribution executions and independent clinical validity remain evidence limits, not unresolved architecture choices. No universal Linux, clinical-validation, production-readiness or energy-saving claims are authorized. Further approval only for material architectural/functional/clinical deviations, algorithm replacements or live migrations.
+24 -31
View File
@@ -1,45 +1,38 @@
# HealthAppRepositoryB # Health App Architecture B
## Project Purpose Architecture B implements the approved modular monolith: one ASP.NET Core HTTPS application, typed Profile/Observations/Analytics/Overview/Guidance modules, and one PostgreSQL database with owned schemas. API/access enforces normalized patient/professional identity and actual resource ownership. Numerical calculations, clinical content and public REST/JSON semantics are preserved from the pinned Architecture A reference, with the approved US-16 and dependency-failure revisions.
HealthAppRepositoryB is part of a Master's thesis in IT investigating the use of Large Language Models (LLMs) for software architecture design and energy efficiency. Approval and implementation evidence are in [ImplementationPlan](ImplementationPlan/implementation-plan.md); the authoritative target remains [ArchitectureProposal](ArchitectureProposal/software-architecture.md). [Approval decisions](Docs/ApprovalRequirements/architecture-b-implementation-approval.md) include portable Linux installation. Input requirements/diagrams and the original repository remain unchanged. No frontend, identity server, background worker, broker or clinical-result store was introduced.
The research question is: ## Build and test
> To what extent can Large Language Models be used to identify and suggest changes to an existing software architecture that result in measurable improvements in the energy efficiency of the implemented system? Use the .NET 10 SDK selected by `global.json`:
## Project Objective ```bash
dotnet restore HealthApp.slnx
dotnet build HealthApp.slnx -c Release
TEST_POSTGRES_CONNECTION='Host=127.0.0.1;Database=postgres;Username=TEST_ADMIN;Password=YOUR_TEST_PASSWORD' \
dotnet test HealthApp.slnx -c Release
```
The purpose of this repository is to develop a software architecture for the Health App based on its documented functional requirements, domain concepts, and relevant constraints. Optional automatic disposable-server harness: `HEALTHAPP_DOTNET=/path/to/dotnet python3 tools/run-disposable-tests.py` (requires administrative Docker access for test infrastructure only).
An LLM-based architecture agent is tasked with evaluating architectural alternatives and designing an architecture that satisfies the application's requirements while considering energy efficiency as an important design objective. Use only a disposable test PostgreSQL server with create/drop database and role permissions. Fixtures create isolated databases and DML-only runtime roles, apply module schema scripts twice, exercise real Kestrel HTTP, and remove their own resources. Do not point tests at Architecture A or production databases. Framework/provider/EF/xUnit versions remain pinned; no algorithm replacement or technology migration is included.
The resulting architecture may resemble or differ from the original Health App architecture. Architectural decisions must be justified by their suitability rather than by novelty. The unchanged executable source/test baseline lives under [Reference/ArchitectureA](Reference/README.md), copied from `2117236366130775214d9fd2611984d4348f2b79`. It is excluded from the final B solution and preserves original architecture-specific tests. Never build/test in `../HealthAppRepository/`.
## Research Context ## Deploy and run
This repository represents the architecture-design work associated with the thesis. ```bash
bash deploy/build-release.sh --output NEW_RELEASE_DIRECTORY
# In the new bundle on a supported systemd Linux host:
sudo bash install.sh --host YOUR_DNS_OR_IP
```
The original Health App serves as the reference system. The proposed architecture will be evaluated for its feasibility and potential energy-related consequences, with the intention of supporting a later empirical comparison. The installer supplies dependencies, fresh database/roles/schemas, protected secrets/configuration, generated or supplied HTTPS certificate, persistent token keys, migrations and `healthapp-b.service`. It verifies representative operations and application stop/restart without stopping PostgreSQL. Remote database mode requires verified TLS/hostname and installs no local PostgreSQL. See [installation guide](deploy/INSTALLATION.md).
Energy-efficiency benefits suggested during architecture design are hypotheses, not established measurements. For an already provisioned B development database, supply external accounts/assignments, connection, key directory and HTTPS settings through `HEALTHAPP_CONFIGURATION_FILE=/absolute/protected/appsettings.json` or normal .NET configuration. [Configuration example](deploy/appsettings.example.json) is illustrative, not a prepared credential file. Production rejects plain HTTP. Use `dotnet run --project src/HealthApp -c Release`; the app never applies migrations itself.
## Repository Structure [Trend methods](src/TRENDS.md) describe unchanged formulas, timestamp ties, full-period direction/variation and clinical limits. [Conformance](ImplementationPlan/architecture-conformance.md), [functional verification](ImplementationPlan/functional-equivalence.md) and [test adaptations](ImplementationPlan/test-adaptations.md) distinguish executed evidence from limitations. Native Debian 12 systemd local/remote installation was exercised in isolated Linux environments; other distribution adapters are intended support with explicit prerequisites.
- `AGENT.md` — Instructions and constraints for the architecture-design agent. This repository remains part of the thesis research. Installation/testing is not an energy experiment or clinical certification. [Measurement context](ImplementationPlan/measurement-context.md) records environment differences and equivalent reproducible synthetic dataset setup. Clinical classifications are preserved for comparison; uncertain provenance is documented without asserting new clinical validity.
- `Docs/` — Functional requirements, domain information, existing design documentation, and relevant constraints.
- `ArchitectureProposal/` — Architecture specifications, editable Draw.io diagrams, architectural decisions, requirements traceability, and supporting documentation produced by the agent.
## Scope
The architecture-design work focuses on software architecture and system-level decisions, including component boundaries, communication, data management, persistence, deployment, and architectural patterns.
Code-level optimization, algorithm replacement, and LLM training or inference energy consumption are outside the research scope.
The architecture-design agent does not implement application code. Its responsibility is to produce a coherent, justified, and sufficiently detailed software architecture.
## Research Status
**Current phase:** Architecture design.
The repository preserves the documentation and agent instructions used as input to the architectural design process.
@@ -0,0 +1 @@
<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>net10.0</TargetFramework><OutputType>Exe</OutputType><Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings></PropertyGroup><ItemGroup><FrameworkReference Include="Microsoft.AspNetCore.App"/><PackageReference Include="Npgsql" Version="10.0.3"/></ItemGroup></Project>
@@ -0,0 +1,145 @@
using System.Diagnostics;
using System.Net;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text.Json;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Identity;
using Npgsql;
namespace HealthApp.Provisioning;
public sealed record Account(string AccountId, string Role, string Password);
public sealed record InstallationPlan(string Database, string RuntimeRole, string RuntimePassword, string ProfileOwner, string ObservationOwner, string Host, int Port, string CertificatePassword, List<Account> Accounts, Dictionary<string, string> Settings);
public static class Installation
{
private static readonly JsonSerializerOptions Json = new() { WriteIndented = true, PropertyNameCaseInsensitive = true };
private static string Secret() => Convert.ToHexString(RandomNumberGenerator.GetBytes(32));
private static string PathAt(string root, string path) => Path.Combine(root, path);
private static void PrivateFile(string path, string text) { File.WriteAllText(path, text); if (OperatingSystem.IsLinux()) File.SetUnixFileMode(path, UnixFileMode.UserRead | UnixFileMode.UserWrite); }
private static InstallationPlan Load(string directory) => JsonSerializer.Deserialize<InstallationPlan>(File.ReadAllText(Path.Combine(directory, "installation.json")), Json) ?? throw new InvalidOperationException();
public static void Prepare(string directory, string host, int port, string root, string? certificate, string? passwordFile, string? caFile)
{
if (Directory.Exists(directory) || File.Exists(directory)) throw new InvalidOperationException("refuse overwrite");
if (Uri.CheckHostName(host) == UriHostNameType.Unknown || host.Contains('%') || port is < 1024 or > 65535) throw new ArgumentException();
var id = Guid.NewGuid().ToString("N")[..12]; var prefix = "healthapp_b_" + id;
var accounts = new List<Account> { new("prototype-patient", "Patient", Secret()), new("prototype-professional", "HealthcareProfessional", Secret()), new("installation-check", "Patient", Secret()) };
var settings = new Dictionary<string, string> { ["urls"] = "https://0.0.0.0:" + port, ["Authentication:KeyDirectory"] = PathAt(root, "var/lib/healthapp-b/keys"), ["Authentication:TokenLifetimeMinutes"] = "30", ["Kestrel:Certificates:Default:Path"] = PathAt(root, "etc/healthapp-b/application.pfx"), ["Resources:MaxPoolSize"] = "32", ["Resources:MaxConcurrentRequests"] = "32", ["Resources:MaxConcurrentAssessments"] = "4", ["Resources:RequestDeadlineSeconds"] = "30" };
var plan = new InstallationPlan(prefix, prefix + "_runtime", Secret(), prefix + "_profile", prefix + "_observations", host, port, Secret(), accounts, settings);
settings["Kestrel:Certificates:Default:Password"] = plan.CertificatePassword;
for (var i = 0; i < accounts.Count; i++)
{ var a = accounts[i]; settings[$"Authentication:Accounts:{i}:AccountId"] = a.AccountId; settings[$"Authentication:Accounts:{i}:Role"] = a.Role; settings[$"Authentication:Accounts:{i}:PasswordHash"] = new PasswordHasher<Account>().HashPassword(a, a.Password); }
Directory.CreateDirectory(directory); if (OperatingSystem.IsLinux()) File.SetUnixFileMode(directory, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
if (certificate is not null)
{
if (passwordFile is null || caFile is null) throw new ArgumentException();
using var supplied = X509CertificateLoader.LoadPkcs12FromFile(certificate, File.ReadAllText(passwordFile).Trim()); if (!supplied.HasPrivateKey) throw new InvalidOperationException();
File.WriteAllBytes(Path.Combine(directory, "application.pfx"), supplied.Export(X509ContentType.Pfx, plan.CertificatePassword)); File.Copy(caFile, Path.Combine(directory, "healthapp-ca.crt"));
}
else
{
// Same framework certificate primitives and prototype trust model as pinned installer.
using var caKey = RSA.Create(3072); var caRequest = new CertificateRequest("CN=HealthApp B prototype " + id, caKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
caRequest.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, true)); caRequest.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.KeyCertSign | X509KeyUsageFlags.CrlSign, true)); caRequest.CertificateExtensions.Add(new X509SubjectKeyIdentifierExtension(caRequest.PublicKey, false));
using var ca = caRequest.CreateSelfSigned(DateTimeOffset.UtcNow.AddMinutes(-5), DateTimeOffset.UtcNow.AddYears(2));
using var key = RSA.Create(3072); var request = new CertificateRequest("CN=" + host, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
request.CertificateExtensions.Add(new X509BasicConstraintsExtension(false, false, 0, true)); request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature | X509KeyUsageFlags.KeyEncipherment, true)); request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new("1.3.6.1.5.5.7.3.1") }, true));
var san = new SubjectAlternativeNameBuilder(); if (IPAddress.TryParse(host, out var ip)) san.AddIpAddress(ip); else san.AddDnsName(host); request.CertificateExtensions.Add(san.Build());
using var leaf = request.Create(ca, DateTimeOffset.UtcNow.AddMinutes(-5), DateTimeOffset.UtcNow.AddYears(1), RandomNumberGenerator.GetBytes(16)); using var withKey = leaf.CopyWithPrivateKey(key);
File.WriteAllBytes(Path.Combine(directory, "application.pfx"), withKey.Export(X509ContentType.Pfx, plan.CertificatePassword)); File.WriteAllText(Path.Combine(directory, "healthapp-ca.crt"), ca.ExportCertificatePem());
}
PrivateFile(Path.Combine(directory, "installation.json"), JsonSerializer.Serialize(plan, Json)); PrivateFile(Path.Combine(directory, "accounts.json"), JsonSerializer.Serialize(accounts, Json));
if (OperatingSystem.IsLinux()) File.SetUnixFileMode(Path.Combine(directory, "application.pfx"), UnixFileMode.UserRead | UnixFileMode.UserWrite);
}
public static async Task DatabaseAsync(string directory, string migrations, string? adminFile)
{
var p = Load(directory); foreach (var identifier in new[] { p.Database, p.RuntimeRole, p.ProfileOwner, p.ObservationOwner }) if (!Regex.IsMatch(identifier, "^[a-z][a-z0-9_]{1,62}$")) throw new ArgumentException();
if (!Regex.IsMatch(p.RuntimePassword, "^[A-F0-9]{64}$")) throw new ArgumentException();
string? admin = adminFile is null ? null : File.ReadAllText(adminFile).Trim();
if (admin is not null)
{
var remote = new NpgsqlConnectionStringBuilder(admin); if (remote.SslMode != SslMode.VerifyFull) throw new InvalidOperationException("Remote admin requires VerifyFull.");
var db = new NpgsqlConnectionStringBuilder(admin) { Database = p.Database, Username = p.RuntimeRole, Password = p.RuntimePassword, Pooling = true, IncludeErrorDetail = false };
p.Settings["ConnectionStrings:HealthDatabase"] = db.ConnectionString; p.Settings["Database:Remote"] = "true";
}
else p.Settings["ConnectionStrings:HealthDatabase"] = new NpgsqlConnectionStringBuilder { Host = "127.0.0.1", Database = p.Database, Username = p.RuntimeRole, Password = p.RuntimePassword, Pooling = true, SslMode = SslMode.Disable, IncludeErrorDetail = false }.ConnectionString;
async Task<string> Sql(string sql, string? database = null)
{
if (admin is not null)
{
var options = new NpgsqlConnectionStringBuilder(admin) { Pooling = false, IncludeErrorDetail = false }; if (database is not null) options.Database = database;
await using var connection = new NpgsqlConnection(options.ConnectionString); await connection.OpenAsync(); await using var command = new NpgsqlCommand(sql, connection); return (await command.ExecuteScalarAsync())?.ToString() ?? "";
}
var start = new ProcessStartInfo("runuser") { UseShellExecute = false, RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true };
foreach (var arg in new[] { "-u", "postgres", "--", "psql", "--no-psqlrc", "--set=ON_ERROR_STOP=1", "--tuples-only", "--no-align", "--dbname", database ?? "postgres" }) start.ArgumentList.Add(arg);
using var process = Process.Start(start) ?? throw new InvalidOperationException(); var output = process.StandardOutput.ReadToEndAsync(); var error = process.StandardError.ReadToEndAsync(); await process.StandardInput.WriteAsync(sql); process.StandardInput.Close(); using var deadline = new CancellationTokenSource(TimeSpan.FromSeconds(60)); await process.WaitForExitAsync(deadline.Token); await error; if (process.ExitCode != 0) throw new InvalidOperationException("administration failed"); return (await output).Trim();
}
if (await Sql($"SELECT EXISTS(SELECT FROM pg_database WHERE datname='{p.Database}');") is "t" or "True") throw new InvalidOperationException("existing database retained");
await Sql($"SET password_encryption='scram-sha-256'; CREATE ROLE {p.RuntimeRole} LOGIN PASSWORD '{p.RuntimePassword}' NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION; CREATE ROLE {p.ProfileOwner} NOLOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE; CREATE ROLE {p.ObservationOwner} NOLOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE;");
await Sql($"CREATE DATABASE {p.Database};");
await Sql($"REVOKE ALL ON DATABASE {p.Database} FROM PUBLIC; GRANT CONNECT ON DATABASE {p.Database} TO {p.RuntimeRole};", p.Database);
await Sql($"REVOKE ALL ON SCHEMA public FROM PUBLIC; CREATE SCHEMA profile AUTHORIZATION {p.ProfileOwner}; CREATE SCHEMA observations AUTHORIZATION {p.ObservationOwner};", p.Database);
foreach (var module in new[] { ("Profile", p.ProfileOwner), ("Observations", p.ObservationOwner) })
{
if (module.Item1 == "Observations") await Sql($"GRANT USAGE ON SCHEMA profile TO {p.ObservationOwner}; GRANT REFERENCES ON profile.patient TO {p.ObservationOwner};", p.Database);
foreach (var script in Directory.GetFiles(Path.Combine(migrations, module.Item1), "*.sql").Order())
await Sql($"BEGIN; SET LOCAL ROLE {module.Item2};\n" + Regex.Replace(await File.ReadAllTextAsync(script), @"^CREATE SCHEMA IF NOT EXISTS \w+;\s*", "") + "\nCOMMIT;", p.Database);
}
await Sql($"GRANT USAGE ON SCHEMA profile,observations TO {p.RuntimeRole}; GRANT SELECT,INSERT,UPDATE ON profile.patient TO {p.RuntimeRole}; GRANT SELECT,INSERT,UPDATE,DELETE ON observations.observation TO {p.RuntimeRole}; GRANT SELECT ON profile.schema_version,observations.schema_version TO {p.RuntimeRole};", p.Database);
if (admin is null)
{
// RHEL/Fedora may default to ident. Add only the new B database/role rule;
// retain every existing rule and a protected backup, rather than weaken host-wide auth.
var hbaPath = (await Sql("SHOW hba_file;")).Trim();
var original = await File.ReadAllTextAsync(hbaPath);
PrivateFile(Path.Combine(directory, "pg_hba.before.conf"), original);
var rule = $"host {p.Database} {p.RuntimeRole} 127.0.0.1/32 scram-sha-256\n";
await File.WriteAllTextAsync(hbaPath, rule + original);
await Sql("SELECT pg_reload_conf();");
}
PrivateFile(Path.Combine(directory, "installation.json"), JsonSerializer.Serialize(p, Json));
await using var runtime = new NpgsqlConnection(p.Settings["ConnectionStrings:HealthDatabase"]); await runtime.OpenAsync();
await using var check = new NpgsqlCommand("SELECT current_user,has_schema_privilege(current_user,'profile','CREATE') OR has_schema_privilege(current_user,'observations','CREATE')", runtime); await using var reader = await check.ExecuteReaderAsync(); await reader.ReadAsync(); if (reader.GetString(0) != p.RuntimeRole || reader.GetBoolean(1)) throw new InvalidOperationException("runtime privilege verification failed");
}
public static void Configure(string directory, string root)
{
var plan = Load(directory); var config = PathAt(root, "etc/healthapp-b"); if (Directory.Exists(config) || File.Exists(config)) throw new InvalidOperationException("configuration exists"); Directory.CreateDirectory(config);
File.Copy(Path.Combine(directory, "application.pfx"), Path.Combine(config, "application.pfx")); File.Copy(Path.Combine(directory, "healthapp-ca.crt"), Path.Combine(config, "healthapp-ca.crt"));
var connection = new NpgsqlConnectionStringBuilder(plan.Settings["ConnectionStrings:HealthDatabase"]);
if (!string.IsNullOrWhiteSpace(connection.RootCertificate))
{ var destination = Path.Combine(config, "database-ca.crt"); File.Copy(connection.RootCertificate, destination); connection.RootCertificate = destination; plan.Settings["ConnectionStrings:HealthDatabase"] = connection.ConnectionString; }
PrivateFile(Path.Combine(config, "appsettings.json"), JsonSerializer.Serialize(plan.Settings, Json));
PrivateFile(Path.Combine(directory, "installation.json"), JsonSerializer.Serialize(plan, Json));
var keys = PathAt(root, "var/lib/healthapp-b/keys"); Directory.CreateDirectory(keys);
if (OperatingSystem.IsLinux()) { File.SetUnixFileMode(config, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute); File.SetUnixFileMode(keys, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute); File.SetUnixFileMode(Path.Combine(config, "application.pfx"), UnixFileMode.UserRead | UnixFileMode.UserWrite); }
}
public static async Task VerifyDatabaseAsync(string directory)
{
var plan = Load(directory); await using var connection = new NpgsqlConnection(plan.Settings["ConnectionStrings:HealthDatabase"]); await connection.OpenAsync();
await using var command = new NpgsqlCommand("SELECT (SELECT max(version) FROM profile.schema_version)=1 AND (SELECT max(version) FROM observations.schema_version)=1", connection);
if (await command.ExecuteScalarAsync() is not true) throw new InvalidOperationException("schema readiness failed");
}
public static async Task VerifyAsync(string directory)
{
var plan = Load(directory); using var root = X509CertificateLoader.LoadCertificateFromFile(Path.Combine(directory, "healthapp-ca.crt"));
using var handler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (_, cert, peerChain, errors) =>
{
if (cert is null || (errors & (SslPolicyErrors.RemoteCertificateNameMismatch | SslPolicyErrors.RemoteCertificateNotAvailable)) != 0) return false;
using var chain = new X509Chain(); chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust; chain.ChainPolicy.CustomTrustStore.Add(root); chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; if (peerChain is not null) foreach (var element in peerChain.ChainElements) chain.ChainPolicy.ExtraStore.Add(element.Certificate); return chain.Build(cert);
}
};
using var client = new HttpClient(handler) { BaseAddress = new UriBuilder("https", plan.Host, plan.Port).Uri, Timeout = TimeSpan.FromSeconds(15) };
var account = plan.Accounts.Single(a => a.AccountId == "installation-check"); using var login = await client.PostAsJsonAsync("api/authentication/login", new { accountId = account.AccountId, password = account.Password }); login.EnsureSuccessStatusCode(); using var ticket = JsonDocument.Parse(await login.Content.ReadAsStringAsync()); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", ticket.RootElement.GetProperty("accessToken").GetString());
using var ready = await client.GetAsync("health/ready"); ready.EnsureSuccessStatusCode();
using var profile = await client.PostAsJsonAsync("api/patients", new { name = "Synthetic installation check", dateOfBirth = "1980-01-01" });
if (profile.StatusCode is not (HttpStatusCode.Created or HttpStatusCode.Conflict)) throw new InvalidOperationException();
using var me = await client.GetAsync("api/patients/me"); me.EnsureSuccessStatusCode(); using var p = JsonDocument.Parse(await me.Content.ReadAsStringAsync()); var id = p.RootElement.GetProperty("patientId").GetGuid();
if (profile.StatusCode == HttpStatusCode.Created) { using var observation = await client.PostAsJsonAsync($"api/patients/{id}/observations", new { measuredAt = "2026-09-12T08:00:00", systolic = 128, diastolic = 82, pulse = 68, measurementContext = new { setting = "Home", activityCondition = "AtRest" } }); observation.EnsureSuccessStatusCode(); }
foreach (var path in new[] { "observations/latest", "observations?from=2026-09-01&to=2026-09-30", "insights?from=2026-09-01&to=2026-09-30", "overview?from=2026-09-01&to=2026-09-30" }) { using var result = await client.GetAsync($"api/patients/{id}/{path}"); result.EnsureSuccessStatusCode(); }
await using var connection = new NpgsqlConnection(plan.Settings["ConnectionStrings:HealthDatabase"]); await connection.OpenAsync();
}
}
+33
View File
@@ -0,0 +1,33 @@
using System.Text.Json;
namespace HealthApp.Provisioning;
public static class Program
{
public static async Task<int> Main(string[] args)
{
var stage = "arguments";
try
{
if (args.Length == 0) throw new ArgumentException();
var options = new Dictionary<string, string>(StringComparer.Ordinal);
for (var i = 1; i < args.Length; i += 2) { if (i + 1 >= args.Length || !args[i].StartsWith("--") || !options.TryAdd(args[i][2..], args[i + 1])) throw new ArgumentException(); }
string Required(string key) => options.GetValueOrDefault(key) ?? throw new ArgumentException();
stage = args[0]; var plan = Required("plan");
switch (stage)
{
case "prepare": Installation.Prepare(plan, Required("host"), int.Parse(options.GetValueOrDefault("port", "5443")), Required("root"), options.GetValueOrDefault("certificate"), options.GetValueOrDefault("certificate-password-file"), options.GetValueOrDefault("ca")); break;
case "database": await Installation.DatabaseAsync(plan, Required("migrations"), options.GetValueOrDefault("admin-file")); break;
case "configure": Installation.Configure(plan, Required("root")); break;
case "verify-database": await Installation.VerifyDatabaseAsync(plan); break;
case "verify": await Installation.VerifyAsync(plan); break;
default: throw new ArgumentException();
}
Console.WriteLine("Completed " + stage + "."); return 0;
}
catch (Exception e)
{
// Never print SQL, password/token values, health payloads or exception text.
Console.Error.WriteLine("Provisioning failed at " + stage + " (" + e.GetType().Name + "). Existing data and diagnostics retained."); return 1;
}
}
}
+33
View File
@@ -0,0 +1,33 @@
# Architecture B native Linux installation
Build with the .NET 10 SDK: `HEALTHAPP_DOTNET=/path/to/dotnet bash deploy/build-release.sh --output NEW_DIRECTORY`. The bundle is independently deployable: one app, transient provisioner, module-owned migrations, dependency adapters and one systemd unit. No source checkout, container engine or other Health App services are required on the target.
Normal local installation, from the bundle: `sudo bash install.sh --host DNS_OR_IP`. It supplies missing dependencies, a fresh database, separate NOLOGIN schema owners and a restricted DML login role, generated account/database secrets, HTTPS certificate, protected configuration/key ring, migrations and a native application service. No manual database, password or certificate creation is required. Synthetic installer checks remain as clearly named prototype records; generated professional has no assignments. Assigned reads require predefined configuration, not an assignment-management API.
Existing `/opt/healthapp-b`, `/etc/healthapp-b`, `/var/lib/healthapp-b`, installation state or unit prevents installation before overwriting anything. Partial failures retain protected material and report the stage; there is no transactional installer rollback or automatic resume. Architecture A paths/databases are not modified. No production-data import is included.
## Distribution support
The installer is distribution-aware, not Ubuntu-only. Intended systemd x86_64 targets: Debian 12/13, Ubuntu 24.04, Fedora 43/44, RHEL-family systems with compatible native feeds, and current Arch/Manjaro. Actual package/runtime availability and systemd must pass preflight. Rolling-distribution dependency installation performs a full package update to avoid partial upgrades. Derivative version numbers are not silently substituted into unrelated upstream feeds. No universal Linux support is claimed.
APT uses native feeds, with identified Microsoft Debian or official Ubuntu .NET backports where necessary; DNF uses configured distribution feeds; pacman uses native repositories. PostgreSQL initialization/startup follows each family. In remote mode none of these adapters installs or starts local PostgreSQL.
Package choices follow [Microsoft Debian](https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian), [Ubuntu](https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-install), [Fedora](https://learn.microsoft.com/en-us/dotnet/core/install/linux-fedora), and [Arch ASP.NET package](https://archlinux.org/packages/extra/x86_64/aspnet-runtime/) documentation. Supported in design does not mean installation has been executed on every family. Verified: Debian 12 bookworm systemd local installation (PostgreSQL 15.19) and remote installation (PostgreSQL 18.6 with VerifyFull), .NET/ASP.NET 10.0.13. These are actual native services inside isolated Linux test environments sharing the Manjaro kernel; bare-metal/VM and other distributions are not independently verified. The implementation evidence register records this boundary.
## Remote PostgreSQL
Provide administrator-controlled reachable PostgreSQL, certificate/CA trust and restrictive network access. Put its administrative connection in an owner-only file (mode 600/400), including `SslMode=VerifyFull` and `RootCertificate=/path/to/trusted-db-ca.crt` when a private CA is used. Use a DNS name matching the DB certificate (or matching IP SAN), not an unverified alias. Credentials never go on a command line.
Run `sudo bash install.sh --mode remote --host APP_DNS --postgres-admin-file /secure/admin.connection`. The tool creates a new B database/roles/schemas remotely. Runtime config inherits verified encryption/hostname checks, replaces administrative identity with the generated restricted role, and copies an explicit DB CA into installed protected configuration. No local PostgreSQL dependency is installed. The database administrator supplies the existing remote host/administrative access; application database/user/secret setup is automated.
## Native runtime and trust
`healthapp-b.service` runs as `healthapp-b`, listens on one HTTPS endpoint (default 5443), and loads `/etc/healthapp-b/appsettings.json`. Its private key/config are root-owned and readable only by the service group. Token keys persist under `/var/lib/healthapp-b/keys` (service-owned mode 700). Migration identities are not runtime credentials. The runtime cannot create/drop schemas/tables or administer PostgreSQL. Local provisioning generates SCRAM credentials and adds a loopback authentication rule scoped only to the new B database/role, retaining existing rules and a protected backup. This handles distributions whose PostgreSQL defaults use ident authentication without weakening host-wide access.
The verifier validates certificate chain and hostname using the generated/supplied trust root. Export `/etc/healthapp-b/healthapp-ca.crt` to establish client trust separately; never disable certificate validation. Supplied certificate options: `--certificate PFX --certificate-password-file OWNER_ONLY_FILE --ca ROOT_CA_PEM`. Certificate replacement is an administrative operation: preserve backups, change PFX/password configuration with restrictive permissions, restart and verify trusted HTTPS. Prototype leaf validity is one year; CA two years; automatic renewal is outside scope.
The installer checks PID/HTTPS/configured DB/representative login/profile/observation/history/insight/overview, stops the app while PostgreSQL stays ready, restarts with a new PID and repeats verification. Liveness and readiness require a valid bearer ticket and disclose no patient information. Readiness checks keys, reference content and both migration versions; guidance/login can operate during DB-only outages.
`--dotnet /absolute/runtime/path` may reuse an existing .NET 10 ASP.NET runtime. Use a system-readable path outside `/tmp` and protected home directories because the service uses PrivateTmp and ProtectHome. Logs omit credentials/tokens/health payloads and identifying route values. Configuration controls pool size, request/assessment concurrency, deadline, accounts, assignments and token lifetime. Defaults are deployment starting values, not measured capacity or energy claims.
Before future upgrades: back up the B database, protected configuration and token keys; retain source/target revisions; stop or explicitly coordinate app access while privileged module migrations run; verify integrity and HTTPS/workflows before switching. No backup SLA, HA, live A import, automatic rollback or production/clinical certification is promised. Measurement host/data/workload equivalence must be controlled separately from installation evidence.
+7
View File
@@ -0,0 +1,7 @@
{
"ConnectionStrings": {"HealthDatabase": "Host=127.0.0.1;Database=YOUR_FRESH_B_DB;Username=YOUR_RUNTIME_ROLE;Password=LOAD_EXTERNALLY"},
"Authentication": {"KeyDirectory": "/var/lib/healthapp-b/keys", "TokenLifetimeMinutes": 30, "Accounts": []},
"Access": {"ProfessionalAssignments": {}},
"Resources": {"MaxPoolSize": 32, "MaxConcurrentRequests": 32, "MaxConcurrentAssessments": 4, "RequestDeadlineSeconds": 30},
"Database": {"Remote": false}
}
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
output=''
while (($#)); do case "$1" in --output) output=$2; shift 2;; *) echo 'Usage: build-release.sh --output NEW_DIRECTORY' >&2; exit 2;; esac; done
[[ -n "$output" && ! -e "$output" ]] || { echo 'A new output directory is required.' >&2; exit 2; }
repository=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
runtime=${HEALTHAPP_DOTNET:-dotnet}
output=$(realpath -m "$output")
mkdir -p "$output/app" "$output/provisioner" "$output/migrations"
"$runtime" publish "$repository/src/HealthApp/HealthApp.csproj" -c Release -o "$output/app" --nologo
"$runtime" publish "$repository/deploy/HealthApp.Provisioning/HealthApp.Provisioning.csproj" -c Release -o "$output/provisioner" --nologo
for module in Profile Observations; do mkdir -p "$output/migrations/$module"; cp "$repository/src/Modules/$module/Migrations/"*.sql "$output/migrations/$module/"; done
cp "$repository/deploy/installer/"*.sh "$output/"
cp "$repository/deploy/systemd/healthapp-b.service" "$output/"
cp "$repository/deploy/INSTALLATION.md" "$output/"
echo 'Release bundle prepared; no generated installation secrets included.'
+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env bash
# Distribution package adapters; normal installation uses signed native package feeds.
has_runtime() { [[ -x "$dotnet" ]] && "$dotnet" --list-runtimes | rg_runtime; }
rg_runtime() { grep -q 'Microsoft.AspNetCore.App 10\.'; }
ensure_dependencies() {
local family=''
source "${HEALTHAPP_OS_RELEASE:-/etc/os-release}"
case " $ID ${ID_LIKE:-} " in
*' debian '*|*' ubuntu '*) family=apt;;
*' fedora '*|*' rhel '*) family=dnf;;
*' arch '*|*' manjaro '*) family=pacman;;
*) fail 'No supported dependency adapter for this systemd distribution.';;
esac
stage='distribution dependencies'
case "$family" in
apt)
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates curl
if ! has_runtime; then
if ! apt-cache policy aspnetcore-runtime-10.0 | grep -Eq 'Candidate: [0-9]'; then
if [[ "$ID" == debian && "$VERSION_ID" =~ ^(12|13)$ ]]; then
local feed; feed=$(mktemp -d)
curl --fail --silent --show-error --location "https://packages.microsoft.com/config/debian/$VERSION_ID/packages-microsoft-prod.deb" -o "$feed/feed.deb"
dpkg -i "$feed/feed.deb"; apt-get update
elif [[ "$ID" == ubuntu && "$VERSION_ID" == 24.04 ]]; then
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
add-apt-repository -y ppa:dotnet/backports; apt-get update
else fail 'No identified .NET 10 feed; derivative versions are not mapped to an unrelated upstream.'; fi
fi
DEBIAN_FRONTEND=noninteractive apt-get install -y aspnetcore-runtime-10.0
fi
if [[ "$mode" == local ]]; then DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql; systemctl enable --now postgresql; fi
;;
dnf)
dnf install -y ca-certificates curl
has_runtime || dnf install -y aspnetcore-runtime-10.0
if [[ "$mode" == local ]]; then
dnf install -y postgresql-server postgresql
[[ -f /var/lib/pgsql/data/PG_VERSION ]] || postgresql-setup --initdb
systemctl enable --now postgresql
fi
;;
pacman)
# Avoid partial rolling-distribution upgrades when installing dependencies.
pacman -Syu --noconfirm --needed ca-certificates curl
has_runtime || pacman -S --noconfirm --needed aspnet-runtime
if [[ "$mode" == local ]]; then
pacman -S --noconfirm --needed postgresql
if [[ ! -f /var/lib/postgres/data/PG_VERSION ]]; then
install -d -o postgres -g postgres -m 700 /var/lib/postgres/data
runuser -u postgres -- initdb -D /var/lib/postgres/data --auth-local=peer --auth-host=scram-sha-256
fi
systemctl enable --now postgresql
fi
;;
esac
has_runtime || fail '.NET 10 ASP.NET Core runtime is unavailable after dependency provisioning.'
if [[ "$mode" == local ]]; then
stage='local PostgreSQL readiness'
local ready=false attempt
for attempt in {1..30}; do if pg_isready -q -h 127.0.0.1 -p 5432; then ready=true; break; fi; sleep 1; done
[[ "$ready" == true ]] || fail 'Local PostgreSQL is not ready on port 5432.'
fi
}
+76
View File
@@ -0,0 +1,76 @@
#!/usr/bin/env bash
set -euo pipefail
umask 077
stage=preflight
fail() { echo "Installation failed at $stage: $1 Existing installation material retained." >&2; exit 1; }
trap 'fail "Command failed; consult protected stage diagnostics."' ERR
bundle=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
mode=local host=localhost port=5443 admin_file='' certificate='' certificate_password_file='' ca=''
dotnet=${HEALTHAPP_DOTNET:-/usr/bin/dotnet}
while (($#)); do
case "$1" in
--mode) mode=$2; shift 2;; --host) host=$2; shift 2;; --port) port=$2; shift 2;;
--postgres-admin-file) admin_file=$2; shift 2;; --dotnet) dotnet=$2; shift 2;;
--certificate) certificate=$2; shift 2;; --certificate-password-file) certificate_password_file=$2; shift 2;; --ca) ca=$2; shift 2;;
*) fail 'Unknown installation option.';;
esac
done
[[ $EUID -eq 0 ]] || fail 'Administrative/root access is required.'
[[ "$mode" == local || "$mode" == remote ]] || fail 'Select local or remote database mode.'
[[ -d /run/systemd/system ]] || fail 'A running systemd host is required.'
[[ -f "$bundle/app/HealthApp.dll" && -f "$bundle/provisioner/HealthApp.Provisioning.dll" ]] || fail 'Release payload missing.'
for path in /opt/healthapp-b /etc/healthapp-b /var/lib/healthapp-b /var/lib/healthapp-b-installation /etc/systemd/system/healthapp-b.service; do [[ ! -e "$path" ]] || fail 'Existing target path would be overwritten.'; done
if [[ "$mode" == remote ]]; then [[ -n "$admin_file" && -f "$admin_file" ]] || fail 'Remote mode needs a protected administrative connection file with VerifyFull and trusted CA.'; fi
if [[ -n "$admin_file" ]]; then [[ $(stat -c '%a' "$admin_file") == 600 || $(stat -c '%a' "$admin_file") == 400 ]] || fail 'Administrative connection file must be owner-only.'; fi
install -d -m 700 /var/lib/healthapp-b-installation
exec > >(tee -a /var/lib/healthapp-b-installation/install.log) 2>&1
source "$bundle/bootstrap.sh"
ensure_dependencies
stage='protected preparation'
install -d -m 700 /var/lib/healthapp-b-installation
plan=/var/lib/healthapp-b-installation/deployment
prepare=(prepare --plan "$plan" --host "$host" --port "$port" --root /)
if [[ -n "$certificate" ]]; then prepare+=(--certificate "$certificate" --certificate-password-file "$certificate_password_file" --ca "$ca"); fi
"$dotnet" "$bundle/provisioner/HealthApp.Provisioning.dll" "${prepare[@]}"
stage='database roles schemas and migration'
database=(database --plan "$plan" --migrations "$bundle/migrations")
if [[ "$mode" == remote ]]; then database+=(--admin-file "$admin_file"); fi
"$dotnet" "$bundle/provisioner/HealthApp.Provisioning.dll" "${database[@]}"
stage='application configuration and identity'
id -u healthapp-b >/dev/null 2>&1 || useradd --system --user-group --home-dir /var/lib/healthapp-b --shell /usr/sbin/nologin healthapp-b
install -d -m 755 /opt/healthapp-b
cp -a "$bundle/app/." /opt/healthapp-b/
"$dotnet" "$bundle/provisioner/HealthApp.Provisioning.dll" configure --plan "$plan" --root /
chown -R root:healthapp-b /etc/healthapp-b
chmod 750 /etc/healthapp-b
chmod 640 /etc/healthapp-b/appsettings.json /etc/healthapp-b/application.pfx
chmod 644 /etc/healthapp-b/*.crt
chown -R healthapp-b:healthapp-b /var/lib/healthapp-b
chmod 700 /var/lib/healthapp-b /var/lib/healthapp-b/keys
stage='native systemd registration'
[[ "$dotnet" =~ ^/[a-zA-Z0-9_./-]+$ ]] || fail 'The runtime must have a safe absolute executable path.'
sed "s|@DOTNET@|$dotnet|g" "$bundle/healthapp-b.service" > /etc/systemd/system/healthapp-b.service
chmod 644 /etc/systemd/system/healthapp-b.service
systemctl daemon-reload
systemctl enable --now healthapp-b.service
stage='HTTPS database and representative workflow verification'
ready=false
for attempt in {1..30}; do if "$dotnet" "$bundle/provisioner/HealthApp.Provisioning.dll" verify --plan "$plan"; then ready=true; break; fi; sleep 1; done
[[ "$ready" == true ]] || fail 'Representative verification did not complete.'
stage='independent stop restart verification'
before_pid=$(systemctl show healthapp-b.service --property MainPID --value)
[[ "$before_pid" =~ ^[1-9][0-9]*$ ]] || fail 'Application PID is missing.'
if [[ "$mode" == local ]]; then pg_isready -q -h 127.0.0.1 -p 5432 || fail 'Database was unavailable before application stop.'; fi
systemctl stop healthapp-b.service
"$dotnet" "$bundle/provisioner/HealthApp.Provisioning.dll" verify-database --plan "$plan"
if [[ "$mode" == local ]]; then pg_isready -q -h 127.0.0.1 -p 5432 || fail 'Application stop affected PostgreSQL.'; fi
systemctl start healthapp-b.service
ready=false
for attempt in {1..30}; do if "$dotnet" "$bundle/provisioner/HealthApp.Provisioning.dll" verify --plan "$plan"; then ready=true; break; fi; sleep 1; done
[[ "$ready" == true ]] || fail 'Workflow did not recover after restart.'
after_pid=$(systemctl show healthapp-b.service --property MainPID --value)
[[ "$after_pid" =~ ^[1-9][0-9]*$ && "$after_pid" != "$before_pid" ]] || fail 'Restarted application PID not verified.'
stage=complete
printf 'Architecture B installed and verified: one HTTPS application, independent PostgreSQL lifecycle.\n'
printf 'Protected generated account material: /var/lib/healthapp-b-installation/deployment/accounts.json\n'
printf 'Export /etc/healthapp-b/healthapp-ca.crt to establish client trust.\n'
+28
View File
@@ -0,0 +1,28 @@
[Unit]
Description=Health App Architecture B
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=healthapp-b
Group=healthapp-b
WorkingDirectory=/opt/healthapp-b
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=HEALTHAPP_CONFIGURATION_FILE=/etc/healthapp-b/appsettings.json
ExecStart=@DOTNET@ /opt/healthapp-b/HealthApp.dll
Restart=on-failure
RestartSec=3
KillSignal=SIGINT
TimeoutStopSec=30
UMask=0077
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/healthapp-b
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
@@ -1,4 +1,5 @@
namespace HealthApp.Contracts; namespace HealthApp.Contracts;
public interface ReferenceCatalog public interface ReferenceCatalog
{ {
ClinicalReference Pulse(); ClinicalReference Pulse();
@@ -0,0 +1,5 @@
namespace HealthApp.Contracts;
// Bundle metadata, not an additional patient response or a clinical decision algorithm.
public sealed record ClinicalRuleProvenance(string Metric, string Claim,
string Prerequisites, string AllowedInference, string ReviewState);
@@ -1,4 +1,5 @@
namespace HealthApp.Contracts; namespace HealthApp.Contracts;
public sealed record HealthOverviewDto(PatientDto Patient, ObservationDto? LatestObservation, HealthInsight? Insight, DateTime PeriodStart, DateTime PeriodEnd, ContextSelection InsightSelection, int InsightContributingCount, string LatestObservationBasis, string InsightExplanation); public sealed record HealthOverviewDto(PatientDto Patient, ObservationDto? LatestObservation, HealthInsight? Insight, DateTime PeriodStart, DateTime PeriodEnd, ContextSelection InsightSelection, int InsightContributingCount, string LatestObservationBasis, string InsightExplanation);
public interface OverviewQueries public interface OverviewQueries
{ {
@@ -1,4 +1,5 @@
namespace HealthApp.Contracts; namespace HealthApp.Contracts;
public interface ObservationQueries public interface ObservationQueries
{ {
Task<Guid?> ResolveOwnerAsync(Guid observationId, CancellationToken ct); Task<Guid?> ResolveOwnerAsync(Guid observationId, CancellationToken ct);
@@ -26,13 +26,20 @@ public sealed class AuthenticationController(PrototypeAccounts accounts,
new Claim(ClaimTypes.Role, account.Role) new Claim(ClaimTypes.Role, account.Role)
}, "Bearer")); }, "Bearer"));
var settings = options.Get("Bearer"); var settings = options.Get("Bearer");
var expiry = settings.TimeProvider!.GetUtcNow().Add(settings.BearerTokenExpiration); var issued = settings.TimeProvider!.GetUtcNow();
var expiry = issued.Add(settings.BearerTokenExpiration);
// Use the framework's ticket protector and bearer validation. No refresh endpoint/token. // Use the framework's ticket protector and bearer validation. No refresh endpoint/token.
var ticket = new AuthenticationTicket(principal, new AuthenticationProperties { ExpiresUtc = expiry }, "Bearer"); var ticket = new AuthenticationTicket(principal, new AuthenticationProperties { IssuedUtc = issued, ExpiresUtc = expiry }, "Bearer");
Response.Headers.CacheControl = "no-store"; Response.Headers.CacheControl = "no-store";
Response.Headers.Pragma = "no-cache"; Response.Headers.Pragma = "no-cache";
return Ok(new { accessToken = settings.BearerTokenProtector.Protect(ticket), tokenType = "Bearer", return Ok(new
expiresIn = (long)settings.BearerTokenExpiration.TotalSeconds, accountId = account.AccountId, role = account.Role }); {
accessToken = settings.BearerTokenProtector.Protect(ticket),
tokenType = "Bearer",
expiresIn = (long)settings.BearerTokenExpiration.TotalSeconds,
accountId = account.AccountId,
role = account.Role
});
} }
public sealed record LoginRequest([Required] string AccountId, [Required] string Password); public sealed record LoginRequest([Required] string AccountId, [Required] string Password);
@@ -4,6 +4,7 @@ using HealthApp.Security;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace HealthApp.Controllers; namespace HealthApp.Controllers;
[ApiController] [ApiController]
public sealed class HealthOverviewController(OverviewQueries overview, AccessPolicy access, RequestTransaction tx) : ControllerBase public sealed class HealthOverviewController(OverviewQueries overview, AccessPolicy access, RequestTransaction tx) : ControllerBase
{ {
@@ -3,6 +3,7 @@ using HealthApp.Security;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace HealthApp.Controllers; namespace HealthApp.Controllers;
[ApiController] [ApiController]
public sealed class InsightsController(AnalyticsQueries analytics, AccessPolicy access) : ControllerBase public sealed class InsightsController(AnalyticsQueries analytics, AccessPolicy access) : ControllerBase
{ {
@@ -2,6 +2,7 @@ using HealthApp.Guidance;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace HealthApp.Controllers; namespace HealthApp.Controllers;
[ApiController, AllowAnonymous, Route("api/measurement-guidance")] [ApiController, AllowAnonymous, Route("api/measurement-guidance")]
public sealed class MeasurementGuidanceController(GuidanceQueries guidance) : ControllerBase public sealed class MeasurementGuidanceController(GuidanceQueries guidance) : ControllerBase
{ {
@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace HealthApp.Controllers; namespace HealthApp.Controllers;
[ApiController, Route("api")] [ApiController, Route("api")]
public sealed class ObservationController(ObservationQueries queries, ObservationCommands commands, AccessPolicy access, RequestTransaction tx) : ControllerBase public sealed class ObservationController(ObservationQueries queries, ObservationCommands commands, AccessPolicy access, RequestTransaction tx) : ControllerBase
{ {
@@ -5,6 +5,7 @@ using HealthApp.Security;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace HealthApp.Controllers; namespace HealthApp.Controllers;
[ApiController, Route("api/patients")] [ApiController, Route("api/patients")]
public sealed class PatientController(ProfileQueries queries, ProfileCommands commands, AccessPolicy access, RequestTransaction tx) : ControllerBase public sealed class PatientController(ProfileQueries queries, ProfileCommands commands, AccessPolicy access, RequestTransaction tx) : ControllerBase
{ {
+17 -7
View File
@@ -11,11 +11,14 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Authentication.BearerToken; using Microsoft.AspNetCore.Authentication.BearerToken;
namespace HealthApp; namespace HealthApp;
public class Program public class Program
{ {
public static async Task Main(string[] args) public static async Task Main(string[] args)
{ {
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
var configurationFile = Environment.GetEnvironmentVariable("HEALTHAPP_CONFIGURATION_FILE");
if (!string.IsNullOrWhiteSpace(configurationFile)) builder.Configuration.AddJsonFile(configurationFile, optional: false, reloadOnChange: false);
builder.Logging.AddFilter("Microsoft.AspNetCore", LogLevel.Warning); builder.Logging.AddFilter("Microsoft.AspNetCore", LogLevel.Warning);
builder.Logging.AddFilter("Microsoft.EntityFrameworkCore", LogLevel.None); builder.Logging.AddFilter("Microsoft.EntityFrameworkCore", LogLevel.None);
builder.Services.AddControllers(o => o.Filters.Add<ReleaseTransactionFilter>()); builder.Services.AddControllers(o => o.Filters.Add<ReleaseTransactionFilter>());
@@ -24,7 +27,8 @@ public class Program
builder.Services.AddSingleton<PrototypeAccounts>(); builder.Services.AddSingleton<PrototypeAccounts>();
builder.Services.AddSingleton<ProfessionalAssignments>(); builder.Services.AddSingleton<ProfessionalAssignments>();
builder.Services.AddSingleton<GuidanceQueries>(); builder.Services.AddSingleton<ReferenceCatalog, ReviewedReferenceCatalog>(); builder.Services.AddAnalytics(); builder.Services.AddOverview(); builder.Services.AddSingleton<GuidanceQueries>(); builder.Services.AddSingleton<ReferenceCatalog, ReviewedReferenceCatalog>(); builder.Services.AddAnalytics(); builder.Services.AddOverview();
builder.Services.AddSingleton(sp=> { builder.Services.AddSingleton(sp =>
{
var c = sp.GetRequiredService<IConfiguration>(); var c = sp.GetRequiredService<IConfiguration>();
var text = c.GetConnectionString("HealthDatabase"); var text = c.GetConnectionString("HealthDatabase");
if (string.IsNullOrWhiteSpace(text)) throw new InvalidOperationException("HealthDatabase connection is required."); if (string.IsNullOrWhiteSpace(text)) throw new InvalidOperationException("HealthDatabase connection is required.");
@@ -35,13 +39,15 @@ public class Program
}); });
builder.Services.AddScoped<RequestTransaction>(); builder.Services.AddProfile(); builder.Services.AddObservations(); builder.Services.AddScoped<AccessPolicy>(); builder.Services.AddScoped<RequestTransaction>(); builder.Services.AddProfile(); builder.Services.AddObservations(); builder.Services.AddScoped<AccessPolicy>();
builder.Services.AddDataProtection().SetApplicationName("HealthApp.ApiGateway"); builder.Services.AddDataProtection().SetApplicationName("HealthApp.ApiGateway");
builder.Services.AddOptions<Microsoft.AspNetCore.DataProtection.KeyManagement.KeyManagementOptions>().Configure<IConfiguration, ILoggerFactory>((o,c,l)=> { builder.Services.AddOptions<Microsoft.AspNetCore.DataProtection.KeyManagement.KeyManagementOptions>().Configure<IConfiguration, ILoggerFactory>((o, c, l) =>
{
var keys = c["Authentication:KeyDirectory"]; var keys = c["Authentication:KeyDirectory"];
if (string.IsNullOrWhiteSpace(keys)) throw new InvalidOperationException("Authentication:KeyDirectory is required."); if (string.IsNullOrWhiteSpace(keys)) throw new InvalidOperationException("Authentication:KeyDirectory is required.");
o.XmlRepository = new Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository(new DirectoryInfo(keys), l); o.XmlRepository = new Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository(new DirectoryInfo(keys), l);
}); });
builder.Services.AddAuthentication("Bearer").AddBearerToken("Bearer", o => o.BearerTokenExpiration = TimeSpan.FromMinutes(builder.Configuration.GetValue("Authentication:TokenLifetimeMinutes", 30))); builder.Services.AddAuthentication("Bearer").AddBearerToken("Bearer", o => o.BearerTokenExpiration = TimeSpan.FromMinutes(builder.Configuration.GetValue("Authentication:TokenLifetimeMinutes", 30)));
builder.Services.AddAuthorization(o=> { builder.Services.AddAuthorization(o =>
{
o.FallbackPolicy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); o.FallbackPolicy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
foreach (var role in new[] { "Patient", "HealthcareProfessional" }) o.AddPolicy(role, p => p.RequireRole(role).RequireClaim(System.Security.Claims.ClaimTypes.NameIdentifier)); foreach (var role in new[] { "Patient", "HealthcareProfessional" }) o.AddPolicy(role, p => p.RequireRole(role).RequireClaim(System.Security.Claims.ClaimTypes.NameIdentifier));
}); });
@@ -55,7 +61,8 @@ public class Program
_ = app.Services.GetRequiredService<PrototypeAccounts>(); _ = app.Services.GetRequiredService<PrototypeAccounts>();
_ = app.Services.GetRequiredService<ProfessionalAssignments>(); _ = app.Services.GetRequiredService<ProfessionalAssignments>();
app.UseExceptionHandler(); app.UseExceptionHandler();
app.Use(async(ctx,next)=> { app.Use(async (ctx, next) =>
{
if (!app.Environment.IsDevelopment() && !ctx.Request.IsHttps) { ctx.Response.StatusCode = 400; return; } if (!app.Environment.IsDevelopment() && !ctx.Request.IsHttps) { ctx.Response.StatusCode = 400; return; }
if (!ctx.Request.Path.StartsWithSegments("/api/measurement-guidance")) ctx.Response.Headers.CacheControl = "no-store"; if (!ctx.Request.Path.StartsWithSegments("/api/measurement-guidance")) ctx.Response.Headers.CacheControl = "no-store";
await next(ctx); await next(ctx);
@@ -64,15 +71,18 @@ public class Program
app.UseMiddleware<RequestBoundaryMiddleware>(); app.UseMiddleware<RequestBoundaryMiddleware>();
app.MapControllers(); app.MapControllers();
app.MapGet("/health/live", () => Results.Ok(new { status = "live" })).RequireAuthorization(); app.MapGet("/health/live", () => Results.Ok(new { status = "live" })).RequireAuthorization();
app.MapGet("/health/ready",async (HttpContext ctx)=>{ app.MapGet("/health/ready", async (HttpContext ctx) =>
try{ {
try
{
_ = ctx.RequestServices.GetRequiredService<Microsoft.AspNetCore.DataProtection.IDataProtectionProvider>().CreateProtector("readiness").Protect("probe"); _ = ctx.RequestServices.GetRequiredService<Microsoft.AspNetCore.DataProtection.IDataProtectionProvider>().CreateProtector("readiness").Protect("probe");
var catalog = ctx.RequestServices.GetRequiredService<ReferenceCatalog>(); var catalog = ctx.RequestServices.GetRequiredService<ReferenceCatalog>();
if (string.IsNullOrWhiteSpace(catalog.Version)) return Results.StatusCode(503); if (string.IsNullOrWhiteSpace(catalog.Version)) return Results.StatusCode(503);
await using var connection = await ctx.RequestServices.GetRequiredService<NpgsqlDataSource>().OpenConnectionAsync(ctx.RequestAborted); await using var connection = await ctx.RequestServices.GetRequiredService<NpgsqlDataSource>().OpenConnectionAsync(ctx.RequestAborted);
await using var command = new NpgsqlCommand("SELECT (SELECT max(version) FROM profile.schema_version)=1 AND (SELECT max(version) FROM observations.schema_version)=1", connection); await using var command = new NpgsqlCommand("SELECT (SELECT max(version) FROM profile.schema_version)=1 AND (SELECT max(version) FROM observations.schema_version)=1", connection);
return await command.ExecuteScalarAsync(ctx.RequestAborted) is true ? Results.Ok(new { status = "ready" }) : Results.StatusCode(503); return await command.ExecuteScalarAsync(ctx.RequestAborted) is true ? Results.Ok(new { status = "ready" }) : Results.StatusCode(503);
}catch(NpgsqlException){return Results.StatusCode(503);} }
catch (NpgsqlException) { return Results.StatusCode(503); }
}).RequireAuthorization(); }).RequireAuthorization();
await app.RunAsync(); await app.RunAsync();
} }
+1
View File
@@ -1,6 +1,7 @@
using System.Security.Claims; using System.Security.Claims;
using HealthApp.Contracts; using HealthApp.Contracts;
namespace HealthApp.Security; namespace HealthApp.Security;
public sealed class AccessPolicy(ProfileQueries profiles, ProfessionalAssignments assignments) public sealed class AccessPolicy(ProfileQueries profiles, ProfessionalAssignments assignments)
{ {
public async Task<AuthorizedPatientContext?> AuthorizeAsync(ClaimsPrincipal user, Guid actualPatient, bool write, CancellationToken ct) public async Task<AuthorizedPatientContext?> AuthorizeAsync(ClaimsPrincipal user, Guid actualPatient, bool write, CancellationToken ct)
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Npgsql; using Npgsql;
namespace HealthApp.Security; namespace HealthApp.Security;
public sealed class RequestAdmission(IConfiguration configuration) : IDisposable public sealed class RequestAdmission(IConfiguration configuration) : IDisposable
{ {
public SemaphoreSlim Health { get; } = new(Positive(configuration, "Resources:MaxConcurrentRequests", 32)); public SemaphoreSlim Health { get; } = new(Positive(configuration, "Resources:MaxConcurrentRequests", 32));
+11 -2
View File
@@ -2,12 +2,21 @@ using HealthApp.Contracts;
using HealthApp.Infrastructure; using HealthApp.Infrastructure;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace HealthApp.Analytics; namespace HealthApp.Analytics;
internal sealed class AnalyticsFacade(ObservationQueries observations, RequestTransaction tx, SummaryPolicy summary, TrendPolicy trend) : AnalyticsQueries internal sealed class AnalyticsFacade(ObservationQueries observations, RequestTransaction tx, SummaryPolicy summary, TrendPolicy trend) : AnalyticsQueries
{ {
public async Task<HealthInsight?> InsightAsync(AuthorizedPatientContext scope, DateTime from, DateTime to, ContextSelection selection, CancellationToken ct) public async Task<HealthInsight?> InsightAsync(AuthorizedPatientContext scope, DateTime from, DateTime to, ContextSelection selection, CancellationToken ct)
{var series=await observations.SelectedAsync(scope,from,to,selection,ct);await tx.FinishAsync(ct);ct.ThrowIfCancellationRequested();return summary.CalculateSummary(scope.PatientId,MeasurementPeriod.Normalize(from),MeasurementPeriod.Normalize(to),series,selection);} {
var series = await observations.SelectedAsync(scope, from, to, selection, ct); await tx.FinishAsync(ct); ct.ThrowIfCancellationRequested(); var result = summary.CalculateSummary(scope.PatientId, MeasurementPeriod.Normalize(from), MeasurementPeriod.Normalize(to), series, selection);
ct.ThrowIfCancellationRequested();
return result;
}
public async Task<TrendAssessment> TrendAsync(AuthorizedPatientContext scope, DateTime from, DateTime to, ContextSelection selection, CancellationToken ct) public async Task<TrendAssessment> TrendAsync(AuthorizedPatientContext scope, DateTime from, DateTime to, ContextSelection selection, CancellationToken ct)
{var series=await observations.SelectedAsync(scope,from,to,selection,ct);await tx.FinishAsync(ct);ct.ThrowIfCancellationRequested();return trend.CalculateTrend(scope.PatientId,MeasurementPeriod.Normalize(from),MeasurementPeriod.Normalize(to),series,selection);} {
var series = await observations.SelectedAsync(scope, from, to, selection, ct); await tx.FinishAsync(ct); ct.ThrowIfCancellationRequested(); var result = trend.CalculateTrend(scope.PatientId, MeasurementPeriod.Normalize(from), MeasurementPeriod.Normalize(to), series, selection);
ct.ThrowIfCancellationRequested();
return result;
}
} }
public static class AnalyticsModule public static class AnalyticsModule
{ {
+1
View File
@@ -1,6 +1,7 @@
using System.Globalization; using System.Globalization;
using HealthApp.Contracts; using HealthApp.Contracts;
namespace HealthApp.Analytics; namespace HealthApp.Analytics;
internal sealed class ClinicalPolicy(ReferenceCatalog catalog) internal sealed class ClinicalPolicy(ReferenceCatalog catalog)
{ {
internal const string GeneralLimits = "General reference thresholds are not individual treatment targets. " + internal const string GeneralLimits = "General reference thresholds are not individual treatment targets. " +
+1
View File
@@ -5,6 +5,7 @@ namespace HealthApp.Analytics;
internal sealed class TrendPolicy(ClinicalPolicy clinical) internal sealed class TrendPolicy(ClinicalPolicy clinical)
{ {
internal const string MethodVersion = "baseline-2026-10-05";
private const string GeneralLimits = ClinicalPolicy.GeneralLimits; private const string GeneralLimits = ClinicalPolicy.GeneralLimits;
public TrendAssessment CalculateTrend(Guid patientId, DateTime from, DateTime to, public TrendAssessment CalculateTrend(Guid patientId, DateTime from, DateTime to,
+1
View File
@@ -3,6 +3,7 @@ namespace HealthApp.Guidance;
// Content preserved from the pinned baseline; no new clinical review is implied. // Content preserved from the pinned baseline; no new clinical review is implied.
public sealed class GuidanceQueries public sealed class GuidanceQueries
{ {
public const string Version = "baseline-2026-10-04";
public object Get(string? setting, string? activityCondition) public object Get(string? setting, string? activityCondition)
{ {
var requestedSetting = string.IsNullOrWhiteSpace(setting) ? "Unknown" : setting.Trim(); var requestedSetting = string.IsNullOrWhiteSpace(setting) ? "Unknown" : setting.Trim();
@@ -4,6 +4,21 @@ namespace HealthApp.Guidance;
public sealed class ReviewedReferenceCatalog : ReferenceCatalog public sealed class ReviewedReferenceCatalog : ReferenceCatalog
{ {
public string Version => "baseline-2026-10-05"; public string Version => "baseline-2026-10-05";
public IReadOnlyList<ClinicalRuleProvenance> Claims { get; } = Array.AsReadOnly(new[]
{
new ClinicalRuleProvenance("Systolic/Diastolic", "Setting-specific reference comparison",
"All recorded AtRest, one Home/Clinic setting, no detected conflicts; recorded rest below five minutes or non-seated position blocks the comparison",
"Compare raw levels with the cited inclusive high boundary; missing irrelevant optional detail does not suppress provisional comparison; no individual target or diagnosis",
"Baseline sources reviewed 2026-10-05; no new clinical review"),
new ClinicalRuleProvenance("Pulse", "Resting rate reference comparison",
"All recorded AtRest and no detected narrative conflicts; BP-specific preparation does not gate pulse",
"Compare raw resting rates below 50 or above 100 using exclusive limits; no rhythm diagnosis or universal healthy range",
"Baseline sources reviewed 2026-10-05; no new clinical review"),
new ClinicalRuleProvenance("Systolic/Diastolic/Pulse", "Development classification",
"At least two distinct instants, applicable reference, SupportedRecordedComparability; exact preserved ClinicalPolicy branches govern reversals and opposite-boundary excursions",
"Only the baseline PotentiallyFavourable/PotentiallyConcerning/Mixed/CannotInterpret branches; no blanket interpretation from numerical sign or range",
"Preserved cautious baseline inference; independent domain validity remains unverified")
});
public ClinicalReference Pulse() public ClinicalReference Pulse()
{ {
return new("Recorded resting pulse", 50, "<", 100, ">", return new("Recorded resting pulse", 50, "<", 100, ">",
@@ -6,6 +6,7 @@ using HealthApp.Observations.Persistence;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace HealthApp.Observations; namespace HealthApp.Observations;
internal sealed class ObservationFacade(ObservationDbContext db, RequestTransaction tx, ProfileQueries profiles) : ObservationQueries, ObservationCommands internal sealed class ObservationFacade(ObservationDbContext db, RequestTransaction tx, ProfileQueries profiles) : ObservationQueries, ObservationCommands
{ {
public async Task<Guid?> ResolveOwnerAsync(Guid id, CancellationToken ct) { await tx.EnlistAsync(db, ct); return await db.Observations.AsNoTracking().Where(o => o.ObservationId == id).Select(o => (Guid?)o.PatientId).SingleOrDefaultAsync(ct); } public async Task<Guid?> ResolveOwnerAsync(Guid id, CancellationToken ct) { await tx.EnlistAsync(db, ct); return await db.Observations.AsNoTracking().Where(o => o.ObservationId == id).Select(o => (Guid?)o.PatientId).SingleOrDefaultAsync(ct); }
+1
View File
@@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations;
using HealthApp.Contracts; using HealthApp.Contracts;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace HealthApp.Overview; namespace HealthApp.Overview;
internal sealed class OverviewFacade(ProfileQueries patients, ObservationQueries observations, AnalyticsQueries analytics) : OverviewQueries internal sealed class OverviewFacade(ProfileQueries patients, ObservationQueries observations, AnalyticsQueries analytics) : OverviewQueries
{ {
public async Task<HealthOverviewDto?> GetAsync(AuthorizedPatientContext scope, DateTime from, DateTime to, ContextSelection selection, CancellationToken ct) public async Task<HealthOverviewDto?> GetAsync(AuthorizedPatientContext scope, DateTime from, DateTime to, ContextSelection selection, CancellationToken ct)
+1
View File
@@ -7,6 +7,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Npgsql; using Npgsql;
namespace HealthApp.Profile; namespace HealthApp.Profile;
internal sealed class ProfileFacade(PatientDbContext db, RequestTransaction tx) : ProfileQueries, ProfileCommands internal sealed class ProfileFacade(PatientDbContext db, RequestTransaction tx) : ProfileQueries, ProfileCommands
{ {
public async Task<Guid?> ResolveAccountAsync(string id, CancellationToken ct) public async Task<Guid?> ResolveAccountAsync(string id, CancellationToken ct)
@@ -58,7 +58,8 @@ public sealed class AuthenticationIntegrationTests
} }
fixture.AdditionalGatewayConfiguration["TestIdentity:Role"] = role; fixture.AdditionalGatewayConfiguration["TestIdentity:AccountId"] = accountId; fixture.AdditionalGatewayConfiguration["TestIdentity:Role"] = role; fixture.AdditionalGatewayConfiguration["TestIdentity:AccountId"] = accountId;
fixture.AdditionalGatewayConfiguration[$"Access:ProfessionalAssignments:{accountId}:0"] = patient.ToString(); fixture.AdditionalGatewayConfiguration[$"Access:ProfessionalAssignments:{accountId}:0"] = patient.ToString();
fixture.ConfigureServices=services=>{ fixture.ConfigureServices = services =>
{
services.AddAuthentication().AddScheme<AuthenticationSchemeOptions, ReplacementHandler>("Replacement", null); services.AddAuthentication().AddScheme<AuthenticationSchemeOptions, ReplacementHandler>("Replacement", null);
services.PostConfigure<AuthenticationOptions>(options => { options.DefaultAuthenticateScheme = "Replacement"; options.DefaultChallengeScheme = "Replacement"; options.DefaultScheme = "Replacement"; }); services.PostConfigure<AuthenticationOptions>(options => { options.DefaultAuthenticateScheme = "Replacement"; options.DefaultChallengeScheme = "Replacement"; options.DefaultScheme = "Replacement"; });
}; };
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Xunit; using Xunit;
namespace HealthApp.AcceptanceTests; namespace HealthApp.AcceptanceTests;
public sealed class ConformanceTests public sealed class ConformanceTests
{ {
[Fact] [Fact]
@@ -27,10 +27,16 @@ public sealed class ContextFilteredHistoryTests(ObservationApiFixture fixture) :
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new
{ {
measuredAt = time, systolic = 128, diastolic = 82, pulse = 68, context = legacy, measuredAt = time,
systolic = 128,
diastolic = 82,
pulse = 68,
context = legacy,
measurementContext = includeContext ? new measurementContext = includeContext ? new
{ {
setting, activityCondition = activity, deviceDetails = "Saved device", setting,
activityCondition = activity,
deviceDetails = "Saved device",
restDurationMinutes = completeContext ? (decimal?)5 : null, restDurationMinutes = completeContext ? (decimal?)5 : null,
bodyPosition = completeContext ? "Seated" : null, bodyPosition = completeContext ? "Seated" : null,
measuredArm = completeContext ? "Left" : null, measuredArm = completeContext ? "Left" : null,
@@ -29,7 +29,11 @@ public sealed class ContextSelectedInsightTests(ObservationApiFixture fixture) :
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new
{ {
measuredAt = time, systolic, diastolic, pulse, context = "Home resting?", measuredAt = time,
systolic,
diastolic,
pulse,
context = "Home resting?",
measurementContext = new { setting, activityCondition = activity, bodyPosition = position } measurementContext = new { setting, activityCondition = activity, bodyPosition = position }
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
@@ -101,6 +105,8 @@ public sealed class ContextSelectedInsightTests(ObservationApiFixture fixture) :
Assert.Equal(120m, result.AverageSystolic); Assert.Equal(120m, result.AverageSystolic);
Assert.Equal(80m, result.AverageDiastolic); Assert.Equal(80m, result.AverageDiastolic);
Assert.Equal(60m, result.AveragePulse); Assert.Equal(60m, result.AveragePulse);
Assert.Equal(120, result.MinSystolic);
Assert.Equal(80, result.MinDiastolic);
Assert.Equal(result.MinSystolic, result.MaxSystolic); Assert.Equal(result.MinSystolic, result.MaxSystolic);
Assert.Equal(result.MinDiastolic, result.MaxDiastolic); Assert.Equal(result.MinDiastolic, result.MaxDiastolic);
Assert.Equal(new Selection(setting, activity), result.AppliedSelection); Assert.Equal(new Selection(setting, activity), result.AppliedSelection);
@@ -17,7 +17,9 @@ public sealed class CreatePatientTests(PatientApiFixture fixture) : IClassFixtur
{ {
using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new
{ {
name = "Steffen Example", dateOfBirth = "1980-01-01", contactInfo = "steffen@example.test" name = "Steffen Example",
dateOfBirth = "1980-01-01",
contactInfo = "steffen@example.test"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
var created = await response.Content.ReadFromJsonAsync<Profile>(); var created = await response.Content.ReadFromJsonAsync<Profile>();
@@ -29,9 +29,23 @@ public sealed class DeleteContextualisedObservationTests(ObservationApiFixture f
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new
{ {
measuredAt = time, systolic, diastolic, pulse, context = "Original context", note = "Original note", measuredAt = time,
measurementContext = new { setting = "Home", activityCondition = "AtRest", restDurationMinutes = 5.5m, systolic,
bodyPosition = "Seated", measuredArm = "Left", deviceDetails = "Device", cuffDetails = "Cuff", additionalCircumstances = "Actual circumstances" } diastolic,
pulse,
context = "Original context",
note = "Original note",
measurementContext = new
{
setting = "Home",
activityCondition = "AtRest",
restDurationMinutes = 5.5m,
bodyPosition = "Seated",
measuredArm = "Left",
deviceDetails = "Device",
cuffDetails = "Cuff",
additionalCircumstances = "Actual circumstances"
}
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Observation>())!; return (await response.Content.ReadFromJsonAsync<Observation>())!;
@@ -15,7 +15,8 @@ public sealed class DeleteObservationTests(ObservationApiFixture fixture) : ICla
{ {
using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new
{ {
name = "Deletion Example", dateOfBirth = "1980-01-01" name = "Deletion Example",
dateOfBirth = "1980-01-01"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Profile>())!.PatientId; return (await response.Content.ReadFromJsonAsync<Profile>())!.PatientId;
@@ -25,7 +26,12 @@ public sealed class DeleteObservationTests(ObservationApiFixture fixture) : ICla
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt, systolic = 128, diastolic = 82, pulse = 68, context = "Resting", note = "Before breakfast" measuredAt,
systolic = 128,
diastolic = 82,
pulse = 68,
context = "Resting",
note = "Before breakfast"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Observation>())!; return (await response.Content.ReadFromJsonAsync<Observation>())!;
@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Xunit; using Xunit;
namespace HealthApp.AcceptanceTests; namespace HealthApp.AcceptanceTests;
public sealed class FoundationTests public sealed class FoundationTests
{ {
[Fact] [Fact]
@@ -25,9 +25,23 @@ public sealed class HealthOverviewTests(ObservationApiFixture fixture) : IClassF
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new
{ {
measuredAt = time, systolic, diastolic = 80, pulse = 65, context = "Preserved original context", note = "Preserved note", measuredAt = time,
measurementContext = new { setting, activityCondition = activity, restDurationMinutes = 5, systolic,
bodyPosition = "Seated", measuredArm = "Left", deviceDetails = "Device", cuffDetails = "Cuff", additionalCircumstances = "Morning" } diastolic = 80,
pulse = 65,
context = "Preserved original context",
note = "Preserved note",
measurementContext = new
{
setting,
activityCondition = activity,
restDurationMinutes = 5,
bodyPosition = "Seated",
measuredArm = "Left",
deviceDetails = "Device",
cuffDetails = "Cuff",
additionalCircumstances = "Morning"
}
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Recorded>())!.ObservationId; return (await response.Content.ReadFromJsonAsync<Recorded>())!.ObservationId;
@@ -261,9 +261,20 @@ public sealed class HealthTrendTests(ObservationApiFixture fixture) : IClassFixt
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patient}/observations", new
{ {
measuredAt = time, systolic, diastolic = 85, pulse = 70, measuredAt = time,
measurementContext = new { setting, activityCondition = activity, restDurationMinutes = 5, systolic,
bodyPosition = "Seated", measuredArm = "Left", deviceDetails = "Device A", cuffDetails = "Adult cuff" } diastolic = 85,
pulse = 70,
measurementContext = new
{
setting,
activityCondition = activity,
restDurationMinutes = 5,
bodyPosition = "Seated",
measuredArm = "Left",
deviceDetails = "Device A",
cuffDetails = "Adult cuff"
}
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Recorded>())!.ObservationId; return (await response.Content.ReadFromJsonAsync<Recorded>())!.ObservationId;
@@ -17,7 +17,8 @@ public sealed class LatestObservationTests(ObservationApiFixture fixture) : ICla
{ {
using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new
{ {
name = "Latest Example", dateOfBirth = "1980-01-01" name = "Latest Example",
dateOfBirth = "1980-01-01"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Profile>())!.PatientId; return (await response.Content.ReadFromJsonAsync<Profile>())!.PatientId;
@@ -27,7 +28,12 @@ public sealed class LatestObservationTests(ObservationApiFixture fixture) : ICla
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt, systolic, diastolic, pulse, context = "Resting", note = "Before breakfast" measuredAt,
systolic,
diastolic,
pulse,
context = "Resting",
note = "Before breakfast"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Observation>())!; return (await response.Content.ReadFromJsonAsync<Observation>())!;
@@ -74,15 +80,27 @@ public sealed class LatestObservationTests(ObservationApiFixture fixture) : ICla
db.Observations.AddRange( db.Observations.AddRange(
new BloodPressureObservation new BloodPressureObservation
{ {
ObservationId = newerId, PatientId = patientId, MeasuredAt = newerMeasured, ObservationId = newerId,
Systolic = 126, Diastolic = 80, Pulse = 66, MeasurementContext = newerContext, PatientId = patientId,
CreatedAt = newerRecorded, UpdatedAt = newerRecorded MeasuredAt = newerMeasured,
Systolic = 126,
Diastolic = 80,
Pulse = 66,
MeasurementContext = newerContext,
CreatedAt = newerRecorded,
UpdatedAt = newerRecorded
}, },
new BloodPressureObservation new BloodPressureObservation
{ {
ObservationId = olderId, PatientId = patientId, MeasuredAt = olderMeasured, ObservationId = olderId,
Systolic = 130, Diastolic = 84, Pulse = 70, MeasurementContext = olderContext, PatientId = patientId,
CreatedAt = olderRecorded, UpdatedAt = olderRecorded MeasuredAt = olderMeasured,
Systolic = 130,
Diastolic = 84,
Pulse = 70,
MeasurementContext = olderContext,
CreatedAt = olderRecorded,
UpdatedAt = olderRecorded
}); });
await db.SaveChangesAsync(); await db.SaveChangesAsync();
return (olderId, newerId); return (olderId, newerId);
@@ -110,8 +128,16 @@ public sealed class LatestObservationTests(ObservationApiFixture fixture) : ICla
var patient = await CreatePatientAsync(); var patient = await CreatePatientAsync();
var time = new DateTime(2026, 9, 12, 8, 0, 0); var time = new DateTime(2026, 9, 12, 8, 0, 0);
var pair = await SeedPair(patient, time.AddDays(-1), time, time, time.AddHours(1), var pair = await SeedPair(patient, time.AddDays(-1), time, time, time.AddHours(1),
new MeasurementContext { Setting = "Home", ActivityCondition = "AtRest", RestDurationMinutes = 5, new MeasurementContext
BodyPosition = "Seated", MeasuredArm = "Left", DeviceDetails = "Recorded device", CuffDetails = "Recorded cuff" }, {
Setting = "Home",
ActivityCondition = "AtRest",
RestDurationMinutes = 5,
BodyPosition = "Seated",
MeasuredArm = "Left",
DeviceDetails = "Recorded device",
CuffDetails = "Recorded cuff"
},
new MeasurementContext()); new MeasurementContext());
var latest = (await Latest(patient))!; var latest = (await Latest(patient))!;
Assert.Equal(pair.NewerId, latest.ObservationId); Assert.Equal(pair.NewerId, latest.ObservationId);
@@ -2,6 +2,7 @@ using HealthApp.Observations.Persistence;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Npgsql; using Npgsql;
namespace Observation.AcceptanceTests; namespace Observation.AcceptanceTests;
public sealed class ObservationApiFixture : PatientProfile.AcceptanceTests.PatientApiFixture public sealed class ObservationApiFixture : PatientProfile.AcceptanceTests.PatientApiFixture
{ {
private string? healthyConnection; private string? healthyConnection;
@@ -5,6 +5,7 @@ using Npgsql;
using Observation.AcceptanceTests; using Observation.AcceptanceTests;
using Xunit; using Xunit;
namespace HealthApp.AcceptanceTests; namespace HealthApp.AcceptanceTests;
public sealed class ObservationConcurrencyTests(ObservationApiFixture fixture) : IClassFixture<ObservationApiFixture> public sealed class ObservationConcurrencyTests(ObservationApiFixture fixture) : IClassFixture<ObservationApiFixture>
{ {
[Fact] [Fact]
@@ -22,7 +23,8 @@ public sealed class ObservationConcurrencyTests(ObservationApiFixture fixture) :
for (var i = 0; i < 100; i++) for (var i = 0; i < 100; i++)
{ {
var count = (long)(await new NpgsqlCommand("SELECT count(*) FROM pg_stat_activity WHERE usename=@role AND wait_event_type='Lock'", probe) { Parameters = { new NpgsqlParameter("role", role) } }.ExecuteScalarAsync())!; var count = (long)(await new NpgsqlCommand("SELECT count(*) FROM pg_stat_activity WHERE usename=@role AND wait_event_type='Lock'", probe) { Parameters = { new NpgsqlParameter("role", role) } }.ExecuteScalarAsync())!;
if(count>=2){waited=true;break;}await Task.Delay(20); if (count >= 2) { waited = true; break; }
await Task.Delay(20);
} }
Assert.True(waited, "Both mutations must wait on the held observation lock."); Assert.True(waited, "Both mutations must wait on the held observation lock.");
Assert.False(first.IsCompleted); Assert.False(second.IsCompleted); Assert.False(first.IsCompleted); Assert.False(second.IsCompleted);
@@ -35,5 +37,13 @@ public sealed class ObservationConcurrencyTests(ObservationApiFixture fixture) :
{ {
await using var c = new NpgsqlConnection(fixture.ConnectionString); await c.OpenAsync(); await using var c = new NpgsqlConnection(fixture.ConnectionString); await c.OpenAsync();
var e = await Assert.ThrowsAsync<PostgresException>(() => new NpgsqlCommand("INSERT INTO observations.observation(observation_id,patient_id,measured_at,systolic,diastolic,pulse,created_at,updated_at) VALUES(gen_random_uuid(),gen_random_uuid(),now(),128,82,68,now(),now())", c).ExecuteNonQueryAsync()); Assert.Equal("23503", e.SqlState); var e = await Assert.ThrowsAsync<PostgresException>(() => new NpgsqlCommand("INSERT INTO observations.observation(observation_id,patient_id,measured_at,systolic,diastolic,pulse,created_at,updated_at) VALUES(gen_random_uuid(),gen_random_uuid(),now(),128,82,68,now(),now())", c).ExecuteNonQueryAsync()); Assert.Equal("23503", e.SqlState);
using var created = await fixture.Client.PostAsJsonAsync("/api/patients", new { name = "Constraints", dateOfBirth = "1980-01-01" }); var p = (await created.Content.ReadFromJsonAsync<PatientDto>())!;
using var recorded = await fixture.Client.PostAsJsonAsync($"/api/patients/{p.PatientId}/observations", new { measuredAt = "2026-09-12T08:00:00", systolic = 128, diastolic = 82, pulse = 68 }); var o = (await recorded.Content.ReadFromJsonAsync<ObservationDto>())!;
foreach (var update in new[] { "systolic=0", "diastolic=-1", "pulse=0", "setting='Unsupported'", "activity_condition='Unsupported'", "rest_duration_minutes=-1" })
{
var command = new NpgsqlCommand($"UPDATE observations.observation SET {update} WHERE observation_id=@id", c); command.Parameters.AddWithValue("id", o.ObservationId);
e = await Assert.ThrowsAsync<PostgresException>(() => command.ExecuteNonQueryAsync()); Assert.Equal("23514", e.SqlState);
}
var saved = (await fixture.Client.GetFromJsonAsync<ObservationDto>($"/api/observations/{o.ObservationId}"))!; Assert.Equal(128, saved.Systolic); Assert.Equal("Unknown", saved.MeasurementContext!.Setting);
} }
} }
@@ -15,7 +15,8 @@ public sealed class ObservationHistoryTests(ObservationApiFixture fixture) : ICl
{ {
using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new
{ {
name = "History Example", dateOfBirth = "1980-01-01" name = "History Example",
dateOfBirth = "1980-01-01"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Profile>())!.PatientId; return (await response.Content.ReadFromJsonAsync<Profile>())!.PatientId;
@@ -25,7 +26,12 @@ public sealed class ObservationHistoryTests(ObservationApiFixture fixture) : ICl
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt, systolic, diastolic, pulse, context = "Resting", note = "Before breakfast" measuredAt,
systolic,
diastolic,
pulse,
context = "Resting",
note = "Before breakfast"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Observation>())!; return (await response.Content.ReadFromJsonAsync<Observation>())!;
@@ -7,6 +7,7 @@ using Npgsql;
using Observation.AcceptanceTests; using Observation.AcceptanceTests;
using Xunit; using Xunit;
namespace HealthApp.AcceptanceTests; namespace HealthApp.AcceptanceTests;
public sealed class OperationalTests(ObservationApiFixture fixture) : IClassFixture<ObservationApiFixture> public sealed class OperationalTests(ObservationApiFixture fixture) : IClassFixture<ObservationApiFixture>
{ {
[Fact] [Fact]
@@ -45,7 +46,8 @@ public sealed class OperationalTests(ObservationApiFixture fixture) : IClassFixt
using var create = await fixture.Client.PostAsJsonAsync("/api/patients", new { name = "Budget", dateOfBirth = "1980-01-01" }); var p = (await create.Content.ReadFromJsonAsync<PatientDto>())!; using var create = await fixture.Client.PostAsJsonAsync("/api/patients", new { name = "Budget", dateOfBirth = "1980-01-01" }); var p = (await create.Content.ReadFromJsonAsync<PatientDto>())!;
fixture.AdditionalGatewayConfiguration["Resources:MaxConcurrentAssessments"] = "1"; await fixture.RestartHostsAsync(); fixture.AdditionalGatewayConfiguration["Resources:MaxConcurrentAssessments"] = "1"; await fixture.RestartHostsAsync();
var held = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var release = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var held = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var release = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
fixture.ConfigureServices=services=>{ fixture.ConfigureServices = services =>
{
var descriptor = services.Last(d => d.ServiceType == typeof(ProfileQueries)); services.Remove(descriptor); var descriptor = services.Last(d => d.ServiceType == typeof(ProfileQueries)); services.Remove(descriptor);
services.AddScoped<ProfileQueries>(sp => new PausedProfile((ProfileQueries)descriptor.ImplementationFactory!(sp), async () => { held.TrySetResult(); await release.Task; })); services.AddScoped<ProfileQueries>(sp => new PausedProfile((ProfileQueries)descriptor.ImplementationFactory!(sp), async () => { held.TrySetResult(); await release.Task; }));
}; await fixture.RestartHostsAsync(); }; await fixture.RestartHostsAsync();
@@ -24,10 +24,23 @@ public sealed class PatchObservationTests(ObservationApiFixture fixture) : IClas
var patientId = (await patient.Content.ReadFromJsonAsync<Profile>())!.PatientId; var patientId = (await patient.Content.ReadFromJsonAsync<Profile>())!.PatientId;
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt = "2026-09-12T08:00:00", systolic = 182, diastolic = 82, pulse = 68, measuredAt = "2026-09-12T08:00:00",
context = "Legacy text", note = "Saved note", systolic = 182,
measurementContext = withContext ? new { setting = "Home", activityCondition = "AtRest", restDurationMinutes = 5.5m, diastolic = 82,
bodyPosition = "Seated", measuredArm = "Left", deviceDetails = "Device", cuffDetails = "Cuff", additionalCircumstances = "Circumstances" } : null pulse = 68,
context = "Legacy text",
note = "Saved note",
measurementContext = withContext ? new
{
setting = "Home",
activityCondition = "AtRest",
restDurationMinutes = 5.5m,
bodyPosition = "Seated",
measuredArm = "Left",
deviceDetails = "Device",
cuffDetails = "Cuff",
additionalCircumstances = "Circumstances"
} : null
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Observation>())!; return (await response.Content.ReadFromJsonAsync<Observation>())!;
@@ -72,15 +85,45 @@ public sealed class PatchObservationTests(ObservationApiFixture fixture) : IClas
public async Task Individual_optional_fields_can_be_corrected_or_cleared_without_erasing_other_context() public async Task Individual_optional_fields_can_be_corrected_or_cleared_without_erasing_other_context()
{ {
var original = await Record(); var original = await Record();
using var corrected = await Patch(original.ObservationId, new { measurementContext = new { restDurationMinutes = 0m, using var corrected = await Patch(original.ObservationId, new
bodyPosition = "Standing", measuredArm = "Right", deviceDetails = "Corrected device", cuffDetails = "Corrected cuff", additionalCircumstances = "After walking" } }); {
measurementContext = new
{
restDurationMinutes = 0m,
bodyPosition = "Standing",
measuredArm = "Right",
deviceDetails = "Corrected device",
cuffDetails = "Corrected cuff",
additionalCircumstances = "After walking"
}
});
Assert.Equal(HttpStatusCode.OK, corrected.StatusCode); Assert.Equal(HttpStatusCode.OK, corrected.StatusCode);
var expected = original with { MeasurementContext = original.MeasurementContext with { RestDurationMinutes = 0, var expected = original with
BodyPosition = "Standing", MeasuredArm = "Right", DeviceDetails = "Corrected device", CuffDetails = "Corrected cuff", AdditionalCircumstances = "After walking" } }; {
MeasurementContext = original.MeasurementContext with
{
RestDurationMinutes = 0,
BodyPosition = "Standing",
MeasuredArm = "Right",
DeviceDetails = "Corrected device",
CuffDetails = "Corrected cuff",
AdditionalCircumstances = "After walking"
}
};
Assert.Equal(expected, await corrected.Content.ReadFromJsonAsync<Observation>()); Assert.Equal(expected, await corrected.Content.ReadFromJsonAsync<Observation>());
using var clear = await Patch(original.ObservationId, new { measurementContext = new { activityCondition = (string?)null, using var clear = await Patch(original.ObservationId, new
restDurationMinutes = (decimal?)null, bodyPosition = (string?)null, measuredArm = (string?)null, {
deviceDetails = (string?)null, cuffDetails = (string?)null, additionalCircumstances = (string?)null } }); measurementContext = new
{
activityCondition = (string?)null,
restDurationMinutes = (decimal?)null,
bodyPosition = (string?)null,
measuredArm = (string?)null,
deviceDetails = (string?)null,
cuffDetails = (string?)null,
additionalCircumstances = (string?)null
}
});
Assert.Equal(HttpStatusCode.OK, clear.StatusCode); Assert.Equal(HttpStatusCode.OK, clear.StatusCode);
expected = original with { MeasurementContext = new ContextData("Home", "Unknown", null, null, null, null, null, null) }; expected = original with { MeasurementContext = new ContextData("Home", "Unknown", null, null, null, null, null, null) };
Assert.Equal(expected, await Read(original.ObservationId)); Assert.Equal(expected, await Read(original.ObservationId));
@@ -145,7 +188,9 @@ public sealed class PatchObservationTests(ObservationApiFixture fixture) : IClas
var original = await Record(); var original = await Record();
using var response = await fixture.Client.PutAsJsonAsync($"/api/observations/{original.ObservationId}", new using var response = await fixture.Client.PutAsJsonAsync($"/api/observations/{original.ObservationId}", new
{ {
systolic = 128, diastolic = 80, pulse = 65, systolic = 128,
diastolic = 80,
pulse = 65,
measurementContext = new { setting = "Unsupported" } measurementContext = new { setting = "Unsupported" }
}); });
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
@@ -11,6 +11,7 @@ using Microsoft.Extensions.DependencyInjection;
using Npgsql; using Npgsql;
using Xunit; using Xunit;
namespace PatientProfile.AcceptanceTests; namespace PatientProfile.AcceptanceTests;
public class PatientApiFixture : IAsyncLifetime public class PatientApiFixture : IAsyncLifetime
{ {
private readonly string databaseName = "architecture_b_" + Guid.NewGuid().ToString("N"); private readonly string databaseName = "architecture_b_" + Guid.NewGuid().ToString("N");
@@ -48,7 +49,8 @@ public class PatientApiFixture : IAsyncLifetime
internal PatientDbContext CreateDbContext() => new(new DbContextOptionsBuilder<PatientDbContext>().UseNpgsql(ConnectionString).Options); internal PatientDbContext CreateDbContext() => new(new DbContextOptionsBuilder<PatientDbContext>().UseNpgsql(ConnectionString).Options);
private void Start() private void Start()
{ {
host=new WebApplicationFactory<HealthApp.Program>().WithWebHostBuilder(b=>{ host = new WebApplicationFactory<HealthApp.Program>().WithWebHostBuilder(b =>
{
b.UseEnvironment("Development"); b.ConfigureKestrel(k => k.Listen(IPAddress.Loopback, 0)); b.UseEnvironment("Development"); b.ConfigureKestrel(k => k.Listen(IPAddress.Loopback, 0));
b.ConfigureAppConfiguration((_, c) => c.AddInMemoryCollection(Authentication.Configuration()).AddInMemoryCollection(AdditionalGatewayConfiguration).AddInMemoryCollection(new Dictionary<string, string?> { ["ConnectionStrings:HealthDatabase"] = RuntimeConnectionString })); b.ConfigureAppConfiguration((_, c) => c.AddInMemoryCollection(Authentication.Configuration()).AddInMemoryCollection(AdditionalGatewayConfiguration).AddInMemoryCollection(new Dictionary<string, string?> { ["ConnectionStrings:HealthDatabase"] = RuntimeConnectionString }));
b.ConfigureServices(s => { s.PostConfigure<BearerTokenOptions>("Bearer", o => o.TimeProvider = Authentication.Clock); ConfigureServices?.Invoke(s); }); b.ConfigureServices(s => { s.PostConfigure<BearerTokenOptions>("Bearer", o => o.TimeProvider = Authentication.Clock); ConfigureServices?.Invoke(s); });
@@ -26,8 +26,12 @@ public sealed class ProfessionalAccessTests(ObservationApiFixture fixture) : ICl
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt = "2026-09-12T08:00:00", systolic = 128, diastolic = 82, pulse = 68, measuredAt = "2026-09-12T08:00:00",
context = "Resting", note = "Actual conditions" systolic = 128,
diastolic = 82,
pulse = 68,
context = "Resting",
note = "Actual conditions"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Observation>())!; return (await response.Content.ReadFromJsonAsync<Observation>())!;
@@ -7,6 +7,7 @@ using Npgsql;
using PatientProfile.AcceptanceTests; using PatientProfile.AcceptanceTests;
using Xunit; using Xunit;
namespace HealthApp.AcceptanceTests; namespace HealthApp.AcceptanceTests;
public sealed class ProfileLifecycleTests(PatientApiFixture fixture) : IClassFixture<PatientApiFixture> public sealed class ProfileLifecycleTests(PatientApiFixture fixture) : IClassFixture<PatientApiFixture>
{ {
[Fact] [Fact]
@@ -27,8 +27,13 @@ public sealed class RecordMeasurementContextTests(ObservationApiFixture fixture)
private Task<HttpResponseMessage> Record(Guid patientId, object? measurementContext, string? context = null, string? note = null) => private Task<HttpResponseMessage> Record(Guid patientId, object? measurementContext, string? context = null, string? note = null) =>
fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt = "2026-09-12T08:00:00", systolic = 128, diastolic = 82, pulse = 68, measuredAt = "2026-09-12T08:00:00",
measurementContext, context, note systolic = 128,
diastolic = 82,
pulse = 68,
measurementContext,
context,
note
}); });
[Fact] [Fact]
@@ -75,8 +80,14 @@ public sealed class RecordMeasurementContextTests(ObservationApiFixture fixture)
public async Task Setting_and_activity_are_independent_and_departures_from_guidance_are_valid(string setting, string activity) public async Task Setting_and_activity_are_independent_and_departures_from_guidance_are_valid(string setting, string activity)
{ {
var patient = await Patient(); var patient = await Patient();
using var response = await Record(patient, new { setting, activityCondition = activity, using var response = await Record(patient, new
restDurationMinutes = 0m, bodyPosition = "Standing", additionalCircumstances = "Walking immediately beforehand" }); {
setting,
activityCondition = activity,
restDurationMinutes = 0m,
bodyPosition = "Standing",
additionalCircumstances = "Walking immediately beforehand"
});
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
var saved = (await response.Content.ReadFromJsonAsync<Observation>())!; var saved = (await response.Content.ReadFromJsonAsync<Observation>())!;
Assert.Equal(setting, saved.MeasurementContext.Setting); Assert.Equal(setting, saved.MeasurementContext.Setting);
@@ -116,8 +127,12 @@ public sealed class RecordMeasurementContextTests(ObservationApiFixture fixture)
public async Task Conflicting_categories_and_narrative_are_preserved_without_relabelling() public async Task Conflicting_categories_and_narrative_are_preserved_without_relabelling()
{ {
var patient = await Patient(); var patient = await Patient();
using var response = await Record(patient, new { setting = "Home", activityCondition = "AtRest", using var response = await Record(patient, new
additionalCircumstances = "During exercise" }, "During exercise", "Recorded as supplied"); {
setting = "Home",
activityCondition = "AtRest",
additionalCircumstances = "During exercise"
}, "During exercise", "Recorded as supplied");
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
var saved = (await response.Content.ReadFromJsonAsync<Observation>())!; var saved = (await response.Content.ReadFromJsonAsync<Observation>())!;
Assert.Equal("AtRest", saved.MeasurementContext.ActivityCondition); Assert.Equal("AtRest", saved.MeasurementContext.ActivityCondition);
@@ -166,8 +181,14 @@ public sealed class RecordMeasurementContextTests(ObservationApiFixture fixture)
{ {
using var request = new HttpRequestMessage(HttpMethod.Post, $"/api/patients/{patient}/observations") using var request = new HttpRequestMessage(HttpMethod.Post, $"/api/patients/{patient}/observations")
{ {
Content = JsonContent.Create(new { measuredAt = "2026-09-12T08:00:00", systolic = 128, diastolic = 82, Content = JsonContent.Create(new
pulse = 68, measurementContext = new { setting = "Clinic" } }) {
measuredAt = "2026-09-12T08:00:00",
systolic = 128,
diastolic = 82,
pulse = 68,
measurementContext = new { setting = "Clinic" }
})
}; };
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
using var response = await fixture.RawClient.SendAsync(request); using var response = await fixture.RawClient.SendAsync(request);
@@ -17,7 +17,8 @@ public sealed class RecordObservationTests(ObservationApiFixture fixture) : ICla
{ {
using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new using var response = await fixture.Client.PostAsJsonAsync("/api/patients", new
{ {
name = "Steffen Example", dateOfBirth = "1980-01-01" name = "Steffen Example",
dateOfBirth = "1980-01-01"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Profile>())!.PatientId; return (await response.Content.ReadFromJsonAsync<Profile>())!.PatientId;
@@ -29,8 +30,12 @@ public sealed class RecordObservationTests(ObservationApiFixture fixture) : ICla
var patientId = await CreatePatientAsync(); var patientId = await CreatePatientAsync();
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt = "2026-09-12T08:00:00", systolic = 128, diastolic = 82, pulse = 68, measuredAt = "2026-09-12T08:00:00",
context = "Resting", note = "Before breakfast" systolic = 128,
diastolic = 82,
pulse = 68,
context = "Resting",
note = "Before breakfast"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
var saved = await response.Content.ReadFromJsonAsync<Observation>(); var saved = await response.Content.ReadFromJsonAsync<Observation>();
@@ -79,7 +84,10 @@ public sealed class RecordObservationTests(ObservationApiFixture fixture) : ICla
var before = await db.Observations.CountAsync(); var before = await db.Observations.CountAsync();
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt = "2026-09-12T08:00:00", systolic, diastolic, pulse measuredAt = "2026-09-12T08:00:00",
systolic,
diastolic,
pulse
}); });
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
Assert.Equal(before, await db.Observations.CountAsync()); Assert.Equal(before, await db.Observations.CountAsync());
@@ -113,7 +121,10 @@ public sealed class RecordObservationTests(ObservationApiFixture fixture) : ICla
var before = await db.Observations.CountAsync(); var before = await db.Observations.CountAsync();
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{Guid.NewGuid()}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{Guid.NewGuid()}/observations", new
{ {
measuredAt = "2026-09-12T08:00:00", systolic = 128, diastolic = 82, pulse = 68 measuredAt = "2026-09-12T08:00:00",
systolic = 128,
diastolic = 82,
pulse = 68
}); });
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
Assert.Equal(before, await db.Observations.CountAsync()); Assert.Equal(before, await db.Observations.CountAsync());
@@ -137,7 +148,10 @@ public sealed class RecordObservationTests(ObservationApiFixture fixture) : ICla
{ {
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt = "2026-09-12T08:00:00", systolic = 128, diastolic = 82, pulse = 68 measuredAt = "2026-09-12T08:00:00",
systolic = 128,
diastolic = 82,
pulse = 68
}); });
Assert.Equal(HttpStatusCode.ServiceUnavailable, response.StatusCode); Assert.Equal(HttpStatusCode.ServiceUnavailable, response.StatusCode);
Assert.Equal(before, await db.Observations.CountAsync()); Assert.Equal(before, await db.Observations.CountAsync());
@@ -6,6 +6,7 @@ using Npgsql;
using Observation.AcceptanceTests; using Observation.AcceptanceTests;
using Xunit; using Xunit;
namespace HealthApp.AcceptanceTests; namespace HealthApp.AcceptanceTests;
public sealed class SnapshotTests(ObservationApiFixture fixture) : IClassFixture<ObservationApiFixture> public sealed class SnapshotTests(ObservationApiFixture fixture) : IClassFixture<ObservationApiFixture>
{ {
[Fact] [Fact]
@@ -15,7 +16,8 @@ public sealed class SnapshotTests(ObservationApiFixture fixture) : IClassFixture
using var record = await fixture.Client.PostAsJsonAsync($"/api/patients/{p.PatientId}/observations", new { measuredAt = "2026-09-12T08:00:00", systolic = 120, diastolic = 80, pulse = 60 }); var o = (await record.Content.ReadFromJsonAsync<ObservationDto>())!; using var record = await fixture.Client.PostAsJsonAsync($"/api/patients/{p.PatientId}/observations", new { measuredAt = "2026-09-12T08:00:00", systolic = 120, diastolic = 80, pulse = 60 }); var o = (await record.Content.ReadFromJsonAsync<ObservationDto>())!;
var captured = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var resume = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var captured = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var resume = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
var armed = 1; var selectedCount = 0; var releasedBeforeReturn = false; var armed = 1; var selectedCount = 0; var releasedBeforeReturn = false;
fixture.ConfigureServices=services=>{ fixture.ConfigureServices = services =>
{
var pd = services.Last(d => d.ServiceType == typeof(ProfileQueries)); services.Remove(pd); var pd = services.Last(d => d.ServiceType == typeof(ProfileQueries)); services.Remove(pd);
services.AddScoped<ProfileQueries>(sp => new PausingProfile((ProfileQueries)pd.ImplementationFactory!(sp), async () => { if (Interlocked.Exchange(ref armed, 0) == 1) { captured.SetResult(); await resume.Task; } })); services.AddScoped<ProfileQueries>(sp => new PausingProfile((ProfileQueries)pd.ImplementationFactory!(sp), async () => { if (Interlocked.Exchange(ref armed, 0) == 1) { captured.SetResult(); await resume.Task; } }));
var od = services.Last(d => d.ServiceType == typeof(ObservationQueries)); services.Remove(od); var od = services.Last(d => d.ServiceType == typeof(ObservationQueries)); services.Remove(od);
@@ -17,14 +17,19 @@ public sealed class UpdateObservationTests(ObservationApiFixture fixture) : ICla
{ {
using var patient = await fixture.Client.PostAsJsonAsync("/api/patients", new using var patient = await fixture.Client.PostAsJsonAsync("/api/patients", new
{ {
name = "Correction Example", dateOfBirth = "1980-01-01" name = "Correction Example",
dateOfBirth = "1980-01-01"
}); });
Assert.Equal(HttpStatusCode.Created, patient.StatusCode); Assert.Equal(HttpStatusCode.Created, patient.StatusCode);
var patientId = (await patient.Content.ReadFromJsonAsync<Profile>())!.PatientId; var patientId = (await patient.Content.ReadFromJsonAsync<Profile>())!.PatientId;
using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new using var response = await fixture.Client.PostAsJsonAsync($"/api/patients/{patientId}/observations", new
{ {
measuredAt = "2026-09-12T08:00:00", systolic = 182, diastolic = 82, pulse = 68, measuredAt = "2026-09-12T08:00:00",
context = "Resting", note = "Before breakfast" systolic = 182,
diastolic = 82,
pulse = 68,
context = "Resting",
note = "Before breakfast"
}); });
Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(HttpStatusCode.Created, response.StatusCode);
return (await response.Content.ReadFromJsonAsync<Observation>())!; return (await response.Content.ReadFromJsonAsync<Observation>())!;
@@ -14,7 +14,9 @@ public sealed class UpdatePatientTests(PatientApiFixture fixture) : IClassFixtur
{ {
using var createdResponse = await fixture.Client.PostAsJsonAsync("/api/patients", new using var createdResponse = await fixture.Client.PostAsJsonAsync("/api/patients", new
{ {
name = "Steffen Example", dateOfBirth = "1980-01-01", contactInfo = "old@example.test" name = "Steffen Example",
dateOfBirth = "1980-01-01",
contactInfo = "old@example.test"
}); });
Assert.Equal(HttpStatusCode.Created, createdResponse.StatusCode); Assert.Equal(HttpStatusCode.Created, createdResponse.StatusCode);
var created = (await createdResponse.Content.ReadFromJsonAsync<Profile>())!; var created = (await createdResponse.Content.ReadFromJsonAsync<Profile>())!;
@@ -22,7 +24,8 @@ public sealed class UpdatePatientTests(PatientApiFixture fixture) : IClassFixtur
using var response = await fixture.Client.PutAsJsonAsync(path, new using var response = await fixture.Client.PutAsJsonAsync(path, new
{ {
name = "Steffen Updated", contactInfo = "new@example.test" name = "Steffen Updated",
contactInfo = "new@example.test"
}); });
Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var expected = created with { Name = "Steffen Updated", ContactInfo = "new@example.test" }; var expected = created with { Name = "Steffen Updated", ContactInfo = "new@example.test" };
@@ -40,7 +43,8 @@ public sealed class UpdatePatientTests(PatientApiFixture fixture) : IClassFixtur
var path = $"/api/patients/{Guid.NewGuid()}"; var path = $"/api/patients/{Guid.NewGuid()}";
using var response = await fixture.Client.PutAsJsonAsync(path, new using var response = await fixture.Client.PutAsJsonAsync(path, new
{ {
name = "Steffen Example", contactInfo = "new@example.test" name = "Steffen Example",
contactInfo = "new@example.test"
}); });
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
Assert.Equal(countBefore, await db.Patients.CountAsync()); Assert.Equal(countBefore, await db.Patients.CountAsync());
@@ -56,14 +60,17 @@ public sealed class UpdatePatientTests(PatientApiFixture fixture) : IClassFixtur
{ {
using var createdResponse = await fixture.Client.PostAsJsonAsync("/api/patients", new using var createdResponse = await fixture.Client.PostAsJsonAsync("/api/patients", new
{ {
name = "Steffen Example", dateOfBirth = "1980-01-01", contactInfo = "old@example.test" name = "Steffen Example",
dateOfBirth = "1980-01-01",
contactInfo = "old@example.test"
}); });
Assert.Equal(HttpStatusCode.Created, createdResponse.StatusCode); Assert.Equal(HttpStatusCode.Created, createdResponse.StatusCode);
var created = (await createdResponse.Content.ReadFromJsonAsync<Profile>())!; var created = (await createdResponse.Content.ReadFromJsonAsync<Profile>())!;
var path = $"/api/patients/{created.PatientId}"; var path = $"/api/patients/{created.PatientId}";
using var response = await fixture.Client.PutAsJsonAsync(path, new using var response = await fixture.Client.PutAsJsonAsync(path, new
{ {
name, contactInfo = "new@example.test" name,
contactInfo = "new@example.test"
}); });
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
Assert.Equal(created, await fixture.Client.GetFromJsonAsync<Profile>(path)); Assert.Equal(created, await fixture.Client.GetFromJsonAsync<Profile>(path));
@@ -28,16 +28,28 @@ public sealed class ViewObservationContextTests(ObservationApiFixture fixture) :
await using var patients = fixture.CreateDbContext(); await using var patients = fixture.CreateDbContext();
patients.Patients.Add(new Patient patients.Patients.Add(new Patient
{ {
PatientId = patientId, AccountId = account, Name = "Retrieval patient", PatientId = patientId,
DateOfBirth = new DateOnly(1980, 1, 1), CreatedAt = timestamp, UpdatedAt = timestamp AccountId = account,
Name = "Retrieval patient",
DateOfBirth = new DateOnly(1980, 1, 1),
CreatedAt = timestamp,
UpdatedAt = timestamp
}); });
await patients.SaveChangesAsync(); await patients.SaveChangesAsync();
await using var observations = fixture.CreateObservationDbContext(); await using var observations = fixture.CreateObservationDbContext();
observations.Observations.Add(new BloodPressureObservation observations.Observations.Add(new BloodPressureObservation
{ {
ObservationId = observationId, PatientId = patientId, MeasuredAt = timestamp, ObservationId = observationId,
Systolic = 128, Diastolic = 82, Pulse = 68, Context = legacyText, Note = "Saved note", PatientId = patientId,
MeasurementContext = context ?? new(), CreatedAt = timestamp, UpdatedAt = timestamp MeasuredAt = timestamp,
Systolic = 128,
Diastolic = 82,
Pulse = 68,
Context = legacyText,
Note = "Saved note",
MeasurementContext = context ?? new(),
CreatedAt = timestamp,
UpdatedAt = timestamp
}); });
await observations.SaveChangesAsync(); await observations.SaveChangesAsync();
return new Saved(account, patientId, observationId); return new Saved(account, patientId, observationId);
@@ -55,9 +67,14 @@ public sealed class ViewObservationContextTests(ObservationApiFixture fixture) :
{ {
var saved = await Seed(new MeasurementContext var saved = await Seed(new MeasurementContext
{ {
Setting = "Home", ActivityCondition = "AtRest", RestDurationMinutes = 5.5m, Setting = "Home",
BodyPosition = "Seated", MeasuredArm = "Right", DeviceDetails = "Recorded device", ActivityCondition = "AtRest",
CuffDetails = "Recorded cuff", AdditionalCircumstances = "Recorded circumstances" RestDurationMinutes = 5.5m,
BodyPosition = "Seated",
MeasuredArm = "Right",
DeviceDetails = "Recorded device",
CuffDetails = "Recorded cuff",
AdditionalCircumstances = "Recorded circumstances"
}, "Original context text"); }, "Original context text");
await fixture.RestartHostsAsync(); await fixture.RestartHostsAsync();
var token = await AuthenticatedTestClient.LoginAsync(fixture.RawClient, saved.AccountId); var token = await AuthenticatedTestClient.LoginAsync(fixture.RawClient, saved.AccountId);
@@ -135,8 +152,12 @@ public sealed class ViewObservationContextTests(ObservationApiFixture fixture) :
[Fact] [Fact]
public async Task Assigned_professional_reads_the_same_context_as_the_owner() public async Task Assigned_professional_reads_the_same_context_as_the_owner()
{ {
var saved = await Seed(new MeasurementContext { Setting = "Clinic", ActivityCondition = "AfterActivity", var saved = await Seed(new MeasurementContext
AdditionalCircumstances = "Actual circumstances" }, "Original narrative"); {
Setting = "Clinic",
ActivityCondition = "AfterActivity",
AdditionalCircumstances = "Actual circumstances"
}, "Original narrative");
fixture.AdditionalGatewayConfiguration["Access:ProfessionalAssignments:professional:0"] = saved.PatientId.ToString(); fixture.AdditionalGatewayConfiguration["Access:ProfessionalAssignments:professional:0"] = saved.PatientId.ToString();
await fixture.RestartHostsAsync(); await fixture.RestartHostsAsync();
var patientToken = await AuthenticatedTestClient.LoginAsync(fixture.RawClient, saved.AccountId); var patientToken = await AuthenticatedTestClient.LoginAsync(fixture.RawClient, saved.AccountId);
@@ -0,0 +1 @@
<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>net10.0</TargetFramework><IsTestProject>true</IsTestProject><Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings></PropertyGroup><ItemGroup><ProjectReference Include="../../deploy/HealthApp.Provisioning/HealthApp.Provisioning.csproj"/><PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1"/><PackageReference Include="xunit" Version="2.9.3"/><PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="all"/></ItemGroup></Project>
@@ -0,0 +1,51 @@
using System.Diagnostics;
using System.Security.Cryptography.X509Certificates;
using System.Text.Json;
using HealthApp.Provisioning;
using Xunit;
namespace HealthApp.DeploymentTests;
public sealed class ProvisioningTests
{
[Fact]
public void Preparation_generates_scoped_protected_material_and_refuses_overwrite()
{
var root = Path.Combine(Path.GetTempPath(), "healthapp-b-prepare-" + Guid.NewGuid()); var plan = Path.Combine(root, "plan"); Directory.CreateDirectory(root);
try
{
Installation.Prepare(plan, "localhost", 5443, root, null, null, null);
using var json = JsonDocument.Parse(File.ReadAllText(Path.Combine(plan, "installation.json"))); var password = json.RootElement.GetProperty("CertificatePassword").GetString();
using var cert = X509CertificateLoader.LoadPkcs12FromFile(Path.Combine(plan, "application.pfx"), password); Assert.True(cert.HasPrivateKey);
Assert.Equal(3, json.RootElement.GetProperty("Accounts").GetArrayLength()); Assert.DoesNotContain("Service-Key", json.RootElement.GetRawText());
if (OperatingSystem.IsLinux()) Assert.Equal(UnixFileMode.UserRead | UnixFileMode.UserWrite, File.GetUnixFileMode(Path.Combine(plan, "installation.json")));
Assert.Throws<InvalidOperationException>(() => Installation.Prepare(plan, "localhost", 5443, root, null, null, null));
}
finally { Directory.Delete(root, true); }
}
[Theory]
[InlineData("debian", "12", false)]
[InlineData("debian", "12", true)]
[InlineData("fedora", "43", false)]
[InlineData("fedora", "43", true)]
[InlineData("manjaro", "rolling", false)]
[InlineData("manjaro", "rolling", true)]
public async Task Distribution_adapters_install_local_persistence_only_when_selected(string distribution, string version, bool local)
{
if (!OperatingSystem.IsLinux()) return;
var root = Path.Combine(Path.GetTempPath(), "healthapp-b-adapter-" + Guid.NewGuid()); Directory.CreateDirectory(root);
try
{
var executable = Path.Combine(root, "commands"); Directory.CreateDirectory(executable); var log = Path.Combine(root, "commands.log");
foreach (var name in new[] { "apt-get", "dnf", "pacman", "systemctl", "install", "runuser", "pg_isready" })
{ var p = Path.Combine(executable, name); await File.WriteAllTextAsync(p, "#!/bin/bash\nprintf '%s\\n' \"${0##*/} $*\" >> \"$HEALTHAPP_ADAPTER_LOG\"\n"); File.SetUnixFileMode(p, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute); }
var dotnet = Path.Combine(executable, "dotnet"); await File.WriteAllTextAsync(dotnet, "#!/bin/bash\necho 'Microsoft.AspNetCore.App 10.0.12 [/test]'\n"); File.SetUnixFileMode(dotnet, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
var os = Path.Combine(root, "os-release"); await File.WriteAllTextAsync(os, $"ID={distribution}\nVERSION_ID={version}\n");
var repository = FindRoot(); var script = Path.Combine(root, "run.sh"); await File.WriteAllTextAsync(script, $"source '{repository}/deploy/installer/bootstrap.sh'\ndotnet='{dotnet}'\nmode={(local ? "local" : "remote")}\nfail() {{ exit 9; }}\nensure_dependencies\n");
var start = new ProcessStartInfo("bash") { UseShellExecute = false, RedirectStandardError = true, RedirectStandardOutput = true }; start.ArgumentList.Add(script); start.Environment["PATH"] = executable + ":" + Environment.GetEnvironmentVariable("PATH"); start.Environment["HEALTHAPP_OS_RELEASE"] = os; start.Environment["HEALTHAPP_ADAPTER_LOG"] = log;
using var process = Process.Start(start)!; var output = process.StandardOutput.ReadToEndAsync(); var error = process.StandardError.ReadToEndAsync(); await process.WaitForExitAsync(); Assert.True(process.ExitCode == 0, await output + await error);
var commands = File.ReadAllText(log); Assert.Equal(local, commands.Contains("postgresql")); if (local) Assert.Contains("systemctl enable --now postgresql", commands); else Assert.DoesNotContain("pg_isready", commands);
}
finally { Directory.Delete(root, true); }
}
private static string FindRoot() { var d = new DirectoryInfo(AppContext.BaseDirectory); while (d is not null && !File.Exists(Path.Combine(d.FullName, "HealthApp.slnx"))) d = d.Parent; return d!.FullName; }
}
+11
View File
@@ -0,0 +1,11 @@
{
"version": "synthetic-comparison-1",
"profile": {"name": "Synthetic comparison patient", "dateOfBirth": "1980-01-01", "contactInfo": "comparison@example.test"},
"observations": [
{"measuredAt": "2026-09-10T08:00:00", "systolic": 150, "diastolic": 92, "pulse": 70, "measurementContext": {"setting": "Home", "activityCondition": "AtRest", "restDurationMinutes": 5, "bodyPosition": "Seated", "measuredArm": "Left", "deviceDetails": "Synthetic device", "cuffDetails": "Synthetic cuff"}},
{"measuredAt": "2026-09-11T08:00:00", "systolic": 140, "diastolic": 88, "pulse": 68, "measurementContext": {"setting": "Home", "activityCondition": "AtRest", "restDurationMinutes": 5, "bodyPosition": "Seated", "measuredArm": "Left", "deviceDetails": "Synthetic device", "cuffDetails": "Synthetic cuff"}},
{"measuredAt": "2026-09-12T08:00:00", "systolic": 160, "diastolic": 95, "pulse": 80, "measurementContext": {"setting": "Clinic", "activityCondition": "AtRest"}},
{"measuredAt": "2026-09-13T08:00:00", "systolic": 145, "diastolic": 90, "pulse": 110, "measurementContext": {"setting": "Home", "activityCondition": "AfterActivity"}, "context": "After activity", "note": "Synthetic departure from routine"},
{"measuredAt": "2026-09-14T08:00:00", "systolic": 130, "diastolic": 84, "pulse": 65, "context": "Synthetic historical text; setting unknown"}
]
}
+54
View File
@@ -0,0 +1,54 @@
"""Initialize a fresh disposable comparison instance via the unchanged public API.
Never run on an existing Architecture A database/production deployment.
"""
import argparse
import hashlib
import json
import pathlib
import ssl
import urllib.request
import urllib.error
parser = argparse.ArgumentParser()
parser.add_argument('--url', required=True)
parser.add_argument('--ca', required=True)
parser.add_argument('--account-file', required=True, help='Owner-only JSON with accountId/password')
parser.add_argument('--dataset', default=str(pathlib.Path(__file__).with_name('dataset.json')))
parser.add_argument('--output', required=True, help='New manifest filename')
args = parser.parse_args()
output = pathlib.Path(args.output)
if output.exists():
raise SystemExit('Output manifest already exists; refusing overwrite.')
if not args.url.startswith('https://'):
raise SystemExit('Verified HTTPS is required.')
credentials_path = pathlib.Path(args.account_file)
if credentials_path.stat().st_mode & 0o077:
raise SystemExit('Credentials file must be owner-only.')
credentials = json.loads(credentials_path.read_text())
data_bytes = pathlib.Path(args.dataset).read_bytes()
data = json.loads(data_bytes)
context = ssl.create_default_context(cafile=args.ca)
token = None
def request(path, payload):
headers = {'Content-Type': 'application/json'}
if token:
headers['Authorization'] = 'Bearer ' + token
query = urllib.request.Request(args.url.rstrip('/') + path,
data=json.dumps(payload).encode(), headers=headers)
with urllib.request.urlopen(query, context=context, timeout=30) as response:
return json.load(response)
try:
token = request('/api/authentication/login', credentials)['accessToken']
patient = request('/api/patients', data['profile'])
observations = [request('/api/patients/' + patient['patientId'] + '/observations', item)
for item in data['observations']]
except urllib.error.HTTPError as error:
raise SystemExit('Initialization stopped at HTTP ' + str(error.code) +
'; inspect the fresh test instance. No mutation retry or automatic cleanup performed.')
output.write_text(json.dumps({'datasetVersion': data['version'],
'datasetSha256': hashlib.sha256(data_bytes).hexdigest(),
'patientId': patient['patientId'],
'observationIds': [item['observationId'] for item in observations]}, indent=2) + '\n')
print('Fresh synthetic dataset initialized; manifest written. No credentials recorded.')
+6
View File
@@ -0,0 +1,6 @@
# Verification environment only; Architecture B is installed natively by systemd inside it.
FROM debian:12-slim
ENV container=docker
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y systemd systemd-sysv dbus ca-certificates curl procps && apt-get clean
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]
+7
View File
@@ -0,0 +1,7 @@
# Native installer verification environments
These optional test harnesses execute the real installer and systemd service in isolated Debian 12 environments. Docker is test infrastructure, not an application deployment requirement. Administrative Docker access and privileged containers are needed for systemd; no Architecture A resources or host data directories are mounted.
Build a fresh release, then set `HEALTHAPP_RELEASE=/absolute/bundle` and run `python3 tools/native-install-test/local.py` and `python3 tools/native-install-test/remote.py`. The local harness builds the verification image first; run it before remote on a fresh machine. Both remove their own test containers. Remote also removes its own network/certificate volume and checks verified hostname rejection plus absence of local PostgreSQL.
Evidence includes actual distribution/runtime, PID/DB/HTTPS/workflow/restart, protected config permissions, and no-overwrite checks. It does not validate bare-metal networking, every intended distribution, HA, clinical validity or energy efficiency. Package/runtime versions come from feeds and are recorded; they must be controlled separately in a measurement setup.
+35
View File
@@ -0,0 +1,35 @@
import pathlib,subprocess,secrets,json,time
import os
root=pathlib.Path(__file__).resolve().parents[2]
bundle=pathlib.Path(os.environ['HEALTHAPP_RELEASE']).resolve()
name='healthapp-b-native-'+secrets.token_hex(4)
image='healthapp-b-systemd-test:debian12'
evidence=root/'ImplementationPlan/evidence';evidence.mkdir(exist_ok=True)
def run(args,check=True):
r=subprocess.run(args,capture_output=True,text=True)
if check and r.returncode:raise RuntimeError('Command failed: '+str(args[:3])+'\n'+(r.stdout+r.stderr)[-4000:])
return r
run(['docker','build','-t',image,str(root/'tools/native-install-test')])
run(['docker','run','--rm','-d','--privileged','--cgroupns=private','--tmpfs','/run','--tmpfs','/run/lock','--name',name,image])
try:
for _ in range(60):
r=run(['docker','exec',name,'systemctl','is-system-running'],False)
if r.stdout.strip() in ('running','degraded'):break
time.sleep(.5)
else:raise RuntimeError('systemd did not start')
run(['docker','cp',str(bundle),name+':/release'])
result=run(['docker','exec',name,'bash','/release/install.sh','--host','localhost'],False)
(evidence/'native-debian12.log').write_text(result.stdout+result.stderr)
print((result.stdout+result.stderr)[-5000:])
if result.returncode:
logs=run(['docker','exec',name,'journalctl','-u','healthapp-b','--no-pager','-n','40'],False)
print(logs.stdout[-4000:]);raise RuntimeError('native installation failed')
config_mode=run(['docker','exec',name,'stat','-c','%a %U %G','/etc/healthapp-b/appsettings.json']).stdout.strip()
if config_mode!='640 root healthapp-b':raise RuntimeError('runtime configuration permissions are incorrect')
before=run(['docker','exec',name,'sha256sum','/etc/healthapp-b/appsettings.json']).stdout
duplicate=run(['docker','exec',name,'bash','/release/install.sh','--host','localhost'],False)
if duplicate.returncode==0 or before!=run(['docker','exec',name,'sha256sum','/etc/healthapp-b/appsettings.json']).stdout:raise RuntimeError('existing installation was overwritten')
data={'environment':run(['docker','exec',name,'cat','/etc/os-release']).stdout,'runtime':run(['docker','exec',name,'dotnet','--list-runtimes']).stdout,'applicationPID':run(['docker','exec',name,'systemctl','show','healthapp-b','--property','MainPID','--value']).stdout.strip(),'databaseStatus':run(['docker','exec',name,'pg_isready']).stdout.strip(),'result':'passed','overwriteRejected':True,'runtimeConfigMode':config_mode,'isolation':'Disposable privileged systemd Linux container; native installer/unit/services executed; not physical-host or measurement evidence'}
(evidence/'native-debian12-summary.json').write_text(json.dumps(data,indent=2)+'\n')
print('Native Debian 12 installation passed.')
finally:run(['docker','stop',name],False)
+42
View File
@@ -0,0 +1,42 @@
import pathlib,subprocess,secrets,json,time,tempfile
import os
root=pathlib.Path(__file__).resolve().parents[2]
bundle=pathlib.Path(os.environ['HEALTHAPP_RELEASE']).resolve()
identity=secrets.token_hex(4);name='healthapp-b-remote-app-'+identity;db='healthapp-b-remote-db-'+identity;network='healthapp-b-remote-net-'+identity;volume='healthapp-b-remote-cert-'+identity
password=secrets.token_hex(32);temporary=pathlib.Path(tempfile.mkdtemp(prefix='healthapp-b-remote-'))
evidence=root/'ImplementationPlan/evidence'
def run(args,check=True):
r=subprocess.run(args,capture_output=True,text=True)
if check and r.returncode:raise RuntimeError('Command failed: '+str(args[:3])+'\n'+(r.stdout+r.stderr).replace(password,'[redacted]')[-3500:])
return r
run(['openssl','req','-x509','-newkey','rsa:2048','-nodes','-keyout',str(temporary/'server.key'),'-out',str(temporary/'server.crt'),'-subj','/CN=b-database','-days','2','-addext','subjectAltName=DNS:b-database'])
run(['docker','network','create',network]);run(['docker','volume','create',volume])
try:
run(['docker','run','--rm','--user','0','--entrypoint','sh','-v',str(temporary)+':/input:ro','-v',volume+':/certs','postgres:18.6','-c','cp /input/server.key /input/server.crt /certs/ && chown 999:999 /certs/server.key /certs/server.crt && chmod 600 /certs/server.key'])
run(['docker','run','--rm','-d','--name',db,'--network',network,'--network-alias','b-database','--network-alias','wrong-b-database','-v',volume+':/certs:ro','-e','POSTGRES_PASSWORD='+password,'postgres:18.6','postgres','-c','ssl=on','-c','ssl_cert_file=/certs/server.crt','-c','ssl_key_file=/certs/server.key'])
for _ in range(60):
if run(['docker','exec',db,'pg_isready','-U','postgres'],False).returncode==0:break
time.sleep(.5)
else:raise RuntimeError('TLS database did not start')
run(['docker','run','--rm','-d','--privileged','--cgroupns=private','--tmpfs','/run','--tmpfs','/run/lock','--name',name,'--network',network,'healthapp-b-systemd-test:debian12'])
for _ in range(60):
if run(['docker','exec',name,'systemctl','is-system-running'],False).stdout.strip() in ('running','degraded'):break
time.sleep(.5)
run(['docker','cp',str(bundle),name+':/release']);run(['docker','cp',str(temporary/'server.crt'),name+':/root/db-ca.crt'])
admin=temporary/'admin.connection';admin.write_text('Host=b-database;Database=postgres;Username=postgres;Password='+password+';SslMode=VerifyFull;RootCertificate=/root/db-ca.crt');admin.chmod(0o600)
run(['docker','cp',str(admin),name+':/root/admin.connection']);run(['docker','exec',name,'chmod','600','/root/admin.connection'])
r=run(['docker','exec',name,'bash','/release/install.sh','--mode','remote','--host','localhost','--postgres-admin-file','/root/admin.connection'],False)
(evidence/'native-debian12-remote.log').write_text((r.stdout+r.stderr).replace(password,'[redacted]'));print((r.stdout+r.stderr).replace(password,'[redacted]')[-4500:])
if r.returncode:
print(run(['docker','exec',name,'journalctl','-u','healthapp-b','--no-pager','-n','30'],False).stdout[-3000:]);raise RuntimeError('remote installation failed')
config_mode=run(['docker','exec',name,'stat','-c','%a %U %G','/etc/healthapp-b/appsettings.json']).stdout.strip()
if config_mode!='640 root healthapp-b':raise RuntimeError('runtime configuration permissions are incorrect')
noServer=run(['docker','exec',name,'sh','-c','! command -v postgres && ! command -v pg_isready'],False).returncode==0
if not noServer:raise RuntimeError('remote mode installed local PostgreSQL')
run(['docker','exec',name,'sh','-c',"mkdir /root/wrong-name && sed 's/Host=b-database/Host=wrong-b-database/g' /var/lib/healthapp-b-installation/deployment/installation.json > /root/wrong-name/installation.json"])
negative=run(['docker','exec',name,'dotnet','/release/provisioner/HealthApp.Provisioning.dll','verify-database','--plan','/root/wrong-name'],False)
if negative.returncode==0:raise RuntimeError('wrong TLS hostname was accepted')
summary={'environment':run(['docker','exec',name,'cat','/etc/os-release']).stdout,'runtime':run(['docker','exec',name,'dotnet','--list-runtimes']).stdout,'database':'PostgreSQL 18.6 separate container/host namespace; TLS certificate SAN b-database','sslMode':'VerifyFull','wrongHostnameRejected':True,'localPostgresInstalled':False,'result':'passed','runtimeConfigMode':config_mode,'isolation':'Separate disposable systemd app and TLS DB containers; no Architecture A database access; not measurement-host evidence'}
(evidence/'native-debian12-remote-summary.json').write_text(json.dumps(summary,indent=2)+'\n');print('Remote Debian 12 native installation passed; local PostgreSQL absent.')
finally:
run(['docker','stop',name],False);run(['docker','stop',db],False);run(['docker','volume','rm',volume],False);run(['docker','network','rm',network],False)
+49
View File
@@ -0,0 +1,49 @@
"""Optional Docker-backed test harness; deployment itself remains native Linux/systemd."""
import argparse
import json
import os
import pathlib
import secrets
import subprocess
import time
parser = argparse.ArgumentParser()
parser.add_argument('--reference', action='store_true', help='Run the preserved B-local A baseline')
parser.add_argument('--image', default='postgres:18.6')
args = parser.parse_args()
repository = pathlib.Path(__file__).resolve().parents[1]
cwd = repository / 'Reference/ArchitectureA' if args.reference else repository
evidence = repository / 'ImplementationPlan/evidence'
evidence.mkdir(exist_ok=True)
label = 'reference' if args.reference else 'b'
name = 'healthapp-b-tests-' + secrets.token_hex(4)
password = secrets.token_hex(32)
container_env = dict(os.environ, POSTGRES_PASSWORD=password)
subprocess.run(['docker', 'run', '--rm', '-d', '--name', name, '-p', '127.0.0.1::5432',
'-e', 'POSTGRES_PASSWORD', args.image], env=container_env,
stdout=subprocess.DEVNULL, check=True)
try:
for attempt in range(60):
if subprocess.run(['docker', 'exec', name, 'pg_isready', '-U', 'postgres'],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0:
break
time.sleep(.5)
else:
raise RuntimeError('Disposable database did not start.')
ports = json.loads(subprocess.check_output(
['docker', 'inspect', '--format', '{{json .NetworkSettings.Ports}}', name], text=True))
port = ports['5432/tcp'][0]['HostPort']
env = dict(os.environ, TEST_POSTGRES_CONNECTION='Host=127.0.0.1;Port=' + port +
';Database=postgres;Username=postgres;Password=' + password)
dotnet = os.environ.get('HEALTHAPP_DOTNET', 'dotnet')
for stage, command in [('build', ['build', 'HealthApp.slnx', '-c', 'Release']),
('tests', ['test', 'HealthApp.slnx', '-c', 'Release', '--no-build',
'--logger', 'trx', '--results-directory', str(evidence / (label + '-trx'))])]:
result = subprocess.run([dotnet, *command], cwd=cwd, env=env, capture_output=True, text=True)
output = (result.stdout + result.stderr).replace(password, '[redacted]')
(evidence / (label + '-' + stage + '.log')).write_text(output)
print(output[-5000:])
if result.returncode:
raise SystemExit(result.returncode)
finally:
subprocess.run(['docker', 'stop', name], stdout=subprocess.DEVNULL, check=True)