Skip to content

Docs graph for the CLI and integrations, template replacement, and themeTemplate export (AST-046, AST-047, AST-035) - #6626

Merged
josephfarina merged 9 commits into
mainfrom
docs/cli-docs-tree
Sep 29, 2026
Merged

josephfarina merged 9 commits into
mainfrom
docs/cli-docs-tree

Conversation

@josephfarina

@josephfarina josephfarina commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

One PR for the CLI docs graph, on top of #6695 (merged). It also folds in #6265 (integrations replace Core templates) and #6702 (export themeTemplate), so there's one review, one spec approval, and one merge.

The docs graph

Every doc is a node with a stable identity (its provider, kind, and name) and one home in a tree. Every read is one level and ends with its moves. Links between docs are typed, so the CLI derives every command it shows.

  • astryx docs cli: Guides (integrations, writing-docs) and Reference (commands, api)
  • astryx docs cli/api/functions/search: one function
  • astryx docs theme: in text, a topic's sections; astryx docs theme quick-start reads one, and --full reads it all
  • astryx docs acme: an integration's own namespace, beside cli
  • astryx docs unorganized: every topic that no section places yet, each under its own name

Every read ends with Up, Previous, Next, and Related, and --json carries them as links. astryx search lands on the smallest part that answers (one section or one tree page), with the command that reads it, the command that opens the level above it, and the package that wrote it.

Nobody lists children or links by hand. A namespace doc declares its slots and adoption rules; commands and API docs are adopted by the namespace they already declare; a guide names its parent with placement; every other topic sits in Unorganized.

JSON keeps its 0.6 shapes

#6695 restored the published 0.6 docs contracts, and this PR keeps every one of them. docs(topic) and astryx docs <topic> --json still return the whole topic (docs.detail), and --index returns its section list. ReferenceContentBlock keeps its six members, graph-only blocks stay in GraphContentBlock for namespace docs, and section lookup keeps #6695's legacy order. links is a new field on each read, and astryx docs --json keeps data as the topic list, every entry of which reads as a topic; the docs tree's top-level namespaces are in a new meta.namespaces. The CLI's text changes: a bare text read lists a topic's sections, and the topic list is tree-first.

