feat: Archon wallet integration — Save Game, Vault backup/restore, PoH Cloak nodes - #5
feat: Archon wallet integration — Save Game, Vault backup/restore, PoH Cloak nodes#5Flaxscrip wants to merge 6 commits into
Conversation
Re-implements feature/archon-vault on top of origin/main (v1.7.1): - KeymasterContext: wallet connect/unlock, vault save/restore/browse - mageHistory: MageArchonBackup schema + vault constants - mageIdentity: deriveMageKeyFromKeymaster, archonDid/archonLinked fields - sessionPassphrase: in-memory passphrase util for KeymasterContext - poh-cloak-contribution: 9 PoH-cloak nodes with emoji + 6 edges - nodes.ts: spreads poh-cloak registry nodes into canonical graph - SpellWeb: 💾 Save button, Archon Vault browser, resolveNodeEmoji normalizer, auto-backup on forge, restore from vault on unlock Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Create/Import tabs to wallet modal (no-wallet state was missing import path) - Polyfill Buffer globally in main.tsx (keymaster lib uses it as a global) - Install buffer, @didcid/* and @noble/hashes packages - Fix @noble/hashes import: sha512/sha256 from sha2.js subpath - Add walletState + connectWallet to SpellWeb useKeymaster destructure - Show 🔑 Connect button in vault panel when wallet not linked - Add REGISTRY_EDGES from poh-cloak-contribution to edges.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Surfaces exportWallet() from KeymasterContext in the vault panel header (visible when wallet is connected). Downloads the encrypted wallet JSON for backup or import into another browser / React Keymaster wallet. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each save-*.json item in the vault browser now shows an '↑ Load' button that restores that save's full state into the current session (spells, constellations, blades, equippedBlade, userEdges, mana, swordsmanLink). resolveNodeEmoji runs on load to migrate any legacy '✦' placeholders. mage-history.json (auto-checkpoint) shows download only, not load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drawbridge (port 4222) JSON-encodes plain-text responses, wrapping returned CIDs in double quotes. Patch gatekeeper.addText in KeymasterContext to strip outer quotes so vault item CIDs are stored as bare strings. Direct Gatekeeper (4224) returns clean CIDs so the strip is a no-op for non-proxied connections. Also adds a delete (×) button to each vault browser row so users can remove stale or corrupt vault items directly from the Spellweb UI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…graph Adds a 🧵 Weaver Vault panel below the Archon Vault in the Mage menu. Users can browse snapshots saved from the Spell Weaver (spellweb-registry) and click ↑ Import to inject the transmuted nodes and edges directly into the running Spellweb force graph without restarting. - KeymasterContext: listWeaverVaultItems() + getWeaverVaultItem() reading from the 'spellweb-weaver-vault' Archon vault alias - weaverImportedNodes state persisted to localStorage; merged into D3 nodeDataRef at init time alongside canonical NODES - nodeDataVersion counter triggers filter effect re-render when nodes are added at runtime (pattern reusable for any future dynamic node injection) - Weaver edges merged into userEdges (existing sync handles D3 update) - Node types map to existing Spellweb visuals: persona=violet, spell=gold, theorem=red, chronicle=cyan, skill=amber, document=grey-blue - ↓ download retained as secondary option per item Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update — Weaver Vault import (2026-05-22)Added in latest commit ( How it worksThe Spell Weaver (a separate DID/VC registry tool) can transmute its registry items into Spellweb graph format and save them to a dedicated Archon vault (
Node type mapping (Weaver → Spellweb visuals)
All existing theme styles, glow filters, and interaction handlers (click-to-select, search highlight, fog-of-war) apply automatically to imported nodes. D3 injection patternUses a |
Summary
save-YYYYMMDD-HHMMSS.jsonto the Archon Vault and checkpointsmage-history.json. Full Mage state (identity, spells, constellations, blades, Swordsman link, mana) is preserved and restored automatically on wallet unlock.did:cidwallet is connected, the Ed25519 blade-signing key is deterministically derived from the Archon keypair (SHA-256(secp256k1_sig_of(MAGE_SEED_DOCUMENT))). Same wallet → same Mage identity on any device.poh-cloak-contribution.tsadded to the canonical graph (Proof of Humanity VC decomposition: Issuer, Schema, Credential, Sovereign Identity, three disclosure valves). Nodes carry emoji and hexagram data per the lattice spec.resolveNodeEmojimigration — on state hydration, any✦placeholder emoji in saved marks/spells/blade constellations is resolved to the current node definition's emoji. Fixes stale saves from before emoji was added to nodes.New files
src/contexts/KeymasterContext.tsx@didcid/keymaster— wallet state, vault ops, history restoresrc/lib/mageHistory.tsMageArchonBackupschema + vault alias constantssrc/utils/sessionPassphrase.tssrc/data/poh-cloak-contribution.tsDependencies added
Requires a running Archon Gatekeeper (default:
http://192.168.1.23:4224— configurable in the connect modal). Works fully offline if wallet is already unlocked in the session.Test plan
M) → scroll to ☁ Archon Vault panel → click 🔑 Connectarchon-wallet-*.jsonSaving… → Saved→ click ↻ Browse → item appearsmage-history.jsonon unlock🤖 Generated with Claude Code