Skip to content

feat(cli): experimental icon sets — icon definitions, astryx experimental icon, templates that use the installed set - #7759

Merged
josephfarina merged 99 commits into
mainfrom
josephfarina/icon-sets
Oct 23, 2026
Merged

josephfarina merged 99 commits into
mainfrom
josephfarina/icon-sets

Conversation

@josephfarina

@josephfarina josephfarina commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Experimental (AST-017 FR27): every icon-set surface sits behind astryx experimental and experimental.* config/manifest keys, so it can change in patch releases. Stable surfaces read icon sets only when experimental.iconSet is configured, and astryx search never does; guard tests prove stable output equals main with no set and with a set configured. Validate adds two additive, never-failing fields: iconSets (optional definitions a set leaves unmapped, with exact-id suggestions) and olderCliNotes (a template or namespace descriptor that sets stability or a template that declares icons, while the package still admits a CLI before 0.7.3; CLI 0.7.2 and earlier drop such descriptors). The issue severity union is unchanged.

One pull request. The maintainer's standing rule for this repository is one pull request per piece of work, with no size-based splits; that was confirmed for this pull request. Reformatting is limited to files with real changes.

User need

An agent building with Astryx needs an icon for "delete" or "settings" and has no way to ask the CLI, so it guesses an import. Templates and blocks hard-code one icon library, so a copied page ignores the icon set the project already uses. Teams with their own icon library have no supported way to plug it in.

Problem and solution fit

  • Icon definitions (new doc type). Astryx ships a folder of typed IconDefinitionDoc files, one per meaning (close, delete, settings…): name, description, search words. 132 ship; 29 are Core's built-in icon names. The icon-definitions docs namespace adopts every definition, Astryx's and each installed set's, so astryx docs and astryx search find them. A set can add its own definitions in the same format; proposing one to Astryx is a PR copying the file.
  • Icon sets (new integration kind). Manifest experimental.iconSets; each set folder holds a descriptor and a data file: icons (id, export, words, variants) and a set-level map from definition to icon. Built-in definitions must be mapped (error); other Astryx definitions are optional (listed in the additive iconSets report); a set's own unmapped definitions warn.
  • No library knowledge in the CLI. Astryx never encodes an icon library. Authors (usually agents) choose icons; the CLI verifies and records them.
  • Any library shape. The set owns a generated module (plus .d.ts and themeIcons): plain re-exports for components, or adapt(source) through the set's declared adapter for data objects, SVG strings, fonts.
  • Export contract. Every icon is a named <Name>Icon export of the set package's public entry, a component taking SVG props, drawn in currentColor, sized to its box.
  • Templates. Each Astryx template/block declares in its descriptor which definition each imported icon means. Copying swaps each icon to the project set's icon for that definition; anything unmapped keeps its import, and the result reports every icon as mapped or kept. No guessing from names.
  • Themes. The generated themeIcons covers the built-in definitions: defineTheme({icons: themeIcons}).

Commands

All under astryx experimental icon (the generic astryx experimental group is new; icon is its first child):

  • astryx experimental icon <words> / <set>/<id> / --list (coverage) — find icons by meaning, with the import line.
  • astryx experimental icon use <set> — writes experimental.iconSet.
  • astryx experimental icon add <Export> --from <module> — shows which definitions fit; --definition maps it; --new-definition --description --words creates the set's own definition. --default, --variant, --id.
  • astryx experimental icon map <definition> <icon> [--remove].
  • astryx experimental icon new-set <name> [--from <module>] [--exclude …] — scaffold, or wrap a whole library.
  • astryx experimental icon new-definition <name>.
  • Stable astryx search never reads icon sets; icon lookup by meaning is only astryx experimental icon <words>. Search's docs gatherer skips docs marked experimental, so stable search output equals main with or without a configured set (guard tests). Joining astryx search happens at promotion.
  • integration check / doctor — data, map, export contract, generated module and types, theme map; exact-id suggestions only.

Current specification

Draft record spec:AST-084 in this PR. Projects architecture:cli-surface INV24, INV28, INV32, INV34, INV35 and spec:AST-039 FR5/FR6/FR11. Runtime icon resolution is unchanged.