What's in it

  • Tree compiler (foundation/doc-compiler/tree.mjs). A doc's home is its explicit placement, else exactly one adoption rule, else, for a topic, the generated Unorganized level. A bad placement, two adopters, or two docs at one route is a compiler diagnostic. Each node's id is its DocId, built from its provider's ProviderId; a generated level such as cli/api/functions or unorganized has id: null.
  • Typed links. Inside a section's text, a doc links another doc by identity with {@link [<provider>:]<kind>:<name>}, in prose, list items, and table cells. Every read prints the astryx docs command that opens the target. A link without a provider resolves against the provider that wrote its section, so an extension's links open the extension's own docs. A link that names no doc prints as written, and an older CLI prints any link as plain text. The 29 hand-written astryx docs links in the CLI's own docs are now typed links, and so are the command ↔ function links. A typed field's bare name (fn, command, related) resolves among the kinds its field allows; FunctionDoc.related names functions only.
  • Integration docs join the graph. An integration can ship namespace docs and place its guides in them. They show up in astryx docs beside cli, with the same moves, links, and search, named by the integration's provider id. The CLI keeps its own routes (cli, unorganized, and its topics' names, compared without case, as topic names are): an integration namespace or topic that claims one is withdrawn with a diagnostic both doctors show, and the name opens the CLI's doc. astryx integration add doc <name> --parent <namespace> writes a placed guide, and the namespace doc when the package has none; it finds an existing namespace by its name, uses its guides slot (or its only slot that takes a guide), and refuses a file of that name that isn't the namespace. astryx docs names any package whose docs failed to load.
  • Every doc has a home. Every flat topic, the CLI's and each integration's, sits in the generated Unorganized level under its own name, in list order, with a way up and across. Placing a topic in a real section takes it out.
  • Doctor reports the whole graph. astryx doctor warns on any tree error, a CLI doc with no route, or a link that names no doc; astryx doctor integration docs runs the same checks inside an integration package. These findings are new, so they warn (as fix(cli): preserve 0.6 docs compatibility #6695 requires): a project that passed before keeps passing. For the same reason, root astryx doctor warns, rather than fails, on an integration contribution problem; astryx doctor integration validate, docs, and templates fail on it.
  • What fails the build. In this repository, test/docs-graph.test.mjs walks the graph from the top and opens every topic, section, namespace, and typed doc, following every child, move, and link. It fails on:
    • a move or link that doesn't open, or a link that names no doc;
    • a Next whose read names a different Previous;
    • a typed edge that names no doc;
    • an astryx command in the docs, the CLI's hint lines, or AGENTS.md that names a command or option the CLI doesn't have;
    • any .doc.mjs the CLI ships that the walk can't reach.
  • A CLI that reads the docs tree. A CLI release that doesn't read the docs tree can hide every doc topic of a package that ships a namespace doc or a placed guide, in text and JSON. I measured one package shape on each: published 0.6.3 hides them when the package ships a namespace doc, with nothing saying why (a placed guide alone reads as a flat topic there), and builds of main before this PR, which report version 0.6.3 like the canaries, hide them for a placed guide too, naming the file only in astryx doctor. astryx integration add doc --parent declares "@astryxdesign/cli": ">=0.7.0" as an optional peer, and astryx integration pack --check fails a package that ships a namespace doc or a placed guide when its peer range admits an older CLI. The same gate covers a template that sets replaces, which AST-035 requires. The peer is optional on purpose: an integration doesn't need the CLI at runtime, and a required peer would install the CLI into every app that uses the package, and fail those installs outright on an older CLI. So this is an author-time gate plus an install-time warning (npm prints an ERESOLVE warning beside 0.6.3; pnpm and yarn warn about the unmet peer). No peer constraint can protect a one-off npx @astryxdesign/[email protected] run, because that CLI is outside the app's dependency tree. An author who wants installs to fail can mark the peer required; the gate accepts either. A test keeps the 0.7.0 floor honest: it fails if the pending changesets would release the CLI below it.
  • A guard for the 0.6 union. test/authoring-types/reference-content-block.exhaustive.ts is an exhaustive switch over ReferenceContentBlock with a never default. Widening the union (type and schema together) fails typecheck:authoring on that file; restoring it passes.
  • New guide: astryx docs cli/writing-docs. It covers how the graph works, how to add, place, and link a doc, how to keep reads short and findable, and how to check your docs.
  • Docsite. It reads each CLI topic through the docs API, so a link renders as the command that opens its doc. The token docs generator writes the same typed links. Tree typed docs (cli/commands/*, cli/api/*) and the Unorganized level have no docsite page yet; that is the docsite phase.
  • Specs: AST-046 (the tree, CLI and integrations, every doc with a home) and AST-047 (navigable output: moves, typed links, nothing stale, every doc one walk away) are draft; AST-035 (template replacement, from feat(cli): let integrations replace Core templates #6265) is current, as approved. cli-surface INV25–INV27.

Also in this PR

  • Integrations replace Core templates (from feat(cli): let integrations replace Core templates #6265). An integration template can set replaces to a Core template id. Unqualified lookup and discovery use a valid replacement; --package @astryxdesign/core still selects the original. The replacing template keeps its own id and package, and template list shows replaces. Missing targets, type mismatches, duplicate claims, and a claim from a template that can't be used (its metadata doesn't load, or it has no type) fail closed and show in astryx doctor integration templates.
  • themeTemplate() is exported from @astryxdesign/cli/api (from feat(cli): export themeTemplate from public API #6702), with runtime and packed-type guards. Its entry leaves the CLI structure check's known-gap list.

Agent test

I gave the CLI to AI agents with no context, in an empty project, with the same goals each round: things like the signature of the function behind astryx search, the error code for an unknown docs section, what a codemod does with a protected file, and how to link docs. From round 5 on, one goal was to write a guide for an integration package so it shows up under the package's own section and links to the astryx doctor docs, then prove it before shipping. A wrapper logged every call. Each round had 3 fresh agents.

Round Goals found Calls per agent Biggest single read Would an agent be happy?
1. The tree, before these changes 26 of 27 28 8 KB 3 yes
2. Search by section and tree page 27 of 27 25 27 KB (a whole guide) 3 yes
3. Moves on every read 27 of 27 26 67 KB (a whole topic) 3 yes
4. Every topic reads one level 27 of 27 28 8 KB 3 yes
5. Typed links, integration docs, writing guide (10 goals) 30 of 30 56, including building a package 9 KB 3 yes, mostly
6. On #6695: JSON unchanged, inline links (10 goals) 30 of 30 (one partly) 84, including building a package 38 KB (the whole-topic JSON read one goal asked for) 3 mostly yes

Round 6 found these, and all are fixed here:

  • integration add run in a folder with no package.json wrote into the app above it. It now refuses and names the package it found.
  • doctor integration docs --help said a broken link exits 1; it warns.
  • The writing guide pointed at a help page with no checks in it, and stated its "no commands in prose" rule too broadly.
  • Search hits for flat topics had no package or parent, guides had no Previous or Next, and some function rows lacked their name(): label.
  • astryx docs doctor gave no suggestion; it now names cli/commands/doctor.
  • The astryx init reminder printed inside integration packages.

Each fix has a test.

Still open: text-mode errors don't show the error code; JSON prints a resolved link as command text, so a program can't tell it was a link; a typed doc's read doesn't print the {@link} target that names it; search ranking misses some paraphrases ("protected file"); integration pack --check doesn't run the docs checks.

Spec review

Five reviewers checked the first ready version against AST-046, AST-047, AST-035, the 0.6 compatibility promises, and the CLI rules. They found these, and all are fixed here, each with a test that fails when the fix is taken out:

  • An integration namespace or topic could take a CLI route (cli, unorganized, or a CLI topic's name), and astryx doctor integration docs missed it.
  • integration add doc --parent found the namespace by its file name, so it could write a broken placement and still print [ok].
  • astryx docs --json listed namespaces in data, where every entry must read as a topic.
  • Root astryx doctor failed a project that passed before when an integration had a contribution problem.
  • A template whose metadata didn't load dropped its replaces, so a sibling could take the target.
  • integration pack --check passed a package with a placed guide and no CLI peer.
  • Smaller: top-level namespace search hits had no parent, --lang dense listed sections where --dense reads whole, and a section read of a typed doc suggested nothing.
  • Later passes over the fixes found that a claim differing only in case (a topic named CLI) still took a CLI route; that reading a template doc that doesn't validate could let it print into --json output; that a namespace placed in a withdrawn namespace stayed in the tree; that a name a topic answers to through replaces could be listed as another integration's namespace that it then couldn't open; that after two replacements of one topic, or a chain of them, only the last replaced name was reserved and the CLI's own links to the topic printed as written; and that a topic replacing another could answer to a CLI route, so astryx docs cli opened it. All are fixed too, and reads, the topic list, and search now ask one function who holds a name.

Breaking

  • astryx docs cli-integrations is now astryx docs cli/integrations, with no alias. Every reference moved with it, and the graph walk fails on any left behind.
  • Template replacement changes which template an unqualified id selects (from feat(cli): let integrations replace Core templates #6265).

Both are in minor changesets; the rest are patch.

Merge order

#6616, #6617, and #6695 are merged, and this PR is rebased on main after them. Nothing else is waiting on it.

Not in this PR

A top-level browse, moving the docsite onto the tree, rendering namespace blocks and collection blocks, and the other commands adopting AST-047's moves.

Test plan

  • vitest for packages/cli: 336 files and 5,403 tests green, including the graph walk, the link tests, and the integration tree tests (a package whose provider id differs from its name, an extension link, a broken link, claims on cli, unorganized, and a CLI topic's name in any case, a namespace placed in a withdrawn one, and every name another topic answers to through replaces, including a topic replaced twice and through a chain, with a walk that checks the CLI's own links still open, and a replacement that answers to a CLI route).
  • check:repo, check:cli-structure, check:knowledge, check:changesets, eslint, tsc (strict, json-api, authoring, template-docs), sync:api-types, the readme check, and cli-api-types-verify.
  • The union guard: widening ReferenceContentBlock fails typecheck:authoring; restoring it passes.
  • The docs-tree gate: dropping its placed-guide or namespace-doc branch, or weakening its range check, fails its tests; a real npm install beside @astryxdesign/[email protected] warns with the optional peer and refuses with a required one.
  • Each spec review fix: a mutant that takes it out fails its test (31 of 31).
  • The test-ui gates (copyright, exports sync, token docs sync, lab readiness), docsite generate and test (43 files), and the docsite production build up to its TypeScript step. On my local test box, static generation crashes a Next build worker with SIGSEGV for this head and for clean main alike, with 23 workers and with 4, so CI's docsite-browser job is the proof.
  • The agent test above.

@vercel

vercel Bot commented Sep 25, 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 Sep 29, 2026 3:36am UTC

Request Review

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

astracat-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Sep 29, 2026, 4:17 AM UTC

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval needs:design-review Affects visuals — Design should review labels Sep 25, 2026
github-actions Bot added a commit that referenced this pull request Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

1 of 420 shot(s) changed. View the report

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

component story theme mode pixels
SideNav Resizable in AppShell probe dark 3,208
SideNav — Resizable in AppShell — probe dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

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

github-actions Bot added a commit that referenced this pull request Sep 25, 2026
github-actions Bot added a commit that referenced this pull request Sep 25, 2026
@josephfarina josephfarina changed the title Read the CLI docs as a tree, one level at a time (AST-043) Read the CLI docs as a tree, one level at a time (AST-044) Sep 25, 2026
github-actions Bot added a commit that referenced this pull request Sep 25, 2026
@josephfarina josephfarina changed the title Read the CLI docs as a tree, one level at a time (AST-044) Read the CLI docs as a tree, one level at a time (AST-046) Sep 28, 2026
github-actions Bot added a commit that referenced this pull request Sep 28, 2026
@josephfarina josephfarina changed the title Read the CLI docs as a tree, one level at a time (AST-046) Read the CLI docs as a tree, one level at a time (AST-046, AST-047) Sep 28, 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.

Review

This is ready to merge. The docs graph gives every doc one derived home and one route, every docs and search read now ends with runnable moves, and links between docs are typed by identity instead of hand-written — while the 0.6 JSON contracts (docs(topic) returning the whole topic, --index, and the ReferenceContentBlock union) are preserved and guarded by tests, including the graph walk that opens every doc, move, and link the CLI ships.

Worth knowing for consumers:

  • The two breaking changes are labelled as such, with minor changesets and migration guidance: astryx docs cli-integrations is now astryx docs cli/integrations with no alias (the old name fails with a suggestion of the new route), and a winning integration template replacement removes the Core entry from the default template list, with explicit --package @astryxdesign/core selection still reaching the original.
  • Integration authors gain namespace docs and placed guides beside cli, template replacement with deterministic precedence and fail-closed invalid claims, and a pack check that refuses a namespace-doc package whose declared CLI peer range admits a CLI too old to read it — closing the silent doc loss seen on 0.6.3.
  • themeTemplate() is now exported from @astryxdesign/cli/api, closing the documented parity gap for astryx theme template.
  • Doctor's new graph findings warn rather than fail, so projects that passed before keep passing.

The still-open items noted in the PR (text-mode errors not printing the error code, resolved JSON links reading as plain command text, and pack check not itself running the docs checks) are reasonable follow-ups and do not block this change.

[Automated review]

- The CLI keeps its routes: an integration namespace or topic that claims cli,
  unorganized, or a CLI topic's name is withdrawn with a duplicate_route
  diagnostic filed against the integration, so both doctors show it, and a
  read, list entry, or search hit of that name resolves to the CLI's doc.
- integration add doc --parent finds the namespace by its name, uses its
  guides slot or its only slot that takes a guide, and refuses a file of that
  name that is not the namespace.
- astryx docs --json keeps data as the topic list; the docs tree's top-level
  namespaces move to meta.namespaces.
- Root astryx doctor warns, rather than fails, on integration contribution
  problems, so a project that passed before keeps passing.
- A template whose metadata does not load, or that has no type, still counts
  its replaces, so the target stays Core (AST-035 FR4).
- integration pack --check requires a CLI that reads the docs tree for a
  namespace doc or a placed guide, and one that reads replaces for a template
  that sets it.
- Top-level namespace search hits carry parent; --lang dense reads whole like
  --dense; a section read of a typed doc suggests the doc itself; the writing
  guide drops two maintainer-only lines.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Sep 29, 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.

Review

Approval is waiting on one maintainer decision, not on code changes.

This PR's main deltas — the docs tree and navigable docs/search output, and integration templates replacing Core templates — are governed by amendments to current spec records carried in this PR itself (the cli-surface docs-tree invariants and the new current template-replacement record). Under the repository's spec process, a PR that creates or changes a current record needs spec-owner approval for its exact current revision, and any new commit invalidates an earlier approval. The approval on record covers the previous revision; the latest fix commit superseded it, and the spec-owner approval status for the current revision is still pending, waiting for an engineering owner.

What must be settled: an eligible spec owner — the author is one, via the /approve-spec comment for the current revision, or another owner by review — approves those current-record amendments for this revision. Once that is recorded, this review's other conclusions stand as they are:

  • The newest revision fixes the earlier findings well: astryx docs --json keeps data as the topic list (namespaces now in meta.namespaces), an integration can no longer take the CLI's own routes, a template whose metadata does not load still keeps its replacement target on Core, and pack check now also gates placed guides and replaces on a CLI range that can read them.
  • The 0.6 JSON contracts are preserved and guarded, the two breaking changes (the cli-integrations route rename and template-replacement selection) carry minor changesets with migration guidance, and themeTemplate() is now exported, closing a documented parity gap.
  • The graph-walk, template, pack-check, and compatibility test suites and the repository checks pass locally on this revision, and no concrete defect was found.

[Automated review]

…hrough the guarded importer

- Topic names already compare without case in the catalog, so the tree now
  does too: an integration topic named CLI or Unorganized claims the CLI's
  routes and is withdrawn with a duplicate_route diagnostic, and reads, the
  topic list, and search resolve it to the CLI's doc. tree.getFolded looks a
  route up without case.
- declaredReplacement reads a template doc that does not validate through
  importDocModule, so anything the doc prints while it loads goes to stderr
  and --json stdout stays clean, and a .doc.ts under node_modules is read
  through jiti.
- Tests: case and spelling variants of the CLI's routes, in the tree and
  end to end with both doctors; a printing .doc.ts outside node_modules; a
  .doc.ts under node_modules that computes its replacement; and --parent with
  more than one slot that takes a guide.

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

Review

Approval is waiting on one maintainer decision, not on code changes.

This PR's main deltas — the docs tree and navigable docs/search output, and integration templates replacing Core templates — are governed by amendments to current spec records carried in this PR itself (the cli-surface docs-tree invariants and the new current template-replacement record). Under the repository's spec process, a PR that creates or changes a current record needs spec-owner approval for its exact current revision, and any new commit invalidates an earlier approval. The approval on record covers an earlier revision; newer commits superseded it, and the spec-owner approval status for the current revision is still pending, waiting for an engineering owner.

What must be settled: an eligible spec owner — the author is one, via the /approve-spec comment for the current revision, or another owner by review — approves those current-record amendments for this revision. Once that is recorded, this review's other conclusions stand as they are:

  • The newest revision strengthens the earlier fixes: an integration can no longer take the CLI's own routes even with a differently-cased name, and an unusable template doc is read through the guarded importer, so its declared replacement still keeps its target on Core and anything it prints while loading cannot pollute --json output.
  • The 0.6 JSON contracts are preserved and guarded, the two breaking changes (the cli-integrations route rename and template-replacement selection) carry minor changesets with migration guidance, and themeTemplate() is now exported, closing a documented parity gap.
  • The graph-walk, template, pack-check, and compatibility test suites and the repository checks pass locally on this revision, and no concrete defect was found.

[Automated review]

github-actions Bot added a commit that referenced this pull request Sep 29, 2026
…ame for its replacement

- Namespaces go into the tree parents first, so a namespace placed in a
  withdrawn namespace is withdrawn too, with an invalid_placement
  diagnostic, before any doc is placed in it.
- A name a topic answers to through replaces is that topic's route: another
  doc that claims it is withdrawn with a duplicate_route diagnostic, so the
  topic list, reads, and search agree with the tree.
- AST-046 FR11 states the order between integrations and the replaces rule.
- Tests: a namespace chain under a withdrawn namespace; a replaced name
  claimed by another integration's namespace, in the tree and end to end;
  a route read in another case.

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

Review

Approval is waiting on one maintainer decision, not on code changes.

This PR's main deltas — the docs tree and navigable docs/search output, and integration templates replacing Core templates — are governed by amendments to current spec records carried in this PR itself (the cli-surface docs-tree invariants and the new current template-replacement record). Under the repository's spec process, a PR that creates or changes a current record needs spec-owner approval for its exact current revision, and any new commit invalidates an earlier approval. The approval on record covers an earlier revision; newer commits superseded it, and the spec-owner approval status for the current revision is still pending, waiting for an engineering owner.

What must be settled: an eligible spec owner — the author is one, via the /approve-spec comment for the current revision, or another owner by review — approves those current-record amendments for this revision. Once that is recorded, this review's other conclusions stand as they are:

  • The newest revision strengthens the earlier fixes: a namespace placed in a withdrawn namespace is now withdrawn too (transitively, so nothing can sit under a route that no longer exists), and a name a topic answers to through replaces is kept for that topic, so the topic list, reads, and search agree with the tree.
  • The 0.6 JSON contracts are preserved and guarded, the two breaking changes (the cli-integrations route rename and template-replacement selection) carry minor changesets with migration guidance, and themeTemplate() is now exported, closing a documented parity gap.
  • The graph-walk, template, pack-check, and compatibility test suites and the repository checks pass locally on this revision, and no concrete defect was found.

[Automated review]

…ough the same names

- DocsCatalog.aliasesOf returns every name the catalog answers to for a
  topic: the topics it replaced, directly or through a chain. After two
  replacements of one topic, or a chain of them, the replacement's entry
  only records the last name it replaced.
- The docs tree reserves all of those names for the topic, so another
  integration's namespace of such a name is withdrawn with a duplicate_route
  diagnostic, and a typed link to any of them resolves to the topic, so the
  CLI's own links keep opening it.
- Tests: every alias reserved in the tree; end to end, a topic replaced twice
  and through a chain, with a walk over every topic read that finds no raw
  link; search skips a topic whose route another doc owns.
github-actions Bot added a commit that referenced this pull request Sep 29, 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.

Review

Approval is waiting on one maintainer decision, not on code changes.

This PR's main deltas — the docs tree and navigable docs/search output, and integration templates replacing Core templates — are governed by amendments to current spec records carried in this PR itself (the cli-surface docs-tree invariants and the new current template-replacement record). Under the repository's spec process, a PR that creates or changes a current record needs spec-owner approval for its exact current revision, and any new commit invalidates an earlier approval. The approval on record covers an earlier revision; newer commits superseded it, and the spec-owner approval status for the current revision is still pending, waiting for an engineering owner.

What must be settled: an eligible spec owner — the author is one, via the /approve-spec comment for the current revision, or another owner by review — approves those current-record amendments for this revision. Once that is recorded, this review's other conclusions stand as they are:

  • The newest revision strengthens the earlier fixes: every name a replaced topic answers to, directly or through a chain of replacements, is now reserved for that topic, links to any of those names resolve to it, and search no longer offers a topic whose route another doc owns, so the topic list, reads, links, and search agree with the tree.
  • The 0.6 JSON contracts are preserved and guarded, the two breaking changes (the cli-integrations route rename and template-replacement selection) carry minor changesets with migration guidance, and themeTemplate() is now exported, closing a documented parity gap.
  • The graph-walk, template, pack-check, and compatibility test suites and the repository checks pass locally on this revision, and no concrete defect was found.

[Automated review]

…at answers to a CLI route

- nameOwner decides who answers to a name a reader types: the tree node at
  that route, compared without case, else the topic the name is an alias of,
  unless the tree gave that topic's own route to another doc. Reads use it,
  and the topic list and search offer a topic only when its own name opens
  it, so all three agree on every name.
- A topic that answers to a route the CLI's own docs keep through replaces
  (directly or through a chain) gets a duplicate_route diagnostic against
  the topic, which both doctors show; the name opens the CLI's doc.
- Tests: one package whose topic replaces its own cli and Unorganized topics,
  a second package continuing the chain, reads in both cases, every listed
  topic reading back as itself, and both doctors.

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

Review

Approval is waiting on one maintainer decision, not on code changes.

This PR's main deltas — the docs tree and navigable docs/search output, and integration templates replacing Core templates — are governed by amendments to current spec records carried in this PR itself (the cli-surface docs-tree invariants and the new current template-replacement record). Under the repository's spec process, a PR that creates or changes a current record needs spec-owner approval for its exact current revision, and any new commit invalidates an earlier approval. The approval on record covers an earlier revision; newer commits superseded it, and the spec-owner approval status for the current revision is still pending, waiting for an engineering owner.

What must be settled: an eligible spec owner — the author is one, via the /approve-spec comment for the current revision, or another owner by review — approves those current-record amendments for this revision. Once that is recorded, this review's other conclusions stand as they are:

  • The newest revision strengthens the earlier fixes: one function now decides who holds a docs name, so reads, the topic list, and search agree on every name, and a topic that answers through replaces to a route the CLI's own docs keep gets a doctor diagnostic naming it, in one package or across a chain of replacements.
  • The 0.6 JSON contracts are preserved and guarded, the two breaking changes (the cli-integrations route rename and template-replacement selection) carry minor changesets with migration guidance, and themeTemplate() is now exported, closing a documented parity gap.
  • The graph-walk, template, pack-check, and compatibility test suites and the repository checks pass locally on this revision, and no concrete defect was found.

[Automated review]

github-actions Bot added a commit that referenced this pull request Sep 29, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec f52303d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Sep 29, 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.

Review

This is ready to merge. The docs graph gives every doc one derived home and one route, every docs and search read now ends with runnable moves, and links between docs are typed by identity instead of hand-written — while the 0.6 JSON contracts (docs(topic) returning the whole topic, --index, and the ReferenceContentBlock union) are preserved and guarded by tests, including the graph walk that opens every doc, move, and link the CLI ships. The spec-owner approval for the current-record amendments in this PR has now been recorded for this revision, so the hold from the previous review is resolved.

Worth knowing for consumers:

  • The two breaking changes are labelled as such, with minor changesets and migration guidance: astryx docs cli-integrations is now astryx docs cli/integrations with no alias (the old name fails with a suggestion of the new route), and a winning integration template replacement removes the Core entry from the default template list, with explicit --package @astryxdesign/core selection still reaching the original.
  • Integration authors gain namespace docs and placed guides beside cli, template replacement with deterministic precedence and fail-closed invalid claims, and a pack check that refuses a package shipping those features whose declared CLI peer range admits a CLI too old to read them — closing the silent doc loss seen on 0.6.3.
  • Reads, the topic list, and search now agree on who holds a docs name, and a topic that answers through replaces to a route the CLI's own docs keep gets a doctor diagnostic naming it, in one package or across a chain of replacements.
  • themeTemplate() is now exported from @astryxdesign/cli/api, closing the documented parity gap for astryx theme template.
  • Doctor's new graph findings warn rather than fail, so projects that passed before keep passing.

The still-open items noted in the PR (text-mode errors not printing the error code, resolved JSON links reading as plain command text, and pack check not itself running the docs checks) are reasonable follow-ups and do not block this change.

[Automated review]

@josephfarina
josephfarina merged commit 533ecc7 into main Sep 29, 2026
48 checks passed
@github-actions
github-actions Bot deleted the docs/cli-docs-tree branch September 29, 2026 06:24
josephfarina added a commit that referenced this pull request Oct 1, 2026
Main's #6626 added the integration-issues check, which runs the validators this
PR first added as a new integrations check (as a warning, per AST-046 FR8). This
merge drops the duplicate check and keeps the three cases main still reports
silently: an installed dependency whose manifest cannot be loaded, roots that
are missing on disk, and integrations provider-identity could not read.

This branch was successfully deployed

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant