Encrypted full-state backup and restore (zip.enc) with Arweave manifest and Vault passphrase#48
Open
johnnyclem wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Motivation
Description
src/backup/backup.tsthat stages agent state, encrypted keys, logs, dependencies, optional WASM, and optional live canister-state metadata, zips the payload, encrypts with a passphrase and records SHA-256 checksums and metadata.<basename>.manifest.json) to preserve listing/preview functionality.restoreFromEncryptedZipthat decrypts a.zip.enc, extracts the payload, copies state files back into~/.agentvault, locates a bundled WASM and invokesdeployAgentto install a fresh canister.agentvault backupcommand (cli/commands/backup.ts) with new options and arestoresubcommand, plus Vault-backed passphrase lookup:--passphrase,--vault-passphrase-key,--arweave-jwk,--wasm, andagentvault backup restore --zip <path> --passphrase <secret>(or read passphrase from Vault).Files changed:
src/backup/backup.ts,cli/commands/backup.ts(added backup export/restore/encryption/Arweave/Vault glue).Testing
npx eslint cli/commands/backup.ts src/backup/backup.ts— passed (no reported lint errors). ✅npm run typecheck— did not fully pass; the run surfaced existing, pre-existing type errors outside this change (errors reported incli/commands/pilot.tsandsrc/pilot/private-replica.ts) and therefore the repo-wide typecheck fails; changes in this PR were adjusted to avoid introducing new type errors in the modified files.npx eslintand manual invocation of the new CLI help/usage paths forbackup exportandbackup restore(commands were exercised, no runtime exceptions in the modified code paths without external deps). ✅If you want, I can follow up with isolated unit tests for the new
exportBackup/restoreFromEncryptedZipfunctions and a small integration test that writes a temporary encrypted zip and restores it (then remove the test helper before merge if preferred).Codex Task