Files
deepseek-harness/packages/storage
_Kerman 501f387b46 feat(storage): add the per-record layout to the json backend
The json backend now serves two layouts. single (the default) keeps the
whole unit as one document at <root>/<name>.json; per-record keeps one
version-stamped document per record at <root>/<name>/<table>/<key>.json
(plus global.json), so one write rewrites one record instead of the whole
unit. The per-record unit is stateless — the directory is the state,
loadAll re-reads the tree, and every write is a single durable file
operation — while single keeps its authoritative in-memory state and
whole-file publish. Records keys must be path-safe ([a-zA-Z0-9_-]+);
an unsafe key rejects. A record document that is malformed or stamped
with another version reads as an absent record: one bad or stale file
never bricks the unit, and a version bump discards stale records instead
of migrating them. DomainSpec and KvUnitDescriptor gain the optional
layout field (defineDomain validates it, descriptorOf projects it).
2026-08-20 13:47:39 +08:00
..
2026-08-17 18:47:02 +08:00

storage/ — non-session storage family

English | 中文

This family persists application data other than session event logs through named backends and typed data forms.

Package Role ctx key
storage/ Connects registered backends with typed data forms ctx.storage
storage-json/ Stores data in JSON files registers backend json
storage-sqlite/ Stores data in SQLite registers backend sqlite
storage-domain/ Provides validated domain-record storage ctx.storageDomain

Consumers use a data form rather than accessing a backend directly. The domain storage decision records the family design.

The subsystem reference — the backend contract, StorageForms, DomainSpec/Domain, domain/changed — is docs/subsystems/storage.md.