Skip to content

Add an end-to-end backup round-trip test - #571

Merged
bradleymackey merged 1 commit into
mainfrom
test/backup-round-trip
Sep 15, 2026
Merged

bradleymackey merged 1 commit into
mainfrom
test/backup-round-trip

Conversation

@bradleymackey

Copy link
Copy Markdown
Member

Problem

The backup pipeline (export → encrypt → attach to PDF → detach → decrypt → import) was covered only as disjoint unit slices across VaultBackupTests. No test proved the composition end-to-end, and nothing proved that duress metadata — killphrase and search-passphrase digests, lock state, searchable level — survives the full trip (MANIFESTO C10).

Changes (test-only)

New BackupRoundTripTests in VaultFeedTests (which sits above all the pipeline modules; Package.swift gains the explicit VaultBackup dependency):

  • pdfRoundTrip_merge_preservesDuressMetadata — seeds a store with a killphrase-armed item, a passphrase-hidden item, a locked item, and a tag; runs the full pipeline including PDFDocument.dataRepresentation() → PDFDocument(data:) reparse (keeps the trip honest about PDF serialization); imports into a second store and asserts behaviorally: killphrase deletion fires with the original phrase, the hidden item is reachable only through a matching digest, lock state survives, tags survive.
  • pdfRoundTrip_override_replacesExistingVault — import-override drops the destination's pre-existing item and installs the restored set.
  • pdfRoundTrip_wrongKey_failsDecrypt — decryption with the wrong key throws.

Uses a directly-constructed DerivedEncryptionKey (.testing signature), never the multi-minute Backup.Secure.v1 deriver.

Local verification: suite green on iPhone 18 Pro Max / iOS 27.0.

⚠️ Automatic CI is still disabled (#548), so this is local verification only.

🤖 Generated with Claude Code

The export, encrypt, PDF attach, detach, decrypt, import pipeline was
covered only as disjoint unit slices. Prove the composition through a
real PDF serialization cycle and assert that killphrase digests,
search-passphrase digests, lock state, and tags survive the trip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bradleymackey
bradleymackey merged commit a62d3ba into main Sep 15, 2026
@bradleymackey
bradleymackey deleted the test/backup-round-trip branch September 15, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant