Files
amethyst/contextvm/src
Claude 4b49198190 refactor(contextvm): one package per CEP
`quartz` puts a NIP's implementation under `nipXX`, `marmot` puts a MIP's
under `mipXX`, and both keep named packages only for what no spec number
covers. ContextVM had neither: CEP-4 sat in `crypto/`, CEP-6/17/23/24/35 were
four unrelated specs sharing one `ServerDiscovery.kt`, CEP-8 in `payment/`.
"Which file implements CEP-17" was a grep rather than a path. Now it is
`cep17RelayList/ServerRelay`.

Four placements are judgment calls, recorded in the README so they can be
argued with:

- CEP-19 stays inside `cep04Encryption/CvmGiftWrap`. Picking the wrap kind
  (21059, falling back to 1059) and building the wrap are one negotiation in
  one class; its own package would separate a method from its only caller.
- CEP-16 gets no package. It is a `_meta` key name plus the server-side
  obligation to inject it -- a constant and fixture behaviour, not a subsystem.
- `transfer/ProgressEnvelope` stays cross-cutting: CEP-22 and CEP-41 share that
  framing, so it is the `marmot/foundation/` analogue.
- `core/`, `jsonrpc/`, `transport/` and `mcp/` keep names because the core
  draft spec is not a CEP and has no number to carry.

Pure moves and package/import rewrites; no behaviour changed. Also drops a
redundant cast the compiler flagged in `CvmMcpClient`. Suite unchanged at 172
on jvm and 143 on the Android target.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012BfD4txdnsaPRXmNXbup9n
2026-09-18 14:54:00 +00:00
..