Skip to content

check-branding-drift.mjs's BRANDING_DRIFT_PATHSPECS excludes every apps/* workspace, including apps/loopover-ui's own live 'gittensory' references #7095

Description

@JSONbored

Context

scripts/check-branding-drift.mjs guards against the pre-rebrand "gittensory" string silently creeping back into runtime code after the LoopOver rebrand. Its own header comment states the intended scope: "executable code in src/** and each workspace package's bin/, lib/, src/, scripts/ dirs" (check-branding-drift.mjs:7). This repo's package.json declares two workspace globs: "apps/*" and "packages/*" (package.json:7-10).

But BRANDING_DRIFT_PATHSPECS (check-branding-drift.mjs:30-41) only contains packages/*/bin/**, packages/*/lib/**/*.js, packages/*/lib/**/*.ts, packages/*/src/**/*.ts, and packages/*/scripts/**/*.mjs — every pathspec is scoped to packages/*; none covers apps/* at all, contradicting the header comment's stated "each workspace package" scope. scripts/branding-drift-baseline.json (the generated snapshot this check diffs against) has zero apps/loopover-ui entries, confirming the gap is real, not just theoretical.

This is a live, non-theoretical gap: git grep -il "gittensory" -- 'apps/loopover-ui/src/**' (excluding tests) currently finds 4 files with real "gittensory" references — apps/loopover-ui/src/components/site/api/try-it.tsx:21 (LEGACY_STORAGE_KEY = "gittensory.session_token"), apps/loopover-ui/src/routes/app.index.tsx:443 (a legacy localStorage-key fallback "gittensory.onboarding"), apps/loopover-ui/src/routes/app.runs.tsx:582 ("gittensory.runs.views"), and apps/loopover-ui/src/routes/app.workbench.tsx:36 ("gittensory.workbench.tab"). These four are all legitimate, intentional legacy-localStorage-key references (preserving already-shipped browser storage keys from before the rebrand) — exactly the kind of "permanent historical reference" the check's own baseline-diff mechanism is built to grandfather (mirroring how scripts/branding-drift-baseline.json already grandfathers legitimate hits elsewhere). The bug is not that these four exist; it's that apps/* is invisible to the check entirely, so a new, unintentional "gittensory" reintroduced anywhere under apps/loopover-ui/src (or any other apps/* workspace) — a hardcoded metric name, resource URI, or default string, the exact class of bug check-branding-drift.mjs's own header comment cites #6786 for — would never be caught.

Requirements

  • Add apps/*/src/**/*.ts, apps/*/src/**/*.tsx, and apps/*/scripts/**/*.mjs to BRANDING_DRIFT_PATHSPECS in scripts/check-branding-drift.mjs, mirroring the existing packages/* pathspecs' shape (.ts and .tsx both covered for apps/* since UI workspaces are TSX-heavy, unlike packages/*/src which is .ts-only today).
  • Keep the existing :(exclude)**/*.test.ts / :(exclude)**/*.test.tsx exclusions applying to the new apps/* pathspecs too (they are unscoped ** excludes already, so no separate edit is needed there — verify this in the implementation, don't assume).
  • Regenerate scripts/branding-drift-baseline.json via npm run branding-drift:update in the same PR, so the four pre-existing legitimate apps/loopover-ui/src hits (try-it.tsx, app.index.tsx, app.runs.tsx, app.workbench.tsx) are grandfathered at their current count rather than failing CI on this PR itself.
  • Do not add apps/*/bin/** or apps/*/lib/** — no apps/* workspace currently has those directories; only add pathspecs for directories that actually exist, matching this script's existing don't-guess convention.

Deliverables

  • BRANDING_DRIFT_PATHSPECS covers apps/* the same way it already covers packages/*
  • scripts/branding-drift-baseline.json regenerated and committed, including the four pre-existing apps/loopover-ui/src legacy-key hits
  • Test asserting a fixture "gittensory" string under an apps/*/src path is detected as new drift (mirroring this file's existing test coverage for packages/* pathspecs)

Test Coverage Requirements

99%+ Codecov patch coverage on every changed line and branch in scripts/check-branding-drift.mjs, plus the regression test above. The regenerated branding-drift-baseline.json is a generated data file, not measured by Codecov.

Expected Outcome

npm run branding-drift:check (part of test:ci) actually scans every apps/* workspace's src/scripts directories, not just packages/*, so a future unintentional "gittensory" reintroduction in apps/loopover-ui, apps/loopover-extension, apps/loopover-miner-extension, or apps/loopover-miner-ui is caught instead of silently shipping.

Links & Resources

  • scripts/check-branding-drift.mjs:7 (header comment's stated "each workspace package" scope), :30-41 (BRANDING_DRIFT_PATHSPECS, the array to extend).
  • package.json:7-10 — the workspaces field confirming apps/* is a real workspace glob.
  • apps/loopover-ui/src/components/site/api/try-it.tsx:21, apps/loopover-ui/src/routes/app.index.tsx:443, app.runs.tsx:582, app.workbench.tsx:36 — the four current, legitimate hits that need baselining once the gap is closed.
  • scripts/branding-drift-baseline.json — the generated artifact to regenerate via npm run branding-drift:update.

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