Repository navigation
feat(cli): name a template's components for one component read - #12389
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval waits on an engineering owner, and on four fixes.
This pull request adds INV40 to architecture:cli-surface, a requirement the current record does not state, so the new components / componentsToRead fields and the "Read the components it uses in one call" line have no current authority yet. An engineering owner approves or amends INV40, including whether the ubiquitous components stay out of the list, and records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner.
- The list leaves out or renames components
astryx componentanswers, against the changeset, the typedefs and INV40:catalogComponentsInSourcesends each tag throughcatalogNames(packages/cli/foundation/discovery/template-adapter.mjs:2195), which drops Text, Heading, Button, HStack, VStack, Link, StackItem and Icon (Text in 376 of the 788 shipped templates, Button in 199, Heading in 120) and strips part suffixes, soInputGroupBasicnamesInputGroupText TextInputbut notInputGroup, and the AvatarGroup blocks nameAvatarinstead ofAvatarGroup. - A tag that no import binds counts as an Astryx component (
template-adapter.mjs:2200,module === undefined), and the tag scan also reads comments, so thedashboard-progressandtable-pagelines tell the agent to readHoverCardalthough both pages import onlyuseHoverCard. - The consumer schema reference omits both new fields:
packages/cli/foundation/response/response-types.doc.mjs:342-354(and the README table it generates) lists every othertemplate.showandtemplate.copyfield, whichspec:AST-017FR13 and DEC-4 require to be complete in the same change. - The description's claim that "the shell and layout come before inner parts" is false, because the order is each name's first tag offset in the text: its own
tableexample putsLayoutfifth, andLayoutis not first in 70 of the 88 lists that hold it.
One non-blocking nit: the topLevelBindings JSDoc now reads "maps AstryxText to Text. Both importedFrom maps …", so the stray "Both" wants dropping.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: one line follows the copy line — verified (
astryx template table out/tableon this head). - Changeset: a printed template gets the same line on stderr and stdout stays the source — verified.
- Changeset: the names are the ones
astryx componentanswers in the project, each once, in first-render order — false for the names it answers (376 templates omit Text;InputGroupandAvatarGroupare folded away). - Changeset: a chart library's parts and the file's own helpers are left out — verified (
dashboarddrops the chart parts; the new unit test covers it). - Changeset: nothing prints for an empty list — verified (
HeadingShowcase). - Changeset:
--jsoncarries the fields and every existing field is unchanged — verified (goldens and the focused test run). - Description:
architecture:cli-surfacegains INV40 and a verification row — verified, and unapproved at this head. - Description: JSON stays additive — verified for compatibility; the documentation leg of the current release claim is not met (third finding).
- Description: the worked
template table src/x.tsxoutput — verified, name for name. - Description: order puts the shell and layout before inner parts — false (fourth finding).
- Description: names come from the existing in-source list, kept only when the project's component list holds them — verified.
- Description: a tag imported from another module does not count — verified for an imported tag; a tag with no import still counts (second finding).
- Description: the added time is about 50 ms — not re-measured in this review.
- Description: the named test selection passes — verified (76 files, 357 passed, 4 skipped).
- Description: knowledge check, strict typecheck, the API-types verifier and the type sync — not re-run in this review.
- Description: the change ships consumer docs with the feature — false (third finding).
- Description: no internal context in public text or artifacts — verified over every added line, the title, body, branch and commit message.
- Files:
.changeset/template-components-line.md(claim finding),docs/architecture/cli-surface.md(unapproved INV40 and its row),packages/cli/api/template/_adapter.mjs(clear),packages/cli/api/template/copy/copy.mjs(clear),packages/cli/api/template/show/show.mjs(clear),packages/cli/api/template/template.mjs(clear),packages/cli/api/template/template.doc.mjs(clear),packages/cli/api/template/template.type.mjs(clear),packages/cli/api/template/copy/copy.components.test.mjs(no case covers an omitted catalog component),packages/cli/clients/cli/commands/template.mjs(clear),packages/cli/foundation/discovery/template-adapter.mjs(first, second and nit findings), the four golden snapshots underpackages/cli/test/__golden__/(clear; each adds only the new field or line), and the untouchedpackages/cli/foundation/response/response-types.doc.mjsthat the third finding names.
|
Owner decision (engineering owner, covering this pull request): after a template is written, the |
|
/approve-spec 7a5a43a |
There was a problem hiding this comment.
Changes requested: the owner approval settles INV40 and the three earlier findings are fixed, but two problems remain in the new component list.
- Miss: the list leaves out components that
astryx componentanswers with their own docs (ResizeHandle,StackItemfrom@astryxdesign/core/Layout,SyntaxTheme,NavHeadingMenu) in 39 of the 788 shipped templates, for exampleResizableSidebarnever namesResizeHandle, because the catalog is onlycomponent --list(packages/cli/api/template/_adapter.mjs:48-74), so the field, INV40, both typedefs,template.doc.mjs, the changeset and the description over-claim; let the catalog hold every nameastryx componentresolves and add those cases to the test. - The new parse and tree walk in
catalogComponentsInSource(packages/cli/foundation/discovery/template-adapter.mjs:2186-2284) copyparseTemplateSourceandwalkfromtemplate-source-tree.mjs, which this file already imports from, so call those and delete the local copies.
The ordering, the stderr placement, the empty case, --json and the response documentation all check out on this head.
Claims and files checked
Review mode: incremental; reason: none
- Claim: the copy receipt gains
components, the components the written file uses thatastryx componentanswers, in first-render order, each once: false for 39 templates (finding 1). - Claim: every component
astryx componentanswers is kept, withText,ButtonandStackincluded: false for sub-component docs such asResizeHandleandStackItem(finding 1);Text,ButtonandStackare kept. - Claim: one line prints right after the copy line with the same command prefix: verified (
clients/cli/commands/template.mjs:361-368, head CLI run). - Claim: a printed template sends the line to stderr and keeps
componentswhile addingcomponentsToRead: verified (commands/template.mjs:326-327, new test). - Claim: nothing prints for an empty list, the line is plain ASCII, and
astryx buildoutput is unchanged: verified (new test; only the template command calls copy and show). - Claim: INV40 and a verification row are added and the JSON stays additive: verified (
docs/architecture/cli-surface.md:627,:1090; goldens). - Claim: both fields are always present and every existing field is unchanged: verified (
copy.mjs:191,show.mjs:67, goldens). - Claim: the example output for the table template: verified (same 17 names on a head run).
- Claim: unbound tags, other modules' tags and comments never count, and a part folds to its root only from that root's module: verified (new test; no chart parts for the dashboard template).
- Claim: order is first use, so helpers declared above the page come first: verified (tags sorted by source position).
- Claim: the named templates print the line, the dashboard leaves out chart parts, two pages no longer list
HoverCard,InputGroupBasiclistsInputGroup InputGroupText TextInputandAvatarGrouplistsAvatarGroup: verified (sweep of all templates). - Claim: one batch
componentcall with a receipt's names finds every name: verified for every shipped template (at most 44 names). - Claim: an agent study showed more batched reads: not checkable here (no data in the pull request).
- Claim: about 50 ms added: consistent (48 to 85 ms for the component list load in this run).
- Claim: goldens change only for the new field and line: verified (diff).
- Claim: both fields are in the response-types reference and the generated README table: verified (
readme:checkin sync). - Claim: the knowledge check passes: verified.
- Changeset: the line follows the copy line and goes to stderr for a printed template: verified.
- Changeset: the names are the ones
astryx componentanswers in the project: false (finding 1). - Changeset: chart parts and local helpers are left out, nothing prints when none are left,
--jsoncarries both fields and existing fields are unchanged: verified. - File
.changeset/template-components-line.md: finding 1 (membership wording). - File
docs/architecture/cli-surface.md: clear. - File
packages/cli/README.md: clear. - File
packages/cli/api/template/_adapter.mjs: finding 1. - File
packages/cli/api/template/copy/copy.components.test.mjs: finding 1 (no sub-component case). - File
packages/cli/api/template/copy/copy.mjs: clear. - File
packages/cli/api/template/show/show.mjs: clear. - File
packages/cli/api/template/template.doc.mjs: finding 1 (membership wording). - File
packages/cli/api/template/template.mjs: clear. - File
packages/cli/api/template/template.type.mjs: finding 1 (membership wording). - File
packages/cli/clients/cli/commands/template.mjs: clear. - File
packages/cli/foundation/discovery/template-adapter.mjs: findings 1 and 2. - File
packages/cli/foundation/response/response-types.doc.mjs: clear. - File
packages/cli/test/__golden__/no-icon-set/template-copy.json: clear. - File
packages/cli/test/__golden__/no-icon-set/template-copy.txt: clear. - File
packages/cli/test/__golden__/no-icon-set/template-show.json: clear. - File
packages/cli/test/__golden__/template.json: clear.
The template.copy receipt gains components and template.show gains componentsToRead: the components the source renders that astryx component answers in the project, in first-use order, each once. A tag counts when a named import binds it to an Astryx package or to the component's own package. Text prints one line naming them in a single component call: after the copy line, and on stderr for a printed template. Both fields join the response-types reference, whose template entries are shorter so the whole read stays under 32 KB.
7a5a43a to
61b637a
Compare
|
/approve-spec 61b637a |
PR Analysis Report🔎 Preview ·
|
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| ~ | cli |
./api · Types · type TemplateCopyResponse |
data: { template: string; outputDir: string; fileName: string; filesCopied: number; demoMediaReplaced: number; demoContentReplaced: number; notes: string[]; missingPa … #88078946 → data: { template: string; outputDir: string; fileName: string; filesCopied: number; demoMediaReplaced: number; demoContentReplaced: number; notes: string[]; missingPa … #96f73985 |
import type {TemplateCopyResponse} from '@astryxdesign/cli/api'; const x: TemplateCopyResponse = {data: …} |
| ~ | cli |
./api · Types · type TemplateShowResponse |
data: { template: string; description: string; type: "page" | "block"; components: string[]; source: string; demoMediaReplaced: number; demoContentReplaced: number; i … #997816e9 → data: { template: string; description: string; type: "page" | "block"; components: string[]; componentsToRead: string[]; source: string; demoMediaReplaced: number; de … #7fe3ecad |
import type {TemplateShowResponse} from '@astryxdesign/cli/api'; const x: TemplateShowResponse = {data: …} |
Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the owner approval settles INV40 and the five earlier findings are fixed, but four problems remain.
- When a configured integration ships its own component under a Core name, such as
Button, the list keeps the bare name, so the printedcomponentcommand exits 1 withERR_AMBIGUOUS_COMPONENT(packages/cli/foundation/discovery/template-adapter.mjs:2238-2254); list such a name as the selector for the package its import names, such as@astryxdesign/core/Button, and add that case to the test. - The required
lintcheck fails onpackages/cli/api/template/_adapter.mjs:89(no-useless-assignment), becauselet found = []is overwritten in both thetryand thecatchbefore it is read, so declare it without a value. packages/cli/foundation/response/response-types.doc.mjs:344and the README row it generates describetemplate.show'scomponentsas every name the template composes, but it is a sorted summary withoutText,Buttonand the other common components, so describe it as that summary and regenerate the README (the description's sentence about it needs the same fix).- The description's
template tableexample leaves outStackItem, which this head prints betweenVStackandHeading, so update that line.
Ordering, the stderr placement, the empty case, --json, and the documentation of the two new fields check out on this head.
Claims and files checked
Review mode: full; reason: rebase
- Claim: the copy receipt gains
components, the components the written file uses thatastryx componentanswers, in first-render order, each once: verified in a Core-only project (every shipped template) and in the test's integration fixture; fails where two packages answer a name (first finding). - Claim: one line prints right after the copy line, with the CLI invocation other commands print: verified (
clients/cli/commands/template.mjs:361-368, new test, head run). - Claim: a printed template sends the line to stderr and keeps stdout to the source: verified (
commands/template.mjs:326-327, new test, head run). - Claim:
template.show's existingcomponentslists every rendered name, sorted and unfiltered: false, it leaves out the common components and folds parts (third finding). - Claim:
componentsToReadis a new additive field andcomponentsis unchanged: verified (api/template/show/show.mjs:67, goldens). - Claim: nothing prints for an empty list, the line is plain ASCII, and
astryx buildoutput is unchanged: verified (new test;buildreads only template discovery). - Claim: INV40 and its verification row are added and JSON stays additive: verified (
docs/architecture/cli-surface.md:653-660,:1162). - Claim: both fields are always present and every existing field keeps its name, type and value: verified (
copy.mjs:189,show.mjs:67, goldens). - Claim: the text adds one stdout line for a copy and one stderr line for a printed template: verified.
- Claim: the example output for
template table src/x.tsx: false, the head also printsStackItem(fourth finding). - Claim: no caller decision is added: verified.
- Claim: a tag counts only when a named import binds it to an Astryx package or the component's own package and
astryx componentanswers the name: verified (foundation/discovery/template-adapter.mjs:2186-2254, new test). - Claim: every component
astryx componentanswers is kept, withText,ButtonandStackincluded and part names as written: verified, no answered component the file renders is missing in any shipped template. - Claim: comment text, unbound tags and other modules' tags never count: verified (new test; no chart parts for
dashboard). - Claim: a part with no doc of its own counts as its family root when imported from that root's module: verified (new test).
- Claim: the order is first use in the file: verified (tags sorted by source position).
- Claim: filtering
componentsin place was rejected because it would change released JSON: consistent with the code, which leaves it unchanged. - Claim: the named templates print the line,
dashboardleaves out chart parts,dashboard-progressandtable-pagedo not listHoverCard,InputGroupBasiclistsInputGroup InputGroupText TextInput,AvatarGrouplistsAvatarGroupandResizableSidebarlistsResizeHandle: verified (sweep of every shipped template). - Claim: a batch call with the copied receipt's names finds every name, and the printed command reads every name in one call with the CLI's own prefix: verified in a Core-only project (at most 46 names, under the limit of 100); fails where two packages answer a name (first finding).
- Claim: agents given the line made fewer component calls with the same success: not checkable here (no data in the pull request).
- Claim: about 50 ms added: consistent (58 ms warm and 103 ms cold for the owner lookup in this run).
- Claim: the new test covers the listed cases: verified (15 tests, passing), with no case where two packages answer a name.
- Claim: goldens change only for the new field and line: verified (diff).
- Claim: the other test files in that run pass: consistent (78 files in the template, command and golden suites pass).
- Claim: both fields are in the response-types reference and its generated README table, and that read stays under 32 KB: verified (
readme:checkin sync; 31,894 bytes). - Claim: the knowledge check, the strict typecheck with two pre-existing missing-build errors, and the API types check pass: verified (both errors are in unchanged templates); the API types sync was not run.
- Claim: the writing rubric finds no narration, research, references, open questions or status in the record: verified (INV40 is present-tense contract text).
- Changeset: the copy prints one line after the copy line naming the components: verified.
- Changeset: a printed template sends the line to stderr: verified.
- Changeset: the names are the ones
astryx componentanswers, in first-render order, each once: verified except where two packages answer a name (first finding). - Changeset: chart parts and local helpers are left out, and nothing prints when none are left: verified.
- Changeset:
--jsoncarries both fields and every existing field is unchanged: verified. - File
.changeset/template-components-line.md: clear. - File
docs/architecture/cli-surface.md: clear. - File
packages/cli/README.md: third finding. - File
packages/cli/api/template/_adapter.mjs: first and second findings. - File
packages/cli/api/template/copy/copy.components.test.mjs: first finding (no case where two packages answer a name). - File
packages/cli/api/template/copy/copy.mjs: clear. - File
packages/cli/api/template/show/show.mjs: clear. - File
packages/cli/api/template/template.doc.mjs: clear. - File
packages/cli/api/template/template.mjs: clear. - File
packages/cli/api/template/template.type.mjs: clear. - File
packages/cli/clients/cli/commands/template.mjs: clear. - File
packages/cli/foundation/discovery/template-adapter.mjs: first finding. - File
packages/cli/foundation/response/response-types.doc.mjs: third finding. - File
packages/cli/test/__golden__/no-icon-set/template-copy.json: clear. - File
packages/cli/test/__golden__/no-icon-set/template-copy.txt: clear. - File
packages/cli/test/__golden__/no-icon-set/template-show.json: clear. - File
packages/cli/test/__golden__/template.json: clear.
…ort names A name an integration also ships under a Core name is written as <package>/<Name>, so the printed component read never stops on an ambiguous name. The response-types reference describes template.show's components as the sorted summary it is.
|
/approve-spec d68a930 |
|
/approve-spec a1a82a2 |
There was a problem hiding this comment.
Changes requested: the owner approval settles INV40 and the four earlier findings are fixed, but one case still prints a list that reads the wrong component or fails.
- When a template imports a component from
@astryxdesign/corethat Core does not document but a configured integration ships under the same name (Core'stable-treerendersSizeProviderfrom@astryxdesign/core/SizeContext),answeredNameinpackages/cli/foundation/discovery/template-adapter.mjs:2252-2253lists the bare name, so the printed command reads that integration's component, and with two such integrations it exits 1 as ambiguous; count a name only when one of its owners is the package the import names, and add that fixture tocopy.components.test.mjs.
The ordering, the stderr placement, the empty case, --json, the @astryxdesign/core/Button selector and the docs for both fields check out on this head, and every shipped template's list reads in one call in a project with Core alone. The required CI jobs did not run on this head because CI had no room, so they need a re-run.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: the copy receipt gains
components, the components the written file uses thatastryx componentanswers (Core's and each integration's), in first-render order, each once: verified with Core alone (all 788 shipped templates) and in the test's integration fixture; false where only integrations answer a name a Core import binds (the finding). - Claim: one line prints right after the copy line, with the CLI invocation other commands print: verified (
clients/cli/commands/template.mjs:367-368, new test, run). - Claim: a printed template prints the same line on stderr with its other notes: verified (
commands/template.mjs:326-327, run). - Claim:
template.show'scomponentsstays a sorted summary without the common components, and the full first-use list is the newcomponentsToRead: verified (api/template/show/show.mjs:66-67, goldens). - Claim: nothing prints for an empty list, the line is plain ASCII, and
astryx buildoutput is unchanged: verified (new test; two shipped templates print no line;buildreads only template discovery). - Claim: the record gains INV40 with a verification row, and the JSON stays additive: verified (
docs/architecture/cli-surface.md:653-662,:1164). - Claim: both fields are always present, possibly empty, and every existing field keeps its name, type and value: verified (
copy.mjs:189,show.mjs:67, goldens). - Claim: the text adds one stdout line for a copy and one stderr line for a printed template: verified.
- Claim: the example output for
template table src/x.tsx: verified (the same 18 names in the same order; the prefix follows how the CLI is run). - Claim: no caller decision is added: verified.
- Claim: a tag counts only when a named import binds it to an Astryx package or the component's own package and
astryx componentanswers the name: verified as written; that rule is what lets an integration's component stand in for a Core import (the finding). - Claim: every component
astryx componentanswers is kept,Text,ButtonandStackincluded, and part names stay as written: verified (sweep of every shipped template;InputGroupText,AvatarGroup). - Claim: comment text, unbound tags and other modules' tags never count: verified (new test;
dashboardlists no chart parts). - Claim: a part with no doc of its own counts as its family root when imported from that root's module: verified (new test).
- Claim: a name more than one package answers is written as the selector of the package the import names: verified when one of its owners is that package (new test; an integration's own
Buttonreads as@acme/widgets/Button); false when none is (the finding). - Claim: the order is first use in the file: verified (
template-adapter.mjs:2219). - Claim: filtering
componentsin place was rejected because it would change released JSON: consistent;componentsis unchanged. - Claim: the named templates print the line,
dashboardwithout chart parts,dashboard-progressandtable-pagewithoutHoverCard,InputGroupBasicwithInputGroup InputGroupText TextInput,AvatarGroupwithAvatarGroupandResizableSidebarwithResizeHandle: verified (sweep). - Claim: a batch call with the copied receipt's names finds every name, and the printed command reads them in one call with the CLI's own prefix: verified with Core alone (at most 46 names, under the limit of 100) and in the test fixture; fails in the finding's state.
- Claim: agents given the line made fewer component calls with the same success: not checkable (no data in the pull request).
- Claim: about 50 ms added: consistent (45-49 ms warm and 90 ms cold for the owner lookup in this run).
- Claim: the new test covers the listed cases: verified (16 tests pass); it has no case where only integrations answer a Core-bound name.
- Claim: goldens change only for the new field and line: verified.
- Claim: the other files in that run pass: verified (77 files, 365 tests).
- Claim: both fields are in the response-types reference and its README table, and that reference stays under its read budget: verified (README generator check in sync; the docs budget tests pass).
- Claim: the knowledge check, strict typecheck, API types check and API types sync pass: the knowledge check and the packaged API types check pass here; the strict typecheck and the types sync were not run.
- Claim: the writing rubric finds no narration, research, references, open questions or status in the record: verified (INV40 is present-tense contract text).
- Changeset: the copy prints one line after the copy line naming the components: verified.
- Changeset: a printed template sends the line to stderr: verified.
- Changeset: the names are the ones
astryx componentanswers, in first-render order, each once: verified except in the finding's state. - Changeset: a name more than one package answers is written
<package>/<Name>, so the read is never ambiguous: false when no owner is the import's package (the finding). - Changeset: chart parts and local helpers are left out, and nothing prints when none are left: verified.
- Changeset:
--jsoncarries both fields and every existing field is unchanged: verified. - File
.changeset/template-components-line.md: the finding (its never-ambiguous claim). - File
docs/architecture/cli-surface.md: clear. - File
packages/cli/README.md: clear. - File
packages/cli/api/template/_adapter.mjs: clear. - File
packages/cli/api/template/copy/copy.components.test.mjs: the finding (no fixture for it). - File
packages/cli/api/template/copy/copy.mjs: clear. - File
packages/cli/api/template/show/show.mjs: clear. - File
packages/cli/api/template/template.doc.mjs: clear. - File
packages/cli/api/template/template.mjs: clear. - File
packages/cli/api/template/template.type.mjs: clear. - File
packages/cli/clients/cli/commands/template.mjs: clear. - File
packages/cli/foundation/discovery/template-adapter.mjs: the finding. - File
packages/cli/foundation/response/response-types.doc.mjs: clear. - File
packages/cli/test/__golden__/no-icon-set/template-copy.json: clear. - File
packages/cli/test/__golden__/no-icon-set/template-copy.txt: clear. - File
packages/cli/test/__golden__/no-icon-set/template-show.json: clear. - File
packages/cli/test/__golden__/template.json: clear.
…ents it A tag counts only when one of the packages that answer its name is the package its import names, so a Core export Core does not document is left out even when an integration documents that name.
|
/approve-spec 7225cee |
There was a problem hiding this comment.
Changes requested: the previous finding is fixed (a Core-bound tag that only an integration documents is no longer listed), but one case still lists a selector that reads the wrong component, and the description no longer states the matching rule.
- Miss: in a project whose integration replaces a Core component under its own name (an
AcmeSideNavthat declaresreplaces: 'SideNav'),loadComponentOwnersinpackages/cli/api/template/_adapter.mjs:99-101does not see the replacement, so a copy ofshell-side-navlists bareSideNav, whichastryx componentresolves to the replacement while the written file renders Core'sSideNav; count an active replacement's package as a second owner so the line names@astryxdesign/core/SideNav, and add areplacesfixture tocopy.components.test.mjs. - The description's "Design and alternatives" bullet says a tag counts when its import names an Astryx package or the component's own package, but at this head it counts only when one of the packages that answer the name is the one the import names (
foundation/discovery/template-adapter.mjs:2249-2252); reword that bullet.
INV40 is owner-approved for this head. With Core alone, every one of the 788 shipped templates prints a list that one astryx component call reads, and the new SizeProvider test fails on the previous head and passes here. The failing docs-gate status does not reproduce on this head: astryx search selector still lists the Selector component first.
Claims and files checked
Review mode: incremental; reason: none
- Changeset: the copy prints the line right after the copy line — verified (copy.components.test.mjs).
- Changeset: a printed template prints it on stderr and stdout stays the source — verified (test).
- Changeset and description: the names are the ones
astryx componentanswers, Core's and each integration's, in first-render order, each once — verified with Core alone and with same-name integration components; false for a renamed component replacement (first finding). - Changeset and description: a name several packages answer is written as
<package>/<Name>from the import's package — verified (Button test). - Changeset and description: chart-library parts, the file's own helpers, unbound and comment-only tags are left out, and nothing prints for an empty list — verified (tests; dashboard in the template sweep).
- Changeset and description:
--jsoncarriescomponentson the copy receipt andcomponentsToReadon show, both always present, and every existing field is unchanged — verified (types, goldens). - Description: the line uses the same CLI invocation as other commands and is one ASCII line — verified (test).
- Description: show's existing
componentsis a sorted summary without common components such as Text and Button — verified (template-adapter.mjsUBIQUITOUS,componentsInSource). - Description:
astryx buildoutput is unchanged — verified (no build file changes). - Description: the record gains INV40 with a verification row — verified (cli-surface.md).
- Description: the
template table src/x.tsxexample names those 18 components in that order — verified (sweep). - Description: a tag counts when bound to an Astryx package or to the component's own package — false at this head (second finding).
- Description: part names stay as written and Text, Button and Stack are kept — verified (InputGroupBasic, AvatarGroup, sweep).
- Description: a part with no doc folds to its family root only from that root's own module — verified (test).
- Description: order is first use in the file — verified (test).
- Description: the named templates print the line; dashboard drops its chart parts; dashboard-progress and table-page do not list HoverCard; InputGroupBasic, AvatarGroup and ResizableSidebar list the names given — verified (sweep).
- Description: one batch read of the dashboard receipt's list finds every name — verified (test and sweep).
- Description: the agent comparison — not checkable; no data ships with the pull request.
- Description: about 50 ms added — consistent (63-68 ms warm in this review's run).
- Description: tests cover the listed cases, goldens change only for the new field and line, the README table is in sync, the reference read stays under 32 KB, and the knowledge and API-type checks pass — verified (17 tests pass, readme check, self-docs audit, knowledge check, API-type check).
.changeset/template-components-line.md— clear.docs/architecture/cli-surface.md— clear.packages/cli/README.md— clear (generated, in sync).packages/cli/api/template/_adapter.mjs— first finding.packages/cli/api/template/copy/copy.components.test.mjs— clear apart from the missing replacement fixture (first finding).packages/cli/api/template/copy/copy.mjs— clear.packages/cli/api/template/show/show.mjs— clear.packages/cli/api/template/template.doc.mjs— clear.packages/cli/api/template/template.mjs— clear.packages/cli/api/template/template.type.mjs— clear.packages/cli/clients/cli/commands/template.mjs— clear.packages/cli/foundation/discovery/template-adapter.mjs— clear; its rule is what the second finding's bullet misstates.packages/cli/foundation/response/response-types.doc.mjs— clear.packages/cli/test/__golden__/no-icon-set/template-copy.json,template-copy.txt,template-show.jsonandtest/__golden__/template.json— clear.
…s import's package There a bare name can read another package's component (a replacement, or a second package with that name), so each name is written as <package>/<Name> for the package its import names, and counts only when that package documents it. A Core-only project keeps bare names. The template docs no longer call the form a selector.
|
/approve-spec 4aaa486 |
There was a problem hiding this comment.
Changes requested: one blocking finding remains, a copy of an existing helper; both findings from the previous review are fixed.
packageOfModuleinpackages/cli/foundation/discovery/template-adapter.mjs:2259-2262repeatspackageOffrompackages/cli/foundation/render/served-packages.mjs:32-36, which swizzle already imports, so importpackageOfthere and delete the copy to keep one rule for mapping an import specifier to its package.
The rest checks out: with an integration loaded, every listed name reads the component the file imports (a replaced SideNav included), and every shipped template's list reads in one astryx component call in both Core-only and integration projects. CI's test jobs did not run on this head because the CI queue was full, so they need a re-run after the fix.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- Changeset: a copy prints one line right after the copy line that names the components for one
componentcall: verified (clients/cli/commands/template.mjs:361-368, test "prints the line right after the copy line"). - Changeset: a printed template prints the line on stderr and stdout stays the source: verified (
commands/template.mjs:326-327; a printedtablewrites only source to stdout). - Changeset: the names are the ones
astryx componentanswers, in first-render order, each once, as<package>/<Name>in a project with an integration, without chart parts or local helpers, and no line when none are left: verified (template-adapter.mjs:2190-2251, the new tests, and all 788 shipped templates in both kinds of project). - Changeset:
--jsoncarriescomponentson the copy receipt andcomponentsToReadon show, with every existing field unchanged: verified (goldens and the JSON keys before and after). - Description: the copy receipt gains
components, and show gainscomponentsToReadbeside its unchanged sortedcomponents: verified (copy.mjs:189,show.mjs:69-70, test "names the same components and leaves components as it was"). - Description: the line uses the CLI invocation other commands print, is plain ASCII, is absent for an empty list, and
astryx buildoutput is unchanged: verified (tests; nothing outside the template command calls the new code). - Description: the example list for the table page: verified (the same 18 names in a Core-only project; the prefix depends on how the CLI runs).
- Description: the matching rules (named import, the package the import names documents the name, comments ignored, unbound and other-module tags dropped, family-root fold, first-use order): verified (
template-adapter.mjs:2190-2251, tests). - Description: with any integration every name is
<package>/<Name>and a Core-only project gets bare names: verified (api/template/_adapter.mjs:92,:117; the shipped templates read in one call both ways). - Description: the listed templates print the lists it names (dashboard without chart parts, no
HoverCardfor the two hover-card-hook pages,InputGroup InputGroupText TextInput,AvatarGroup,ResizeHandle): verified. - Description: the printed command, run as printed, reads every name in one call: verified (test, and a run in a project whose integration replaces
SideNav). - Description: about 50 ms added in a Core-only project: consistent (63-77 ms warm here; about 200 ms with one integration).
- Description: the agent comparison: the author's report, not checked.
- Description: the new test's cases, goldens changed only for the new field and line,
readme:check,check:knowledgeand the API types check: verified;typecheck:strictandsync:api-typeswere not run here.
Files:
.changeset/template-components-line.md: cleardocs/architecture/cli-surface.md: clear (INV40 and its verification row, owner-approved for this head)packages/cli/README.md: clear (generated rows in sync)packages/cli/api/template/_adapter.mjs: clearpackages/cli/api/template/copy/copy.components.test.mjs: clearpackages/cli/api/template/copy/copy.mjs: clearpackages/cli/api/template/show/show.mjs: clearpackages/cli/api/template/template.doc.mjs: clearpackages/cli/api/template/template.mjs: clearpackages/cli/api/template/template.type.mjs: clearpackages/cli/clients/cli/commands/template.mjs: clearpackages/cli/foundation/discovery/template-adapter.mjs: finding (copied package helper)packages/cli/foundation/response/response-types.doc.mjs: clearpackages/cli/test/__golden__/no-icon-set/template-copy.json: clearpackages/cli/test/__golden__/no-icon-set/template-copy.txt: clearpackages/cli/test/__golden__/no-icon-set/template-show.json: clearpackages/cli/test/__golden__/template.json: clear
|
/approve-spec e193c22 |
There was a problem hiding this comment.
Approved pending CI: some of CI's test shards were still running on this head when it was reviewed.
The one blocking finding from the previous review is fixed: the template component list now imports the shared packageOf from foundation/render/served-packages.mjs instead of keeping its own copy, and the printed line and both JSON fields are unchanged. INV40 has an engineering owner's approval for this exact head, and nothing else needs to change.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Changeset: a copy prints one line right after the copy line that names the components for one
componentcall: verified (clients/cli/commands/template.mjs:361-368, test "prints the line right after the copy line"). - Changeset: a printed template prints the line on stderr and stdout stays the source: verified (
commands/template.mjs:326-327; a printedtablewrites only its source to stdout). - Changeset: the names are the ones
astryx componentanswers, in first-render order, each once, as<package>/<Name>in a project with an integration, without chart parts or local helpers, and no line when none are left: verified (template-adapter.mjs:2191-2252and the new tests). - Changeset:
--jsoncarriescomponentson the copy receipt andcomponentsToReadon show, with every existing field unchanged: verified (goldens, and the JSON keys before and after). - Description: the copy receipt gains
components, and show gainscomponentsToReadbeside its unchanged sortedcomponents: verified (copy.mjs:189,show.mjs:69-70, test "names the same components and leaves components as it was"). - Description: the line uses the CLI invocation other commands print, is plain ASCII, is absent for an empty list, and
astryx buildoutput is unchanged: verified (tests; nothing outside the template command calls the new code). - Description: the example list for the table page: verified (the same 18 names in a Core-only project; the prefix depends on how the CLI runs).
- Description: the matching rules (named import, the package the import names documents the name, comments ignored, unbound and other-module tags dropped, family-root fold, first-use order): verified (
template-adapter.mjs:2191-2252, tests). - Description: with any integration every name is
<package>/<Name>, and a Core-only project gets bare names: verified (api/template/_adapter.mjs:92,:117; tests). - Description: the listed templates print the lists it names (dashboard without chart parts, no
HoverCardfor the two hover-card-hook pages,InputGroup InputGroupText TextInput,AvatarGroup,ResizeHandle): verified. - Description: the printed command, run as printed, reads every name in one call: verified (test).
- Description: about 50 ms added in a Core-only project: consistent (about 65 ms warm; the lookup code is unchanged since it was measured).
- Description: the agent comparison: the author's report; the pull request carries no data to check it.
- Description: the new test's cases, goldens changed only for the new field and line,
readme:check,check:knowledge, the API types check, andtypecheck:strictwith only two pre-existing errors in templates that need a theme build: verified. - Description: both fields are in the response-types reference and its generated README table, and the reference stays inside its 32 KB read budget: verified (
readme:checkin sync; the self-doc audit reports nothing oversized).
Files:
.changeset/template-components-line.md: cleardocs/architecture/cli-surface.md: clear (INV40 and its verification row, owner-approved for this head)packages/cli/README.md: clear (generated rows in sync)packages/cli/api/template/_adapter.mjs: clearpackages/cli/api/template/copy/copy.components.test.mjs: clearpackages/cli/api/template/copy/copy.mjs: clearpackages/cli/api/template/show/show.mjs: clearpackages/cli/api/template/template.doc.mjs: clearpackages/cli/api/template/template.mjs: clearpackages/cli/api/template/template.type.mjs: clearpackages/cli/clients/cli/commands/template.mjs: clearpackages/cli/foundation/discovery/template-adapter.mjs: clear (now imports the sharedpackageOf)packages/cli/foundation/response/response-types.doc.mjs: clearpackages/cli/test/__golden__/no-icon-set/template-copy.json: clearpackages/cli/test/__golden__/no-icon-set/template-copy.txt: clearpackages/cli/test/__golden__/no-icon-set/template-show.json: clearpackages/cli/test/__golden__/template.json: clear
User need
After
astryx buildnames a template and an agent scaffolds it withastryx template <name> <path>, the agent still has to learn the components the file uses: the shell, navigation, layout and table parts. Today it looks them up oneastryx component <Name>call at a time, because nothing tells it which set to read.astryx component A B Calready answers several names in one call; the scaffold just does not name them.Problem and solution fit
template.copyreceipt gainscomponents: the components the written file uses thatastryx componentanswers in this project (Core's and each configured integration's), in the order the file first renders them, each once.Copied template to ...:Read the components it uses in one call: `<cli> component A B C`, with the same CLI invocation other commands print.astryx template <name>(no path; stdout is the source) prints the same line to stderr with its other notes.template.showalready hascomponents, a sorted summary of the component names the source composes that leaves out the components almost every template uses (such asTextandButton); changing it would change its JSON, so the full, first-use-ordered list is a new additive field,componentsToRead.astryx buildoutput is unchanged.Current specification
architecture:cli-surfacegains INV40 ("A template names its components for one read"), with a verification row. JSON stays additive underspec:AST-017.Public delta and caller burden
template.copydata.components: string[]andtemplate.showdata.componentsToRead: string[](both always present, possibly empty). Every existing field keeps its name, type and value.template table src/x.tsx):Design and alternatives
astryx componentanswers the name: a name the component list (component --list, the same kept gather) holds, or oneastryx component <name>finds on its own, such as a part a family doc documents (ResizeHandle,StackItem). So every componentastryx componentanswers is kept,Text,ButtonandStackincluded, and part names such asInputGroupTextorAvatarGroupstay as written.Tooltip,XAxis,Bar, or a helper from a local file), do not count.TableHeaderfrom@astryxdesign/core/TablenamesTable).<package>/<Name>for the package its import names (@astryxdesign/core/SideNav,@acme/widgets/AcmeBadge), whichastryx componentreads exactly; there a bare name could open another package's component (a replacement, or a second package with that name). A Core-only project gets bare names. A name counts only when the package its import names documents it, so an undocumented Core export is left out even when an integration documents that name.template.show's existingcomponentsin place (it would change released JSON).Evidence
template table,shell-top-nav,dashboard,dashboard-progress,table-page,InputGroupBasicandAvatarGroupprint the line.dashboardleaves out its chart parts.dashboard-progressandtable-pageimport only a hover-card hook, so they do not listHoverCard.InputGroupBasiclistsInputGroup InputGroupText TextInput,AvatarGrouplistsAvatarGroup, andResizableSidebarlistsResizeHandle.astryx componentcall with the copieddashboardreceipt'scomponentsfinds every name, and the printed command, run as printed, reads every name it lists in one call. Its prefix is the one the CLI prints in its other commands.template table src/x.tsx: about 50 ms on a loaded shared machine (the component list plus one parse of the file).Scope
Components: CLI
template(copy and show), template discovery's component scanTesting
CI=1 pnpm exec vitest run --project node packages/cli/api/template packages/cli/clients/cli/commands/template packages/cli/testapi/template/copy/copy.components.test.mjs: the field with Core, a part only its family doc documents, an integration fixture (every name as<package>/<Name>), an integration component under a Core name (the bare name is ambiguous;@astryxdesign/core/Buttonreads Core's), a replacement ofSideNav(bare reads the replacement;@astryxdesign/core/SideNavreads Core's), an undocumented Core export an integration documents (left out), and a Core-only project (bare names, all read in one call) (an integration component plus Core components,Textand a part kept); unbound, chart-library, local-file and comment-only names dropped; a part folded into its own family root; first-use order and no duplicates;template.show'scomponentsToReadand its unchangedcomponents; the text line right after the copy line and on stderr for a printed template (stdout stays the source); no line for an empty list; the printed command runs and reads every name in one call, with the CLI's own prefix;--jsoncarries the field and prints no line.test/__golden__/template.json,test/__golden__/no-icon-set/template-copy.{json,txt},test/__golden__/no-icon-set/template-show.json.foundation/response/response-types.doc.mjs) and the README table it generates (pnpm -F @astryxdesign/cli readme:check). The template entries there are shorter, so the whole reference read is under 32 KB again.pnpm check:knowledge,pnpm -F @astryxdesign/cli typecheck:strict(no new errors; two pre-existing missing-build errors in templates),node .github/scripts/cli-api-types-verify.mjs,pnpm sync:api-types.Writing rubric results
Record:
architecture:cli-surface(new INV40 and its verification row).