StoreErrorKind
This content is not available in your language yet.
type StoreErrorKind = "transient" | "permanent" | "not_found" | "precondition_failed";会话历史分层存储 · 调用契约(接口先冻)。
这里只有运行时接口;持久化数据契约(段条目 / 清单)在 protocol storage.ts
(contract-v0.22)。分层核接在既有段层之上(journal/{writer,reader,manifest}.ts:
写侧 onSegmentSealed 钩子 → 上传不可变段;读侧 segmentSource 钩子 → 本地段缺席时回源),
热层本地盘恒为耐久性地板,冷层只承接封存后不可变的段 / 快照 / 附件。
两级接口对上层同一类型:
- 一级
SegmentBlobStore(字节对象:put/get/head/list/delete;S3 / OSS / COS / MinIO / GCS / Azure / GridFS / 文件系统皆此级;引擎内置分层核把分段/编码/清单提交/热盘 LRU/重试全做掉); - 二级
SessionHistoryStore(自管布局:KV / 关系库;引擎只调 store / load / listSessions / remove)。 适配器唯一要遵守的错误约定 =StoreError.kind四类;其他异常一律按 transient。 边界:键对适配器不透明、体为字节流、不假设 list 一致性、幂等靠 sha256、取消靠 AbortSignal; 加密 / 驻留地 / 访问控制归开发者(transform挂点)。
Was this page helpful?
Thanks for your feedback.