HyperVault integration: cloud mind ⇄ sovereign chain + archive#66
Merged
Conversation
Implements PLAN_HYPERVAULT_INTEGRATION.md — a first-class bridge between the HyperVault cloud mind (hypervault.store) and AgentVault's ICP/Arweave stack across three tiers: hot (cloud), warm (canister), cold (Arweave). New src/hypervault/ module (exported as agentvault/hypervault): - client.ts: typed REST client over undici with retry/backoff and streamed NDJSON export/import. - auth.ts: key resolution (flag -> env -> vault) and hypervault.json state that stores only a keyRef, never the key. - snapshot.ts: agentvault-hypervault-snapshot-v1 bundle — per-entry SHA-256, Merkle root, ed25519 manifest signature, AES-256-GCM encryption via the audited CanisterEncryption. Private artifacts/conversations always encrypted. - index/: pure-TS weighted FTS index, cosine VectorIndex, RRF hybrid recall with graceful FTS-only fallback. - memory/knowledge/wiki-store adapters over the backbone interfaces. - mind-sync.ts: topological, idempotent mind-DAG replay onto a memory_repo canister with on-chain archive receipts. - pipeline.ts: connect/pull/push/snapshot/archive/verify/restore/status/ recall/bootstrap flows shared by the CLI and MCP server. - mcp-server.ts: native stdio JSON-RPC MCP server (no new dependency) exposing hypervault_* pipeline tools + the existing wiki_* tools. CLI: new `agentvault hypervault` command group, `agentvault mcp serve` subcommand, and `agentvault init --hypervault`. Security (audit C-1): vetkeys.decryptJSON now validates the GCM auth tag before returning plaintext; adds an encryptJSON counterpart and refuses payloads with no usable tag. EncryptedData gains an optional tag field. Tests: tests/hypervault/** (client, snapshot round-trip/tamper/encryption, indices/recall, mind-sync topo+idempotency, auth no-plaintext-key) and tests/mcp-server/** (protocol conformance). Full suite green (1554 tests); typecheck and lint clean. Docs: docs/guides/hypervault.md, docs/architecture/hypervault-integration.md, README HyperVault section, CHANGELOG. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FbdRFUf2aN6kGSWhkvP5NX
|
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.
Summary
Implements
PLAN_HYPERVAULT_INTEGRATION.md— a first-class bridge between the HyperVault cloud mind (hypervault.store) and AgentVault's ICP + Arweave stack. It makes each the missing half of the other across three tiers of the same mind:The two one-liners (also exposed as MCP tools)
What's included
New
src/hypervault/module (exported asagentvault/hypervault):client.ts—HyperVaultClient, typed REST over undici with retry/backoff and streamed NDJSON export/import.auth.ts— key resolution (--key→HYPERVAULT_API_KEY→ secrets vault) and.agentvault/hypervault.jsonstate that stores only a keyRef, never the key.snapshot.ts— theagentvault-hypervault-snapshot-v1bundle: per-entry SHA-256, Merkle root, ed25519 manifest signature, AES-256-GCM encryption via the auditedCanisterEncryption. Private artifacts and conversations are always encrypted.index/— pure-TS weighted FTS index, cosineVectorIndexover exported embeddings, and reciprocal-rank hybrid recall with graceful FTS-only fallback.memory-store.ts/knowledge-store.ts/wiki-store.ts— adapters running the existing backbone/wiki interfaces against the cloud mind.mind-sync.ts— topological, idempotent mind-DAG replay onto amemory_repocanister, with on-chain archive receipts.pipeline.ts— theconnect/pull/push/snapshot/archive/verify/restore/status/recall/bootstrapflows shared by the CLI and MCP server.mcp-server.ts— AgentVault's first native MCP server (stdio JSON-RPC, no new dependency) exposing thehypervault_*pipeline tools and the existingwiki_*tools.CLI: new
agentvault hypervaultcommand group (connect · status · bootstrap · pull · push · snapshot · archive · verify · restore · reindex · recall), anagentvault mcp servesubcommand, and anagentvault init --hypervaultflag.Security
vetkeys.decryptJSONnow validates the AES-256-GCM / ChaCha20-Poly1305 authentication tag before returning plaintext (previouslysetAuthTagwas never called, so tampered ciphertext decrypted silently).EncryptedDatagains an optionaltagfield, a matchingencryptJSONhelper is added, payloads with no usable tag are refused, and legacy combined-layout payloads (tag appended to ciphertext) remain supported.CanisterEncryption(validated GCM tags), deliberately not the legacy vetkeys path.hv_keys never persist to argv/config;hypervault.jsonrefuses to write anything that looks like a plaintext key.Testing
New suites under
tests/hypervault/**(client mock-agent contract, snapshot round-trip / tamper rejection / encryption, indices + hybrid recall, mind-sync topological order + idempotency, auth no-plaintext-key) andtests/mcp-server/**(MCP protocol conformance over stdio pipes), plus atests/security/regression for the C-1 fix.npm run typecheck,npm run lint(0 errors),npm run build, and the fullnpm testall pass.Docs
docs/guides/hypervault.md— end-to-end tutorial (bootstrap → archive → resurrect).docs/architecture/hypervault-integration.md— three-tier architecture + normative bundle-format spec.Notes / follow-ups
hypervaultendpoints from the plan (GET /api/export,POST /api/import/vault, archive receipts) are consumed by this client and land as separate PRs in that repo. The client tolerates their absence (receipts are best-effort; export falls back gracefully).🤖 Generated with Claude Code
https://claude.ai/code/session_01FbdRFUf2aN6kGSWhkvP5NX
Generated by Claude Code