Uh oh!
There was an error while loading. Please reload this page.
docs(spec): lifecycle.storage rotation 文案补上方言限定 — O(1) 分片 DROP 仅 SQLite (#6631) - #6789
Merged
os-project-manager merged 1 commit intoAug 8, 2026
Merged
Conversation
…te (#6631) The maxAge guidance, the strategy .describe() and the module TSDoc stated the SQLite-only shard-DROP mechanism as an unconditional property of the rotation strategy. Measured authority: driver-sql gates physical rotation behind supportsRotation (isSqlite only) and rotateShards throws elsewhere; the LifecycleService then takes its 'rotation-fallback' leg — an age-based reap from created_at, exactly the mechanism the old guidance said rotation does not use. All three sites now carry the split the driver note already states: the retained window (shards x unit) is identical on every dialect; only the reclamation mechanics differ (SQLite DROPs the oldest shard whole, O(1); other dialects reap the same window by age). The maxAge guidance's routing advice survives verbatim. Text-only: LifecycleSchema's acceptance surface is unchanged and the superRefine is untouched. Two pins added in batch 20 (both with anti-vacuity guards, matched by idiom): the guidance bullet and the strategy description must each name both legs; reverse-verified red on the reverted text, green on this one. test-typecheck-debt re-recorded 2 -> 1 for the batch-20 file (LifecycleSchema is now imported, retiring its unused-import entry). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ffcE95NaMJcL9XJ9VDYgk
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 112 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-project-manager
marked this pull request as ready for review
August 8, 2026 18:01
Uh oh!
There was an error while loading. Please reload this page.
os-project-manager
deleted the
claude/issue-6631-rotation-dialect-caveat
branch
August 8, 2026 18:15
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 freeto 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.
Fixes#6631
缺陷
packages/spec/src/data/object.zod.ts的lifecycle.storage块有三处无条件表述,实际只在 SQLite 上为真(实测行号,基于origin/main@a5d25734c)::735-737—maxAgeguidance:"Rotation does not reap by age — it retainsshards×unitof history and DROPs the oldest shard whole.":740—strategy: z.literal('rotation')的.describe():"Time-shard the table; rotate by DROPping the oldest shard (O(1) reclaim).":603— 模块 TSDoc:"Rotator (time-shard + DROP oldest)"。权威(逐条实测)
packages/drivers/driver-sql/src/sql-driver.ts:4128-4130:get supportsRotation() { return this.isSqlite; };:4173-4175:rotateShards在其他方言直接 throw。:4121-4123驱动注释本身已把分野写对——"SQLite-only; on other dialects the LifecycleService falls back to an age-based reap, so the declared bound holds everywhere — only the reclamation mechanics differ."packages/objectql/src/lifecycle/lifecycle-service.ts:925-937:else if (lc.storage?.strategy === 'rotation' && !rotated && !lc.ttl)分支调用reap(engine, object, lc, 'rotation-fallback', 'created_at', windowMs, report)—— 按created_at的年龄 reap,恰是旧 guidance 宣称 rotation 不使用的机制;outcome 枚举自己就叫'rotation-fallback'。packages/drivers/五个驱动中,supportsRotation只在driver-sql声明、只在isSqlite下为 true;其余驱动无rotateShards。修改(纯文案,一个从句的代价)
三处均改为驱动注释已有的表述:保留窗口(
shards×unit)在所有方言一致——声明的边界处处成立;回收机制不一致——SQLite 整分片 DROP(O(1) 回收),其他方言按年龄从created_atreap 同一窗口。maxAgeguidance 的路由建议("Set the window withshards/unit, or useretentioninstead of rotation.")逐字保留。接受面零变化:未触碰任何
superRefine/.refine/类型/枚举/可选性;retention.onlyWhen× rotation 的拒绝(理由同样是方言特定的)按 issue 划定明确不动。content/docs/references/data/object.mdx不含这三段文案(生成器只渲染顶层 property 表),check:docs绿,无需再生成。Pin(批 20 新增两条,反空洞 + 按惯用语匹配)
lifecycle.storage.maxAge的拒绝文案必须点名两条腿(/SQLite/+ 按龄 reap 惯用语),路由建议句作反空洞锚(guidance 条目整体消失即红),兄弟未知键作对照(证明匹配的是本键的 guidance 而非 surface 通用文案),并钉死旧句 "does not reap by age" 不得以原文回归。strategy.description非空、仍描述分片机制(反空洞),同样双腿匹配,旧无条件句钉死。逆向验证(方向先行)
预测:回退三处文案(保留 pin)→ 恰好两条新 pin 红(红点落在 SQLite/按龄断言,反空洞守卫在回退文案上保持绿),其余 45 条测试不动;恢复 → 全绿。
实测:完全一致 —— 回退后
2 failed | 45 passed,失败断言分别在:295(guidance 侧/SQLite/)与:312(describe 侧/SQLite/),均位于反空洞守卫之后;恢复后该文件 47 条全绿,spec 全套 345 files / 8848 tests 全绿。验证
pnpm --filter @objectstack/spec test— 345 passed / 8848 passedpnpm --filter @objectstack/spec typecheck— 绿(test-typecheck-debt.json批 20 条目 2 → 1:pin 引用了此前未使用的LifecycleSchemaimport,消掉一条 TS6133;按 ratchet 要求重录)node scripts/check-type-check-coverage.mjs --re-measure(先按 lint.yml 构建 closure)— OK,34 entries re-measured,无一上漂check:docs/check:generated/check:api-surface/check:authorable-surface/check:spec-changes/check:upgrade-guide— 绿(api-surface的 stale 为未建 dist 的本地伪象,干净 main 同样报;dist 构建后绿)node scripts/check-nul-bytes.mjs— OK;changed files ESLint — 0 problemsChangeset:
.changeset/lifecycle-rotation-dialect-caveat.md(@objectstack/specpatch ——.describe()为已发布文案)。🤖 Generated with Claude Code
https://claude.ai/code/session_018ffcE95NaMJcL9XJ9VDYgk
Generated by Claude Code