feat(storage): add Phase 5 SQLite contract preview - #92
Draft
Yuge Zhang (ultmaster) wants to merge 4 commits into
Draft
feat(storage): add Phase 5 SQLite contract preview#92Yuge Zhang (ultmaster) wants to merge 4 commits into
Yuge Zhang (ultmaster) wants to merge 4 commits into
Conversation
Yuge Zhang (ultmaster)
force-pushed
the
feat/multi-backend-storage-phase-5-sqlite-preview
branch
from
August 14, 2026 04:37
fc1da3d to
2618a93
Compare
Yuge Zhang (ultmaster)
force-pushed
the
feat/multi-backend-storage-phase-5-sqlite-preview
branch
from
August 18, 2026 03:06
2618a93 to
883d0ae
Compare
`values.ts` held three unrelated concerns behind a name that described none of them: JSON codecs, `spaces` row statements, and collision-key allocation. Split it where a dependency boundary already ran. `rows.ts` owns everything that touches a stored column or `DatabaseSync`. `identity.ts` owns the pure title and label allocation rules, and imports no SQLite at all — which is what makes the cut a boundary rather than a preference. Several consumers now depend on less: `space-logs`, `space-tasks` and `structured-store` need only `rows.ts`, and `space-nodes` takes a single symbol from `identity.ts` in place of a mixed five-symbol block. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Yuge Zhang (ultmaster)
force-pushed
the
feat/multi-backend-storage-phase-5-sqlite-preview
branch
from
August 18, 2026 05:05
883d0ae to
2bc7a6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Reworked onto current
mainafter #93 merged, so this diff contains Phase 5 only.What changed
node:sqliteimplementation of the structured storage contracts.main.Reading the new backend
Nine implementation modules land under
backends/sqlite/, plus contract and integration tests, test support, and the immutable v1 migration fixture:structured-store.tsStructuredStore— adapter lifecycle and compositionspace-repository.tsSpaceRepositoryspace-nodes.tsSpaceNodesspace-tasks.tsSpaceTasksspace-logs.tsSpaceEvents,SpaceChanges, and the delta logspace-write.tsSpaceHandle.writedatabase.tsrows.tsidentity.tsThe first six align with the port surface and reuse the Disk filenames for the same roles, so the parity suites in
ports/contracts/map directly across both adapters.identity.tsremains pure allocation logic and imports #93's backend-neutral naming rules, keeping collision behavior identical without importing the Disk adapter.Why
This provides a concrete contract and churn preview before SQLite is wired into runtime composition, without changing product capabilities. It tests whether the extracted storage seam supports a transactional backend before committing to production selectability.
Selecting
sqlitestill fails invalidateStorageProfile, now with a distinct preview diagnostic: the adapter is available but not selectable. Physical Disk reads, World bootstrap, Blob placement, import/export, and Workspace remounting still require later composition work.Scope
mainapps/server/src/modules,docs/architecture/canvas-storage.md, anddocs/proposals/multi-backend-storage.mdValidation
All re-run on the published head (
2bc7a6bb):pnpm run check— passedpnpm run build— passedpnpm --filter @huabu/server exec vitest run src/modules/storage— 18 files, 335 passed against Disk, SQLite, and the shared port contractspnpm --filter @huabu/server typecheck— passed