feat(lint): catch legacy pre-ADR-0021 dashboard analytics keys at author time (#1878/#1894)#3238
Merged
Merged
Conversation
#1894) An author — very often an AI — can still write the removed inline-analytics shape (categoryField/valueField/xAxisField/yAxisFields/aggregate/aggregation/ rowField/columnField) on a dashboard widget. Post-ADR-0021 the renderer routes dataset-bound widgets through DatasetWidget and never reads these keys, so authoring one is a silent no-op — exactly the "AI writes a dead property" failure the liveness audit targets, but on the authoring side. Add a `widget-legacy-analytics-shape` advisory rule to validateWidgetBindings (already wired into `objectstack compile`): when a widget carries any legacy key, emit a warning steering the author to `dataset` + `dimensions` + `values`, with the fix spelled out. Fires whether or not a dataset is also present (the keys are dead either way) and closes the gap where a dataset-less legacy widget was skipped silently. Warning-only, per-widget suppressible via `suppressWarnings`; never fails the build. Tests: 4 new cases (dataset-bound legacy key, dataset-less legacy pivot, clean dataset widget, suppression); full validate-widget-bindings suite green (37 passed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LddW4NaQBdf5FTEnBPpnUJ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…data source (#1878/#1894) Escalation of the legacy-analytics-shape rule for the case that is an outright bug rather than deprecated-but-working: a widget that uses the removed pre-ADR-0021 inline keys (categoryField/rowField/valueField/…) as its ONLY data wiring — no `dataset`, no `object`, no inline `data`. The renderer reads only the dataset path, so such a widget has no data at all and renders nothing. New rule `widget-legacy-analytics-unrenderable` (severity error) fires for exactly that case; the existing `widget-legacy-analytics-shape` stays a suppressible warning when a data source IS present (the widget still renders, the legacy keys are just ignored noise). Rationale (AI-writes / human-reviews): a silently-blank widget is precisely what a human reviewer misses. Because validateWidgetBindings runs only in the CLI author path (`objectstack compile`/`validate`/`doctor`/`lint`, never in Studio's runtime authoring), this fails the AI/code build in CI without touching Studio. It only fails builds that are already broken (the widget renders nothing regardless), so it surfaces an existing defect rather than introducing a new gate. Errors are not suppressible. Framework examples/fixtures carry no legacy-key dashboards, so nothing regresses. Tests: 3 new cases (unrenderable→error, object-bound→warning, error-not-suppressible); full suite 40 passed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LddW4NaQBdf5FTEnBPpnUJ
os-zhuang
marked this pull request as ready for review
July 18, 2026 20:43
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.
Summary
Part of the metadata-liveness follow-through (#1878), serving the platform's core goal — AI writes metadata, humans review, and we catch AI mistakes at author time (in CI) rather than leaving silent no-ops for a human reviewer to miss.
An author (very often an AI) can still write the removed pre-ADR-0021 inline-analytics shape on a dashboard widget —
categoryField/valueField/xAxisField/yAxisFields/aggregate/aggregation/rowField/columnField. Post-cutover the renderer routes dataset-bound widgets throughDatasetWidgetand never reads these keys. Two failure modes, two severities:dataset/object/data)widget-legacy-analytics-shapedataset, noobject, no inlinedatawidget-legacy-analytics-unrenderableWhy this shape
validateWidgetBindings, which runs only in the CLI author path (objectstack compile/validate/doctor/lint) — the path AI writes to and CI gates. It is not in objectui or any Studio/runtime authoring path, so this does not touch Studio (which still authors the legacy shape via its own inspectors — a separate, deferred workstream).DashboardWidgetSchemais already clean (declares none of these keys; examples are 100% dataset-shaped), so nothing regresses. A hard schema.strict()is a separate, breaking step blocked on migrating Studio'sWidgetConfigPanel— deliberately out of scope here.Testing
validate-widget-bindingssuite green (40 passed).🤖 Generated with Claude Code
https://claude.ai/code/session_01LddW4NaQBdf5FTEnBPpnUJ