Skip to content

[Bug] Draft PRs are ingested as regular OPEN PRs, allowing WIP drafts to affect scoring/collateral #1259

@admiral223

Description

@admiral223

Summary

Draft pull requests are currently treated the same as normal OPEN pull requests in the mirror/scoring pipeline. This means work-in-progress drafts can be counted in open-PR paths even though they are not ready for review.

Why this is a problem

  • It creates a mismatch between contributor workflow (Draft = WIP) and scoring behavior.
  • Draft PRs can influence open-PR collateral/threshold logic before they are review-ready.
  • It allows low-signal draft activity to affect miner evaluation.

Evidence

  • Draft PR exists in tracked repos (example: entrius/gittensor PR Fix: register issue no build artifact #271 is draft).
  • Mirror PR model stores state but no draft flag:
    • packages/das/src/entities/PullRequest.entity.ts
    • packages/db/02_pull_requests.sql
  • Backfill query reads state but not isDraft:
    • packages/das/src/webhook/github-fetcher.service.ts
  • Loader classifies by state only; OPEN goes directly to open PR bucket:
    • gittensor/validator/oss_contributions/mirror/load.py

Reproduction

  1. Create/open a draft PR in a mirrored repository.
  2. Let mirror ingestion/backfill run.
  3. Run validator scoring/load flow.
  4. Observe PR is handled as ordinary OPEN PR (no draft distinction).

Expected behavior

Draft PRs should be represented explicitly and either:

  • excluded from open-PR scoring/collateral paths, or
  • handled by a clearly defined draft-specific policy.

Suggested fix

  1. Add is_draft field in mirror DB/entity.
  2. Populate it from:
    • GraphQL isDraft (backfill/metadata paths)
    • webhook pull_request.draft (event path)
  3. Update gittensor mirror load/scoring to apply intended policy for draft PRs.
  4. Add tests covering OPEN + isDraft=true vs OPEN + isDraft=false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions