Repository navigation
Add typed documentation graph contracts - #6471
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.
This PR establishes a substantial new public documentation contract, but approval needs a maintainer to provide or identify the committed governing specification for NamespaceDoc, shared graph metadata and semantic blocks, and provider/document identity (including rename, collision, and legacy-reader behavior).
Two implementation issues also need correction:
- Distinct configured packages that resolve to the same
providerIdcurrently cause the later package and its contributions to be dropped without any warning or project issue. - An extension section with a new stable
iddoes not replace a same-title legacy base section without an ID; it appends a duplicate section instead.
Please surface provider collisions explicitly, preserve legacy title fallback during section-ID migration, and add focused regression coverage for both cases.
[Automated review]
PR Analysis Report
No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: 36 accessibility violation(s) found — 2 critical, 34 serious. Button pattern - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
Checkbox pattern - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 1 issue(s)
CodeEditorPerf - 1 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
LogStream - 1 issue(s)
MediaTheme Auto - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
Radio group pattern - 1 issue(s)
RadioList - 1 issue(s)
RichTextEditor - 2 issue(s)
SelectableCard - 1 issue(s)
Stepper - 1 issue(s)
TableGroupedRows - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Generated by PR Enrichment workflow | View full report |
Two review findings on this PR, plus what an adversarial pass turned up while fixing them. A package that claimed another package's provider ID used to vanish without a word. Now the package being authored wins, otherwise the first-loaded one, and the one set aside shows up in `astryx doctor`, in the project's issues, and as a warning on every command. Autolinked packages go through the same check, and `astryx upgrade` no longer runs codemods from a package that was set aside. A topic extension whose section gained a stable `id` got appended as a duplicate instead of replacing the section it extends. Merging now matches by `id` first and falls back to the authored title, including under `--zh`/`--dense`, and a legacy extension keeps the base section's `id`.
There was a problem hiding this comment.
Approval needs a maintainer to provide or identify the committed governing specification for this new public documentation contract — NamespaceDoc slots and adoption, shared placement/aliases/audience and workflow/collection/reference blocks, provider/artifact/document identity including providerId rename and the collision winner, stable section-ID migration, case-insensitive topic lookup, and legacy-reader rejection. Please name what specification owns each of those semantics, or state that case-insensitive lookup should be split out.
The two implementation issues raised earlier are now addressed: provider-ID collisions surface the set-aside package in project issues, astryx doctor, and command warnings (and upgrade no longer runs its codemods), and an ID-bearing section extension replaces a same-title legacy section instead of duplicating it. No further code change is requested for the hold itself.
[Automated review]
`astryx upgrade --integration <pkg>`, run inside <pkg> itself, set aside the installed copy the user asked for, because the package being authored claimed its provider ID first. Naming the package now works the same as listing it in the config: the installed copy's released codemods run, never the work in progress.
There was a problem hiding this comment.
Approval needs a maintainer to provide or identify the committed governing specification for this new public documentation contract - NamespaceDoc slots and adoption, shared placement/aliases/audience and workflow/collection/reference blocks, provider/artifact/document identity including providerId rename and the collision winner (including astryx upgrade --integration naming the authored package), stable section-ID migration, case-insensitive topic lookup, and legacy-reader rejection. Please name what specification owns each of those semantics, or state that case-insensitive lookup should be split out.
The implementation issues raised earlier are addressed and verified: provider-ID collisions surface the set-aside package in project issues, astryx doctor, and command warnings (and upgrade no longer runs its codemods), an ID-bearing section extension replaces a same-title legacy section instead of duplicating it, and upgrade naming the authored package runs the installed copy. No further code change is requested for the hold itself.
[Automated review]
Every section now has a key: its authored `id`, or one derived from its title. `astryx docs <topic> <key>` reads that section. A query that matches more than one section is refused with the candidates instead of guessed, and a section read on its own inlines its token refs (it used to print blank). Two sections sharing a key fail validation instead of one silently shadowing the other.
There was a problem hiding this comment.
Approval needs a maintainer to provide or identify the committed governing specification for this new public documentation contract - NamespaceDoc slots and adoption, shared placement/aliases/audience and workflow/collection/reference blocks, provider/artifact/document identity including providerId rename and the collision winner (including astryx upgrade --integration naming the authored package), legacy-reader rejection, and the new stable section-key contract (derived keys stamped as section id, duplicate-key validation, reading by key, ambiguous partial queries refused, and single-section token-ref inlining). Please name what specification owns each of those semantics, or state that case-insensitive topic lookup or section-key reading should be split out.
One code-adjacent fix is also needed: the Changeset does not name the breaking section-reader change - a partial query that matched several sections previously returned the first one and now fails, and topics whose sections share a derived key (or whose title derives no key) now fail validation. Please extend the Changeset to name that old usage, reading by stable key as the replacement, and those failures, or restore the old first-match behavior.
The implementation issues raised earlier are addressed and verified: provider-ID collisions surface the set-aside package, an ID-bearing section extension replaces a same-title legacy section instead of duplicating it, and upgrade naming the authored package runs the installed copy.
[Automated review]
`astryx docs <topic>` now prints the topic's sections, one line each, with the
key to read it by, and `docs(topic)` returns `docs.index`. One section is
`astryx docs <topic> <key>`; the whole topic is `--detail full`
(`{detail: 'full'}`). The topic list is one line per topic, long lines wrap at
120 columns, and a table too wide for that prints one row at a time.
One topic for every file an integration author writes: the manifest, astryx.config, codemods, identity, and each doc type, one section each, field by field. It is built from the self-docs that sit beside each schema, so it cannot drift from them, and an audit names any self-doc it cannot reach, any that fails to load, and any section over the 32 KB a single read may return.
Two new checks. "Documentation navigation and size" loads every topic and fails when one does not load, when its section index or any section is over the 32 KB a single read may return, or when a contributed doc is invalid. "Authoring docs" fails when an authoring self-doc is missing from `astryx docs authoring`, fails to load, or has a section over that size. Both report problems instead of crashing Doctor.
A long description wrapped as one line, which collapsed the padding after the topic name. Only the description wraps now, under its column.
There was a problem hiding this comment.
Approval needs a maintainer to provide or identify the committed governing specification for this new public documentation contract - NamespaceDoc slots and adoption, shared placement/aliases/audience and workflow/collection/reference blocks, provider/artifact/document identity including providerId rename and the collision winner (including upgrade naming the authored package), legacy-reader rejection, stable section keys and merge-by-key, the section-index default for topic reads, astryx docs authoring, and astryx doctor progressive-disclosure checks in every language. Please name what specification owns each of those semantics, or state that case-insensitive topic lookup or human-text formatting should be split out.
One code-adjacent fix is also needed: the Changeset does not name two breaking changes - topics whose sections share a derived key, whose section id is not a stable key, or whose title derives no key previously loaded and now fail validation, and human docs text now wraps at 120 columns (including CJK), renders lists inline, and renders wide tables vertically. Please extend the Changeset to name that old usage, those failures and text changes, and the migration (a distinct title or an explicit stable id), or restore the old behavior for either part.
The implementation issues raised earlier are addressed and verified: provider-ID collisions surface the set-aside package, an extension section replaces a same-key legacy section instead of duplicating it, and upgrade naming the authored package runs the installed copy.
[Automated review]
The English line still sent readers to the section index for "the full reference"; the zh and dense versions already said --detail full.
There was a problem hiding this comment.
Approval needs a maintainer to provide or identify the committed governing specification for this new public documentation contract - NamespaceDoc slots and adoption, shared placement/aliases/audience and workflow/collection/reference blocks, provider/artifact/document identity including providerId rename and the collision winner (including upgrade naming the authored package), legacy-reader rejection, stable section keys and merge-by-key, the section-index default for topic reads, astryx docs authoring, and astryx doctor progressive-disclosure checks in every language. Please name what specification owns each of those semantics, or state that case-insensitive topic lookup or human-text formatting should be split out.
One code-adjacent fix is also needed: the Changeset does not name two breaking changes - topics whose sections share a derived key, whose section id is not a stable key, or whose title derives no key previously loaded and now fail validation, and human docs text now wraps at 120 columns (including CJK), renders lists inline, and renders wide tables vertically. Please extend the Changeset to name that old usage, those failures and text changes, and the migration (a distinct title or an explicit stable id), or restore the old behavior for either part.
The implementation issues raised earlier are addressed and verified: provider-ID collisions surface the set-aside package, an extension section replaces a same-key legacy section instead of duplicating it, and upgrade naming the authored package runs the installed copy.
[Automated review]
The docsite types generated docs as DocSection, which had no `id`, so the authoring topic (whose sections have ids) failed the docsite typecheck.
There was a problem hiding this comment.
Approval needs a maintainer to provide or identify the committed governing specification for this new public documentation contract — NamespaceDoc slots and adoption, shared placement/aliases/audience and workflow/collection/reference blocks, provider/artifact/document identity including providerId rename and the collision winner, legacy-reader rejection, stable section keys and merge-by-key, the section-index default for topic reads, astryx docs authoring, and astryx doctor progressive-disclosure checks in every language. Please name what specification owns each of those semantics, or state that case-insensitive topic lookup or human-text formatting should be split out.
One code-adjacent fix is also needed: the Changeset does not name two breaking changes — topics with duplicate derived keys, non-key section ids, or underivable keys previously loaded without section-key problems and now get validation problems, and human docs text now wraps at 120 columns including CJK with inline records. Please extend the Changeset to name that old usage, those failures and text changes, and the migration (a distinct title or an explicit stable id), or restore the old behavior for either part.
The newest change here is safe: the generated docsite section type just gains an optional id carrying the stable key, with no runtime behavior change. Previously found implementation issues remain addressed in the current code: provider-ID collisions surface the set-aside package, an extension section replaces a same-key legacy section instead of duplicating it, and upgrade naming the authored package runs the installed copy.
[Automated review]
`docs(topic)` and `astryx docs <topic>` returned the new section index, which
broke existing readers of the whole doc: a docs-site generator that requires
`docs.detail` for every topic fails outright, and a caller that merges the full
doc silently loses it. A topic read now returns the whole doc again, as it did
before this PR. The index is opt-in: `astryx docs <topic> --index` or
`docs(topic, undefined, {index: true})`. Reading one section by key is unchanged.
The changeset now names every breaking change with its migration: section-key
validation, ambiguous section queries, merge by key, 120-column text, and
provider conflicts.
There was a problem hiding this comment.
Approval needs a maintainer to provide or identify the committed governing specification for this new public documentation contract — NamespaceDoc slots and adoption, shared placement/aliases/audience and workflow/collection/reference blocks, provider/artifact/document identity including providerId rename and the collision winner, sealed parsers with visible legacy-reader rejection, stable section keys and merge-by-key, the opt-in section index for topic reads, astryx docs authoring, and astryx doctor budget checks. Please name what specification owns each of those semantics, or state which parts should be split out.
No code change is requested for the hold itself. Since the last review round the Changeset now names each breaking behavior with its old usage, replacement, and migration (section-key validation, ambiguous-query refusal, extension merge-by-key, human-text wrapping with --json unchanged, provider-collision naming, doctor failures), and a topic read returns the whole doc as before with the section index opt-in via --index.
[Automated review]
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided.
…iptors (#6498) * Keep a topic's title when an integration extends it `mergeTopic` took the extension's title and description whenever it stated them, and every extension has to state both, so extending a topic renamed it: with an integration extending `theme` installed, `astryx docs theme` printed the extension's title instead of "Theme System". An extension now adds or replaces sections and leaves the title and description alone. A topic that `replaces` another still renames it. The authoring reference and the integration guide say so, and tests cover both relationships. * Author integration themes with typed descriptors Rebuilds draft PR #6315 on the doc types from #6471 and #6492. Every theme now ships a strongly typed same-stem `ThemeDoc` beside its source instead of an entry in a central `themes/manifest.json` catalog, which was only ever in canary. Theme discovery reads the descriptor, derives the source entry and runtime export from the shared stem, parses the source without running it, and keeps each theme directory together when it copies and packs it. New component, topic, and template scaffolds emit typed `.doc.mjs` files; released `.doc.ts`, `.doc.js` and `.template.*` inputs still load. On top of #6315 as it stood: - `ThemeDoc` joins the typed examples, the authoring self-docs and their field test, and the lock list; its relative imports name their files so the packed types still resolve under nodenext. - The integration guide keeps #6290's palette detail (the request, the candidate and its receipt) and drops the catalog steps. Its drift test now checks the ThemeDoc fields and that the documented theme directory is exactly what discovery ships; `theme palette generate` no longer tells authors to list files in a catalog. - The spec draft moves from AST-035 to AST-039, because #6265 already uses AST-035. That is bookkeeping, not a resolution: the two drafts describe overlapping rules, and which one governs is still undecided. * Give every doctor integration warning its fix `astryx doctor integration validate` already finds a contribution no root reads, a codemod outside a version folder, a mis-named codemod folder, a component source with no doc, and a doc with no source. It said what was wrong and left the author to work out the fix. Each message now ends with it: the root that reads the file (or the exact manifest line to declare its folder as one), the version folder a codemod belongs in, or the file to add. A theme descriptor's fix names the folder above its theme directory, since that is the themes root. Codemod paths are shown relative to the package, not as absolute paths. * List every authored descriptor once, as compiler input The doc compiler only saw reference topics. `collectDocInputs` lists every descriptor a project reads, whatever root it comes from: components, hooks, templates, themes, doc topics and their extensions, and the CLI's own self-docs. Each input records the root that reads it, the name a reader asks for, the package that contributes it, and where the file ships (`<package>/<path>`), so nothing machine-specific reaches a compiled node. Nothing reads the list yet; the next slices compile it. A new test is the completeness check for what this repo ships. Every `.doc.mjs` under Core's source and every directory the CLI's package.json ships must be read exactly once, and nothing else may be. Mutating the list (dropping hooks, unlisted docs, extensions, or a self-doc tree; keying templates by title; skipping the duplicate check) fails it. Writing it turned up two things. Ten core docs are read by `component <Name>` but left out of `component --list`, because the list needs a same-stem source. The test pins them, since listing them would change the CLI's output. And templates are looked up by type and directory name, not by title; three showcase blocks share a title with the block they show, which is fine, but it means the title can never be an id. * Compile every doc kind, and read every doc through the compiler Until now only doc topics went through the doc compiler. Components, hooks, templates, themes, and the CLI's own self-docs were each loaded by whichever reader wanted them, with its own export order, its own translation merge, and no check. Now every kind lowers through `lowerDoc` into one sealed node shape: checked against its kind's parser, translated, carried as JSON, with package provenance and no machine paths. - `foundation/doc-compiler/read.mjs` is the one place that loads a doc file for reading, and `import.mjs` the one place that executes one. The component and hook loaders, search, template and theme discovery, the docs list, and the authoring self-docs now read compiled nodes. A new test fails if any other module starts executing modules. - `compileDocs` compiles everything a project reads at once: 1,055 nodes for this repo, nine kinds, zero diagnostics, in every language. A bundle reads back through a sealed parser that rejects schema skew, unknown fields, machine paths, and non-JSON values. - One diagnostic shape for every phase: a stable code that fixes its phase, severity, scope, and remediation, sorted into one order. A token reference that finds nothing is now a warning in the bundle. Nothing a reader sees changes. Each reader keeps its own strictness: the checked loaders still throw what they threw, and the unchecked ones still read a doc that fails its parser. The overlay logic moved as is. Evidence: 2,939 CLI reads (every component, hook, template, topic, and section, text and `--json`, in every language, plus search, build, and theme list) are byte-identical to the base, and new golden snapshots of integration-doc reads were recorded at the base and match. * Move the typed-descriptor policy text to its own spec PR The descriptor rule (every integration item owns one typed doc, and the manifest never catalogs items) is a public-model decision, so it gets its own draft spec PR and its own review instead of riding along with the code. This removes the spec draft, the INV20 invariant, the contributing guidance, and the AGENTS.md pointer from this PR. The theme code and the INV19 text that describes it stay: they state what the code does. Test titles no longer name the spec. * cli: resolve provider precedence once, with a ledger Project, upgrade, and markProviderConflicts each re-derived which package wins a provider ID, and every drop path returned a shorter list with no record. They now share one resolver, foundation/integrations/provider-resolution.mjs. It returns the same resolved list as before, plus a ledger keyed by real package directory with one outcome per package: contributes, set-aside (winner and reason), load-failed, or alias-of. - Project.load resolves configured, autolinked, and local candidates in one pass and keeps the ledger (providerLedgerOf, internal). - The autolink copy dedupe, an autolinked load failure, and a dependency key that repeats a loaded directory are ledger entries now, not silent skips. - upgrade's loadProjectContext hands Project's list, the installed copy, and its extras to the same resolver under the codemod policy, on top of Project's ledger. - markProviderConflicts and autolinkIntegrations keep their signatures and results. No output changes. A seeded property test runs the real Project.load and upgrade context over 200 generated projects. It checks that the ledger accounts for every candidate exactly once, and that both agree on the winner of every provider ID, except where the installed copy stands in for the package being authored. Two it.fails repros pin a disagreement that exists today: upgrade lets an --integration extra with an autolinked package's name@version stand in for it, from any directory, at the extras' position, so another extra can win the ID in upgrade only. * test(cli): inventory every doc route with a proposed placement Add doc-routes.json: one row per built-in topic and section key, and one row per provider and kind of typed descriptor (ids in doc-routes.ids.json). Each row records the current CLI route, the docsite URL, a proposed docs-graph placement, whether an alias is needed, and a rationale. doc-routes.test.mjs derives today's routes from the CLI and fails when a route has no row, a row names a route that no longer exists, or a row lacks a rationale or uses a placement form the proposal does not define. * Document DebugEvent and GapReportHandler in astryx docs authoring Both types are exported from @astryxdesign/cli/authoring, but no self-doc sat beside debug/type.ts or gap-report/type.ts, so astryx docs authoring had no section for either. Add one for each, list them after the config section, and hold them to the published types in the self-doc type test. * Fail doctor when a public authoring type has no doc checkAuthoringDocs now also traces every type @astryxdesign/cli/authoring exports to the module that declares it, parsing index.d.ts and the modules it re-exports with jscodeshift. The self-doc beside that module must be listed in AUTHORING_SELF_DOCS, load, and render a section that astryx docs authoring --index lists, and a listed self-doc must document a type the package exports. Parsers are left out: they read these types and are not a shape anyone writes. A failure names each type, the module that declares it, and the self-doc that is missing, unlisted, or not in the topic. A passing run prints exactly what it printed before. * Route the two new authoring sections, and give whole-repo tests room The route inventory now has rows for `debug-event` and `gap-report-handler`, the two authoring sections the doctor check added. The tests that compile or import every doc in the repo get explicit timeouts, because on a busy machine they ran past the 30 s default. * Generate the CLI README from the CLI's self-docs The README copied reference data by hand, and the copies had drifted: the search options named a --detail flag that is really --verbose, and the config and integration tables left out five fields. - Every command gets a generated usage line, options and examples from its CommandDoc, and the API section lists every function in @astryxdesign/cli/api and @astryxdesign/cli/json from its FunctionDoc. - The search options and the doctor integration table come from their CommandDocs. The config and integration tables and the copied "How it works" text become pointers to the `astryx docs` sections that serve them, checked against `astryx docs <topic> --index`. - The generator writes only between markers, formatting each block on its own, so every other byte is kept. It checks each section's source comment, fails when a live command or an exported function has no doc, and warns about a doc for something that does not exist. - --check names the drifted sections and the command that fixes them. The generator stays one script, the module the doc-load guard allows to import self-docs, and runs only when node runs it, not when a test imports it. * Readers print the authored doc; only the whole-project compile is JSON Adversarial testing found that routing reads through the compiler had changed what readers print. Every reader got the doc after a JSON round trip, so a BigInt, a cycle, a function, a date, `Infinity`, or a key set to `undefined` changed or broke text output: `component Link --zh` lost its Props heading for nine core components, and an integration doc with `10n` in it crashed `component`. Checked loaders also threw a JSON error instead of the parser's message, and accepted a theme descriptor as a component. - `lowerDoc` now returns the view readers have always read: the authored export with its translation laid over it, uncopied and unconverted. Only the sealed node, which a whole-project compile collects, goes through JSON, and a value JSON cannot hold withdraws the node, never the view. - Each reader keeps its old loader (a plain import for the unchecked readers, jiti for the checked ones), export order (`a ?? b ?? c`, empty value included), and strictness: the parser's error first, then a failed translation. Outside the themes root a theme descriptor is still an unsupported type, with the same message. - Unchecked readers no longer run the parser at all, and reads no longer stat and resolve every file: a process lowers each file once, as Node's module cache holds it, and tries a file that failed to load again. - `component` and `hook` detail reads hand out their own copy (containers copied with their descriptors, everything else shared), so a caller that edits a result no longer changes the next read. - The bundle withdraws a node with a problem of its own, so every bundle reads back through its sealed parser; diagnostics never carry a machine path; a package with no name is named by its folder; two extension files from one package get their own inputs; a topic value JSON cannot hold is `not_json` like any other doc; and prototype names are not diagnostic codes. * Make the doc-loads guard see every way a module runs code The guard matched callee names, so 18 of the 23 ways a reviewer found to run a doc file got past it: a static doc import, a renamed or namespaced loader, a loader passed as a value, createRequire, a Worker, eval, and more. It now matches by what a module imports and how it uses it, scans every source file in the package, and lists each of the 42 modules that run code outside their static imports with exactly the sites it has, so a new site, a removed one, or a stale entry fails. The doc reader's headers now say what the guard enforces instead of claiming to be the only way a doc file runs. * Read theme descriptors by their JSDoc, and keep bundled themes as cheap as main Fixes for the round-1 findings in the typed theme descriptor and template suffix work. - Two template specs for one stem list twice and read as ambiguous again, as on main, and a core page keeps the released precedence (.template.*, then .doc.ts, before .doc.mjs). Nothing is dropped silently. - The ThemeDoc check reads the JSDoc TypeScript reads for the default export: the last JSDoc before it, or a parenthesized cast. A @typedef or @import alias counts. A line comment, a string, or a comment after the export no longer does. - A blank name, displayName, or description fails with its field named. __proto__ fails like any unknown key. A BigInt no longer reads as a string. - Theme messages name the package and the file: a symlinked descriptor, a nested second descriptor, a name that does not match its folder. - A dot-folder, or a folder with neither a descriptor nor a <name>Theme source, is not a theme. Discovery skips it and pack-check does not require it. A folder with a theme source and no descriptor still fails. - theme add copies a bundled theme exactly as main did: its source files in main's order, without the CLI's descriptor. An integration theme still copies its whole directory, entry first. - Bundled theme sources are checked by the bundle test, not on every run. The descriptor parser loads on the first read, and each read is kept for the process while the file's size and mtime hold. theme list goes from 36% to 1% slower than main; the doc-loads guard lists the two lazy parser loads. - The theme bundle generator and its check fail on a public theme package that has no descriptor, and name it. - The integration guide says which released suffixes still load: a .doc.ts topic in an installed package is listed but cannot be read. * Make every doctor integration Fix hold when followed Each `Fix:` that `astryx doctor integration validate` prints now works when followed as written, and a test follows it on a fixture and validates again. Before, several led to a new error or pointed somewhere wrong: - A theme descriptor at the package root was told to set `themes: './..'`, outside the package, and one in a top-level folder was told `themes: './'`, which reads every folder as a theme. Both now move the theme into themes/<slug>/. - A component, topic or template fix never makes the package root a root. It never declares a folder that also holds another kind of doc, another root or an incomplete doc, and never swaps out a declared root that still holds contributions. - A move takes the same-stem source along, asks for a missing one, and says how to separate the target root from any other root that also reads it. - A component doc without its source names the real doc file (Foo.doc.ts) and never says to delete it. A doc of another type in the components root is told which root to change or where to move it. - When the codemods root is the package root or holds another root, the manifest is never listed as a stray codemod and no folder is told to be renamed to a version; codemods get a folder of their own instead. Contribution metadata at the top of the codemods root is told where it belongs instead of being moved into a version folder. - A hidden component doc no longer draws "add <Name>.doc.mjs" for a file that exists. - An invalid codemod is named by its path inside the package. The fix logic lives in foundation/integrations/contribution-fixes.mjs so the component and codemod checks in foundation can use it; the static metadata reader moved there with it. Messages that were already right are unchanged. * Ask to rename a theme descriptor that is not a .doc.mjs file Theme discovery reads only `.doc.mjs` descriptors, so a `sandTheme.doc.ts` moved into themes/sand/ as its fix said still failed with "found 0". The fix now also says to rename it. A theme source at the top of the codemods root is recognized beside a descriptor of any doc suffix, not only `.doc.mjs`. * Read a themes root the way theme discovery now does Theme discovery skips dot-folders and folders with neither a descriptor nor a <name>Theme source. The fix check for a would-be themes root now skips them too, so a helper folder beside the themes no longer turns "set themes" into a longer move. A folder that discovery reads as a theme but that is broken still blocks it. * Keep readers on the module's own doc, and never let a message break a read Round-two testing found the edges where the reader copy still differed from main: a doc nested thousands of levels deep overflowed the copy, and a Proxy doc printed its target's text instead of the Proxy's. Component and hook reads now return the module's own doc, exactly as main did. A load error whose text held a malformed `file://` URL turned into "URI malformed" when the diagnostic scrubbed its paths; scrubbing now leaves text it cannot decode as it is. An error with an empty message no longer produces a diagnostic its own bundle parser rejects. The bundle's header no longer claims callers it does not have. * Say the theme catalog shipped in 0.6.3, and hide README markers on the docsite The changeset called the integration theme catalog canary-only, but 0.6.3 writes `themes/manifest.json`. It now says so, and what an integration that still ships the catalog must do. The docsite's package page drops HTML comments before rendering a README, as GitHub and npm do, so the generated README's section markers no longer show as text. `integrationAddTheme` names its own command, `integration add theme`. * Lower every read afresh, as the readers always loaded Readers shared one lowered view per file for the life of a process. A caller that edited a `template()` result changed later reads, a doc's getters ran once instead of on every read, and a failed translation rethrew one shared error. Main loaded, parsed, and translated on every call, so each read now does too; only the whole-project compile keeps its per-file memo. Node's module cache still holds each file, so a read costs what it did on main. * Keep the compiler's own error code out of the public error envelope A topic value JSON cannot hold made `docs <topic> --json` report the compiler's internal `not_json` code instead of main's `ERR_UNKNOWN`, because the error carried it as `code`, which the envelope reads. The compiler now keeps its code under its own key. The component loader's header says what readers get now. * Catch the obfuscation shapes worth catching, and say where the line is A second pass at the guard found runners it could not see: a doc module fetched from a `data:` URL, process.dlopen and process.execve, WebAssembly, Function reached as a called `.constructor`, and eval or Function taken off the global object by destructuring, through an alias, or with Reflect.get. Each is one shape with one name, so each is now a site. What is left out is now stated rather than implied: the scan claims every ordinary way of running code, whatever the local names, and does not claim that the rule cannot be evaded on purpose. A method name assembled at run time still passes, and that is the documented boundary. The self-test grows to 89 ways around the rule and 28 innocent snippets, among them the shapes real code uses that these rules must not touch: a constructor passed on or read for its name, process.cwd, {env} = process, and WebAssembly.validate. * Fill an existing theme folder, and keep junk and stray folders out of themes Round-2 fixes for the typed theme descriptor work. - `integration add theme` fills an existing folder again, as main did, and refuses only a file it would write. - A theme's files leave out dot entries and files npm never publishes, at any depth (.DS_Store, ._*, .gitignore, .npmrc, *.orig, npm-debug.log, node_modules, CVS). pack-check no longer fails a correct package over them, theme add no longer copies them, and files beside the theme folders are no longer required. - A blank description is accepted, as the released catalog accepted it. - The ThemeDoc check finds tags the way TypeScript's JSDoc scanner does: a cast inside outer parentheses counts, and a code span no longer hides the real @type. {!T}, {?T}, {T=}, {(T)}, T | null, T | undefined, T & {}, @Satisfies on a cast, @import {type ThemeDoc}, and typedef chains are accepted. @Satisfies on the export statement and `@import type {...}` are not, because TypeScript does not apply them. - doctor integration validate warns about a folder under the themes root that looks like a theme but is not read as one, with a fix that holds: make it a theme, or rename it to a dot-folder. A folder another module imports is not flagged. - The theme bundle generator runs when its path goes through a symlinked directory, and refuses a descriptor the CLI cannot read, naming the package. - The integration guide says an installed package's component or topic .doc.ts cannot be read; it loads only when the package is linked from outside node_modules. * Keep the doc-loads guard off the folders tests create and delete The guard scans the whole package, so it could list a temporary __import_hint_integration_* folder that another test was deleting and fail at random. Every __* folder is test scaffolding, so the guard now skips it, and an import from one still counts as a site. * Never let a doctor Fix move a contribution onto a taken name Some `Fix:` lines from `astryx doctor integration validate` still broke something when followed: - A move into a root never checked the target. A theme slug the themes root already has, a topic name the docs root already has, or a component or template name its root already has led to a second descriptor, "both define the topic", or an overwritten file. The same holds when a fix first moves a root out of the components root and then moves a file into it. The fix now names what already holds the name and asks for a new slug or name. - Moving a theme whose source imports a file outside its folder left that import pointing outside, which discovery rejects. The fix now names each such file to copy in and the import to change. - A folder was offered as the components root while it held a `.tsx` no doc covers, which then drew a new warning. Such a folder, one that holds a name twice, or a theme that imports from outside it, is no longer offered as a root. - "Add <Name>.doc.mjs" now also says how to stop another root that reads the components root from reading the new doc too. - A file at the top of the codemods root that a theme there imports is told to move with that theme, not into a version folder as a codemod. Messages that were already right are unchanged. * Treat any thrown value as a failure, undefined included The compiler recorded a failure by its value, so a doc whose check threw `undefined` read as a pass: `integration pack --check` called a package ready that main failed, and a translation that threw `undefined` printed English. A failure is now a flag beside the value, for loads, checks, and translations alike. Describing a thrown value never throws in its place, so a reader rethrows what the doc threw, as main did. * Scan every folder that can ship; skip only test scaffolding Skipping every __* folder kept the guard off the temporary folders a test deletes mid-scan, but it also stopped it reading code in a folder like __generated__, which ships. The guard now skips __tests__, __fixtures__, and folders tests create with mkdtemp, and scans the rest. * Keep the compiler-boundary test off folders other tests delete The test that keeps compiler functions out of api/ and clients/ walked every folder, so it could open a file in a temporary folder the import-hint test was deleting and fail with ENOENT. It now skips folders created with mkdtemp, as the doc-loads guard does. * Convert the 0.6 theme catalog with a codemod, and call its removal breaking 0.6.3 shipped `integration add theme` writing a central themes/manifest.json catalog, so dropping it breaks every integration package made with it. The changeset is now [breaking], so the next release is a minor, and a codemod staged for that release converts a package: `astryx upgrade --from 0.6.3 --path . --apply` writes each theme's typed descriptor from its catalog entry and removes the catalog. It plans the whole package first and changes nothing when an entry cannot convert. A themes root that still holds the catalog now names that command. It is the first core project codemod: it plans whole-file writes and deletions under the package instead of rewriting the files it is handed, and the runner applies or previews the plan as one unit. Integration codemods keep the file contract. `integration add theme` and the codemod render descriptors through one function, and a test holds a second theme to touching no shared file. * List the Tree Table template main added in the doc route inventory Main gained the table-tree page template (#6195), and the inventory test holds every current route to a row, so the core page count goes from 54 to 55. * Record the per-item descriptor rule this change follows (AST-039) The catalog question is decided (no central item catalog in any form), so the spec comes back from its separate PR and ships with the code it describes. Adds the AST-039 draft record, INV24 in the CLI architecture, the typed-doc and no-catalog rules in the CLI conventions, and a pointer in AGENTS.md. FR11 forbids a catalog file under a root, a per-item map or list in the integration manifest, and a hand-synced registry, for every kind; DEC-4 records why and supersedes AST-035 DEC-1. * Keep the CLI README as main has it, plus a pointer to the CLI's own docs The README is the entry point for agents, so it stays short. This drops the generated command reference and API function list this branch had added, with their generator code and tests, and goes back to main's generator and its three tables. A new hand-written section names the command that prints each kind of CLI doc: --help, manifest --json, docs authoring, docs cli-integrations, and docs. The only other change from main is the generated ERR_THEME_INVALID row, which follows the theme descriptor change. * Fail doctor when a CLI doc has no namespace, or one no topic reads Every command, API function, schema, and enum doc the CLI ships has a `namespace` field, and nothing read it. A new doctor check, CLI docs, loads them through the compiler and fails when one has no namespace, names one no `astryx docs` topic reads (cli/commands and cli/api go to `astryx docs cli`, authoring to `astryx docs authoring`), or disagrees with the authoring topic's list. INV25 in the CLI architecture records the rule. On this commit the check fails on this repo on purpose, with 83 findings: the 41 API function docs have no namespace, and 42 docs name "cli", which no topic reads (34 commands, 5 authoring schemas, 2 enums, the output schema). The tests record them; the next commit fixes them and adds the reader. * Give every CLI doc a namespace, and read the cli ones with astryx docs cli Each command doc now declares cli/commands and each API function doc, enum, and the output schema cli/api; the five schemas `astryx docs authoring` reads declare authoring. The new `astryx docs cli` topic is built from the cli/... docs like the authoring topic is from its self-docs: one section per doc, keyed commands-<name> and api-<name>, with usage, options, parameters, returns, throws, examples, and links between a command and the function it runs. The doctor check now passes: all 95 CLI docs are readable, 78 in `astryx docs cli` and 17 in `astryx docs authoring`. The route inventory lists the topic and its 78 sections under the cli namespace. The docsite does not publish the topic yet, because /docs/cli is the @astryxdesign/cli package page. The README points to the topic, and the namespace field's docs say what it now does. * Keep main's latest README and tests working on this branch Main moved 70 commits while this PR was open. The CLI README keeps main's new text (apiVersion, --verbose) under the pointer section. Main's new theme-add binary test now installs a typed descriptor instead of the 0.6 catalog, and its integration-add controls test reads the template's own doc. The load guard lists the three places main now runs code outside its static imports (the manifest command doc, twice, and @babel/parser), and the golden component read shows main's plain "-" for an empty default. --------- Co-authored-by: Joey Farina <[email protected]>
User need
Package authors need one plain-object documentation contract that can feed CLI, agent, site, search, navigation, and validation work without each surface inventing its own identity or schema. Today, the authoring types, runtime validation, provider identity, and legacy topic readers do not share that contract, which permits collisions and silent data loss.
Problem and solution fit
This PR establishes the first contract layer:
NamespaceDoc, plus shared placement, aliases, and audience metadataworkflow,collection, andreferencesemantic blocksproviderIdThe
init --jsoncontract test now runs in a disposable project directory so it cannot write generated agent guidance into the repository under test.Current specification
The public authoring surface remains plain objects as documented by
packages/cli/authoring/index.d.ts. Compatibility and release classification followdocs/specs/AST-017/spec.md.Public delta and caller burden
New public exports include:
NamespaceDocand namespace slot/adoption typesAuthoredDocGraphFields,DocPlacement, andDocAudienceparseNamespaceAstryxIntegration.providerIdfor an explicit package renameExisting authored docs require no rewrite. Minimal migrated generic docs are normalized to the complete public
ReferenceDocshape, and template descriptions remain optional for existing templates.This is classified as breaking on 0.x because exhaustive
AuthoredDocKindandReferenceContentBlockswitches gain new members. Callers must addnamespace,workflow,collection, andreferencecases.Design and alternatives
Authoring stays as typed plain objects. This PR does not add
defineNamespaceDoc,defineReferenceDoc, or block builders.Stable document identity is provider + authored kind + discovery-supplied stable name. Navigation placement, package version, and runtime lifecycle state do not change it. New semantic blocks fail visibly in legacy readers until compiled graph renderers ship; silently accepting and dropping them was rejected.
Evidence
Scope
Testing
pnpm -F @astryxdesign/cli typecheck:authoringpnpm -F @astryxdesign/cli typecheck:strictpnpm -F @astryxdesign/cli typecheck:template-docspnpm check:repopnpm exec vitest run --root . packages/cli --maxWorkers=2