# RC14 — Phase 4A: Preservation + Runtime Finding Migration

## Preservation is now mandatory

The installer now creates a timestamped pre-update backup before modifying an existing installation.

Preserved locations:

- `App/data`
- active calculator and finding-rule bundles
- application settings
- `ClinicalReasoningDatabase/active`
- research exports and cache
- owner backup files
- logs

The installer updates application code without blindly replacing active owner data.

Backups are stored under:

`Backups/pre-update-YYYYMMDD-HHMMSS`

## Owner database preservation

The Clinical Reasoning Database Settings page now includes a Preservation and Recovery panel.

It provides:

- Export Owner Backup
- Merge Backup
- Replace From Backup
- Create Local Snapshot
- Restore Local Snapshot
- record counts before restoration

Merge is the default import mode. Existing medication records, claims, calculators, and finding rules are retained unless the imported record uses the same stable ID.

Before a replace or restore operation, the current repository is snapshotted automatically.

## Backup layers

1. Browser local snapshots for fast recovery
2. Portable JSON owner backups
3. Installer pre-update file backups
4. Manual file backup script
5. Runtime bundle history snapshots

## First runtime finding migration

Managed finding text and enable/disable state are now read from the active finding-rule INI bundle.

The runtime can now change:

- whether a rule is active
- the displayed finding message
- the active rule version

The following findings consume runtime message/status configuration:

- bleeding combination
- opioid/CNS-depressant combination
- QT burden
- hyperkalemia burden
- AV-nodal burden
- NSAID/RAAS/diuretic AKI risk
- hypoglycemia burden
- anticholinergic burden
- fall-risk burden

The hardcoded implementation remains a safe fallback when the bundle is missing or malformed.

## Still preserved

RC14 carries forward:

- Top-300 medication database bootstrap fix
- calculator truth console
- finding-rule console
- runtime bundle publication
- visual patient report
- concise MedRec
- strengthened SCr parser
- research workbench repair
