fix(core,fs): phase 3 cleanup — drop legacy Store, sync bootstrap, dedup VarStore #49

Merged
xiaoju merged 1 commits from fix/47-phase3-cleanup into main 2026-06-02 10:10:43 +00:00
Owner

What

Phase 3 review cleanup for issue #47.

Why

Address remaining cleanup items: legacy type removal, unnecessary async, and VarStore logic duplication.

Changes

  • Legacy Store removal: dropped legacy Store type from types.ts; migrated bootstrap-capable.ts to CasStore; renamed OcasStore -> Store across core/fs/cli.
  • Sync bootstrap() / putSchema(): removed async/Promise since CasStore.put() is sync; updated all call sites to drop await.
  • VarStore dedup: extracted pure helpers into new packages/core/src/var-store-helpers.ts; both Memory and Fs VarStores delegate. Persistence stays separate (no base class).

Gates

  • bun test: 591 pass / 0 fail
  • bun run build: clean
  • bun run check: clean (1 preexisting warning)

Ref

Fixes #47

## What Phase 3 review cleanup for issue #47. ## Why Address remaining cleanup items: legacy type removal, unnecessary async, and VarStore logic duplication. ## Changes - **Legacy Store removal**: dropped legacy Store type from types.ts; migrated bootstrap-capable.ts to CasStore; renamed OcasStore -> Store across core/fs/cli. - **Sync bootstrap() / putSchema()**: removed async/Promise<Hash> since CasStore.put() is sync; updated all call sites to drop await. - **VarStore dedup**: extracted pure helpers into new packages/core/src/var-store-helpers.ts; both Memory and Fs VarStores delegate. Persistence stays separate (no base class). ## Gates - bun test: 591 pass / 0 fail - bun run build: clean - bun run check: clean (1 preexisting warning) ## Ref Fixes #47
xiaoju added 1 commit 2026-06-02 10:10:16 +00:00
- Remove legacy `Store` type with `Promise<Hash>` `put`; rename `OcasStore` → `Store`
  across @ocas/core, @ocas/fs, @ocas/cli (production + tests).
- Migrate `BootstrapCapableStore` to `CasStore`; `[BOOTSTRAP_STORE]` returns `Hash`
  synchronously.
- Make `bootstrap()` and `putSchema()` synchronous; remove `await` at all call sites.
- Extract pure VarStore helpers into `packages/core/src/var-store-helpers.ts`
  (`varKey`, `addNameIndex`, `removeNameIndex`, `extractSchema`, `checkTagLabelConflict`,
  `pushHistory`, `cloneVarRecord`, `VarRecord`); both `MemoryVarStore` (-74 lines) and
  `FsVarStore` (-63 lines) now delegate to them while keeping persistence separate.

Refs #47
xiaoju merged commit 0735e7ca24 into main 2026-06-02 10:10:43 +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#49