Repository navigation
fix(cli): template help names only what the base serves - #12419
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 decision: no current spec governs the new options[].pointers authoring field (CommandOptionDoc.pointers in @astryxdesign/cli/authoring) or leaving the @astryxdesign/core sentence out of template --package help on a base other than Core, and the closest record, the bases spec's FR7, is still draft. An engineering owner settles both by naming the governing record, or by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. The help change itself works: the new bases test passes, and Core output is unchanged.
- The "Expected behavior and authority" line calls the bases spec current, but
spec:AST-114is draft, so citespec:AST-017FR14 for the--skeletonpart and the record the owner names for the rest.
Non-blocking: an option documented only through param would show just its pointer text in astryx docs once it gains pointers, because publishedOptionDescription does not fall back to the param description (inline note).
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: on a non-Core base, template help no longer names
--skeletonin the--listtext: verified (new bases test; base and head help output). - Changeset: it no longer suggests
--package @astryxdesign/core: verified (same). - Changeset: a command doc's option can declare
pointersthat help leaves out when the base does not serve what they name: verified (type.ts:58-64,_schema.mjs:657-669,define-command.mjs:341-350). - Description: base help named an option and a package the base does not serve, and following them fails: verified (on a native base,
template --list --package @astryxdesign/coreandtemplate shell-side-nav --package @astryxdesign/coreexit 1). - Description: help already drops command pointers and the root
--detailpointer parts, while doc options had one plain description: verified (define-command.mjs:300-313,index.mjs:694-703). - Description: the governing record is the current bases spec: false (
spec:AST-114is draft). - Description: help and JSON help both read the served option description: verified (
base-gate.mjs:207,json-shim.mjs:114). - Description: the manifest and Commander description keep the full text, and docs and search read every part: verified (
define-command.mjs:212-216,cli-self-docs.mjs:124-142; manifest and docs output unchanged). - Description: the template doc marks the two clauses: verified (
template.doc.mjs:47-71). - Description: on Core, template help, JSON help, the template docs page, the JSON manifest and
search skeleton --jsonare byte-identical, and goldens did not change: verified (base and head output; golden-reads test passes). - Description: the regression test checks text and JSON help on a native base: verified (
bases.test.mjs:594-615). - Description: no internal context in public text: verified.
- Description: the listed tests and checks pass: verified for the tests, authoring and JSON-API typechecks, README, changeset and published-type checks and lint; the strict typecheck needs a theme build.
- Files:
.changeset/cli-template-help-base.mdclear;_schema.mjsclear;command.doc.mjsclear;type.tsnew public member, held for an owner;bases.test.mjsclear;template.doc.mjsclear;define-command.mjsclear;cli-self-docs.mjsnon-blocking note;command-pointers.mjsnon-blocking note.
PR Analysis Report🔎 Preview ·
|
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | cli |
./authoring · Types · interface CommandOptionDoc |
pointers?: (string | {commands: string[]; text: string})[] |
import type {CommandOptionDoc} from '@astryxdesign/cli/authoring'; const x: CommandOptionDoc = {pointers: …} |
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
|
Owner decision (engineering owner, covering this pull request): a command doc's option may declare |
|
/approve-spec 441d001 |
There was a problem hiding this comment.
Changes requested: the template help fix works, and an engineering owner has approved the new options[].pointers field and the record text, but one help line still contradicts the FR14 sentence this pull request adds.
astryx mcp --helpon a base other than Core still namestheme targetsin--docs-only(packages/cli/clients/cli/commands/mcp.doc.mjs:34), a command that base hides, so either mark that clause as a pointer ({commands: ['theme targets'], text: ' and theme targets'}) or narrow the new FR14 sentence to the parts a command doc marks as pointers.
Non-blocking: the changeset is tagged [fix] but also announces the new authoring field, which spec:AST-017 FR7 would tag [feat]. The earlier note about parameter-only options in the docs is fixed.
Claims and files checked
Review mode: full; reason: spec-record
- Changeset: on a non-Core base, template help no longer names
--skeletonin the--listtext: verified (new bases test; base and head help on the same fixture). - Changeset: it no longer suggests
--package @astryxdesign/core: verified (same). - Changeset: a command doc's option can declare
pointersthat help leaves out when the base does not serve what they name: verified (type.ts:58-64,_schema.mjs:657-669,define-command.mjs:341-350). - Description: on a non-Core base, help named an option and a package that fail there: verified (base help on the fixture).
- Description: help already drops a command's pointer and the root
--detailpointer part, while doc options had one plain description: verified (define-command.mjs:299-313,index.mjs:695). - Description: help and JSON help both read the served option description: verified (
base-gate.mjs:207,json-shim.mjs:114). - Description: the manifest and the Commander description keep the full text, and docs and search read the description plus every part: verified (
define-command.mjs:212-222,manifest.mjs:113,cli-self-docs.mjs:189-191; manifest and docs output unchanged on the fixture). - Description: an option with no description of its own leads with its parameter's text, then its parts, in help and docs alike: verified (
define-command.mjs:339,command-pointers.mjs:44-52, unit tests). - Description: the template doc marks the two clauses: verified (
template.doc.mjs:46-72). - Description: before and after help text on a native base fixture: verified (base and head output).
- Description: on Core, template help, JSON help, the template docs page, the JSON manifest and skeleton search are byte-identical, and the goldens did not change: verified (base and head output; golden reads test passes).
- Description: the unit tests build an option's text from its parts, drop an unserved part, and render every part in the docs: verified (
define-command.test.mjs:33,cli-self-docs.test.mjs:320). - Description: the regression test checks text and JSON help on a native base: verified (
bases.test.mjs:594-615). - Description: FR14 now records that an option's text in help leaves out a part that names an unserved command or option: false for
mcp --docs-only(finding above). - Description: INV7 records the option
pointersfield, and the bases spec's FR7 is draft context only: verified (cli-surface.md:169-174). - Description: the rubric results cover the added record sentences: verified (no narration, status or change references in them).
- Description: no internal context in public text: verified.
- Description: the listed tests and checks pass: verified for the listed test suites, the authoring, JSON-API and template-doc typechecks, the README, knowledge and changeset checks and lint; the packed published-type check was not rerun.
- Files:
.changeset/cli-template-help-base.mdnon-blocking note;docs/architecture/cli-surface.mdclear;docs/contributing/cli-conventions.mdclear;docs/specs/AST-017/spec.mdblocking (the FR14 sentence);_schema.mjsclear;command.doc.mjsclear;type.tsclear;bases.test.mjsclear;template.doc.mjsclear;define-command.mjsclear;define-command.test.mjsclear;cli-self-docs.mjsclear;cli-self-docs.test.mjsclear;command-pointers.mjsclear.
|
/approve-spec c4fbfe7 |
There was a problem hiding this comment.
Approved pending CI: the CI workflow has not finished on this head yet, so this is not ready to merge until it passes.
The mcp --docs-only help line now marks the theme targets clause as a pointer, so on a base other than Core no option help names a command or option that base hides, as the new FR14 sentence says; the changeset is now tagged [feat] for the new options[].pointers authoring field, and an engineering owner approved the record text at this head. No blocking findings remain.
Claims and files checked
Review mode: incremental; reason: none
- Changeset: a command doc's option can declare
pointers, parts that help leaves out when the base does not serve what they name: verified (type.ts:58-64,_schema.mjs:657-669,define-command.mjs:340-350,define-command.test.mjs:33). - Changeset: on a non-Core base, template help no longer names
--skeletonin the--listtext: verified (bases.test.mjs:594-619; base and head help on the same fixture). - Changeset: it no longer suggests
--package @astryxdesign/core: verified (same). - Changeset: mcp help no longer names
theme targetsin the--docs-onlytext: verified (bases.test.mjs:613-616; base and head help). - Description: on a non-Core base, three option texts named an option, a package and a command that base does not serve: verified (base help on the fixture).
- Description: help already dropped a command's pointer and the root
--detailpart, while command-doc options had one plain description: verified (define-command.mjs:299-313,index.mjs:695). - Description: FR14 already hides unserved commands and options, and the pull request records the option-text case there: verified (
docs/specs/AST-017/spec.md:313-322). - Description: INV7 already generates help from each command doc, and the pull request records the option
pointersfield there; the bases spec's FR7 is draft context only: verified (docs/architecture/cli-surface.md:165-174). - Description: help and JSON help both read the served option description: verified (
base-gate.mjs:207,json-shim.mjs:114). - Description: the type, schema and command self-doc describe the field: verified (
type.ts:58-64,_schema.mjs:657-669,command.doc.mjs:162-167). - Description: the manifest and the Commander description keep the full text, and docs and search read the description plus every part: verified (
define-command.mjs:212-222,manifest.mjs:113,cli-self-docs.mjs:189-190; manifest, docs and search output unchanged). - Description: an option with no description of its own leads with its parameter's text, then its parts, in help and docs alike: verified (
define-command.mjs:339,command-pointers.mjs:44-52, both unit tests). - Description: the template doc marks the two clauses and the mcp doc marks the
theme targetsclause: verified (template.doc.mjs:51-54,:66-71,mcp.doc.mjs:35-38). - Description: no other option text on a non-Core base names a hidden command or option: verified (option help of all 43 served commands scanned; none).
- Description: the before and after help text on a non-Core fixture: verified (base and head output).
- Description: on Core, template and mcp help, JSON help and docs pages, the JSON manifest and skeleton search are byte-identical, and the goldens did not change: verified (base and head output; golden reads test passes).
- Description: the unit tests build an option's text from its parts, drop an unserved part, and render every part in the docs: verified (
define-command.test.mjs:33,cli-self-docs.test.mjs:320). - Description: the regression test checks template text and JSON help and mcp help on a non-Core base: verified (
bases.test.mjs:594-619). - Description: the scope checklist discloses the one optional authoring field: verified.
- Description: no internal context in public text: verified.
- Description: the writing rubric results cover the added record sentences: verified (present tense, no narration, status or change references).
- Description: the listed tests and checks pass: verified for the listed test suites, the authoring, JSON-API and template-doc typechecks, the README, knowledge and changeset checks, lint and the published type check; the strict typecheck stops only on two unchanged template pages that need a theme build.
- Files:
.changeset/cli-template-help-base.mdclear;docs/architecture/cli-surface.mdclear;docs/contributing/cli-conventions.mdclear;docs/specs/AST-017/spec.mdclear;packages/cli/authoring/doctypes/_schema.mjsclear;packages/cli/authoring/doctypes/command/command.doc.mjsclear;packages/cli/authoring/doctypes/command/type.tsclear;packages/cli/clients/cli/bases.test.mjsclear;packages/cli/clients/cli/commands/mcp.doc.mjsclear;packages/cli/clients/cli/commands/template.doc.mjsclear;packages/cli/clients/cli/lib/define-command.mjsclear;packages/cli/clients/cli/lib/define-command.test.mjsclear;packages/cli/foundation/discovery/cli-self-docs.mjsclear;packages/cli/foundation/discovery/cli-self-docs.test.mjsclear;packages/cli/foundation/discovery/command-pointers.mjsclear.
On a base other than Core, `astryx template --help` described Core-only usage: the `--list` text named `--skeleton`, which that base hides, and `--package` suggested `@astryxdesign/core`. A command doc's option can now declare `pointers`: parts that continue its description, each plain text or a pointer that names command paths. The command builder passes them to describeOption, so help and JSON help drop a pointer the run's base does not serve. The manifest, docs, and search read the whole text, which on Core is unchanged.
AST-017 FR14 records that an option's text in help leaves out a part that names a command or option the run's base does not serve. The CLI surface record (INV7) and the CLI conventions guide describe the option `pointers` field. An option with pointers and no description of its own now leads with its API parameter's text in the docs, as it does without pointers. Unit tests cover building the parts, dropping an unserved one, and the docs text.
The `--docs-only` text in `astryx mcp --help` marks ` and theme targets` as a pointer, so a base that hides `theme targets` does not name it. A scan of every command's option help on a non-Core base finds no other option text that names a hidden command or option. The bases test covers `mcp --help`. The changeset is `[feat]`: it adds an authoring field.
c4fbfe7 to
2666050
Compare
|
/approve-spec 2666050 |
There was a problem hiding this comment.
Approved. After the rebase onto main, option help on a base other than Core still leaves out only the parts that name what that base hides (--skeleton, the Core package sentence and theme targets), Core output is byte-identical, CI passed on this head, and an engineering owner approved the record text at this head.
- Non-blocking:
component --packageandswizzle --packagestill suggest@astryxdesign/coreon a base other than Core, the same kind of sentence this change marks intemplate --package; marking them the same way would make the three commands agree.
Claims and files checked
Review mode: full; reason: rebase
- Changeset: a command doc's option can declare
pointers, parts that help leaves out when the base does not serve what they name: verified (type.ts:58-64,_schema.mjs:657-669,define-command.mjs:341-350,define-command.test.mjs:33). - Changeset: on a base other than Core, template help no longer names
--skeletonin the--listtext or suggests--package @astryxdesign/core: verified (bases.test.mjs:594-620; base and head help on the same fixture). - Changeset: on such a base, mcp help no longer names
theme targetsin the--docs-onlytext: verified (same). - Description: the requirement record now says option help leaves out a part naming a hidden command or option, and the CLI surface record describes the option
pointersfield: verified (docs/specs/AST-017/spec.md:316-319,docs/architecture/cli-surface.md:169-174). - Description: before, three option lines on such a base named an option, a package and a command that base hides: verified (base help on the fixture).
- Description: help already dropped a command's pointer and the root
--detailpart per base, while command-doc options carried one plain description: verified (define-command.mjs:182-251,index.mjs:695). - Description: the current requirement already hides unserved commands and options, help comes from each command doc, and the bases record is draft context only: verified (current records on
main, unchanged since the merge base). - Description: help and JSON help both read the served option description: verified (
base-gate.mjs:145-150,:207;json-shim.mjs:114). - Description: the type, schema and command self-doc describe the field: verified (
type.ts:58-64,_schema.mjs:657-669,command.doc.mjs:162-167). - Description: the manifest and the Commander description keep the whole text, and docs and search read the description plus every part: verified (
manifest.mjs:107-115,cli-self-docs.mjs:189-190,:258; manifest, docs and search output unchanged on both projects). - Description: an option with no description of its own leads with its parameter's text, then its parts, in help and docs alike: verified (
define-command.mjs:339-349,command-pointers.mjs:44-52, both unit tests). - Description: the template doc marks the
--skeletonclause and the Core sentence, and the mcp doc marks thetheme targetsclause: verified (template.doc.mjs:51-54,:66-71,mcp.doc.mjs:35-38). - Description: no other option text on such a base names a hidden command or option: verified (option help of all 43 served commands; none).
- Description: the before and after help text: verified (base and head output on the fixture).
- Description: on Core, template and mcp help, JSON help, both docs pages, the JSON manifest and skeleton search are byte-identical, and the goldens did not change: verified (base and head output; golden reads test passes).
- Description: the unit tests build an option's text from its parts, drop an unserved part and render every part in the docs; the regression test checks template text and JSON help and mcp help on such a base: verified (
define-command.test.mjs:33,cli-self-docs.test.mjs:320,bases.test.mjs:594-620). - Description: the scope checklist discloses the one optional authoring field: verified.
- Description: public text carries no internal context: verified.
- Description: the writing rubric results cover the added record sentences: verified (present tense; no narration, status or change references).
- Description: the listed tests and checks pass: verified for the listed test suites, API type sync, the authoring, JSON-API and template-doc typechecks, the README, knowledge and changeset checks, lint and the published type check; the strict typecheck here stops only on two unchanged template pages that import a theme build output this environment did not build.
- Files:
.changeset/cli-template-help-base.mdclear;docs/architecture/cli-surface.mdclear;docs/contributing/cli-conventions.mdclear;docs/specs/AST-017/spec.mdclear;packages/cli/authoring/doctypes/_schema.mjsclear;packages/cli/authoring/doctypes/command/command.doc.mjsclear;packages/cli/authoring/doctypes/command/type.tsclear;packages/cli/clients/cli/bases.test.mjsclear;packages/cli/clients/cli/commands/mcp.doc.mjsclear;packages/cli/clients/cli/commands/template.doc.mjsclear;packages/cli/clients/cli/lib/define-command.mjsclear;packages/cli/clients/cli/lib/define-command.test.mjsclear;packages/cli/foundation/discovery/cli-self-docs.mjsclear;packages/cli/foundation/discovery/cli-self-docs.test.mjsclear;packages/cli/foundation/discovery/command-pointers.mjsclear.
Record changes:
spec:AST-017FR14 adds that option help leaves out a part naming a command or option the base does not serve;architecture:cli-surfaceINV7 describes the optionpointersfield. Proof: on a non-Core base,template --helpandmcp --helpno longer name--skeleton,@astryxdesign/coreortheme targets; on Core, help, JSON help, docs and manifest are byte-identical tomain.User impact
In a project whose base is not Core, option help described Core-only usage. In
astryx template --help, the--listtext said--skeletonis refused, but that base hides--skeleton, and the--packagetext suggested@astryxdesign/core, which that project does not have. Inastryx mcp --help, the--docs-onlytext namedtheme targets, which that base hides. An agent that reads help could try an option or package the base does not serve.Problem and solution fit
Help already leaves out a command's pointer, and a root option's pointer part (
--detail), when the run's base does not serve what it names. But options built from a command doc had a plain description only, so these clauses could not be marked. This change lets a command doc's option declare its parts, and the existing option-description path drops them per base.Expected behavior and authority
spec:AST-017FR14 (current): help leaves out the commands and options the run's base does not serve. This PR records in FR14 that an option's text in help also leaves out a part that names one of them.architecture:cli-surfaceINV7 (current): help comes from each command'sCommandDoc. This PR records the optionpointersfield there.spec:AST-114FR7 is draft context only.Smallest restoration
pointers: parts that continue its description, in order. Each part is plain text, or{commands, text}like a command's pointers. The command builder passes them todescribeOption, so help and JSON help (both readservedHelpOptionDescription) drop a pointer the base does not serve. Type, schema, and the command self-doc describe the field.template.doc.mjsuses it for the two clauses:, --skeletonin--listnamestemplate --skeleton, and the@astryxdesign/coresentence in--packagenames the run that selects a replaced Core original.mcp.doc.mjsuses it forand theme targetsin--docs-only. A scan of every command's option help on a non-Core base finds no other option text that names a hidden command or option.Evidence
template --helpprinted<name>, <path>, --skeleton and --overwrite are refusedandUse @astryxdesign/core to select an original….mcp --helpon that base printed(search, build, component, hook, docs, template, discover, theme list and theme targets).<name>, <path> and --overwrite are refusedandNarrow to templates from a specific package., andmcp --helpprints(…, discover, theme list), one message at a time.template --help,--json template --help,docs cli/commands/template,mcp --help,--json mcp --help,docs cli/commands/mcp,--json manifest, andsearch skeleton --jsonare byte-identical tomain. The goldens did not change.define-command.test.mjsbuilds an option's text from its parts and drops a part the base does not serve.cli-self-docs.test.mjsrenders every part, after the option's own text or its parameter's text.bases.test.mjs("names in option help only what the base serves") checks thattemplatetext and JSON help on the native base name neither--skeletonnor@astryxdesign/core, and thatmcp --helpdoes not nametheme targets.Scope
Components: CLI (template and mcp command docs, help, authoring doc types), AST-017 FR14, cli-surface INV7, CLI conventions guide
options[].pointers. It works like the existing command-levelpointers. The authoring self-doc, the CLI surface record, and the CLI conventions guide describe it.)Writing rubric results
Run over the added sentences in AST-017 FR14 and cli-surface INV7.
Testing
vitest(node project,--maxWorkers=4):bases.test,golden-reads,experimental-isolation,template.flag-help,clients/cli/lib,authoring,cli-self-docs: all pass.pnpm sync:api-types,pnpm typecheck,pnpm typecheck:json-api,pnpm typecheck:authoring,pnpm readme:check(inpackages/cli)node .github/scripts/cli-api-types-verify.mjs,pnpm check:knowledge,node scripts/check-changesets.mjs, eslint on changed files