Skip to content

fix(scripts): check-branding-drift.ts scans packages/*/src/**/*.ts but not the matching .tsx files #8657

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

scripts/check-branding-drift.ts's BRANDING_DRIFT_PATHSPECS (lines 29-42) lists both
"apps/*/src/**/*.ts" and "apps/*/src/**/*.tsx" for the apps/* scope, but only
"packages/*/src/**/*.ts" for the packages/* scope — no .tsx counterpart — despite the script's
own header explicitly framing packages/*/src/ as mirroring the top-level apps/* scope.

packages/loopover-ui-kit/src/**/*.tsx — 48 non-test component files (e.g. alert-dialog.tsx,
sidebar.tsx, card.tsx) — is exactly the shared design-system surface this check exists to
protect; the script's own header cites #6786 (a hardcoded pre-rebrand brand string that slipped
through) as the motivating incident. None of these 48 files are ever passed to the git grep -ciI gittensory -- <pathspecs> scan (scanBrandingHits, line 60), because the .tsx pathspec for
packages/* simply doesn't exist.

Consequence: a hardcoded "gittensory" (or any other stale pre-rebrand) string reintroduced into any
ui-kit .tsx component — consumed by every secondary UI in the repo per the design-system-reuse
house rule — would never trip this CI check.

Requirements

  • Add "packages/*/src/**/*.tsx" to BRANDING_DRIFT_PATHSPECS, matching the existing apps/*
    pattern.
  • Confirm no existing .tsx file under any packages/*/src/ currently contains a flagged string
    (i.e. this addition should not immediately fail CI against the real current tree — if it does,
    fix the real hit as part of this same PR, since a new stale string discovered by the fix isn't a
    separate follow-up).

Deliverables

  • BRANDING_DRIFT_PATHSPECS includes "packages/*/src/**/*.tsx".
  • Running the real drift check against the current repo tree with this pathspec added produces
    no new hits (or, if it does, the real stale string(s) found are fixed in this same PR).
  • A new test in the existing branding-drift test harness, using a git-grep-stub fixture, proving
    a .tsx fixture file under packages/x/src/ is now included in scanBrandingHits's scanned
    set — currently excluded.

All three Deliverables are required in the same PR.

Test Coverage Requirements

scripts/** and its test suite are measured by codecov/patch (99%+ target). The new fixture test
must exercise the added pathspec directly (a .tsx file under a packages/*/src/ fixture path),
not just re-assert already-covered .ts/apps/* cases.

Expected Outcome

check-branding-drift.ts scans packages/*/src/**/*.tsx the same way it already scans
apps/*/src/**/*.tsx, so the shared loopover-ui-kit design-system components — the highest-reuse
surface in the repo — are actually covered by the rebrand-drift check its own header says protects
exactly this kind of file.

Links & Resources

  • scripts/check-branding-drift.ts:29-42 (BRANDING_DRIFT_PATHSPECS), :60 (scanBrandingHits)
  • packages/loopover-ui-kit/src/**/*.tsx (the 48 currently-unscanned files)
  • Motivating incident cited by the script's own header: fix(mcp): rename enrichment-analyzers resource URI to loopover:// #6786
  • See [[feedback-secondary-uis-must-reuse-main-site-design-system]] for why ui-kit coverage matters
    repo-wide

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions