Add an end-to-end backup round-trip test - #571
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
BackupRoundTripTestsin VaultFeedTests (which sits above all the pipeline modules;Package.swiftgains the explicitVaultBackupdependency):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 includingPDFDocument.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(.testingsignature), never the multi-minuteBackup.Secure.v1deriver.Local verification: suite green on iPhone 18 Pro Max / iOS 27.0.
🤖 Generated with Claude Code