Repository navigation
feat(cli): build tells parts from pages by the system's components; templates declare keywords - #6805
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
39b510e to
dae19e9
Compare
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression16 of 424 shot(s) changed. A change here is a question, not a failure: check whether the after is the
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
…clare keywords Rewrites the build ranker changes of #6805 so they stay right as templates, components, and integrations are added. - TemplateDoc gains an optional `keywords` list, validated by parseTemplate and documented in the TemplateDoc schema doc and the integrations guide. Discovery carries it from every template source, search matches it as it matches a description, and build's page ranker reads it. Each Core page template's closing list of ideas moves out of `description` into `keywords`, and the ranker no longer reads a description's last sentence as keywords. - A part of a page starts where it lives (spec:AST-048 FR3), and the project's own components say what a part is: an idea whose head noun is a word of a component's name or keywords asks for a part, unless the noun is a family word or the idea lists three or more pieces. A part starts from the base template of the family it names, else from the app shell; a change to an existing page starts from the app shell (FR9). A shell template the idea describes stands in for the neutral shell. The start's reason says which case applies and why. Build reuses the components its search already gathered. - A family's base template leads its family unless a variant matches two terms of its own. - The ranker's filler word list is gone. No per-template words and no new word lists live in the ranker. Tests use made-up ideas.
dae19e9 to
c415aa5
Compare
…clare keywords Rewrites the build ranker changes of #6805 so they stay right as templates, components, and integrations are added. - TemplateDoc gains an optional `keywords` list, validated by parseTemplate and documented in the TemplateDoc schema doc and the integrations guide. Discovery carries it from every template source, search matches it as it matches a description, and build's page ranker reads it. Each Core page template's closing list of ideas moves out of `description` into `keywords`, and the ranker no longer reads a description's last sentence as keywords. - A part of a page starts where it lives (spec:AST-048 FR3), and the project's own components say what a part is: an idea whose head noun is a word of a component's name or keywords asks for a part, unless the noun is a family word or the idea lists three or more pieces. A part starts from the base template of the family it names, else from the app shell; a change to an existing page starts from the app shell (FR9). A shell template the idea describes stands in for the neutral shell. The start's reason says which case applies and why. Build reuses the components its search already gathered. - A family's base template leads its family unless a variant matches two terms of its own. - The ranker's filler word list is gone. No per-template words and no new word lists live in the ranker. Tests use made-up ideas.
c415aa5 to
a8d83c6
Compare
There was a problem hiding this comment.
Thanks for the careful write-up — the typed keywords field and deriving parts from the project's own components are the right shape, and the targeted tests are thorough. I found two ranking cases on the shipped catalog that need fixing before this lands:
- A family's base can erase the variant that should lead. Asking build for "a funnel for a dashboard" ranks
dashboard-cohort-funnelfirst with plenty of evidence, but the base promotion putsdashboardahead of it even thoughdashboardalone does not clear the start threshold — so the kit falls back to the app shell and says "too little of the idea fits it" about the very template search matched. The base should only be promoted when it can start itself, or the variant should stay when it cannot. - Any use of the word "existing" is treated as editing a page you already have. "A new dashboard inspired by the existing one" and "show existing users in a table page" both get the shell plus a "keep the page you already have" reason, even though neither asks to change an existing page. The edit signal needs to attach to the page being changed, not to any noun in the idea.
Both reproduce against the shipped template catalog; a regression test for each phrasing would cover them well. Everything else — the parser and discovery plumbing, the pack-check guard for integrations, and the keyword moves themselves — looks good.
[Automated review]
…clare keywords Rewrites the build ranker changes of #6805 so they stay right as templates, components, and integrations are added. - TemplateDoc gains an optional `keywords` list, validated by parseTemplate and documented in the TemplateDoc schema doc and the integrations guide. Discovery carries it from every template source, search matches it as it matches a description, and build's page ranker reads it. Each Core page template's closing list of ideas moves out of `description` into `keywords`, and the ranker no longer reads a description's last sentence as keywords. Integration templates that set it need CLI 0.7.0, and `integration pack --check` fails a package that sets it without declaring that CLI range, as it does for `replaces`. - A part of a page starts where it lives (spec:AST-048 FR3), and the project's own components say what a part is: an idea whose head noun is a word of a component's name or keywords asks for a part, unless the noun is a family word or the idea lists three or more pieces. A part starts from the base template of the family it names, else from the app shell. - A change to an existing page or part starts from the app shell (FR3, FR9). "Existing" marks one only when its phrase names a page family or a component ("the existing table", "the existing banner"); a new page that mentions something existing is still a page. - A shell template the idea describes stands in for the neutral shell. The start's reason says which case applies and why. Build reuses the components its search already gathered. - A family's base template leads its family unless a variant matches two terms of its own, and a base that cannot start on its own never displaces the variant that leads. - The ranker's filler word list is gone. No per-template words and no new word lists live in the ranker. Tests use made-up ideas.
a8d83c6 to
391a842
Compare
…clare keywords Rewrites the build ranker changes of #6805 so they stay right as templates, components, and integrations are added. - TemplateDoc gains an optional `keywords` list, validated by parseTemplate and documented in the TemplateDoc schema doc and the integrations guide. Discovery carries it from every template source, search matches it as it matches a description, and build's page ranker reads it. Each Core page template's closing list of ideas moves out of `description` into `keywords`, and the ranker no longer reads a description's last sentence as keywords. Integration templates that set it need CLI 0.7.0, and `integration pack --check` fails a package that sets it without declaring that CLI range, as it does for `replaces`. - A part of a page starts where it lives (spec:AST-048 FR3), and the project's own components say what a part is: an idea whose head noun is a word of a component's name or keywords asks for a part, unless the noun is a family word or the idea lists three or more pieces. A part starts from the base template of the family it names, else from the app shell. - A change to an existing page or part starts from the app shell (FR3, FR9). "Existing" marks one only when its phrase names a page family or a component ("the existing table", "the existing banner"), and never when the idea asks for a new page ("a new dashboard like the existing dashboard", "clone the existing dashboard as a new page"). - A shell template the idea describes stands in for the neutral shell. The start's reason says which case applies and why. Build reuses the components its search already gathered. - A family's base template leads its family unless a variant matches two terms of its own, and a base that cannot start on its own never displaces the variant that leads. - The ranker's filler word list is gone. No per-template words live in the ranker; its only new words are `existing` and `new`. Tests use made-up ideas.
391a842 to
7d4a89d
Compare
There was a problem hiding this comment.
Thanks for the rework — the typed keywords field, deriving parts from the project's own components, and the base-template guard all look right, and the targeted tests are thorough.
The previously reported cases now behave correctly: a new dashboard based on or cloned from the existing dashboard starts from dashboard, showing existing users in a table page starts from a table template, and “a funnel for a dashboard” starts from the funnel variant, each covered by a shipped-catalog regression. True edits such as “add a column to the existing table” still start from the app shell.
One noted limit, not a blocker: a bare phrase such as “existing users dashboard”, with no request for a new page, is read as the builder's own page, as documented.
Everything else — the parser and discovery plumbing, the pack-check guard for integrations, and the keyword moves themselves — looks good.
[Automated review]
…clare keywords Rewrites the build ranker changes of #6805 so they stay right as templates, components, and integrations are added. - TemplateDoc gains an optional `keywords` list, validated by parseTemplate and documented in the TemplateDoc schema doc and the integrations guide. Discovery carries it from every template source, search matches it as it matches a description, and build's page ranker reads it. Each Core page template's closing list of ideas moves out of `description` into `keywords`, and the ranker no longer reads a description's last sentence as keywords. Integration templates that set it need CLI 0.7.0, and `integration verify` fails a package that sets it without declaring that CLI range, as it does for `replaces`. - A part of a page starts where it lives (spec:AST-048 FR3), and the project's own components say what a part is: an idea whose head noun is a word of a component's name or keywords asks for a part, unless the noun is a family word or the idea lists three or more pieces. A part starts from the base template of the family it names, else from the app shell. - A change to an existing page or part starts from the app shell (FR3, FR9). "Existing" marks one only when its phrase names a page family or a component ("the existing table", "the existing banner"), and never when the idea asks for a new page ("a new dashboard like the existing dashboard", "clone the existing dashboard as a new page"). - A shell template the idea describes stands in for the neutral shell. The start's reason says which case applies and why. Build reuses the components its search already gathered. - A family's base template leads its family unless a variant matches two terms of its own, and a base that cannot start on its own never displaces the variant that leads. - The ranker's filler word list is gone. No per-template words live in the ranker; its only new words are `existing` and `new`. Tests use made-up ideas.
7d4a89d to
0781664
Compare
There was a problem hiding this comment.
Thanks for the rework — the typed keywords field, deriving parts from the project's own components, and the base-template guard all look right, and the targeted tests are thorough.
The previously reported cases now behave correctly: a new dashboard based on or cloned from the existing dashboard starts from dashboard, showing existing users in a table page starts from a table template, and “a funnel for a dashboard” starts from the funnel variant, each covered by a shipped-catalog regression. True edits such as “add a column to the existing table” still start from the app shell.
One noted limit, not a blocker: a bare phrase such as “existing users dashboard”, with no request for a new page, is read as the builder's own page, as documented.
Everything else — the parser and discovery plumbing, the pack-check guard for integrations, and the keyword moves themselves — looks good.
[Automated review]
…clare keywords Rewrites the build ranker changes of #6805 so they stay right as templates, components, and integrations are added. - TemplateDoc gains an optional `keywords` list, validated by parseTemplate and documented in the TemplateDoc schema doc and the integrations guide. Discovery carries it from every template source, search matches it as it matches a description, and build's page ranker reads it. Each Core page template's closing list of ideas moves out of `description` into `keywords`, and the ranker no longer reads a description's last sentence as keywords. Integration templates that set it need CLI 0.7.0, and `integration verify` fails a package that sets it without declaring that CLI range, as it does for `replaces`. - A part of a page starts where it lives (spec:AST-048 FR3), and the project's own components say what a part is: an idea whose head noun is a word of a component's name or keywords asks for a part, unless the noun is a family word or the idea lists three or more pieces. A part starts from the base template of the family it names, else from the app shell. - A change to an existing page or part starts from the app shell (FR3, FR9). "Existing" marks one only when its phrase names a page family or a component ("the existing table", "the existing banner"), and never when the idea asks for a new page ("a new dashboard like the existing dashboard", "clone the existing dashboard as a new page"). - A shell template the idea describes stands in for the neutral shell. The start's reason says which case applies and why. Build reuses the components its search already gathered. - A family's base template leads its family unless a variant matches two terms of its own, and a base that cannot start on its own never displaces the variant that leads. - The ranker's filler word list is gone. No per-template words live in the ranker; its only new words are `existing` and `new`. Tests use made-up ideas.
0781664 to
4ab2767
Compare
There was a problem hiding this comment.
Thanks for the rework — the typed keywords field, deriving parts from the project's own components, and the base-template guard all look right, and the targeted tests are thorough.
The previously reported cases now behave correctly: a new dashboard based on or cloned from the existing dashboard starts from dashboard, showing existing users in a table page starts from a table template, and "a funnel for a dashboard" starts from the funnel variant, each covered by a shipped-catalog regression. True edits such as "add a column to the existing table" still start from the app shell, and the rebased CLI-floor handling correctly keeps keywords on the newer floor while themes and section ids stay on the earlier one.
Two noted limits, not blockers: a bare phrase such as "existing users dashboard", with no request for a new page, is read as the builder's own page, as documented; and a bare "executive summary" is read as a part and starts from the app shell, with the scorecard template still listed first to choose instead. Naming the page ("executive summary dashboard") starts from a template as expected.
Everything else — the parser and discovery plumbing, the verification guard for integrations, and the keyword moves themselves — looks good. Template owners may still want to trim any added keyword their template does not serve, as the description asks.
[Automated review]
This replaces the first version of this PR. That version kept three
hand-kept word lists in the ranker and put ranking keywords in template
description prose. Builds on #6862, which amends AST-048 so a change to an
existing page starts from the app shell.
User need
A builder, a person or a coding agent, describes the UI they want and asks
astryx buildwhere to begin. Two kinds of request got the wrong start.settings page" asks for one piece, not a page, but build ranked it like a
page request, so it scaffolded whichever page template shared a word with
it.
spec:AST-048FR3 says a part starts from the page the request names,else from the app shell. To follow that rule, build has to know what a part
is. A word list kept by hand in the ranker drifts as components are added,
and it misfires: "calendar" names a component, and people also ask for
whole calendar pages.
closing sentence of each template's description ("Dashboard, overview,
metrics, ..."). Descriptions are written for people and shown in search and
the docs, so that sentence was a keyword list wearing prose. The ranker had
to guess where it began, and template authors had no typed place to put
those words.
The result in both cases: the builder scaffolds a page they then throw away,
or composes from primitives, which build exists to prevent (AST-048 DEC-1).
Problem and solution fit
keywordsonTemplateDoc. Each template names the ideas it servesin a typed, documented field that its author owns. Build and search read
the same words, and descriptions go back to describing the layout.
part when its head noun is a word of a component's name or keywords, Core's
or an integration's. It is a page when that noun names a family of page
templates ("a data table") or the request lists three or more pieces. Words
that only mean "page" ("page", "screen", "app", "view") name no component,
so "a calendar page" is a page and "a calendar" is a part. A new component,
or an integration's components, extend this with no change to build.
request names ("an empty state for a settings page" starts from
settings), else from the app shell. A shell template the requestdescribes ("a frame with sidebar navigation") stands in for the neutral
shell.
builder keeps the page they have. "Existing" marks such a change only when
its phrase names a page family or a component ("add a column to the
existing table", "swap the existing banner"), and never when the request
asks for a new page ("a new dashboard like the existing dashboard", "clone
the existing dashboard as a new page"); "a new dashboard inspired by the
existing one" is a new page too.
request for a new one ("existing users dashboard"), reads as the builder's
own page, the way requests that open "Existing … dashboard" are usually
written. Telling "a dashboard of existing users" from "the existing users
dashboard" needs more than words.
a part of a page and names no page, so it starts from the app shell."
terms of its own. That is the same evidence a start already needs, so "a
support dashboard with a small comparison note" starts from
dashboard. Abase that cannot start on its own never displaces the variant that leads,
so "a funnel for a dashboard" starts from the funnel dashboard.
Current specification
spec:AST-048: FR1, FR2, FR3 (as amended by spec(cli): AST-048 a change to an existing page starts from the app shell #6862), FR4, FR6, FR9; FR11(a ranking change moves values, not shapes).
spec:AST-017FR10, FR11 and DEC-2: template metadata, keywords included,is catalog data.
spec:AST-035FR1: the precedent for a strict-metadata field that needsCLI 0.7.0 in integrations.
spec:AST-039(draft): each item's same-stem descriptor is the only sourceof its metadata, with no catalogs and no per-item maps.
Overlapping open work: #6816 also edits build's adapter, kit and text output,
and #6730 also adds a
TemplateDocfield. Whichever lands second rebases;neither changes this design.
Public delta and caller burden
New optional
TemplateDoc.keywords: string[](lowercase), on page andblock templates. It is typed in
@astryxdesign/cli/authoring, validated byparseTemplate, and documented in theTemplateDocschema doc and thetemplate doc overview guide, beside the other fields every template shares.
The versioning, checks and troubleshooting guides list it with the other
fields that need CLI 0.7.0.
keywordsneeds@astryxdesign/cli0.7.0 or later, the same floor asreplaces. Templatemetadata is strict, so a stable CLI before 0.7.0 rejects the field, drops
that template, and hides the package's doc topics. Checked on 0.6.3 with
two templates: only the one that sets
keywordsdrops, andastryx template --listandastryx searchprint one warning,Warning: <package> has 1 integration issue(s). Run: astryx doctor integration validate <package>;that command names the unrecognized key.
astryx docsandastryx buildsay nothing; making that loud is separate work. Declare
@astryxdesign/cli >=0.7.0when a template useskeywords:integration verifynow fails such a package until it does(
keywords_needs_cli), as it already does forreplaces.from
descriptionintokeywords, so descriptions intemplate --list,search and the docs get shorter. This is a catalog value change under
AST-017 FR10.
build: no JSON shape change. Values move under AST-048 FR11: thestart, its alternatives, and search's page matches. Start reasons gain
wording for parts and for changes to an existing page.
search: a template's keywords are matched like its description.keywords.Template owners: please review the keyword lists that moved out of your
templates' descriptions, and trim any word your template does not serve.
Design and alternatives
Every signal comes from the design system's own sources: template ids,
families and categories; component names and keywords; and template
keywords. The ranker holds no per-template words. It adds two words,
existingandnew. Its other word sets are unchanged from main: theoverlay frames, the layout word
side, and the joining words that end aphrase. Main's filler-word list is removed. Each rule names the AST-048
requirement it implements, and each constant states why it has its value.
Rejected:
drift, nobody owns them, and they misfire.
its metadata.
word-matching ranker. It may come later for docs and agents.
Removed from the first version: two special cases for overlays (an overlay
named among a page's parts, and a minimum term count for a flow in a dialog).
Evidence
Tests use made-up requests.
words; a variant displaces its family's base template only with two terms
of its own; family words come from template ids; an integration's component
joins the part vocabulary by existing; a request that lists three pieces is
a page; the frame in "in a modal" is not the head noun; "existing" marks a
change only when its phrase names a page family or a component, and a
request for a new page is never a change.
shell;
dashboard, and "a funnel for a dashboard" keeps the funnel dashboard;
on the existing dashboard", "clone the existing dashboard as a new page"
and "show existing users in a table page" start from their page
templates, while changes to an existing dashboard, table or banner start
from the app shell.
response reports is still named.
parseTemplateaccepts keywords on pages and blocks andrejects a non-list or an empty word.
build to reuse, and out of its JSON.
integration verifyfails a package whose template setskeywordswithout a CLI peer range that reads it, and passes once itdeclares
@astryxdesign/cli >=0.7.0.Two test suites this PR added to were removed on main as content-coupled, so
these assertions have no home yet. Re-home them if the suites come back:
assets/docs/tree/integrations.test.mjs: the guide that documents templatefields mentions
keywords, saysastryx buildranks page templates onthem, carries the 0.7.0 note, and says
integration verifyfails until thepeer is declared; the
TemplateDocschema doc'skeywordsfield isstring[]and its description names 0.7.0.api/search/search.test.mjs: the search-side check above, that searchedcomponents stay out of the JSON and are absent for a templates-only
search. It now lives in
api/build/build.test.mjs, next to its onlycaller.
Scope
Testing
No browser states: the recommendation is CLI output (AST-048 platform
support).