feat(core): MemoryStore returns OcasStore (cas + var + tag) #45

Merged
xiaoju merged 2 commits from fix/40-memorystore-ocas into main 2026-06-02 06:54:24 +00:00

2 Commits

Author SHA1 Message Date
xiaoju 0f10580937 test: update snapshots for Phase 2 changes 2026-06-02 06:54:09 +00:00
xiaoju 56e3253829 feat(core): MemoryStore returns OcasStore (cas + var + tag)
Rewrite createMemoryStore() to return an OcasStore with three sub-stores:
cas, var, tag. The cas sub-store keeps the existing Map-based logic, but
its put is now synchronous; the in-memory VarStore and TagStore are new
Map-based implementations of the types defined in #39.

The legacy Store.put signature is widened to Hash | Promise<Hash> so that
the new sync cas can still be passed to helpers (bootstrap, gc, render,
schema, …) that have not yet been migrated to the unified surface.

Tests in packages/core were mechanically updated from store.* to
store.cas.* and new test suites for VarStore (var-store.test.ts) and
TagStore (tag-store.test.ts) cover the spec from issue #40.

Closes #40

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-02 06:30:01 +00:00