Repository navigation
fix(cli): the documented hook example referenced a hook that does not exist - #4742
Merged
Merged
Conversation
… exist `astryx hook useToggle --json` fails with ERR_UNKNOWN_HOOK — there is no useToggle in the design system (the CLI helpfully suggests useToast/useTheme). It shipped in two places a consumer sees: the examples in `astryx manifest --json`, which agents read to learn the CLI, and the hook CommandDoc that feeds --help. Both now use useFocusTrap, which resolves. Found by executing every documented example rather than reading them: the drift harness compares a CommandDoc's flags and args against the live CLI, but nothing ran the examples, so an example naming a nonexistent subject looked fine. Co-authored-by: Cursor <cursoragent@cursor.com>
josephfarina
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
August 5, 2026 21:43
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
astryx hook useToggle --jsonfails withERR_UNKNOWN_HOOK— there is nouseTogglein the design system (the CLI suggestsuseToast/useThemeinstead).It shipped in two places a consumer actually sees:
astryx manifest --json, which agents read to learn the CLIhookCommandDoc that feeds--helpBoth now use
useFocusTrap, which resolves.How it was found
By executing every documented example instead of reading them. The drift harness compares a CommandDoc's flags and args against the live CLI, but nothing ever ran the examples — so an example naming a nonexistent subject looked perfectly valid.
The example-runner is now part of the Night Watch Doc Reviewer's CLI check, so this class of rot gets caught nightly.
Pre-existing:
manifest.mjshas carried it since #4623, and #4714 propagated it into the CommandDoc.Test plan
astryx hook useFocusTrap --jsonreturns ahook.detailenvelope, exit 0hookno longer reports. The 5 that remain reference files/packages absent from an empty sandbox (theme build ./src/themes/ocean.ts), which is legitimately illustrativecheck:cli-structuregreen,typecheck:strict0Made with Cursor