Repository navigation
fix(app-shell): datasource preview 不再报告读副本数量(objectstack#4468 配套) - #3143
Merged
Merged
Conversation
`datasource.readReplicas` is retired in @objectstack/spec 17 (objectstack-ai/objectstack#4468) — nothing in the platform ever opened a replica connection, so the pill reported a configuration that did not exist. The pill did not merely echo the draft back, which is what a preview panel is for and is harmless. It concluded: an author who configured replicas and saw "2 read replicas" light up got the platform telling them it had understood. It was also the only surface in either repo that acknowledged the key at all, so it was the whole of the evidence that the feature worked. packages/spec/liveness/README.md has the standing rule this violated — an authoring or preview renderer is never a runtime consumer — and the 2026-06 sweep that classified 13 properties on preview-renderer evidence alone was later found wrong on 10 of them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WsgTqRF58HsQYKLsrZ5pQY
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 17, 2026
…ma accepts (objectstack-ai#4131) (objectstack-ai#4226) `retryPolicy`, `healthCheck` and `capabilities` were removed from the datasource document by objectstack#4583 under ADR-0049 enforce-or-remove: connection retry and health probing belong to the runtime driver, and pushdown is decided by that driver's own `supports.*`, never by datasource metadata. `DatasourceSchema` is `.strict()`, so it refuses all three by name — while this preview kept painting a `Retry Policy` SideBlock, a `Health Check` SideBlock and a `Capabilities` chip strip for them. An author who typed any of the three saw the designer confirm a draft that cannot be saved, and the preview was the only surface acknowledging the keys at all, so it was also the strongest signal they worked. Deleted: both SideBlocks, the chip strip, `enabledCapabilities()`, the reads at `d.retryPolicy` / `d.healthCheck` / `d.capabilities`, and the now unused `RotateCcw` import. `pool` and `ssl` are still declared and still render. This is the third wave of the same defect on this one file (objectstack-ai#3275 deleted `d.type`, `isDefault` and the `Array.isArray(capabilities)` branch; objectstack-ai#3143 deleted the read-replica pill), and the removals sat in `main` for eight days because nothing compared the two halves of the contract. They are compared mechanically now: `DatasourcePreview.spec-keys.test.ts` derives the preview's read set from the component's own AST — every key reached off the `draft` prop, through dot access, optional chain, bracket or destructure, following a renamed prop and alias chains — and derives the accepted set from the schema object's `.keyof()`. Neither side is written down as a list, so a key added or removed in `@objectstack/spec` moves the pin on the next dependency bump instead of leaving it stale. The pin also asserts things about itself, because a derivation that silently returned nothing would satisfy a subset check forever: that it still finds this file's real reads, and that every use of the draft binding is a read form it understands, so it fails loudly rather than going blind if the preview is refactored. Reverse-verified both ways — restoring the pre-fix file turns it red naming all three keys at their exact lines, and a freshly planted `d.readReplicas` read turns it red naming that one. The AST is load-bearing rather than a grep: the header comment now names all three removed keys in prose, so a text scan would report violations that do not exist. Fixes objectstack-ai#4131 Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3 Co-authored-by: Claude <noreply@anthropic.com>
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 free
to 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.
配套 objectstack-ai/objectstack#4481(issue objectstack-ai/objectstack#4468)。
改了什么
DatasourcePreview从datasource.readReplicas渲染一枚 "2 read replicas" 的 pill。这个 key 在@objectstack/spec17 里被退休了 —— 平台里没有任何东西打开过副本连接:没有驱动读这个 key,也没有任何查询路径区分读和写。删除:
readReplicas常量、那枚 Pill、以及随之不再使用的Copy图标 import。文件头的 feature 列表相应更新,并留下一句说明去向。为什么这不是"顺手清理"
preview 面板把草稿回显出来通常是无害的,那正是它的用途。这一枚不是回显,是结论 —— "2 read replicas"。作者配好副本、保存、看到 pill 亮起,得到的信号是平台确认它理解了配置。
而它是两个仓库里唯一承认这个 key 存在的地方,所以它就是"这个功能能用"的全部证据。
packages/spec/liveness/README.md里有一条常设规则专门讲这个:authoring / preview renderer 永远不算 runtime consumer。2026-06 那次仅凭 preview renderer 就把 13 个属性定性为live的扫描,复核后 10 个是错的。这枚 pill 是同一类错误的下游产物。验证
npx eslint packages/app-shell/src/views/metadata-admin/previews/DatasourcePreview.tsx— clean(确认没有留下未使用的 import)合并顺序
两边可以独立合并,先后都安全 —— spec 的删除不会让这段代码报错(读的是
Record<string, unknown>上的可选 key),这段代码的删除也不依赖 spec 的版本。但两边都合完之前会存在一个中间态:spec 已经拒收readReplicas,而 UI 还在数副本数量。建议贴近合并。后续
读副本路由本身立在 objectstack-ai/objectstack#4479(从查询路径的读写判定开始,不是从加字段开始)。UI 侧等那个功能真正存在时再重新出现,而不是继续替一个不存在的机制作证。
Generated by Claude Code