docs(usage): design revision-consistent screen reads - #5023
Sun-GLiang wants to merge 6 commits into
Conversation
Generated-by: Codex
Align the design draft and PR scope around the core P1 contract, leaving concrete Storage boundaries and mechanisms for likun before implementation. Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
|
从问题定义和奥卡姆剃刀角度看,我认可核心方向:单个 Storage 事务返回首屏、SQL 聚合、明细按需游标分页、后续页校验 revision,且不保留 Host 侧的整批数据快照。这比用容量、租约、释放协议维护全量副本更直接。 建议把问题定义收敛为:
这里需要区分三个独立目标:数据一致性、资源有界、产品可用性。前两个成立,不自动意味着第三个成立。文档已经列出相关取舍,但建议在继续细化实现前,先明确两个产品决策:
最小实现方向仍建议保留上述核心,以及现有计费、完整性、搜索语义。不要为简化而把未计价当成零费用,或把范围搜索缩成当前页搜索。细粒度 revision、额外列表分页、通用查询抽象则应按实际约束和证据决定,不必预先全部引入;暂不分页的集合仍需明确上限及超限行为。 另外,SQL 聚合减少的是应用侧物化、JSON 解码和传输,不自动消除随历史规模增长的扫描/分组工作;现有单源 SQLite probe 的结论边界应继续保留。 结论:支持核心方向,但先把“数据大了能否拒绝展示”和“写入活跃时能否打断翻页”定清楚,再选择具体 Storage 机制和预算。这是设计意见,不是实现批准。 AI-assisted:本评论由 Codex 根据本任务中的讨论整理并经用户授权发布。基于设计文档 |
Remove the performance admission and scale-availability design. Keep the single-transaction screen, revision-checked continuation, Host fencing, and consistency verification required by apache#4058.\n\nGenerated-by: Codex
Give Storage review concrete defaults and alternatives for the query boundary, repair ownership, revision, cursor, and restore fencing. Generated-by: Codex
Summary
Settings Usage should install its statistics, breakdowns, pricing/coverage, and first activity page from one Storage read transaction and one opaque revision. Further activity pages carry that revision and receive rows only while it still matches. A mismatch returns
revision_changed; Host retains no per-reader Usage dataset and Desktop never combines different revisions.This is a design-only draft for #4058, following the maintainer's P1 review and Storage/protocol rules. It does not introduce or evaluate new performance budgets, bounded-admission thresholds, arbitrary-history availability, or incremental aggregate projections.
The latest inspected main baseline is
1ae4d5b89. Its renderer paginates the already-loaded activity array, but Desktop still constructs one Usage screen from independent summary, LLM-log, tool-log, and pricing reads. The consistency defect therefore remains.Design: Revision-consistent Usage screen reads.
Review focus
The document now gives an author proposal, an alternative, and a specific confirmation request for every remaining Storage decision:
(timestamp, source, stableStorageIdentity); an equivalent globally unique Storage ordering key remains an alternative.revision_changeduntil Refresh.Agreement with this document is design agreement, not implementation approval.
Explicit non-goals
limit_exceededproduct state.Existing protocol item and encoded-byte limits remain wire safety constraints.
Implementation outline
Verification
1ae4d5b89on 2026-09-15.AI use
Select exactly one:
Tool(s) and scope: Codex inspected the latest main Usage path and rewrote the design to isolate #4058's consistency contract and make its remaining Storage choices reviewable. Sun-GLiang is the contributor of record. Documentation commits carry
Generated-by: Codex.Checklist
These implementation checks remain pending; this draft changes documentation only.
Does this PR entail a change in behavior?
The current diff has no runtime behavior change. Update this selection when implementation lands.