Design and alternatives

  • One typed file per definition, read from folders; no central list. Rejected: one JSON list (drifts, needs a PR to extend).
  • Templates declare definitions. Rejected: mapping by icon names or words (guesses wrong meanings, e.g. eye → eye-off).
  • Rejected: shipping Astryx-maintained wrappers per library (Astryx would encode libraries).

Follow-ups, not here: icons join astryx search as a section gatherer at promotion; astryx build picking icons.

Evidence

  • Synthetic @acme fixtures cover every command, check code and mapping path.
  • Blind agent tests (fresh agent, no context, only the CLI and its docs, real task): a component library and a data-object library (through an adapter) each became a working, publishable icon set; findings from each run are fixed in this PR. Latest run: 17 minutes, integration check 0 errors / 0 warnings.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

On main b2c4f18 (merged; clean against newer main): full CLI node suite 482 files, 8,469 passed (2 expected failures, 3 skipped). pnpm build; typecheck:strict, typecheck:json-api, typecheck:authoring, typecheck:template-docs 0 errors; cli-api-types-verify, check:cli-structure, readme:check, check:knowledge, check:changesets ([experimental] for icon surfaces; [feat] for the general stability doc field and olderCliNotes) pass; eslint 0 errors; docsite route-resolution passes. Isolation guard tests compare stable search, template, discover, doctor, integration verify and every stable docs topic and docs-tree node against the base CLI's output, with no icon set and with one installed. Docsite tests 649 passed. Formatting-only edits outside the change were dropped.

Command admission (spec:AST-042 FR4, FR7; spec:AST-053 FR13)

astryx experimental is the one new top-level command. spec:AST-084 (current, approved by an approval owner) authorizes it in FR0. Each command below sits inside its parent's one job. For each one: the question it answers, why an option on the parent or on an existing subcommand cannot answer it, its FR1 function, and how its exact selector position classifies under AST-053 FR11 E1–E5.

Command Question it answers Why not an option on the parent or an existing subcommand Function Selector position, E1–E5
experimental icon [query...] Which installed icon draws this meaning, and what is its import line? experimental is a group with no job of its own. Stable astryx search must stay icon-free without the opt-in (AST-017 FR27, AST-084 FR8). No stable command may gain an experimental subcommand (AST-084 FR0). icon query: not eligible, fails E1. It is free text, so several words form one query. <set>/<id> is one spelling of the same position, not a separate exact selector.
experimental icon add <export> How do I register one export I chose from a library in my set? experimental icon is a read-only lookup, so a write cannot be one of its options. map edits a map entry for an icon the set already has, and cannot add the icon or verify the export. iconAdd export: not eligible, fails E1 and E4. The command writes the set's data file and generated module.
experimental icon map <definition> [icon] Which of my set's icons draws this icon definition? add adds icons, and new-definition creates definitions. Pointing an existing definition at an existing icon is neither, and as an option on add it would need an export to verify. iconMap definition: not eligible, fails E1 and E4 (writes the data file). It also fails E5, because icon follows it.
experimental icon use <set> Which installed set is my project's? Choosing a set writes astryx.config, and the read-only experimental icon must not write. No stable command may change behavior for icon sets (FR27). iconUse set: not eligible, fails E1 and E4 (writes astryx.config).
experimental icon new-set <name> How do I start an icon set in my integration package? Stable integration add must gain no experimental kind (AST-084 FR0). add and map work on a set that already exists. iconNewSet name: not eligible, fails E1 and E4 (creates files).
experimental icon new-definition <name> How do I add my set's own icon definition? Stable integration add must gain no experimental kind (FR0). add --new-definition creates a definition only while adding an icon. This command creates one alone, optionally pointed at an existing icon. iconNewDefinition name: not eligible, fails E1 and E4 (creates files).

None of these commands is eligible for the AST-053 batch contract, so none adopts it. Each exclusion names its failed condition above.

Writing rubric results

spec:AST-084

  • R1 narration: none; present tense throughout.
  • R2 research: none.
  • R3 evidence: verification cells name tests and fixtures, not changes.
  • R4 rejected alternatives: two, one line each inside DEC-1 and DEC-7.
  • R5 change references: none.
  • R6 open questions: none.

