test(backup): pin the file and the restored account against golden copies

Seed one account as far as the schema allows (a row of every two-ended
model, every column of those rows and of the account row, the instance
settings, a sharing grant), export it both ways and restore each file
into a fresh account, over the live account, and from a version-1 file
in the old shapes. The files, counts, parsed payload, preview, restore
outcome, reported phases, audit rows, wide-event fields and every row the
account holds afterwards are compared with golden copies after ids,
ciphertext and run-time timestamps are normalised. Refusals, skip reports
and the schema's issue list for malformed files are pinned the same way.

The seed moves out of the round-trip test into a shared fixture module
so both files fill the same account.
This commit is contained in:
Marc-André Bombeck committed 2026-10-22 06:22:30 +02:00
1 parent 1915f91526
commit 64fa65b460
15 files changed
+25084 -1559

No files matched your search

+3
View File
@@ -11,6 +11,9 @@ paths = [
# All test files contain hardcoded fake tokens / idempotency-keys.
'''(^|/)__tests__/''',
'''\.test\.ts$''',
# Golden copies of the backup file written by the parity test: synthetic
# fixture values, and every `…Encrypted` value already opened to its text.
'''^tests/integration/__golden__/''',
# OpenAPI spec contains example tokens (`hlk_example…`) used to document the schema.
'''^docs/api/openapi\.yaml$''',
]
+4
View File
@@ -25,3 +25,7 @@ src/__tests__/baselines
# Benchmark results, written by scripts/bench/run.ts and committed as they
# come out, so a re-run diffs cleanly against the last one.
scripts/bench/results
# Golden copies of the backup file and the restored account, written by the
# parity test itself (BACKUP_PARITY_WRITE=1), so a rewrite diffs cleanly.
tests/integration/__golden__
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,806 @@
{
"undecryptable": {
"outcome": {
"ok": false,
"status": 422,
"code": "backup.payload.undecryptable",
"message": "Backup payload could not be decrypted — either the key that wrote this copy is no longer in ENCRYPTION_KEYS, or the stored copy is not the one that was written. Nothing was changed.",
"meta": {
"errorCode": "backup.payload.undecryptable"
}
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
}
],
"audit": [
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "Invalid authentication tag length: 7"
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"schemaInvalid": {
"outcome": {
"ok": false,
"status": 422,
"code": "schema_invalid",
"message": "Backup payload failed schema validation"
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
}
],
"audit": [
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "schema_invalid",
"message": "measurements.0.type: Invalid option: expected one of \"WEIGHT\"|\"BLOOD_PRESSURE_SYS\"|\"BLOOD_PRESSURE_DIA\"|\"PULSE\"|\"BODY_FAT\"|\"SLEEP_DURATION\"|\"ACTIVITY_STEPS\"|\"BLOOD_GLUCOSE\"|\"TOTAL_BODY_WATER\"|\"BONE_MASS\"|\"OXYGEN_SATURATION\"|\"HEART_RATE_VARIABILITY\"|\"RESTING_HEART_RATE\"|\"ACTIVE_ENERGY_BURNED\"|\"FLIGHTS_CLIMBED\"|\"WALKING_RUNNING_DISTANCE\"|\"VO2_MAX\"|\"BODY_TEMPERATURE\"|\"FAT_FREE_MASS\"|\"FAT_MASS\"|\"MUSCLE_MASS\"|\"SKIN_TEMPERATURE\"|\"PULSE_WAVE_VELOCITY\"|\"VASCULAR_AGE\"|\"VISCERAL_FAT\"|\"AUDIO_EXPOSURE_ENV\"|\"AUDIO_EXPOSURE_HEADPHONE\"|\"TIME_IN_DAYLIGHT\"|\"WALKING_STEADINESS\"|\"AUDIO_EXPOSURE_EVENT\"|\"RESPIRATORY_RATE\"|\"BODY_MASS_INDEX\"|\"LEAN_BODY_MASS\"|\"WALKING_HEART_RATE_AVERAGE\"|\"WALKING_ASYMMETRY\"|\"WALKING_DOUBLE_SUPPORT\"|\"WALKING_STEP_LENGTH\"|\"WALKING_SPEED\"|\"CARDIO_RECOVERY\"|\"WRIST_TEMPERATURE\"|\"FALL_COUNT\"|\"SIX_MINUTE_WALK_DISTANCE\"|\"STAIR_ASCENT_SPEED\"|\"STAIR_DESCENT_SPEED\"|\"BREATHING_DISTURBANCES\"|\"IRREGULAR_RHYTHM_NOTIFICATION\"|\"HIGH_HEART_RATE_EVENT\"|\"LOW_HEART_RATE_EVENT\"|\"WALKING_STEADINESS_EVENT\"|\"BREATHING_DISTURBANCE_EVENT\"|\"RECOVERY_SCORE\"|\"STRESS_SCORE\"|\"STRAIN_SCORE\"|\"HRV_RMSSD\"|\"DAY_STRAIN\"|\"WORKOUT_STRAIN\"|\"SLEEP_PERFORMANCE\"|\"SLEEP_EFFICIENCY\"|\"SLEEP_CONSISTENCY\"|\"SLEEP_NEED\"|\"ENERGY_EXPENDITURE_KJ\"|\"AVERAGE_HEART_RATE\"|\"MAX_HEART_RATE\"|\"SLEEP_DISTURBANCE_COUNT\"|\"ANS_CHARGE\"|\"CARDIO_LOAD\"|\"SLEEP_SCORE\"|\"BODY_TEMPERATURE_DEVIATION\"|\"RESILIENCE\"|\"PHQ9_SCORE\"|\"GAD7_SCORE\"|\"GRIP_STRENGTH\"|\"PAIN_NRS\"|\"WAIST_CIRCUMFERENCE\"|\"WAIST_TO_HEIGHT\"|\"WHO5_SCORE\"|\"SCI_SCORE\"|\"EXERCISE_MINUTES\"|\"STAND_MINUTES\"|\"STAND_HOURS\"|\"MINDFUL_MINUTES\"|\"STATE_OF_MIND_VALENCE\"|\"INDOOR_CO2\"|\"INDOOR_TEMPERATURE\"|\"INDOOR_HUMIDITY\"|\"AFIB_BURDEN\""
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"stableIdMissing": {
"outcome": {
"ok": false,
"status": 422,
"code": "schema_invalid",
"message": "Backup payload failed schema validation"
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
}
],
"audit": [
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "schema_invalid",
"message": "measurements.0.id: Canonical v2 measurements require a stable id"
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"qualitativeMarkerWithNumbers": {
"outcome": {
"ok": false,
"status": 422,
"code": "schema_invalid",
"message": "Backup payload failed schema validation"
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
}
],
"audit": [
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "schema_invalid",
"message": "[\n {\n \"code\": \"custom\",\n \"path\": [\n \"labResults\",\n 0,\n \"unit\"\n ],\n \"message\": \"A numeric lab reading needs its unit\"\n },\n {\n \"code\": \"custom\",\n \"path\": [\n \"biomarkers\",\n 0,\n \"unit\"\n ],\n \"message\": \"Biomarker \\\"Urine colour\\\" has numeric readings and needs its unit\"\n }\n]"
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"incompatibleVersion": {
"outcome": {
"ok": false,
"status": 422,
"code": "incompatible_schema_version",
"message": "Backup schema version '99' is not supported by this server"
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
}
],
"audit": [
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "incompatible_schema_version",
"schemaVersion": "99"
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"ownerMismatch": {
"outcome": {
"ok": false,
"status": 409,
"code": "owner_mismatch",
"message": "Backup payload declares a different owner than the backup record"
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
}
],
"audit": [
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "owner_mismatch",
"declaredOwnerId": "someone-else"
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"sectionMissing": {
"outcome": {
"ok": false,
"status": 422,
"code": "backup.section.missing",
"message": "Backup is missing documents — the file's own manifest says it carries that section. Nothing was changed. Use a disaster-recovery snapshot, or export the account again.",
"meta": {
"errorCode": "backup.section.missing",
"sections": [
"documents"
]
}
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
}
],
"audit": [
{
"action": "admin.backups.restore.start",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"ownerUsername": "round-trip-owner",
"snapshotExportedAt": "2026-07-20T08:00:00.000Z",
"restoreInstanceSettings": false
}
},
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "section_missing",
"sections": [
"documents"
]
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"metadataOnlyDocument": {
"outcome": {
"ok": false,
"status": 422,
"code": "document_ciphertext_missing",
"message": "Document 'metadata-only-document' is metadata-only and cannot be restored"
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
}
],
"audit": [
{
"action": "admin.backups.restore.start",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"ownerUsername": "round-trip-owner",
"snapshotExportedAt": "2026-07-20T08:00:00.000Z",
"restoreInstanceSettings": false
}
},
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "document_ciphertext_missing",
"documentId": "metadata-only-document"
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"keyMissing": {
"outcome": {
"ok": false,
"status": 422,
"code": "backup.key.missing",
"message": "This backup holds 1 encrypted value written under encryption key 'v9', which is not in ENCRYPTION_KEYS on this server. Add that key back to ENCRYPTION_KEYS and restart, then try again. Nothing was changed.",
"meta": {
"errorCode": "backup.key.missing",
"keyIds": [
"v9"
]
}
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 1
}
],
"audit": [
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "key_missing",
"missingKeyIds": [
"v9"
],
"unreadableKeyIds": [],
"affectedValues": 1
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
}
]
}
},
"intakeForUnknownMedication": {
"outcome": {
"ok": false,
"status": 500,
"code": "transaction_failed",
"message": "The restore could not be written and was rolled back. Nothing was changed.",
"meta": {
"cause": "other"
}
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "clearing",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "measurements",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
}
],
"audit": [
{
"action": "admin.backups.restore.start",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"ownerUsername": "round-trip-owner",
"snapshotExportedAt": "2026-07-20T08:00:00.000Z",
"restoreInstanceSettings": false
}
},
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "transaction_failed",
"cause": "other",
"code": null,
"message": "Unknown medication references in intake events: a medication this file never carried. The backup records doses against medications it does not carry."
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
},
{
"meta": {
"restoreFailReason": "Unknown medication references in intake events: a medication this file never carried. The backup records doses against medications it does not carry.",
"restoreFailCause": "other",
"restoreFailCode": null,
"restoreTransactionTimeoutMs": 120001
}
}
]
}
},
"labForUnknownMarker": {
"outcome": {
"ok": false,
"status": 500,
"code": "transaction_failed",
"message": "The restore could not be written and was rolled back. Nothing was changed.",
"meta": {
"cause": "other"
}
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "clearing",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "measurements",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 1,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 2,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 3,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 4,
"sectionsTotal": 17,
"measurementsTotal": 0
}
],
"audit": [
{
"action": "admin.backups.restore.start",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"ownerUsername": "round-trip-owner",
"snapshotExportedAt": "2026-07-20T08:00:00.000Z",
"restoreInstanceSettings": false
}
},
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "transaction_failed",
"cause": "other",
"code": null,
"message": "Unknown biomarker reference: a-marker-the-file-never-carried"
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
},
{
"meta": {
"restoreFailReason": "Unknown biomarker reference: a-marker-the-file-never-carried",
"restoreFailCause": "other",
"restoreFailCode": null,
"restoreTransactionTimeoutMs": 120001
}
}
]
}
},
"illnessWithUnknownParent": {
"outcome": {
"ok": false,
"status": 500,
"code": "transaction_failed",
"message": "The restore could not be written and was rolled back. Nothing was changed.",
"meta": {
"cause": "other"
}
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "clearing",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "measurements",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 1,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 2,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 3,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 4,
"sectionsTotal": 17,
"measurementsTotal": 0
},
{
"phase": "sections",
"sectionsDone": 5,
"sectionsTotal": 17,
"measurementsTotal": 0
}
],
"audit": [
{
"action": "admin.backups.restore.start",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"ownerUsername": "round-trip-owner",
"snapshotExportedAt": "2026-07-20T08:00:00.000Z",
"restoreInstanceSettings": false
}
},
{
"action": "admin.backups.restore.failed",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"reason": "transaction_failed",
"cause": "other",
"code": null,
"message": "Unknown illness parent: an-episode-the-file-never-carried"
}
}
],
"effects": {
"invalidated": [],
"unitRefresh": [],
"foldRepair": [],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
},
{
"meta": {
"restoreFailReason": "Unknown illness parent: an-episode-the-file-never-carried",
"restoreFailCause": "other",
"restoreFailCode": null,
"restoreTransactionTimeoutMs": 120001
}
}
]
}
}
}
@@ -0,0 +1,406 @@
{
"outcome": {
"ok": true,
"response": {
"restored": true,
"summary": {
"schemaVersion": "2",
"userId": "round-trip-owner",
"exportedAt": "2026-08-01T00:00:00.000Z",
"measurements": 5,
"medications": 1,
"intakeEvents": 1,
"medicationSideEffects": 1,
"medicationEfficacyTargets": 1,
"medicationScheduleRevisions": 3,
"moodEntries": 1,
"cycles": 2,
"cycleDayLogs": 1,
"nutrientDays": 1,
"labResults": 1,
"biomarkers": 1,
"illnessEpisodes": 2,
"illnessDayLogs": 1,
"allergies": 1,
"familyHistory": 1,
"workouts": 1,
"documents": 1,
"documentConditionLinks": 1,
"extractedFacts": 1,
"healthProfile": 1,
"healthProfileFactRevisions": 1,
"customMetrics": 1,
"customMetricEntries": 2,
"correlationPatterns": 1,
"intradayProfiles": 1,
"healthScoreRecords": 1,
"onboardingRecords": 1,
"practitioners": 1,
"encounters": 1,
"encounterLinks": 3,
"vaccinations": 1,
"vaccinationLinks": 1,
"relationLinks": 5,
"customVaccines": 1,
"measurementReminders": 1,
"measurementReminderEvents": 2,
"coachConversations": 2,
"coachMessages": 3,
"coachFacts": 1,
"coachPlans": 1,
"coachReminders": 1,
"mentalHealthAssessments": 1,
"consentReceipts": 2,
"personalRecords": 3,
"userAchievements": 2,
"environmentContexts": 2,
"environmentTravelLocations": 1,
"dawarichDays": 1,
"ecgRecordings": 1
},
"skipped": {
"catalogueKeys": [],
"links": 0
},
"cleared": {
"measurements": 5,
"medications": 1,
"intakeEvents": 1,
"moodEntries": 1,
"notificationChannels": 0,
"pushSubscriptions": 0,
"telegramScheduledDeletions": 0,
"cycles": 2,
"cycleDayLogs": 1,
"cycleProfile": 1,
"labResults": 1,
"biomarkers": 1,
"nutrientDays": 1,
"illnessEpisodes": 2,
"allergies": 1,
"familyHistory": 1,
"workouts": 1,
"documents": 1,
"documentConditionLinks": 0,
"extractedFacts": 0,
"healthProfile": 1,
"healthProfileFactRevisions": 1,
"customMetrics": 1,
"correlationPatterns": 1,
"intradayProfiles": 1,
"healthScoreRecords": 1,
"onboardingRecords": 1,
"practitioners": 1,
"encounters": 1,
"encounterLinks": 0,
"vaccinations": 1,
"vaccinationLinks": 0,
"relationLinks": 0,
"customVaccines": 1,
"measurementReminders": 1,
"measurementReminderEvents": 2,
"coachConversations": 2,
"coachMessages": 3,
"coachConversationDocuments": 0,
"coachFacts": 1,
"coachPlans": 1,
"coachReminders": 1,
"mentalHealthAssessments": 1,
"consentReceipts": 2,
"personalRecords": 3,
"userAchievements": 2,
"environmentContexts": 2,
"environmentTravelLocations": 1,
"dawarichDays": 1,
"ecgRecordings": 1,
"symptomDefinitions": 2,
"lifeEvents": 2
}
}
},
"progress": [
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": null
},
{
"phase": "validating",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "clearing",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "measurements",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 0,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 1,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 2,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 3,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 4,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 5,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 6,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 7,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 8,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 9,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 10,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 11,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 12,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 13,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 14,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 15,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 16,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "sections",
"sectionsDone": 17,
"sectionsTotal": 17,
"measurementsTotal": 5
},
{
"phase": "rebuilding",
"sectionsDone": 17,
"sectionsTotal": 17,
"measurementsTotal": 5
}
],
"audit": [
{
"action": "admin.backups.restore.start",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"ownerUsername": "round-trip-owner",
"snapshotExportedAt": "2026-08-01T00:00:00.000Z",
"restoreInstanceSettings": false
}
},
{
"action": "admin.backups.restore",
"userId": "<actor>",
"details": {
"backupId": "<id:1>",
"ownerId": "round-trip-owner",
"ownerUsername": "round-trip-owner",
"restoreInstanceSettings": false,
"cleared": {
"measurements": 5,
"medications": 1,
"intakeEvents": 1,
"moodEntries": 1,
"notificationChannels": 0,
"pushSubscriptions": 0,
"telegramScheduledDeletions": 0,
"cycles": 2,
"cycleDayLogs": 1,
"cycleProfile": 1,
"labResults": 1,
"biomarkers": 1,
"nutrientDays": 1,
"illnessEpisodes": 2,
"allergies": 1,
"familyHistory": 1,
"workouts": 1,
"documents": 1,
"documentConditionLinks": 0,
"extractedFacts": 0,
"healthProfile": 1,
"healthProfileFactRevisions": 1,
"customMetrics": 1,
"correlationPatterns": 1,
"intradayProfiles": 1,
"healthScoreRecords": 1,
"onboardingRecords": 1,
"practitioners": 1,
"encounters": 1,
"encounterLinks": 0,
"vaccinations": 1,
"vaccinationLinks": 0,
"relationLinks": 0,
"customVaccines": 1,
"measurementReminders": 1,
"measurementReminderEvents": 2,
"coachConversations": 2,
"coachMessages": 3,
"coachConversationDocuments": 0,
"coachFacts": 1,
"coachPlans": 1,
"coachReminders": 1,
"mentalHealthAssessments": 1,
"consentReceipts": 2,
"personalRecords": 3,
"userAchievements": 2,
"environmentContexts": 2,
"environmentTravelLocations": 1,
"dawarichDays": 1,
"ecgRecordings": 1,
"symptomDefinitions": 2,
"lifeEvents": 2
},
"accountSettingsApplied": 62,
"skipped": {
"catalogueKeys": [],
"links": 0
},
"restored": {
"measurements": 5,
"medications": 1,
"intakeEvents": 1,
"moodEntries": 1,
"cycles": 2,
"cycleDayLogs": 1,
"labResults": 1,
"biomarkers": 1,
"nutrientDays": 1,
"illnessEpisodes": 2,
"illnessDayLogs": 1,
"allergies": 1,
"familyHistory": 1,
"workouts": 1,
"documents": 1,
"healthProfile": 1,
"healthProfileFactRevisions": 1,
"customMetrics": 1,
"customMetricEntries": 2,
"correlationPatterns": 1,
"practitioners": 1,
"encounters": 1,
"encounterLinks": 3,
"vaccinations": 1,
"vaccinationLinks": 1,
"relationLinks": 5,
"customVaccines": 1,
"measurementReminders": 1,
"measurementReminderEvents": 2
}
}
}
],
"effects": {
"invalidated": [
"round-trip-owner"
],
"unitRefresh": [],
"foldRepair": [
"round-trip-owner"
],
"annotations": [
{
"action": {
"name": "admin.backups.restore"
},
"meta": {
"id": "<id:1>",
"restore_instance_settings": false
}
},
{
"meta": {
"restore_expired_tombstones_skipped": 0
}
},
{
"meta": {
"restoreSkippedLinks": 0,
"restoreSkippedKeys": ""
}
}
]
},
"snapshotChanges": []
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,454 @@
{
"everySectionWrong": [
{
"code": "custom",
"path": [
"exportedAt"
],
"message": "Expected ISO-8601 date-time string"
},
{
"origin": "string",
"code": "too_small",
"minimum": 1,
"inclusive": true,
"path": [
"userId"
],
"message": "Too small: expected string to have >=1 characters"
},
{
"expected": "number",
"code": "invalid_type",
"path": [
"accountSettings",
"heightCm"
],
"message": "Invalid input: expected number, received string"
},
{
"expected": "boolean",
"code": "invalid_type",
"path": [
"accountSettings",
"hasDiabetes"
],
"message": "Invalid input: expected boolean, received string"
},
{
"expected": "number",
"code": "invalid_type",
"path": [
"measurements",
0,
"value"
],
"message": "Invalid input: expected number, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"measurements",
0,
"unit"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"measurements",
0,
"measuredAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"medications",
0,
"name"
],
"message": "Invalid input: expected string, received number"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"medications",
0,
"dose"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "array",
"code": "invalid_type",
"path": [
"medications",
0,
"schedules"
],
"message": "Invalid input: expected array, received string"
},
{
"expected": "number",
"code": "invalid_type",
"path": [
"moodEntries",
0,
"score"
],
"message": "Invalid input: expected number, received string"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"moodEntries",
0,
"loggedAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"labResults",
0,
"analyte"
],
"message": "Invalid input: expected string, received null"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"labResults",
0,
"unit"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"labResults",
0,
"takenAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"labResults",
0,
"source"
],
"message": "Invalid input: expected string, received undefined"
},
{
"code": "invalid_value",
"values": [
"DOCTOR_REPORT",
"DISCHARGE_LETTER",
"LAB_RESULT",
"IMAGING",
"PRESCRIPTION",
"REFERRAL",
"INSURANCE",
"VACCINATION",
"SICK_NOTE",
"OTHER"
],
"path": [
"documents",
0,
"kind"
],
"message": "Invalid option: expected one of \"DOCTOR_REPORT\"|\"DISCHARGE_LETTER\"|\"LAB_RESULT\"|\"IMAGING\"|\"PRESCRIPTION\"|\"REFERRAL\"|\"INSURANCE\"|\"VACCINATION\"|\"SICK_NOTE\"|\"OTHER\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"documents",
0,
"mimeType"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "number",
"code": "invalid_type",
"path": [
"documents",
0,
"byteSize"
],
"message": "Invalid input: expected number, received undefined"
},
{
"code": "invalid_value",
"values": [
"STORED",
"EXTRACTING",
"EXTRACTED",
"FAILED",
"CONFIRMED",
"DISCARDED"
],
"path": [
"documents",
0,
"status"
],
"message": "Invalid option: expected one of \"STORED\"|\"EXTRACTING\"|\"EXTRACTED\"|\"FAILED\"|\"CONFIRMED\"|\"DISCARDED\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"vaccinations",
0,
"occurredAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"vaccinations",
0,
"createdAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"vaccinations",
0,
"updatedAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "boolean",
"code": "invalid_type",
"path": [
"coachConversations",
0,
"documentScoped"
],
"message": "Invalid input: expected boolean, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"coachConversations",
0,
"createdAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"coachConversations",
0,
"updatedAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"coachConversations",
0,
"messages",
0,
"id"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"coachConversations",
0,
"messages",
0,
"role"
],
"message": "Invalid input: expected string, received number"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"coachConversations",
0,
"messages",
0,
"createdAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"environmentContexts",
0,
"date"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "number",
"code": "invalid_type",
"path": [
"environmentContexts",
0,
"lat"
],
"message": "Invalid input: expected number, received undefined"
},
{
"expected": "number",
"code": "invalid_type",
"path": [
"environmentContexts",
0,
"lon"
],
"message": "Invalid input: expected number, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"environmentContexts",
0,
"locationLabel"
],
"message": "Invalid input: expected string, received undefined"
},
{
"code": "invalid_value",
"values": [
"HOME",
"TRAVEL",
"DEVICE"
],
"path": [
"environmentContexts",
0,
"source"
],
"message": "Invalid option: expected one of \"HOME\"|\"TRAVEL\"|\"DEVICE\""
},
{
"code": "invalid_value",
"values": [
"MANUAL",
"WITHINGS",
"IMPORT",
"APPLE_HEALTH",
"COMPUTED",
"WHOOP",
"FITBIT",
"NIGHTSCOUT",
"POLAR",
"OURA",
"TELEGRAM",
"MCP",
"GOOGLE_HEALTH",
"STRAVA",
"EXTERNAL",
"HEALTH_CONNECT"
],
"path": [
"ecgRecordings",
0,
"source"
],
"message": "Invalid option: expected one of \"MANUAL\"|\"WITHINGS\"|\"IMPORT\"|\"APPLE_HEALTH\"|\"COMPUTED\"|\"WHOOP\"|\"FITBIT\"|\"NIGHTSCOUT\"|\"POLAR\"|\"OURA\"|\"TELEGRAM\"|\"MCP\"|\"GOOGLE_HEALTH\"|\"STRAVA\"|\"EXTERNAL\"|\"HEALTH_CONNECT\""
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"ecgRecordings",
0,
"externalRecordingId"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"ecgRecordings",
0,
"recordedAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "number",
"code": "invalid_type",
"path": [
"ecgRecordings",
0,
"samplingFrequency"
],
"message": "Invalid input: expected number, received undefined"
},
{
"expected": "number",
"code": "invalid_type",
"path": [
"ecgRecordings",
0,
"sampleCount"
],
"message": "Invalid input: expected number, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"ecgRecordings",
0,
"createdAt"
],
"message": "Invalid input: expected string, received undefined"
},
{
"expected": "string",
"code": "invalid_type",
"path": [
"ecgRecordings",
0,
"updatedAt"
],
"message": "Invalid input: expected string, received undefined"
}
]
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff