fix(fs): add FsStore var/tag test coverage and share validateName #48

Merged
xiaoju merged 1 commits from fix/42-fsstore-implements-store into main 2026-06-02 09:35:09 +00:00
Owner

What

Phase 4 of #42: complete FsStore test coverage and finalize cleanup items from #47.

Why

Phase 3 (PR #46) moved var-store.ts to packages/fs/src/, made openStore() return OcasStore, and removed sqlite from core. This PR adds the missing FS-side test coverage and dedups validateName.

Changes

  • New packages/core/src/validation.ts — shared validateName, exported from @ocas/core
  • New packages/fs/src/var-store.test.ts — 12 FsVarStore tests (incl. persistence-across-reopen, JSONL append correctness)
  • New packages/fs/src/tag-store.test.ts — 11 FsTagStore tests (incl. reopen + replay fidelity)
  • New packages/cli/src/prompts/usage-doc.test.ts — grep regression tests for usage.md
  • Remove duplicate validateName from core/src/store.ts and fs/src/var-store.ts
  • Fix FsTagStore.listByTag to honor ListOptions via applyListOptions
  • Add OcasStore shape assertion in fs/src/store.test.ts
  • Update packages/cli/src/prompts/usage.md to use openStore/OcasStore (drop stale openStoreAndVarStore)

Verification

  • bun test → 591 pass / 0 fail (32 new tests)
  • bun run build → clean
  • bun run check → 0 errors
  • no-sqlite.test.ts still green

Ref

Fixes #42

## What Phase 4 of #42: complete FsStore test coverage and finalize cleanup items from #47. ## Why Phase 3 (PR #46) moved var-store.ts to packages/fs/src/, made openStore() return OcasStore, and removed sqlite from core. This PR adds the missing FS-side test coverage and dedups validateName. ## Changes - New packages/core/src/validation.ts — shared validateName, exported from @ocas/core - New packages/fs/src/var-store.test.ts — 12 FsVarStore tests (incl. persistence-across-reopen, JSONL append correctness) - New packages/fs/src/tag-store.test.ts — 11 FsTagStore tests (incl. reopen + replay fidelity) - New packages/cli/src/prompts/usage-doc.test.ts — grep regression tests for usage.md - Remove duplicate validateName from core/src/store.ts and fs/src/var-store.ts - Fix FsTagStore.listByTag to honor ListOptions via applyListOptions - Add OcasStore shape assertion in fs/src/store.test.ts - Update packages/cli/src/prompts/usage.md to use openStore/OcasStore (drop stale openStoreAndVarStore) ## Verification - bun test → 591 pass / 0 fail (32 new tests) - bun run build → clean - bun run check → 0 errors - no-sqlite.test.ts still green ## Ref Fixes #42
xiaoju added 1 commit 2026-06-02 09:34:46 +00:00
Phase 4 of unified Store refactor (#38):
- Add FsVarStore tests (12 cases) and FsTagStore tests (11 cases)
  covering CRUD, persistence-across-reopen, JSONL replay fidelity,
  ListOptions, and error paths.
- Extract validateName into packages/core/src/validation.ts; remove
  duplicated copies in core/src/store.ts and fs/src/var-store.ts.
- Fix FsTagStore.listByTag to honor ListOptions (limit/offset/desc)
  via applyListOptions, matching the in-memory implementation.
- Replace stale openStoreAndVarStore example in usage.md with
  openStore returning OcasStore; add grep-based regression test.
- Add OcasStore shape assertion in fs/src/store.test.ts.

Closes #42; partially addresses #47 (items 1, 3).
xiaoju merged commit e398d090b0 into main 2026-06-02 09:35:09 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/ocas#48