Skip to content

Pre-factor: MethodRegistry generic utility #132

Description

@harrryyd

What to build

A thin, reusable MethodRegistry<Key, Value> utility module in packages/contracts/src/. Behaves like a Map but validates at registration time — rejects duplicate keys with a clear error. Accepts register(key, value) and exposes get(key) / has(key) / entries().

This is the shared infrastructure that both the RPC method registry (Candidate 1) and the command handler registry (Candidate 2) will use.

Acceptance criteria

  • MethodRegistry supports register(key, value) — throws on duplicate key
  • MethodRegistry supports get(key)Value | undefined
  • MethodRegistry supports has(key)boolean
  • MethodRegistry supports entries()Iterable<[Key, Value]>
  • Published from packages/contracts/src/ alongside existing exports
  • vp check and vp run typecheck pass

Blocked by

None — can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions