feat: add LP6 backup, restore, retention, and DR proof - #11
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9c9f77fe3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const existing = JSON.parse(await readFile(manifestPath, 'utf8')); | ||
| const verification = verifyArchiveManifest(existing, source.entries); | ||
| if (!verification.complete) throw new Error('existing LP6 archive is incomplete'); | ||
| console.log(JSON.stringify({ milestone: 'LP6', archiveId: existing.archiveId, idempotent: true, status: 'verified' }, null, 2)); |
There was a problem hiding this comment.
Validate the envelope before taking the idempotent path
If the initial worker invocation writes archive-manifest.json but terminates before metadata-envelope.json is written—such as from a full volume or process interruption—the next invocation validates only the manifest and exits successfully with status: 'verified'. The restore worker then necessarily fails when reading the missing envelope, so a reported successful backup can remain unusable; validate/decrypt both persisted files or publish them atomically before treating the backup as complete.
Useful? React with 👍 / 👎.
| const sourceEntries = Object.freeze({ | ||
| 'mail/INBOX/0001.eml': 'From: alice@example.test\nSubject: LP6 synthetic backup\n\nSynthetic only.\n', | ||
| 'calendar/home.ics': 'BEGIN:VCALENDAR\nVERSION:2.0\nEND:VCALENDAR\n', | ||
| 'contacts/alice.vcf': 'BEGIN:VCARD\nVERSION:4.0\nFN:Alice\nEND:VCARD\n', | ||
| }); |
There was a problem hiding this comment.
Verify restored content from the backup volume
In the inspected LP6 Compose flow, the backup worker persists only a manifest and metadata envelope, while the restore worker supplies archive member bodies from these literals compiled into its image. Consequently, the checksum and restore validation passes even when no backed-up payload exists on lp6-backup-data, and the generated evidence still reports isolatedRestore and checksumsVerified; read actual archived members from the read-only backup volume, or do not report this as a restore proof.
Useful? React with 👍 / 👎.
Summary
Validation
LP6 remains bounded local synthetic evidence, not a production RPO/RTO claim.