Skip to content

feat(signals): recognize testdata paths as test evidence - #2272

Closed
luciferlive112116 wants to merge 7 commits into
JSONbored:mainfrom
luciferlive112116:feat/signals-testdata-test-evidence
Closed

feat(signals): recognize testdata paths as test evidence#2272
luciferlive112116 wants to merge 7 commits into
JSONbored:mainfrom
luciferlive112116:feat/signals-testdata-test-evidence

Conversation

@luciferlive112116

@luciferlive112116 luciferlive112116 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Go and other ecosystems place fixture inputs under a testdata/ directory (sibling to _test.go files). isTestPath in src/signals/test-evidence.ts already recognizes __tests__/, *_test.go, and __snapshots__/, but not testdata/, so PRs that only add or update golden/fixture files under pkg/foo/testdata/ were misclassified as missing test evidence by slop, reviewability, and local-branch scoring surfaces.

This counts any path containing a testdata/ directory segment as test evidence (e.g. pkg/auth/testdata/golden.json and src/testdata/client.ts), matching the Go convention.

Also adds the same testdata/ segment matcher to engine.ts:isTestFile so engine-driven signal paths stay aligned with local-branch.ts (which delegates to isTestPath). No linked-issue rationale changes — those belong in separate PRs (#2117 / #2271).

Distinct from #2105 (fixtures/mocks path segments); this PR only adds the testdata/ directory convention.

No linked issue: small, self-evident slop/test-evidence hardening with no open tracker; linkedIssuePolicy is preferred.

Scope

  • Conventional Commit title (feat(signals): …) for gittensor:feature scoring.
  • Focused change in shared test-path helpers + regression tests only.
  • Follows CONTRIBUTING.md; no UI/API/schema/migration changes.
  • No linked issue — summary explains why.

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage — extended test evidence helpers and local-branch-file-classifiers with positive testdata/ cases and boundary negatives (contestdata, testdatabase); engine isTestFile adds matching testdata/ segment.
  • npm run test:ci

If any required check was skipped, explain why:

  • Node/npm is unavailable in this environment; CI will run the full gate on the PR.

Safety

  • No secrets/wallets/hotkeys; classification-only change on public path metadata.
  • No auth/API/UI change.

Notes

  • Reproduction: isTestPath("pkg/auth/testdata/golden.json") returned false (should be true); after the fix it returns true for any path with a /testdata/ segment on both shared and engine classifiers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dosubot dosubot Bot added the size:XS label Jul 1, 2026
@loopover-orb

loopover-orb Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-01 18:05:57 UTC

4 files · 1 AI reviewer · no blockers · readiness 55/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This change correctly treats `testdata/` as test evidence in both the shared `isTestPath` helper and the engine-local `isTestFile` classifier. The matcher is segment-bounded, so it covers Go-style fixture paths like `pkg/auth/testdata/golden.json` without matching adjacent names like `contestdata` or `testdatabase`. The added regression cases cover the shared helper and the local-branch delegation path; the main remaining maintainability concern is the duplicated classifier logic in `src/signals/engine.ts`.

Nits — 3 non-blocking
  • nit: `src/signals/engine.ts:5474` still duplicates the test-file matcher list instead of sharing `isTestPath`, so this classifier can drift again the next time a convention is added.
  • Consider routing `src/signals/engine.ts:isTestFile` through the same shared helper as `local-branch.ts`, or centralize the segment regex list so `testdata/` cannot fall out of sync again.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ No-issue rationale PR body explains why no issue is linked.
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:XS; no linked issue context).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 24 registered-repo PR(s), 6 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor luciferlive112116; Gittensor profile; 24 PR(s), 7 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: luciferlive112116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: JavaScript, MDX, Python, Rust, TypeScript
  • Official Gittensor activity: 24 PR(s), 7 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (PR #2122, PR #2392)
  • Related work: Titles/paths share 6 meaningful terms. (PR #2122, PR #2389)
  • Related work: Titles/paths share 6 meaningful terms. (PR #2392, PR #2389)
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Triage stale or unlinked PRs.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Check active issues and PRs before submitting.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 1, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@luciferlive112116

Copy link
Copy Markdown
Contributor Author

Fixed gate blocker: removed the contradictory negative assertion for src/testdata/client.ts - any path with a /testdata/ directory segment is valid test evidence per the matcher. Updated PR description accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dosubot dosubot Bot added size:S and removed size:XS labels Jul 1, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@dosubot dosubot Bot added size:XS and removed size:S labels Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.71%. Comparing base (17d70b2) to head (05df84e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2272   +/-   ##
=======================================
  Coverage   95.71%   95.71%           
=======================================
  Files         222      222           
  Lines       24661    24661           
  Branches     8949     8949           
=======================================
  Hits        23605    23605           
  Misses        433      433           
  Partials      623      623           
Files with missing lines Coverage Δ
src/signals/engine.ts 97.36% <ø> (ø)
src/signals/test-evidence.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Minor issues:

The added regression cases cover the shared helper and the local-branch delegation path; the main remaining maintainability concern is the duplicated classifier logic in `src/signals/engine.ts`.

@JSONbored JSONbored closed this Jul 1, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants