feat(spec): unify ActionSchema.visible/disabled on one condition shape - #6450
Merged
Merged
Conversation
…ape (#5970) Both keys now accept `boolean | string(CEL) | {dialect, source}`. `visible` was missing the boolean arm, so `visible: true` was a spec-side parse error while objectui's ActionDef accepted it — an asymmetry between two keys of the same kind is a dialect nursery (Prime Directive #12), and it is what forced console's `(action as any).disabled` cast. The boolean arm is not normalized into a CEL literal: a literal survives as a literal so a renderer can branch on it without an evaluator. `requiresFeature` lowering now meets two literals it never could before: `visible: true` composes to the gate alone (`true && gate` IS `gate`), while `visible: false` is refused loudly — the gate could never fire, which is the parses-clean-changes-nothing shape ADR-0078 rejects. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3U9PJm1hEJitS9LtZz8TC
Conflict: bulk-action.zod.ts `visible` describe — kept this branch's rewording (it no longer claims shape-identity with `action.visible`, which now carries a boolean arm) alongside main's new `requiredPermissions` key. Generated artifacts are regenerated as a whole in the next commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3U9PJm1hEJitS9LtZz8TC
`gen:docs` — action.mdx now prints one shape for both keys
(`boolean | string | {dialect,...}`), and bulk-action.mdx carries the reworded
`visible` that no longer claims shape-identity with `action.visible`.
Also fixes two type errors the new tests introduced, rather than re-recording
them: the `getMetadataTypeSchema('action')` call follows the file's own
defined-then-assert precedent, and `lowerRequiresFeature` annotates its
`visible` local because a generic `Omit<T, …>` indexed access cannot be narrowed
by control flow — without it the `=== true` / `=== false` guards leave the
boolean arm on the type and the envelope spread does not compile.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3U9PJm1hEJitS9LtZz8TC
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
qq9340100
enabled auto-merge
August 7, 2026 21:24
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:
|
qq9340100
disabled auto-merge
August 7, 2026 21:25
qq9340100
enabled auto-merge
August 7, 2026 21:30
qq9340100
disabled auto-merge
August 7, 2026 21:35
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.
Fixes #5970
变更
ActionSchema的visible/disabled统一到同一个条件形状:boolean | string(CEL) | {dialect, source}。visible此前缺 boolean 臂:visible: true在 spec 侧是解析错误,而 objectui 的ActionDef接受它 —— 同类两键形状不对称是方言苗圃(Prime Directive Add comprehensive test suite for Zod schema validation #12),也是 console 侧(action as any).disabled强转的根因。requiresFeature下沉新遇两种字面量:visible: true合成为仅门控(true && gate即gate);visible: false大声拒绝 —— 门控永不可能触发,正是 ADR-0078 拒绝的 parses-clean-changes-nothing 形状。origin/main(bulk-action.zod.ts 的visibledescribe 冲突按本支措辞保留,同时保住 main 新增的requiredPermissions),生成物整体重生成,gen:docs参考文档已更新。交付通道注记
wave-6 工头 dev 会话(
session_01G3U9PJm1hEJitS9LtZz8TC,串行第 1 张)无 GitHub 工具,走交付降级通道:dev 实现并 push 分支,PM(session_011M7UwH25Unfi73UHim7ajY)代开本 PR 并跟进 CI 至合并。Generated by Claude Code