feat(spec): blueprint dashboard widget gains explicit measure/groupBy slots#2360
Merged
Merged
Conversation
… slots
The plan-first blueprint dashboard widget carried only {id,title,object,chart},
so cloud's deterministic dashboardBody() had to GUESS which measure/dimension a
widget binds from the title alone — a non-count metric took the next measure by
field order, a grouped chart took the first category dimension. Both produce
structurally-valid-but-semantically-wrong bindings that graph-lint cannot catch
(cloud #476).
Add optional `measure` (the field to aggregate, or "count") and `groupBy` (the
breakdown field) to both the lenient BlueprintDashboardSchema and the strict
StrictDashboard mirror (the generateObject contract; stripNulls already drops
the emitted nulls). The model names the FIELD; cloud maps it to the semantic
measure (total_* SUM / avg_* AVG) so aggregation stays coherent.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 91 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
Why
The plan-first blueprint dashboard widget carried only
{id, title, object, chart}, so cloud's deterministicdashboardBody()had to guess which measure/dimension a widget binds from the title alone. Two heuristic gaps produced structurally-valid-but-semantically-wrong bindings that BVL graph-lint cannot catch (cloud #476):[score(percent), amount(currency)]a "total revenue" card boundavg_score;status.The propose prompt already said "group by the field the user named", but the widget had no slot to express it.
What
Add optional
measure/groupByto the blueprint dashboard widget, in both the lenientBlueprintDashboardSchema(optional, snake_case) and the strictStrictDashboardmirror — thegenerateObjectcontract the model emits against (nullable + present, per OpenAI strict).stripNullsin the cloud blueprint tools already drops the emitted nulls so the lenient schema sees them absent.measurenames the field to aggregate ("amount","win_rate") or the literal"count"; cloud maps the field to its semantic measure (total_*SUM /avg_*AVG) so aggregation coherence (percent→avg) is preserved automatically.groupBynames the breakdown field. Additive + optional → no behavior change for existing blueprints; the cloud builder keeps its title heuristics as the fallback.Tests
packages/specsuite green (6629 tests), incl. new coverage: lenient widgets carrying / omittingmeasure+groupBy, snake_case rejection, and the strict mirror requiring + accepting the nullable keys.Consuming cloud change: objectstack-ai/cloud
fix/dashboard-widget-semantic-binding. Cloud bumps.framework-shato this commit once merged.🤖 Generated with Claude Code