Skip to content

fix(cli): restore the astryx layout command removed before its deprecation - #6887

Merged
cixzhang merged 1 commit into
mainfrom
restore-layout-command
Oct 2, 2026
Merged

cixzhang merged 1 commit into
mainfrom
restore-layout-command

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

User impact

A project on published @astryxdesign/[email protected] uses astryx layout expand, astryx layout check and astryx layout grammar today, calls layoutExpand / layoutCheck / layoutGrammar from @astryxdesign/cli/api, and reads the layout.expand, layout.check and layout.grammar response schemas from --json. On current main all of that is gone, so the next release would break those consumers with no deprecation, no replacement, and no codemod.

It would also break them in a patch. The removal's [breaking] Changeset is the only minor entry among the 22 pending ones, and the ten packages are a fixed group — so that single entry re-targets the entire release:

changeset status
main @ f0355e3 all ten packages bump minor → 0.7.0
this branch all ten bump patch → 0.6.5

This PR restores the surface and drops that Changeset, so the next release is patch-compatible again.

Problem and solution fit

Why does the defect occur? #6615 removed the command in one step, describing it as experimental and unused.

Why does that harm the task? It was neither. astryx layout shipped in published 0.6.4 as one of 17 ordinary registered top-level commands, with manifest entries, documented examples, a layout docs topic, and three response schemas. Four fixes to it — #6564, #6569, #6565, #6572 — are in 0.6.4's changelog, so it was actively maintained right up to the last release.

Why does that matter? It is a stable released CLI surface under spec:AST-017 FR3, which makes stable CLI command names, options, exit behavior, and machine-readable schemas contractual. Removing it is a breaking change against a released victim (FR1), and nothing authorised it yet.

Expected behavior and authority

spec:AST-017 (authority: current) does not permit this removal in its present form:

  • FR28 — deprecation is replacement-first and needs a public DEP-* record before removal becomes eligible. There is none.
  • FR31 — a removal is allowed only when its DEP-* and CLN-* ids appear in a frozen minor manifest. There is no such manifest.
  • FR37 — every minor needs an owner-approved public plan and freeze before the cut. There is no approved minor plan.
  • FR22 — "A released stable surface cannot be retroactively demoted to experimental." FR27 requires experimental CLI controls to live in a dedicated experimental namespace; only the experimental.xle.components config key ever had one. The command itself never did.

This PR therefore rests on authority that is already current. It does not depend on any new policy landing.

Smallest restoration

A revert of #6615 and deletion of its [breaking] Changeset. Nothing else.

No replacement behavior is invented, and no deprecation metadata is added — layout returns to exactly its 0.6.4 shape. Whether and how to deprecate it is left as a separate, explicit decision under AST-017's lifecycle, because creating a DEP-* record here would be the very product decision this PR is restoring the ability to make deliberately.

Deliberately untouched: the retained @astryxdesign/cli/xle barrel (checkExpression, expandExpression) and the experimental.xle.components config key, both of which #6615 kept.

No Changeset accompanies this PR. Classification is against the latest stable release (spec:AST-017 FR2), and the removal was never published — so after this change, main is identical to 0.6.4 for consumers. There is no consumer-visible delta to describe.

Three conflicts with later main commits were resolved toward main, not toward the revert:

Evidence

  • Reproduction before the change: on main, astryx layout grammar exits with an unknown-command error; layoutExpand is not exported from @astryxdesign/cli/api; npx changeset status reports all ten packages bumping minor.
  • Result after the change: astryx layout grammar, layout check and layout expand run again; the three /api functions are exported and type-verified by .github/scripts/cli-api-types-verify.mjs; npx changeset status reports all ten at patch.
  • Representative unchanged path: @astryxdesign/cli/xle and experimental.xle.components behave exactly as on main; the ERR_LAYOUT_PARSE / ERR_LAYOUT_INVALID codes stay registered, as architecture:cli-surface INV3 requires.
  • Regression test or other mutation-sensitive proof: Remove the experimental layout command #6615's own deleted tests come back and pass — layout.test.mjs (297 lines), layout.error-codes.test.mjs, layout.exit-parity.test.mjs, layout.path-help.test.mjs, layout.stdin-cap.test.mjs, layout.text-fields.test.mjs, expand.path-safety.test.mjs. astryx manifest --json reports 17 top-level commands, matching the restored spec:AST-042 text, and check:cli-structure independently confirms 17 handlers and 17 api folders.

