RFC: Variable System — mutable bindings over immutable CAS #20

Closed
opened 2026-05-30 05:35:31 +00:00 by xingyue · 0 comments
Owner

背景

Issue #19 设计的 Variable System,在不可变 CAS 之上加一层可变命名绑定。经讨论已确定:

  • Scope 以 / 结尾,精确匹配用 ==,递归用前缀
  • SQLite 存储
  • GC 全局,scope 只影响查询
  • Tag 无历史
  • Tag key 和 label 同名互斥
  • CLI 统一 :name 语义删除 tag/label
  • update 校验 schema 一致
  • 所有输出 { type: <schema-hash>, value } JSON 信封,不存 CAS

Phase 拆分

Phase 1: Variable CRUD

作为用户,我能用 CLI 创建 variable 绑定到 CAS node,查看、更新、删除。

Phase 2: Tag/Label + 查询

作为用户,我能给 variable 打 tag/label,按 scope/tag/label 组合筛选。

Phase 3: GC 集成

作为用户,运行 gc 时 variable 引用的数据自动保留。

完成标准

  • 所有 Phase 的 testing issue 已 close
  • CI 通过

Ref: #19

## 背景 Issue #19 设计的 Variable System,在不可变 CAS 之上加一层可变命名绑定。经讨论已确定: - Scope 以 `/` 结尾,精确匹配用 `==`,递归用前缀 - SQLite 存储 - GC 全局,scope 只影响查询 - Tag 无历史 - Tag key 和 label 同名互斥 - CLI 统一 `:name` 语义删除 tag/label - update 校验 schema 一致 - 所有输出 `{ type: <schema-hash>, value }` JSON 信封,不存 CAS ## Phase 拆分 ### Phase 1: Variable CRUD 作为用户,我能用 CLI 创建 variable 绑定到 CAS node,查看、更新、删除。 - Testing issue: #21 ### Phase 2: Tag/Label + 查询 作为用户,我能给 variable 打 tag/label,按 scope/tag/label 组合筛选。 - Testing issue: #22 ### Phase 3: GC 集成 作为用户,运行 gc 时 variable 引用的数据自动保留。 - Testing issue: #23 ## 完成标准 - [ ] 所有 Phase 的 testing issue 已 close - [ ] CI 通过 Ref: #19
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/json-cas#20