spec:AST-046 (one sentence added to FR2)

  • R1 narration: none in the added sentence.
  • R2 research: none.
  • R3 evidence: no change references.
  • R4 rejected alternatives: unchanged; one line each inside its decisions.
  • R5 change references: none.
  • R6 open questions: OQ1 and OQ2 are pre-existing and unchanged.

spec:AST-051 (one sentence each added to FR5 and FR7)

  • R1 narration: none in the added sentences.
  • R2 research: none.
  • R3 evidence: no change references.
  • R4 rejected alternatives: unchanged; one line each inside DEC-1 to DEC-5.
  • R5 change references: none.
  • R6 open questions: none.

architecture:cli-surface (one sentence added to INV35)

  • R1 narration: none; the sentence states when codes may join in a patch release.
  • R2 research: none.
  • R3 evidence: no change references.
  • R4 rejected alternatives: unchanged.
  • R5 change references: none.
  • R6 open questions: none added.

…config (AST-084)

IconSetDoc and IconSetData types with sealed parsers and self-docs, the
manifest iconSets root, and the iconSet project config field. The static
descriptor reader is shared by theme and icon-set descriptors.
Project.iconSets() reads each loaded integration iconSets root without
executing anything, withdraws invalid or unresolvable sets, and picks the
project set from iconSet, else the only set.
icon <words> (icon.search), icon <set>/<id> (icon.detail), icon --list
(icon.list); astryx search gains the icon domain, ranked below equal
component and doc matches.
Static export check with re-exports followed, theme-map check against
fills, upstream drift and license-notice warnings, and the doctor
icon-sets check.
template show and copy map icon imports to the project set by meaning
(shared name, then id, then words), keep unmatched icons, and report
every icon under icons; printed source reports on stderr.
@vercel

vercel Bot commented Oct 20, 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 23, 2026 6:38am UTC

Request Review

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

astracat-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Oct 23, 2026, 7:04 AM UTC

An icon may list reviewed matches for icons in other sets. Template
mapping applies exact and strong matches before the shared name, id, and
words rules; a likely match is only suggested on a kept icon. Unknown
confidence or a match naming its own set makes the data file invalid.
Draft record of the icon-set contract as the CLI implements it, with the
parts not yet in the CLI named in Current-state impact.
Writes the set directory with its typed IconSetDoc and a starter data file (module = the package, no icons), declares the iconSets root through the shared manifest writer, and adds it to package.json files. Same receipt, dry run, no-clobber, rollback, and post-write verify as the other kinds; integrationAddIconSet is the typed per-kind API.
icon-set is a discover kind: package lists carry iconSets, --type icon-set keeps them, a catalog entry may carry iconCount and fills, and discover <package>/<set> shows description, license, icon count, default, fills, and the command that searches its icons.
The iconSets root joins the doc type check: each set descriptor, including one discovery withdraws, is checked against IconSetDoc like ThemeDoc.
An exact query is a name match (the id, or a word that is an id part) or a meaning match (one of the other words). Meaning matches lead unless more searched icons are named for the query than tagged with it; within a score, whole id before id part, earlier tag first. delete now finds trash before the icon that draws the Delete key; user keeps the user icon first.
FR2 names integration add icon-set; FR6 gains the name/meaning reading rule (DEC-5); current-state impact drops what the CLI now implements; changeset updated.
cli/integrations/building-blocks/icon-sets: integration add icon-set, the data file fields, generating it from a library's tags, the integration check codes, and how apps find icons and how templates follow iconSet. A test pins that "icon set", "add icons", and "ship icons" find it first.
…declared template icons (AST-084)

Astryx owns a folder of typed icon definitions (IconDefinitionDoc); a set
maps each definition to one of its icons in its data file's `map` and may
add its own definitions. Templates declare which definition each imported
icon draws, so mapping is a lookup with no library knowledge and no
guessing. New commands write a set one verified icon at a time
(`icon add`, `icon map`, `icon use`, `integration add icon-definition`,
`integration add icon-set --from`) through a set-owned generated module and
an optional adapter. `integration check` enforces the icon export contract,
follows package re-exports, reads createElement/jsx theme-map entries, and
reports unmapped definitions with suggestions. Guide, AST-084 record, and
changeset updated.
@github-actions github-actions Bot removed the needs:design-review Affects visuals — Design should review label Oct 20, 2026

