Files
2026-05-27 23:29:53 +01:00

2.8 KiB

Tasks — restore-crypto-fold-keys-vault

1. Pre-move audit

  • 1.1 Confirm no consumer outside crypto-vault's own tests imports ChainSigner
  • 1.2 List every @suaveplan/crypto-keys and @suaveplan/crypto-vault consumer with grep -rln (expected: only auth/auth)
  • 1.3 Snapshot test count + coverage across the three packages so post-move parity is measurable

2. Move files (preserve git history with git mv)

  • 2.1 git mv crypto-keys/src/keypair/* crypto/src/keychain/keypair/
  • 2.2 git mv crypto-keys/src/keychain/* crypto/src/keychain/storage/
  • 2.3 git mv crypto-vault/src/mnemonic/* crypto/src/vault/mnemonic/
  • 2.4 git mv crypto-vault/src/vault/* crypto/src/vault/legacy-vault/
  • 2.5 Merge crypto-keys/src/errors/codes/* and crypto-vault/src/errors/codes/* into crypto/src/errors/codes/ (resolve any code collisions; document in the diff)
  • 2.6 Walk every internal import in moved files and re-point relative paths to the new home
  • 2.7 Update crypto/src/index.ts to re-export the moved surface from the new locations

3. Delete ChainSigner

  • 3.1 git rm -r crypto-vault/src/chain-signer/
  • 3.2 Confirm no remaining import of ChainSigner anywhere in packages/

4. Delete the two old packages

  • 4.1 git rm -r packages/crypto/crypto-keys/
  • 4.2 git rm -r packages/crypto/crypto-vault/
  • 4.3 Run bun install to refresh the workspace lockfile

5. Migrate consumers

  • 5.1 auth/auth/package.json: remove @suaveplan/crypto-keys dep; add @suaveplan/crypto dep
  • 5.2 Codemod-update every auth/auth/src/**/*.ts import from @suaveplan/crypto-keys to @suaveplan/crypto (subpath form may need adjustment to match the new layout)
  • 5.3 If any other consumer surfaces in the audit (Section 1.2), repeat for it

6. Manifest + docs

  • 6.1 Update CLAUDE.md package list: remove crypto-keys, crypto-vault
  • 6.2 bun scripts/folder-reorg/generate-manifest.ts to refresh MANIFEST.md

7. Verification gates

  • 7.1 bun run check — Biome 0/0/0 across monorepo
  • 7.2 bunx turbo lint typecheck test --filter=@suaveplan/crypto green
  • 7.3 bunx turbo lint typecheck test --filter=@suaveplan/auth green
  • 7.4 bunx turbo test:coverage --filter=@suaveplan/crypto 100/100/100/100 over folded modules
  • 7.5 bunx turbo test --filter=...@suaveplan/crypto (dependent sweep) green
  • 7.6 grep -rln "@suaveplan/crypto-keys\|@suaveplan/crypto-vault" packages/ returns zero (excluding archive/)

8. Archive

  • 8.1 Fold spec delta into openspec/specs/crypto/spec.md
  • 8.2 Delete openspec/specs/crypto-keys/ and openspec/specs/crypto-vault/ if those dirs exist
  • 8.3 Move openspec/changes/restore-crypto-fold-keys-vault/ → openspec/archive/<yyyy-mm-dd>-restore-crypto-fold-keys-vault/