Skip to content

fix(spec): COMPONENT_NODE_VISIBILITY_GUIDANCE no longer claims a hoisted properties visibility key is evaluated by nothing - #11390

Merged
os-steve merged 1 commit into
mainfrom
claude/issue-11033-visibility-guidance
Aug 23, 2026
Merged

fix(spec): COMPONENT_NODE_VISIBILITY_GUIDANCE no longer claims a hoisted properties visibility key is evaluated by nothing#11390
os-steve merged 1 commit into
mainfrom
claude/issue-11033-visibility-guidance

Conversation

@os-steve

@os-steveos-steve commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Fixes#11033

What was false, and why it mattered

COMPONENT_NODE_VISIBILITY_GUIDANCE's prescription in
packages/spec/src/ui/component.zod.ts is not a docblock — it is the
user-facing text emitted to an author the moment the COMPONENT_NODE_VISIBILITY_KEYS
guard refuses a visibility key (visible/visibleWhen/…) written inside
properties. It said:

Inside properties it is hoisted onto the node by the renderer but
evaluated by nothing — the component renders unconditionally, which is a
visibility gate that silently does not gate.

That was true when it was written and stopped being true when objectui#5505
(c86185eb5, merged 2026-08-21) bound record into SchemaRenderer's
node-level visibleWhen evaluator. Post-#5505 the hoisted value is
evaluated by the node-level gate — both gates evaluate the same value over
the same RecordContext and compose as an idempotent AND. An author (or an
AI agent generating metadata) that trusted the old sentence would reason
about the wrong gate.

The fix

Per the triage dispatch clause on #11033, this is a prose-truth repair,
not a guidance redesign:

  1. The move-it-up advice stays — now resting on the ADR-0089
    canonical-spelling / layer-discipline reason (visibleWhen belongs on the
    node, beside type and id), not on the props-level form being inert.
  2. The falsified "evaluated by nothing" sentence is replaced with the
    post-objectui: the shadcn Sheet/Dialog primitives ship a hardcoded English Close sr-only label — every drawer and modal in the console announces it untranslated #5505 truth, in the card's own measured wording: the hoisted form IS
    evaluated by the node-level gate since objectui#5505; the two gates
    evaluate the same value and compose as an idempotent AND.
  3. No schema shape change. No accept/reject verdict changes anywhere —
    COMPONENT_NODE_VISIBILITY_KEYS's key set, and everything it refuses, is
    unchanged.

Diff is confined to the one prescription string (packages/spec/src/ui/component.zod.ts),
plus a patch changeset.

Out of scope

content/docs/protocol/objectui/layout-dsl.mdx's hasRole claim, named as a
separate adjacent finding in #11033 — not touched here.

Verification (all at 819e30500e)

  • pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated
    — all 14 generated artifacts still up to date; nothing extracts this
    prescription string into a generated artifact.
  • No test in the repo pins the old prescription text (git grep for
    "evaluated by nothing" / "hoisted onto the node by the renderer" /
    COMPONENT_NODE_VISIBILITY_GUIDANCE finds only this one file before and
    after) — nothing to update.
  • pnpm --filter @objectstack/spec test (full package suite) — 419/419 test
    files, 11136/11136 tests passed.
  • pnpm --filter @objectstack/spec typechecktsc --noEmit +
    check:scripts-typecheck + check:test-typecheck all clean; the
    pre-existing shrink-only test-typecheck debt (55 files / 263 errors,
    @ts-expect-error 退役 pin 在 packages/spec 里是幽灵检查:tsconfig 把 **/*.test.ts 排除出唯一的 tsc --noEmit #5286) is untouched by this diff.
  • node scripts/pm/dispatch-gates.mjs on this diff names 22 local gate
    families (17 before the changeset existed, 5 more once it did — the
    changeset self-tests, check:objectui-changeset, ADR-0087 registration,
    no-major, and empty-changeset checks). All 22 ran green, with one
    worktree-environment caveat: check:doc-formula-expressions
    (packages/lint) failed once on a stale @objectstack/formula/dist in
    this fresh worktree, unrelated to this diff, and passed once that
    dependency was built. check:dev-prereqs's EXISTENCE half needs the full
    67-package workspace built (a pnpm dev preflight, not a per-diff check)
    and stayed red in this partially-built worktree independent of any
    change; its FRESHNESS half (the part that reads packages/spec/dist) is
    satisfied by the pnpm --filter @objectstack/spec build above. Full
    commands and exit codes are in the dev report comment on COMPONENT_NODE_VISIBILITY_GUIDANCE still tells authors a hoisted properties visibility key is "evaluated by nothing" — false since objectui#5505 landed, and it is user-facing parse-error text #11033.
  • node scripts/check-adr-0087-registration.mjs confirms this changeset is
    correctly non-breaking (no ADR-0087 disposition marker required).

Generated by Claude Code

…claims a hoisted properties visibility key is evaluated by nothing
`COMPONENT_NODE_VISIBILITY_GUIDANCE`'s prescription — the user-facing text
emitted when a visibility key (`visible`/`visibleWhen`/…) is authored inside
`properties` instead of on the component node — said the hoisted value is
"evaluated by nothing" and "silently does not gate". That was true when it
was written and is false since objectui#5505 (`c86185eb5`, merged
2026-08-21): SchemaRenderer's node-level `visibleWhen` evaluator now binds
`record`, so the hoisted value IS evaluated by the node-level gate; the two
gates evaluate the same value and compose as an idempotent AND.
The move-it-up advice stays — it now rests on the ADR-0089 canonical-spelling
/ layer-discipline reason (beside `type` and `id`), not on the props-level
form being inert.
Message text only: no schema shape change, no accept/reject verdict change.
Claude-Session: https://claude.ai/code/session_01T9cDbY2NBiVJWYx3BpWfH2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)

Coarse fallback — 126 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 9337cd8104cb4640b5616a7227c55b9fb5a1222epackageMentionDocs.

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation protocol:ui tooling labels Aug 23, 2026
@os-steve
os-steve marked this pull request as ready for review August 23, 2026 15:35
@os-steve
os-steve added this pull request to the merge queueAug 23, 2026
Merged via the queue into main with commit dcb10a5Aug 23, 2026
42 checks passed
@os-steve
os-steve deleted the claude/issue-11033-visibility-guidance branch August 23, 2026 15:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationprotocol:uisize/stooling

Projects

None yet

2 participants

@os-steve@claude