@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.

Changes requested: the owner approval at this revision settles the spec direction and the lint fix is in, but two things remain.

  • CI test-node (1/4) fails 7 tests in packages/cli/test/experimental-isolation.test.mjs on the merge with current main, because the goldens still carry guide titles that main has since changed (#7934); regenerating them from a main checkout with the recipe in the test's header fixes it.
  • About 21,900 authored lines still land as one unit although set authoring, template mapping and discover's icon-set kind stack on the core, so please land the core first with those layers as a stack, or show why the core cannot merge without them.

[Automated review]

"type": "docs.node",
"children": [
"author-a-theme: Author a theme",
"browser-support: Browser Support",

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.

Current main titles this guide "Browser support" (#7934), so this golden and the other goldens that record stable docs titles and search snippets fail 7 tests in CI test-node (1/4) on the merge. Regenerating them from a main checkout with the recipe in the header of packages/cli/test/experimental-isolation.test.mjs fixes it.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8b13733

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8eda69e

@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.

Changes requested: the owner approval at this revision settles the spec direction and the isolation goldens now hold against main, but three things remain.

  • About 22,100 authored lines still land as one unit although set authoring, template mapping and discover's icon-set kind stack on the core, so please land the core first with those layers as a stack, or show why the core cannot merge without them.
  • .changeset/cli-icon-sets.md says astryx search never changes, but in a project with no icon set astryx search experimental now returns 6 results instead of 3, because the stable validateIntegration and response-types descriptions point at astryx docs cli/experimental; please drop that pointer and reword the note.
  • The isolation guard now skips every cli route and compares prose-free skeletons, so it would not catch that leak; please scan the stable cli reference docs for leak sentences, or have the owner restate the spec:AST-084 Verification row to what the guard proves.

[Automated review]

Comment thread .changeset/cli-icon-sets.md Outdated
'@astryxdesign/cli': patch
---

[experimental] Icon sets: an integration can ship an icon set, agents find icons by meaning and get the exact import line, and copied templates use the project's icons. Everything here is experimental and may change or be removed in a patch release; a project that does not set `experimental.iconSet` sees no change in any stable command apart from the marked `experimental` group in help and in `astryx manifest` (and its `--json`), which list that group and its commands, and the marked experimental entries in the `astryx docs cli` listings, and `astryx search` never changes. With a package that ships icon sets installed, the warnings an older CLI gave about its manifest key `experimental` (in `astryx doctor` and `astryx doctor integration validate <package>`, and a one-line nudge to run it from other commands) go away, and `doctor integration` checks that package's icon sets only in a project that sets `experimental.iconSet`; and `astryx integration check` reports icon-set findings for a package that declares `experimental.iconSets` (below).

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.

This says astryx search never changes, but in a project with no icon set and no experimental.iconSet, astryx search experimental returns 6 results here and 3 on the CLI without the feature: the field reference's new stability row and the validateIntegration and response-types descriptions, which now point at astryx docs cli/experimental, match. Saying that search never returns icons or experimental docs would be accurate.

type: 'integration.validate',
description:
"The result envelope: `data.validated`, false when nothing was validated — with no `package.json` at all, `data.issues` carries one `no_package` error-severity issue so the command exits 1; with a `package.json` but no integration manifest, `data.issues` is empty, which means \"not looked at\", not \"healthy\"; `data.name` and `data.version` of the validated package (both null when `data.validated` is false; `data.name` is `(local package)` when the local package.json has no readable name), plus `data.issues`, an AstryxIntegrationIssue[] of {code, severity: `warning` | `error`, message, fix?, file?, line?}: `fix` is the change that resolves the issue, and `file` and `line` where it is, relative to the package, when the check knows them; and `data.notes` when there are any: {code, message, next?} information beside the issues; a note fails nothing by default, and one with `next: true` counts as a warning under `integration check --next`, fails `integration check --strict --next`, and fails `--strict` from the next minor release. Notes include `invalid_cli_command` for a `cliCommand` that was ignored as malformed and `cli_peer_version` when the running CLI is outside the `@astryxdesign/cli` peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message: `duplicate_component_doc`, `symlinked_root`, `unreadable_file`, `invalid_package_json` (no `name` or `version`), `no_provider_id`, and `source_without_component_doc` for a doc whose file name differs from its source only in letter case where the two still pair; and `doc_name_mismatch` and `unknown_block_component` (see `docNames` and `blockComponents`); they become warnings in the next minor release. For the commands a topic writes, `runner_command` (written with a package runner), `plain_command` (written bare), `package_manager_command` (written for one package manager) and `doc_token` (a token that does not parse) notes each give the file, line and the token to write. A `doc_target_not_found` note names a doc whose `replaces` or `extends` names no topic and no guide of the CLI's docs or the package's own (such as a namespace, with the guides below it), so it changes nothing unless an app also installs a package that provides it, and a `doc_section_unplaced` note a section whose `before` or `after` names no section of the topic or guide it extends, so it is added at the end, and a `duplicate_guide_replacement` note two docs of the package that replace one guide, of which only the last is read; they become warnings in the next minor release. When the manifest loads, `data.docTypes` holds the doc type check: `status` (`checked` | `skipped`), `reason` when skipped, `typescript`, `docs` (doc values checked), `findings` ({doc, line, export, type, field, problem: `unknown_field` | `missing_field` | `wrong_type`, severity: `warning`, message, fix}), `unchecked` ({doc, reason}: a doc that could not be fully checked, or a root its reader cannot read), and `fixtures` when the components or docs root holds test fixture docs under `__tests__`: how many, none of them checked. When the manifest loads, `data.docNames` lists the component doc names it could not judge: `status` (`checked`), `findings` (always empty; a doc name the module its import names provably does not export is a `doc_name_mismatch` note, with its fix in the message) and `unchecked` ({file, name, reason}: a doc whose `name` differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, `data.blockComponents` lists the component names templates give in `exampleFor` or `componentsUsed` that could not be judged: `status` (`checked`), `findings` (always empty; a name neither the package nor Core has, and the template does not import, is an `unknown_block_component` note, with its fix in the message) and `unchecked` ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is a note in `data.notes`, its fix inside the message, listed only: it does not fail this command or `integration check --strict`, and fails `--strict` from the next minor release. The codes are `component_import_not_exported`, `component_import_other_package`, `component_import_missing_name`, `example_import_not_exported`, `example_import_missing_name`, `template_import_not_exported`, `template_import_outside_root`, `template_private_import`, `template_import_missing_name` and `template_no_default_export`. When the manifest loads, `data.publicImports` is `{status: 'checked', findings: [], unchecked}`: `unchecked` lists each import the check could not judge, as {file, specifier, reason}, the reason starting `example <label>:` for an import in a component example: an `exports` target not built yet; a module whose export list cannot be read in full (CommonJS, or a declaration file it cannot read); a root import in a package with no `exports` (the root module `main` names is not read); every name an import (other than a component doc's own component) names that its module does not export, while a TypeScript file in the package has a `declare module` block for a relative path or the package's own name or a subpath of it, which can add names to that module (a `declare module` in a comment, `declare global`, a wildcard such as `'*.css'`, and another package's name do not count; a file whose text has `declare module` but that cannot be parsed counts); the same for every such name when the package has more than 5,000 files to search for that block; a deep path into build output not built yet in a package with no `exports`; a template import of Core when `@astryxdesign/core` is not installed beside the package (a `packages/core` of the workspace under another name does not count); every import of the package's own name when package.json has no `name` or a `name` that is not a bare package name; one entry for the whole check when package.json cannot be read; and an import of a subpath whose `exports` entry has only a `types` target, unless it is `import type`, every binding is an inline `type`, or every name it imports is a type its types file declares: a value import of a name that file does not declare as a type, a namespace or side-effect import, or any import when the types file cannot be read (it may be build output). `integration check` counts the unchecked as not compared; they never fail it.",
"The result envelope: `data.validated`, false when nothing was validated — with no `package.json` at all, `data.issues` carries one `no_package` error-severity issue so the command exits 1; with a `package.json` but no integration manifest, `data.issues` is empty, which means \"not looked at\", not \"healthy\"; `data.name` and `data.version` of the validated package (both null when `data.validated` is false; `data.name` is `(local package)` when the local package.json has no readable name), plus `data.issues`, an AstryxIntegrationIssue[] of {code, severity: `warning` | `error`, message, fix?, file?, line?}: `fix` is the change that resolves the issue, and `file` and `line` where it is, relative to the package, when the check knows them; and `data.notes` when there are any: {code, message, next?} information beside the issues; a note fails nothing by default, and one with `next: true` counts as a warning under `integration check --next`, fails `integration check --strict --next`, and fails `--strict` from the next minor release. Notes include `invalid_cli_command` for a `cliCommand` that was ignored as malformed and `cli_peer_version` when the running CLI is outside the `@astryxdesign/cli` peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message: `duplicate_component_doc`, `symlinked_root`, `unreadable_file`, `invalid_package_json` (no `name` or `version`), `no_provider_id`, and `source_without_component_doc` for a doc whose file name differs from its source only in letter case where the two still pair; and `doc_name_mismatch` and `unknown_block_component` (see `docNames` and `blockComponents`); they become warnings in the next minor release. For the commands a topic writes, `runner_command` (written with a package runner), `plain_command` (written bare), `package_manager_command` (written for one package manager) and `doc_token` (a token that does not parse) notes each give the file, line and the token to write. A `doc_target_not_found` note names a doc whose `replaces` or `extends` names no topic and no guide of the CLI's docs or the package's own (such as a namespace, with the guides below it), so it changes nothing unless an app also installs a package that provides it, and a `doc_section_unplaced` note a section whose `before` or `after` names no section of the topic or guide it extends, so it is added at the end, and a `duplicate_guide_replacement` note two docs of the package that replace one guide, of which only the last is read; they become warnings in the next minor release. When the manifest loads, `data.docTypes` holds the doc type check: `status` (`checked` | `skipped`), `reason` when skipped, `typescript`, `docs` (doc values checked), `findings` ({doc, line, export, type, field, problem: `unknown_field` | `missing_field` | `wrong_type`, severity: `warning`, message, fix}), `unchecked` ({doc, reason}: a doc that could not be fully checked, or a root its reader cannot read), and `fixtures` when the components or docs root holds test fixture docs under `__tests__`: how many, none of them checked. When the manifest loads, `data.docNames` lists the component doc names it could not judge: `status` (`checked`), `findings` (always empty; a doc name the module its import names provably does not export is a `doc_name_mismatch` note, with its fix in the message) and `unchecked` ({file, name, reason}: a doc whose `name` differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, `data.blockComponents` lists the component names templates give in `exampleFor` or `componentsUsed` that could not be judged: `status` (`checked`), `findings` (always empty; a name neither the package nor Core has, and the template does not import, is an `unknown_block_component` note, with its fix in the message) and `unchecked` ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is a note in `data.notes`, its fix inside the message, listed only: it does not fail this command or `integration check --strict`, and fails `--strict` from the next minor release. The codes are `component_import_not_exported`, `component_import_other_package`, `component_import_missing_name`, `example_import_not_exported`, `example_import_missing_name`, `template_import_not_exported`, `template_import_outside_root`, `template_private_import`, `template_import_missing_name` and `template_no_default_export`. When the manifest loads, `data.publicImports` is `{status: 'checked', findings: [], unchecked}`: `unchecked` lists each import the check could not judge, as {file, specifier, reason}, the reason starting `example <label>:` for an import in a component example: an `exports` target not built yet; a module whose export list cannot be read in full (CommonJS, or a declaration file it cannot read); a root import in a package with no `exports` (the root module `main` names is not read); every name an import (other than a component doc's own component) names that its module does not export, while a TypeScript file in the package has a `declare module` block for a relative path or the package's own name or a subpath of it, which can add names to that module (a `declare module` in a comment, `declare global`, a wildcard such as `'*.css'`, and another package's name do not count; a file whose text has `declare module` but that cannot be parsed counts); the same for every such name when the package has more than 5,000 files to search for that block; a deep path into build output not built yet in a package with no `exports`; a template import of Core when `@astryxdesign/core` is not installed beside the package (a `packages/core` of the workspace under another name does not count); every import of the package's own name when package.json has no `name` or a `name` that is not a bare package name; one entry for the whole check when package.json cannot be read; and an import of a subpath whose `exports` entry has only a `types` target, unless it is `import type`, every binding is an inline `type`, or every name it imports is a type its types file declares: a value import of a name that file does not declare as a type, a namespace or side-effect import, or any import when the types file cannot be read (it may be build output). `integration check` counts the unchecked as not compared; they never fail it. `data.olderCliNotes` ({file, kind: `template` | `namespace`, field, message}), for the local package, lists each descriptor field a release before 0.7.4 refuses while the package's CLI peer range admits one: `stability` on a template or namespace doc, and a template's experimental field (its values are on the `cli/experimental` routes); it is present only when it has entries, is never counted, and never fails a check. Experimental fields are documented on their own routes under `astryx docs cli/experimental`.",

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.

The closing sentence, "Experimental fields are documented on their own routes under astryx docs cli/experimental", puts an experimental pointer in a stable function doc that every project reads, and it is why astryx search experimental finds this doc without the opt-in. The olderCliNotes text reads fine without it; the same sentence closes the integration.validate description in foundation/response/response-types.doc.mjs line 398.

Comment on lines +499 to +500
const experimental = (/** @type {string} */ route) =>
route === 'cli' || route.startsWith('cli/');

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.

Treating every cli/ route as experimental skips the stable cli/api/functions/* and cli/api/enums/* docs entirely, so the leak sentence added to validateIntegration.doc.mjs passes. Skipping only reads that carry stability: 'experimental' would keep FR0's exception for the experimental command and function docs and still scan the stable reference docs for LEAK_WORDS.

…an experimental neighbor; the guard scans every stable cli node and searches for experimental and icon set
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0997d77

@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.

Changes requested: the owner approval at this revision settles the spec direction, and the release-note and guard-coverage points from the last round are fixed, but three things remain.

  • About 22,200 authored lines still land as one unit although set authoring, template mapping and discover's icon-set kind stack on the core, so please land the core first with those layers as a stack, or show concretely why the core cannot merge without them.
  • The icon-sets guide says a project without experimental.iconSet sees no stable change apart from the help line, but the manifest, the astryx docs cli listings and astryx search experimental change too, as spec:AST-084 FR0 lists; please give the guide that list.
  • The goldens' regeneration recipe in packages/cli/test/experimental-isolation.test.mjs says vitest run -u on the file, but vitest 4 reads the path as the value of -u and updates the whole suite; please write it as vitest run <file> --update.

[Automated review]

content: [
{
type: 'prose',
text: 'Icon sets are experimental: the `astryx experimental icon` commands, the `experimental.iconSet` key in astryx.config, the `experimental.iconSets` key in an integration manifest, the data file, icon definitions, and the output and JSON of all of them can change, or go away, in any patch release without a deprecation period. A project that does not set `experimental.iconSet` sees no change in any stable command apart from the `experimental` group in help: templates, discover, and doctor answer as they do with no icon set installed. `astryx search` never returns icons or these docs; to find an icon by meaning, use `astryx experimental icon <words>`.',

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.

Without experimental.iconSet a project also sees the experimental group in astryx manifest, the marked entries in the astryx docs cli listings, and one more astryx search experimental result (the field reference's stability section); with an icon-set package installed, the older CLI's warnings about the manifest key go away. spec:AST-084 FR0 and .changeset/cli-icon-sets.md list those differences, so "no change in any stable command apart from the experimental group in help" understates them.

* While main lacks the icon-set feature (before the feature lands), the
* goldens are main's own output: regenerate them from a checkout of main
* with `GOLDEN_CLI_BIN=<main>/packages/cli/clients/cli/bin/astryx.mjs
* GOLDEN_CLI_ROOT=<main>/packages/cli vitest run -u` on this file. That runs

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.

With the repository's vitest 4.1.11, -u takes an optional value (-u, --update [type]), so vitest run -u packages/cli/test/experimental-isolation.test.mjs reads the path as the update type and runs every test file in update mode with GOLDEN_CLI_ROOT set. Writing the flag after the file (vitest run packages/cli/test/experimental-isolation.test.mjs --update) regenerates exactly the 38 goldens; the same wording is on lines 33 and 51.

… without the opt-in; the guard's update recipe names the file before --update
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 68cb24f

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec c1e34f0

@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.

Changes requested: the owner approval at this revision settles the spec direction, and the guide and regeneration-recipe points from the last round are fixed, but two things remain.

  • About 22,250 authored lines still land as one unit although set authoring, template mapping and discover's icon-set kind stack on the core, so please land the core first with those layers as a stack, or show concretely why the core cannot merge without them.
  • astryx experimental icon use appends experimental: {iconSet} after a spread in astryx.config (export default {...base}), which overrides the spread's experimental object and silently drops settings such as experimental.xle.components while printing [ok]; please refuse a spread there, as the writer already refuses non-literal values, and add a test.

[Automated review]

);
if (!holder) {
const created = j.objectExpression([]);
object.properties.push(j.objectProperty(j.identifier(each), created));

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.

When the object on the path has no literal experimental but spreads another object (export default {...base}), this pushes a new experimental: {} after the spread, which overrides the spread's whole experimental object. With base = {experimental: {xle: {components: {...}}}}, astryx experimental icon use glyphs prints [ok] and the config then evaluates to {"experimental":{"iconSet":"glyphs"}}, so xle.components silently stops applying. Treating a spread element on the path like a non-literal value (the refuse() error above) would keep the header's promise that such a config is refused rather than rewritten; a test with export default {...base} would pin it.

@josephfarina

Copy link
Copy Markdown
Contributor Author

Maintainer decision: why each layer belongs with the core, concretely.

  • Set authoring (experimental icon new-set, add, map, new-definition) is the only producer of the generated module and theme map that the core checks validate (FR12, FR15: icon_theme_map_mismatch, icon_generated_types_mismatch, icon_export_missing). Without it the core would validate a file format that nothing in the CLI writes. The isolation and check tests build their fixture sets through these writers (test-utils/icon-set-fixture.mjs, icon-authoring.test.mjs), and the fresh-agent runs that proved the feature usable depended on them.
  • Template icon mapping is the reason icon definitions exist (FR9, FR10). The 141 bundled templates declare icons by definition. Without mapping, the definitions and the project opt-in experimental.iconSet have no consumer, so the core alone would ship an opt-in that changes nothing.
  • The opted-in discover kind and the Doctor check are how a project learns that its configured set is installed, missing or withdrawn (FR17). Without them, a misconfigured opt-in fails silently in templates.

Each slice alone either has no consumer or no producer. All of it sits behind one opt-in, and the isolation guard proves stable output unchanged without it. One PR is the accepted shape.

…dow a spread; icon use refuses with ERR_WRITE_FAILED and leaves the config as it was
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec fc351ce

astracat-bot[bot]
astracat-bot Bot previously requested changes Oct 23, 2026

@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.

Changes requested: the owner approval at this revision settles the spec direction, and the experimental icon use spread fix from the last round works, but the scope finding remains. About 22,500 authored lines still land as one unit, and set authoring, template mapping, and discover's icon-set kind with Doctor's icon-sets check each stack on the core, so please land the core first with those layers as a stack, or show concretely why the core cannot merge without one of them. The reasons in the latest maintainer decision do not hold at this revision: the shared fixture packages/cli/test-utils/icon-set-fixture.mjs writes a complete set without any writer, Project.iconSets() already uses experimental.iconSet to put the project's set first in lookups, and FR17 has the template icons report and experimental icon --list show a missing or withdrawn set.

[Automated review]

@josephfarina
josephfarina dismissed astracat-bot[bot]’s stale review October 23, 2026 07:06

Maintainer decision: one PR (see the decision comments). Every other review item is resolved on fc351ce.

This branch was successfully deployed

1 active deployment
Preview — fc351ce0 Deployed Oct 23, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant