Dashboard › cli › Distillation
d7890500-7740-4cc8-8e38-be294055e444["lore_tm_v1_GXhBviHF9f-zTQDQb-kLXm81toa8w8HOU8ql5LmvlWU"]
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/check-fragments.ts, a tsx validation script for documentation fragments.packages/cli/script/check-fragments.ts validates 5 conditions: 1. every CLI route has a corresponding command fragment plus index.md; 2. every command fragment corresponds to a route or index.md; 3. fragments contain neither YAML frontmatter nor <!-- GENERATED:END -->; 4. required top-level fragments exist; 5. fragment content covers every route subcommand, with warnings by default and errors under --strict.../src/app.js and ../src/lib/introspect.js, the script checks for src/generated/skill-content.ts; if absent, it creates src/generated recursively and writes export const SKILL_FILES: [string, string][] = [];\n.RouteInfo and RouteMap from ../src/lib/introspect.js, imports DOCS_FRAGMENTS from ./paths.js, and defines command fragments under ${DOCS_FRAGMENTS}/commands.help route via SKIP_ROUTES = new Set(["help"]), obtains routes through extractAllRoutes(routeMap), and expects one .md fragment per remaining route plus index.md.${DOCS_FRAGMENTS}/commands cannot be read, the script emits ERROR: Fragment directory not found: ${FRAGMENTS_DIR} and exits with status 1.Missing fragment: ... (route "..." exists but has no fragment file) and unmatched files as Stale fragment: ... (no matching route found — delete it or add the route).---\ntitle: or beginning with ---\n as forbidden YAML frontmatter, and flags the generated marker <!-- GENERATED:END -->.REQUIRED_TOP_LEVEL_FRAGMENTS currently contains exactly ["configuration"]; the checker requires ${DOCS_FRAGMENTS}/configuration.md for the generated configuration.md page.FENCED_CODE_BLOCK_RE = /^({3,}|~{3,}).\n[\s\S]?\n\1\s*$/gmandstripCodeBlocks(md)` to remove fenced code blocks before checking markdown headings, preventing bash comments inside code blocks from being mistaken for headings.fragmentMentionsSubcommand(content, routeName, command, isDefaultCommand) accepts subcommand documentation in this order: 1. a case-insensitive full CLI reference such as sentry dashboard revisions anywhere in the fragment; 2. for a default command, a regex-matched bare sentry <route> invocation not followed by a subcommand; 3. a level 1–4 markdown heading outside fenced code blocks containing the leaf subcommand name.getMultiCommandRoutes() skips standalone routes only when they have at most 1 command and that command’s path is exactly sentry <route-name>; all other routes are checked for subcommand coverage.findDefaultInRouteMap(target) calls target.getDefaultCommand() and compares its object identity with each target.getAllEntries() item’s sub.target, returning sub.name.original; getDefaultCommandName(routeName) locates the top-level route and delegates to that function.cmd.examples.length > 0; for commands without examples, it derives the subcommand text from cmd.path, compares the leaf name with the route’s default command, and invokes fragmentMentionsSubcommand().Fragment missing subcommand coverage: ${fragmentPath}, a comma-separated Not documented: list, and a hint using sentry ${routeName} ${missing[0]}. These findings go to warnings normally or errors when process.argv.includes("--strict").⚠; validation errors are printed with ✗ and cause exit status 1. On success it reports All ${actualFragments.size} command fragment files valid (${routeNames.size} routes + index) and All ${REQUIRED_TOP_LEVEL_FRAGMENTS.length} top-level fragment(s) valid.