Skip to content

feat(lint): bidirectional binding-root check for visibility predicates (ADR-0089 D3b) - #2931

Merged
os-zhuang merged 1 commit into
mainfrom
claude/adr-0089-visibility-schema-q7gz10
Jul 14, 2026
Merged

feat(lint): bidirectional binding-root check for visibility predicates (ADR-0089 D3b)#2931
os-zhuang merged 1 commit into
mainfrom
claude/adr-0089-visibility-schema-q7gz10

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Follow-up to #2900 (ADR-0089), addressing the remaining gap in D3b (#2903).

Context — what was already done vs. what this adds

The D3b lint rule (validate-visibility-predicates) already landed with #2900: it flags deprecated visibleOn / visibility aliases (with an autofix-grade rename hint) and mis-layered binding roots, is wired into os validate / compile, and is tested. A repo-wide sweep of packages/ + examples/ is already clean (the #2900 codemod normalized all first-party sources).

The one genuine gap: ADR-0089 D3 specifies the binding-root check in both directions —

a predicate whose binding root does not match its layer (data. in a runtime form predicate, or record. in a metadata form predicate)

— but the rule only implemented the runtime direction (data. on a *.view.ts / *.page.ts surface). This PR adds the metadata direction.

Changes

  • validateVisibilityPredicates(stack, { layer }) gains an optional layer option:
    • 'runtime' (default, behavior unchanged) — flags a data.-rooted predicate on a runtime view/page surface.
    • 'metadata' — flags a record.-rooted predicate on a *.form.ts metadata-editing form (which binds data, the row under edit).
  • The root matcher is generalized to any leading identifier (still excludes nested accesses like foo.data / my_record.x); the message + hint are driven from a per-layer table.
  • Exports VisibilityLayer / VisibilityOptions.

Back-compat

Fully back-compat. The os validate / compile call sites pass a single argument and keep the 'runtime' default — correct for app views/pages, which are always runtime surfaces. The 'metadata' layer is opt-in for a caller that knows it is linting a *.form.ts.

Tests

Adds a metadata layer describe block covering: record. flagged, canonical data. clean, the runtime/metadata directions being opposites, the alias check staying layer-agnostic, and the my_record.x false-positive guard. Full @objectstack/lint suite green (204 passed, 2 skipped); tsc --noEmit clean. Includes a minor changeset.

Follow-ups (not in this PR)

Related: closes part of #2903 · parent #2642 · sibling #2904 (objectui renderers, already merged via objectstack-ai/objectui#2490).

🤖 Generated with Claude Code

https://claude.ai/code/session_01R7oGohmS4pT9H73zoV6Jdb


Generated by Claude Code

…s (ADR-0089 D3b)
The `visibility-root-mislayered` rule only flagged the runtime direction
(`data.` root on a `*.view.ts` / `*.page.ts` surface). ADR-0089 D3 spells
out the check in both directions, so make it layer-aware:
- `validateVisibilityPredicates(stack, { layer })` gains an optional layer.
`'runtime'` (default) is unchanged; `'metadata'` flags a `record.`-rooted
predicate on a `*.form.ts` metadata-editing form (which binds `data`).
- Generalize the root matcher to any leading identifier and drive the
message/hint from a per-layer table.
- Export `VisibilityLayer` / `VisibilityOptions`.
Back-compat: the single-argument `os validate` / `compile` call sites keep
runtime behavior. Adds metadata-direction tests; full lint suite green
(204 passed), tsc clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R7oGohmS4pT9H73zoV6Jdb
@vercel

vercelBot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJul 14, 2026 4:03pm

Request Review

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation tests tooling size/m labels Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/lint.

1 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/permissions/authorization.mdx(via @objectstack/lint)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang marked this pull request as ready for review July 14, 2026 16:14
@os-zhuang
os-zhuang merged commit 891ea81 into mainJul 14, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/adr-0089-visibility-schema-q7gz10 branch July 14, 2026 16:14
xuyushun441-sys pushed a commit that referenced this pull request Jul 17, 2026
…ole coverage
The previous revision under-covered the line in three ways, now fixed:
1. 15.0.0 was missing everything outside the ADR-0095 theme from the
14.8.0..15.0.0 range: the strict view/page schema BREAKING change
(ADR-0089 D3a, #2943) with its migration, the per-row import automation
chain + skipAutomations + runAutomations-default-ON behavior change
(#2922), the sys_position/sys_capability system-row write guardrail
(#2930), the bidirectional visibility lint (#2931), and the explain
posture-label alignment (#2949).
2. 15.0.0 had NO Console section at all, despite bundling the objectui 14.0
major (13.2.0→14.0.0, ~73 commits — first release-page disclosure since
much of it rode unversioned in the 14.8.0 pin): the ADR-0057 ChatDock
consolidation (including its breaking cleanup #2475), the Gantt batch,
lists/forms/auth/Studio/i18n enhancements, two security fixes
(#2485/#2410), and the six early-14.1 commits the 15.0.0 pin picked up.
3. The 15.1.0 sections were over-compressed; every domain is now expanded to
its full changeset detail, and the Console 14.1 section covers all eight
areas of the 94-commit range instead of seven bullets.
465 → ~1000 lines; structure mirrors v14.mdx (per-minor annotations inside
one major page, per docs/releases-maintenance.md).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
os-zhuang added a commit that referenced this pull request Jul 17, 2026
…ole coverage (#3082)
* docs(releases): expand v15 page to full 14.8→15.0→15.1 backend + Console coverage
The previous revision under-covered the line in three ways, now fixed:
1. 15.0.0 was missing everything outside the ADR-0095 theme from the
14.8.0..15.0.0 range: the strict view/page schema BREAKING change
(ADR-0089 D3a, #2943) with its migration, the per-row import automation
chain + skipAutomations + runAutomations-default-ON behavior change
(#2922), the sys_position/sys_capability system-row write guardrail
(#2930), the bidirectional visibility lint (#2931), and the explain
posture-label alignment (#2949).
2. 15.0.0 had NO Console section at all, despite bundling the objectui 14.0
major (13.2.0→14.0.0, ~73 commits — first release-page disclosure since
much of it rode unversioned in the 14.8.0 pin): the ADR-0057 ChatDock
consolidation (including its breaking cleanup #2475), the Gantt batch,
lists/forms/auth/Studio/i18n enhancements, two security fixes
(#2485/#2410), and the six early-14.1 commits the 15.0.0 pin picked up.
3. The 15.1.0 sections were over-compressed; every domain is now expanded to
its full changeset detail, and the Console 14.1 section covers all eight
areas of the 94-commit range instead of seven bullets.
465 → ~1000 lines; structure mirrors v14.mdx (per-minor annotations inside
one major page, per docs/releases-maintenance.md).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(releases): note post-14.1 fixes carried by the final Console pin (#2615/#2617/#2619/#2620/#2621/#2623)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(releases): add v15 to the releases index; mark v14 line final at 14.8.0
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@os-zhuang@claude