Skip to content

fix(review): exclude bare .ts app-source files from isVisualPath - #6330

Merged
loopover-orb[bot] merged 1 commit into
mainfrom
fix/visual-path-classifier-scope
Jul 16, 2026
Merged

fix(review): exclude bare .ts app-source files from isVisualPath#6330
loopover-orb[bot] merged 1 commit into
mainfrom
fix/visual-path-classifier-scope

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • isVisualPath's app-folder pattern (apps/*/) is extension-agnostic, so a bare .ts file living inside an app's own src/ tree — a data/logic/hooks/test file, never a route (TanStack Router's file-based routing is always .tsx/.jsx) — also matched, triggering the full screenshot-capture pipeline even though it renders nothing.
  • Confirmed live on fix(ui): apply the pre-2000 placeholder rule in normalizeFreshnessSources metagraphed#6036: a non-visual data-layer fix touching only apps/ui/src/lib/metagraphed/queries.ts + its .test.ts sibling burned Browser Rendering on a meaningless before/after of the unchanged homepage, despite the bot's own screenshot-table-gate.ts correctly calling this PR out of scope for screenshot evidence.
  • New pattern excludes apps/*/src/**/*.ts specifically (never .tsx) — an app-root .ts config file (tailwind.config.ts, vite.config.ts) still matches since it isn't under src/, and every non-.ts file anywhere in the app tree is unaffected.

Course-correction from the issue's original proposal: #6322 initially proposed requiring a route/page-shape path OR a front-end extension. While investigating, I found the existing test suite (test/unit/visual-paths.test.ts) explicitly and intentionally asserts apps/loopover-ui/README.md and apps/ui/components.json (neither route-shaped, neither a front-end extension) as true — that broader proposal would have regressed those. The narrower apps/*/src/**/*.ts exclusion implemented here fixes the exact observed bug without touching any existing, intentionally-asserted case.

Closes #6322

Test plan

  • test/unit/visual-paths.test.ts extended: the exact fix(ui): apply the pre-2000 placeholder rule in normalizeFreshnessSources metagraphed#6036 file paths now false; a sibling .tsx under the same src/ tree, app-root .ts config files, and a non-.ts file under src/ all remain true (100% stmt/branch/line coverage on the changed file)
  • test/unit/queue-3.test.ts + test/unit/queue-4.test.ts (the integration tests exercising isVisualPath end-to-end via buildCapture) pass unchanged — both use .tsx route fixtures, unaffected by this narrowing
  • npm run typecheck clean
  • Full local npm run test:ci gate green

Closes #6322

isVisualPath's app-folder pattern (apps/*/) is extension-agnostic, so a
bare .ts file living inside an app's own src/ tree -- a data/logic/hooks/
test file, never a route (TanStack Router's file-based routes are always
.tsx/.jsx) -- also matched, triggering the full screenshot-capture
pipeline even though it renders nothing.

Confirmed live on JSONbored/metagraphed#6036: a non-visual data-layer fix
touching only apps/ui/src/lib/metagraphed/queries.ts + its .test.ts
sibling burned Browser Rendering on a meaningless before/after of the
unchanged homepage, despite the bot's own screenshot-table-gate correctly
calling this PR out of scope for screenshot evidence.

Excludes apps/*/src/**/*.ts specifically (never .tsx) -- an app-root .ts
config file (tailwind.config.ts, vite.config.ts) still matches since it
isn't under src/, and every non-.ts file anywhere in the app tree is
unaffected.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 16, 2026
@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-16 02:16:35 UTC

2 files · 1 AI reviewer · no blockers · readiness 86/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a narrow, well-targeted fix to isVisualPath: it adds a NON_VISUAL_APP_SOURCE regex that excludes bare .ts files under an app's own src/ tree from the visual-path match, while leaving .tsx files, app-root .ts config files, and non-.ts files under src/ untouched. The logic is correctly ordered (exclusion checked before the OR-list of VISUAL_PATTERNS) and the accompanying tests directly cover the reported bug case (JSONbored/metagraphed#6036) plus the boundary cases that must remain true. The PR closes issue #6322 and explicitly avoids regressing the existing README.md/components.json assertions called out in the description.

Nits — 4 non-blocking
  • The regex `/^apps\/[^/]+\/src\/.*\.ts$/i` uses `.*` which is fine here but relies on path separators always being `/`; worth a one-line comment noting paths are assumed POSIX-normalized (probably already true given the rest of the file uses `/`).
  • The doc comments on lines 9-20 are quite long for a single regex; could be trimmed to keep the file scannable, though the detail is genuinely useful given the subtlety of the bug.
  • Consider a test asserting a bare `.ts` file directly at `apps/ui/src/` (no subdirectory) still excludes, e.g. `apps/ui/src/index.ts`, to confirm `.*` correctly matches zero-length paths after `src/`.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6322
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 42 registered-repo PR(s), 34 merged, 443 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 42 PR(s), 443 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Partially addressed
The PR excludes bare .ts files under apps/*/src/ (fixing the exact #6036 case) but explicitly diverges from the issue's proposal, which required narrowing to route/page-shape or front-end-extension matches broadly (e.g. .py, .json, .md files anywhere in apps/*/ would still incorrectly match per the PR's own tests for README.md/components.json), and it does not perform the requested cross-check aga

Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 42 PR(s), 443 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Then work through the remaining 2 steps in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit b88b319 into main Jul 16, 2026
15 checks passed
@loopover-orb
loopover-orb Bot deleted the fix/visual-path-classifier-scope branch July 16, 2026 02:16
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.60%. Comparing base (44570d0) to head (cc3236c).
⚠️ Report is 42 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6330   +/-   ##
=======================================
  Coverage   95.60%   95.60%           
=======================================
  Files         596      596           
  Lines       47121    47123    +2     
  Branches    14999    15000    +1     
=======================================
+ Hits        45049    45051    +2     
  Misses       1290     1290           
  Partials      782      782           
Flag Coverage Δ
shard-1 43.95% <50.00%> (-0.19%) ⬇️
shard-2 36.80% <50.00%> (+0.29%) ⬆️
shard-3 32.35% <50.00%> (-0.05%) ⬇️
shard-4 33.60% <100.00%> (-0.80%) ⬇️
shard-5 31.84% <50.00%> (-0.05%) ⬇️
shard-6 45.19% <50.00%> (+0.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/visual/paths.ts 100.00% <100.00%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tighten isVisualPath so a non-visual apps/*/ file (e.g. a .ts lib file) doesn't trigger screenshot capture

1 participant