Skip to content

fix(services): contributor-evidence-graph.ts caps outcomes silently with no warning, unlike the other three capped collections #8887

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

src/services/contributor-evidence-graph.ts:264-273: repos, labels, and paths are each capped (.slice(0, MAX_*)) with a matching warnings entry (e.g. reposCapped ? [...] : []). outcomes = allOutcomes.slice(0, CONTRIBUTOR_EVIDENCE_GRAPH_MAX_OUTCOMES) (line 265) is capped identically but has no corresponding warning branch -- a caller can silently lose outcome relationships past the 50-item bound with no signal in warnings. test/unit/contributor-evidence-graph.test.ts:473-474 explicitly asserts the repo/label/path cap warnings exist but never asserts an outcomes-cap warning.

Requirements

Add a warning entry for the outcomes cap, matching the exact pattern used for repos/labels/paths: ...(outcomes.length < allOutcomes.length ? [\Evidence graph outcome relationships capped at ${CONTRIBUTOR_EVIDENCE_GRAPH_MAX_OUTCOMES}.`] : [])`.

Deliverables

  • The warnings array in contributor-evidence-graph.ts includes an outcomes-cap entry, matching the existing repo/label/path pattern exactly
  • A test forcing more than 50 outcome relationships, asserting the new warning appears in warnings

All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.

Test Coverage Requirements

src/** -- 99%+ patch coverage, branch-counted, on the new warning branch.

Expected Outcome

A caller of the contributor evidence graph sees an explicit warning when outcome relationships were capped, consistent with the existing warning behavior for repos/labels/paths.

Links & Resources

  • src/services/contributor-evidence-graph.ts:264-273
  • test/unit/contributor-evidence-graph.test.ts:473-474

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