Incidental finding, fixed here

#6737 re-added the layout ids to packages/cli/test/doc-routes.ids.json while the command stayed deleted, so main currently claims four layout commands and three layout functions that do not exist. This change makes that file honest again rather than leaving the inconsistency behind.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

npx vitest run --root . packages/cli     # 5314 passed, 0 failed, 342 files
pnpm check:repo                          # passes, including check:changesets (21 valid)
npx changeset status                     # ten packages at patch; none at minor
pnpm -F @astryxdesign/cli readme         # regenerated; readme-gen test passes

No real-browser states are involved: this is a CLI and programmatic-API surface with no rendered output.

`astryx layout expand`, `astryx layout check` and `astryx layout grammar`
shipped in published `@astryxdesign/[email protected]`, as ordinary registered
top-level commands with documented examples, manifest entries, a `layout`
docs topic, and the `layout.expand` / `layout.check` / `layout.grammar`
response schemas. Four fixes to them (#6564, #6569, #6565, #6572) are in
0.6.4's changelog. They are a stable released CLI surface under
`spec:AST-017` FR3.

#6615 removed that surface in one step. `spec:AST-017` (authority: current)
does not allow this yet:

- FR28 requires a replacement-first deprecation patch and a public `DEP-*`
  record before a removal becomes eligible. There is none.
- FR31 allows a removal only when its `DEP-*` and `CLN-*` ids appear in a
  frozen minor manifest. There is no such manifest.
- FR37 requires an owner-approved public minor plan before freeze. There is
  no approved minor plan.
- FR22 forbids retroactively demoting a released stable surface to
  experimental. `layout` was never behind an experimental boundary: FR27
  requires a dedicated experimental namespace, and only the
  `experimental.xle.components` config key had one — the command did not.

So this reverts #6615 and drops its `[breaking]` Changeset.

Effect on the next release, measured with `changeset status`:

- before: all ten fixed-group packages bump **minor** -> 0.7.0
- after:  all ten bump **patch** -> 0.6.5

The ten manifests read 0.6.4, which is the published base; the target is
derived from that base plus the highest pending bump. One `minor` Changeset
in a `fixed` group moves all ten, which is why a single unplanned removal
re-targeted the whole release.

This is compatibility restoration, not new behavior. Nothing is invented and
no deprecation metadata is added: `layout` returns to exactly its 0.6.4
shape, and its deprecation is left to be decided explicitly under AST-017.
Because the removal was never published, main after this change is identical
to 0.6.4 for consumers, so the restoration needs no Changeset of its own.
The retained `@astryxdesign/cli/xle` barrel and the
`experimental.xle.components` config key are untouched.

Conflicts with later main commits were resolved toward main, not toward the
revert:

- `packages/cli/README.md` keeps main's rewritten descriptions and is
  regenerated, so the `layout` row and config row come from the restored
  docs.
- `packages/cli/test/docs-graph.test.mjs` stays deleted; #6737 removed it
  for unrelated reasons.
- `doc-routes.ids.json` keeps both `integration verify` (#6737) and the
  layout ids.

Note for a follow-up: #6737 re-added the layout ids to
`packages/cli/test/doc-routes.ids.json` while the command stayed deleted, so
main currently claims four layout commands and three layout functions that
do not exist. This change makes that file honest again.

Test plan:
- `npx vitest run --root . packages/cli` — 5314 passed, 0 failed
- `pnpm check:repo` — passes, including `check:changesets`
- `npx changeset status` — all ten packages at patch (0.6.5), none at minor
- `astryx layout grammar|check|expand` run again from the built CLI
- `astryx manifest --json` reports 17 top-level commands, matching the
  restored `spec:AST-042` text
@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 2, 2026 3:46pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 2, 2026
@astracat-bot

astracat-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 2, 2026, 3:52 PM UTC

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

15 of 420 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Chat Full AI Chat probe light 155,733
Chat Full AI Chat probe dark 155,005
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,229
Chat With Attachments probe dark 11,065
SideNav Resizable in AppShell probe dark 3,208
Markdown Default probe dark 897
Markdown Default probe light 897
Markdown Default neutral dark 882
Markdown Default neutral light 858

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restoring astryx layout is the right fix. The commands, the layoutExpand / layoutCheck / layoutGrammar functions, and the layout.* JSON responses shipped as stable surface, so removing them without a replacement-first deprecation would break existing projects on upgrade — and cancelling the unreleased removal also keeps the next release patch-compatible instead of forcing a minor for every package.

No changes are requested. The restored surface matches the released shape, the docs and tests come back with it, and the previously inert layout config works again as documented. Whether to deprecate layout in the future can stay a separate, deliberate decision with its own replacement and migration path.

[Automated review]

@cixzhang

cixzhang commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 81bf552

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 2, 2026
@cixzhang
cixzhang merged commit ebd939b into main Oct 2, 2026
44 checks passed
josephfarina added a commit that referenced this pull request Oct 2, 2026
#6887 restored the layout command, so the layout half this PR dropped for
#6615 applies again: layout expand splices template blocks and replaces their
demo media without saying so (AST-028 FR11). This restores it as it was before
that drop, with one change: the count comes from replaceDemoMedia in the
template adapter, the same pass template copy uses, so one reference counts
once however many fixture paths its URL carries.
@github-actions
github-actions Bot deleted the restore-layout-command branch October 3, 2026 06:24
josephfarina added a commit that referenced this pull request Oct 5, 2026
…#6567)

* fix(cli): say when a template copy replaced demo media

Copying a template swaps Astryx demo images and video for placeholders, but
the receipt never said so. `template.copy` now reports `demoMediaReplaced`,
and the text output names the file whose media the consumer has to supply.

* fix(cli): say when layout expand replaced demo media

Expanding a layout splices template blocks through the same demo media
replacement as a template copy, but `layout.expand` never said so. It now
reports `demoMediaReplaced` from the copy path's shared count, and the text
output states it, as a trailing comment when the code is printed.

* fix(cli): count each replaced demo media reference once; drop the layout half

Review fix. The count was the drop in '/template-assets/' substrings, so one
reference whose query held a second fixture path counted twice. The count now
comes from the replacement pass itself (replaceDemoMedia in the template
adapter, the same code as #6870, so the two PRs merge cleanly), one per
replaced reference. copy.mjs uses it instead of its own helper.

The layout half is gone: #6615 removes the layout command, so layout expand no
longer gets a receipt field, and the changeset names template only.

* docs(cli): regenerate the README tables on current main

* fix(cli): layout expand says when it replaced demo media again

#6887 restored the layout command, so the layout half this PR dropped for
#6615 applies again: layout expand splices template blocks and replaces their
demo media without saying so (AST-028 FR11). This restores it as it was before
that drop, with one change: the count comes from replaceDemoMedia in the
template adapter, the same pass template copy uses, so one reference counts
once however many fixture paths its URL carries.

* docs(cli): regenerate the README tables on current main

---------

Co-authored-by: Joey Farina <[email protected]>
josephfarina added a commit that referenced this pull request Oct 6, 2026
#6887 restored the layout command, so the case asserting that `layout expand ''`
keeps ERR_MISSING_ARGUMENT applies again. This restores it, the matching
changeset paragraph and the helper comment, exactly as they were before
2744d47 removed them for #6615.

This branch was successfully deployed

1 active deployment
Preview — 81bf552a Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant