Skip to content

fix(gittensor): drop empty-name repos from contributor snapshot#445

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
philluiz2323:fix/gittensor-snapshot-empty-repo-filter
Jun 7, 2026
Merged

fix(gittensor): drop empty-name repos from contributor snapshot#445
JSONbored merged 2 commits into
JSONbored:mainfrom
philluiz2323:fix/gittensor-snapshot-empty-repo-filter

Conversation

@philluiz2323
Copy link
Copy Markdown
Contributor

Summary

buildGittensorContributorSnapshot (src/gittensor/api.ts:246) filtered the snapshot's repositories list by activity only, not by a valid repoFullName -- unlike the pull-request and issue lists right beside it, which both require a non-empty repoFullName:

repositories: (...).map(toRepositoryEvaluation).filter((repo) => repo.pullRequests + repo.openIssues + repo.closedIssues > 0), // no name guard
pullRequests: (...).filter((pr) => pr.repoFullName && pr.number > 0),    // guarded
issues: (...).filter((issue) => issue.repoFullName && issue.number > 0), // guarded

#437 made repositoryFullName an untrusted unknown and coerces malformed/missing values to "" (asString), but did not add the empty-name filter to the repositories list. So a malformed repo evaluation with nonzero stats leaks in as { repoFullName: "", ... }. Closes #444.

Observable impact

snapshot.repositories feeds buildGittensorContributorProfile (src/signals/engine.ts):

  • reposTouched (engine.ts:1119) keeps the empty-name repo (nonzero stats), so it leaks into registeredRepoActivity.reposTouched as "".
  • evidenceScore = clamp(... + reposTouched.length * 10 + ..., 0, 100) (engine.ts:1137): one phantom repo adds +10 on a 0-100 scale, which can bump trustSignals.level a tier (new < 25, emerging 25-59, established >= 60).

Reachable because #437 itself treats upstream Gittensor repository names as untrusted JSON that can be malformed.

Scope

Validation

  • npx tsc --noEmit -- clean.
  • npx vitest run test/unit/gittensor-api.test.ts -- 8/8.
  • Full suite -- 1207 passed, 1 skipped (excluding the two unparseable upstream test files and one unrelated mcp-cli timeout that passes in isolation).
  • Branch coverage at/above the 97% gate; gittensor/api.ts 100% line.

Safety

  • Behavior is unchanged for well-formed snapshots (valid repo names pass the added guard exactly as before). Only malformed/empty-name entries are now dropped, consistent with the PR/issue lists.
  • No response-shape change; the snapshot simply no longer contains phantom ""-named repositories.

@philluiz2323 philluiz2323 requested a review from JSONbored as a code owner June 6, 2026 11:40
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 6, 2026
@github-actions github-actions Bot added the gittensor:bug Gittensor-scored bug fix label Jun 6, 2026
@gittensory
Copy link
Copy Markdown

gittensory Bot commented Jun 6, 2026

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #445 is no longer open. No action.

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

@gittensory gittensory Bot added the gittensory:reviewed Gittensor contributor context label Jun 6, 2026
Copy link
Copy Markdown
Owner

@JSONbored JSONbored left a comment

Choose a reason for hiding this comment

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

@philluiz2323 this is good to land.

A few notes:

  • The empty-name repository guard matches the existing PR/issue filtering behavior.
  • The updated test now verifies malformed repo names are dropped instead of carried into the contributor snapshot.
  • This resolves #444 cleanly without changing behavior for valid repository records.
  • No code changes requested.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 7, 2026
@JSONbored JSONbored merged commit 6526f00 into JSONbored:main Jun 7, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 7, 2026
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 gittensory:reviewed Gittensor contributor context lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Gittensor snapshot keeps empty-name repos, inflating evidenceScore

2 participants