Skip to content

check-ui-mcp-version-copy.mjs's SCAN_TARGETS is blind to apps/loopover-ui/content's *.mdx docs since the fumadocs migration #7093

Description

@JSONbored

Context

scripts/check-ui-mcp-version-copy.mjs guards against stale @loopover/mcp version strings creeping back into UI copy (README badges, install commands, MCP client args). Its SCAN_TARGETS constant (check-ui-mcp-version-copy.mjs:15-19) is ["README.md", "packages/loopover-mcp/README.md", "apps/loopover-ui/src"], and isTextSource (check-ui-mcp-version-copy.mjs:144-146) only matches /\.(md|ts|tsx|js|jsx|json)$/ — no .mdx.

Since the fumadocs-mdx content-pipeline migration (5003fabe, "feat(docs): migrate loopover-ui docs pages to fumadocs-mdx content pipeline"), the docs website's prose content lives in apps/loopover-ui/content/docs/*.mdx — a directory that sits alongside apps/loopover-ui/src, not inside it. A sibling script, scripts/check-docs-drift.mjs, was correctly updated for this move (its DOCS_ROUTES_DIR = "apps/loopover-ui/content/docs", check-docs-drift.mjs:239), but check-ui-mcp-version-copy.mjs's SCAN_TARGETS was never touched, so it is now structurally blind to that entire directory — doubly so, since even if the directory were added, .mdx files still wouldn't pass isTextSource.

This is a live, non-theoretical gap: 10 real files under apps/loopover-ui/content/docs/*.mdx currently reference @loopover/mcp or loopover-mcp (confirmed via git grep), including install-command snippets this exact script is designed to catch drift in — e.g. apps/loopover-ui/content/docs/quickstart.mdx:13,16 (npx -y @loopover/mcp@latest --help, npm i -g @loopover/mcp@latest), apps/loopover-ui/content/docs/miner-quickstart.mdx:23-24, apps/loopover-ui/content/docs/beta-onboarding.mdx:24, and apps/loopover-ui/content/docs/mcp-clients.mdx. Every one of these currently uses the correct @latest/no-version form (so there is no CURRENT stale-version failure), but a future PR that hardcodes a version or drops @latest in any of these 10 files — the exact regression class collectVersionCopyFailures (check-ui-mcp-version-copy.mjs:82-124) exists to catch — would pass npm run test:ci's ui:version-audit step with zero signal.

Requirements

  • Add "apps/loopover-ui/content" to SCAN_TARGETS in scripts/check-ui-mcp-version-copy.mjs.
  • Extend isTextSource's regex from /\.(md|ts|tsx|js|jsx|json)$/ to also match .mdx (e.g. /\.(md|mdx|ts|tsx|js|jsx|json)$/), so .mdx files are scanned regardless of which directory contains them.
  • Do not alter collectVersionCopyFailures's matching logic itself — this issue is scoped to source-file discovery (SCAN_TARGETS + isTextSource), not the stale-version patterns.

Deliverables

  • SCAN_TARGETS includes apps/loopover-ui/content
  • isTextSource matches .mdx files
  • Test asserting collectSourceFiles picks up at least one real file under apps/loopover-ui/content/docs/*.mdx (e.g. quickstart.mdx)
  • Test asserting a deliberately-introduced stale version string in a fixture .mdx file (mirroring check-ui-mcp-version-copy-script.test.ts's existing collectVersionCopyFailures fixtures) is flagged as a failure

Test Coverage Requirements

99%+ Codecov patch coverage on every changed line and branch in scripts/check-ui-mcp-version-copy.mjs (root-level scripts/** is inside vitest.config.ts's coverage include list and is measured by Codecov, unlike apps/**), plus the two regression tests above.

Expected Outcome

npm run ui:version-audit (and its test:ci invocation) actually scans every .mdx file under apps/loopover-ui/content, so a future hardcoded/stale @loopover/mcp version string in the docs content pipeline is caught the same way it already is in apps/loopover-ui/src and the two README files.

Links & Resources

  • scripts/check-ui-mcp-version-copy.mjs:15-19 (SCAN_TARGETS), :144-146 (isTextSource) — the two lines to change.
  • scripts/check-docs-drift.mjs:239 (DOCS_ROUTES_DIR) — the sibling drift-checker that was correctly updated for the same content-directory move.
  • test/unit/check-ui-mcp-version-copy-script.test.ts — existing test file to extend.
  • apps/loopover-ui/content/docs/quickstart.mdx, miner-quickstart.mdx, beta-onboarding.mdx, mcp-clients.mdx — real files with live @loopover/mcp references this check should be scanning today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions