Description
The pr_labels_by_actor and issue_labels_by_actor views expose actor_association for label events, but they resolve that role only through contributor_repo_roles. Today contributor_repo_roles is built solely from PR and issue authors.
The service already stores maintainer association evidence from submitted PR reviews and issue/PR thread comments:
reviews.reviewer_association
comments.author_association
If a maintainer reviews or comments in a repository, then applies a label, but has not authored a recent PR or issue in that repository, the label actor can be exposed with actor_association=null even though authoritative role evidence is already stored.
This matters because validators can use label actor attribution to decide whether a scoring label was maintainer-applied.
Steps to Reproduce
- Store a PR review row for actor
42 in reviews with reviewer_association='MEMBER'.
- Store a
label_events row where actor 42 applies a label to a PR in the same repository.
- Do not store any PR or issue authored by actor
42 in that repository.
- Query
pr_labels_by_actor for that PR.
- Repeat the same shape with
comments.author_association='OWNER' and issue_labels_by_actor.
Expected Behavior
Label actor role resolution should use all stored GitHub association evidence for the actor in the repository:
- PR authors
- issue authors
- submitted reviews
- issue/PR thread comments
The label row should return the latest known non-null association for the actor and repository, for example MEMBER or OWNER.
Actual Behavior
The label views only use PR/issue author evidence through contributor_repo_roles. A maintainer who has review or comment evidence but no authored PR/issue row can be returned with actor_association=null.
Environment
- OS: Any server environment
- Runtime/Node version: Node 20, as used by CI
- Browser (if applicable): N/A
Additional Context
Affected code paths:
packages/db/20_view_contributor_repo_roles.sql
packages/db/24_view_pr_labels_by_actor.sql
packages/db/25_view_issue_labels_by_actor.sql
packages/das/src/webhook/handlers/review.handler.ts
packages/das/src/webhook/handlers/comment.handler.ts
packages/das/src/api/miners/miners.service.ts
The downstream gittensor mirror scorer treats actor_association as a trust signal for scoring labels on repositories that do not opt into a trusted label pipeline. Missing maintainer attribution can therefore suppress valid maintainer-applied scoring labels.
Description
The
pr_labels_by_actorandissue_labels_by_actorviews exposeactor_associationfor label events, but they resolve that role only throughcontributor_repo_roles. Todaycontributor_repo_rolesis built solely from PR and issue authors.The service already stores maintainer association evidence from submitted PR reviews and issue/PR thread comments:
reviews.reviewer_associationcomments.author_associationIf a maintainer reviews or comments in a repository, then applies a label, but has not authored a recent PR or issue in that repository, the label actor can be exposed with
actor_association=nulleven though authoritative role evidence is already stored.This matters because validators can use label actor attribution to decide whether a scoring label was maintainer-applied.
Steps to Reproduce
42inreviewswithreviewer_association='MEMBER'.label_eventsrow where actor42applies a label to a PR in the same repository.42in that repository.pr_labels_by_actorfor that PR.comments.author_association='OWNER'andissue_labels_by_actor.Expected Behavior
Label actor role resolution should use all stored GitHub association evidence for the actor in the repository:
The label row should return the latest known non-null association for the actor and repository, for example
MEMBERorOWNER.Actual Behavior
The label views only use PR/issue author evidence through
contributor_repo_roles. A maintainer who has review or comment evidence but no authored PR/issue row can be returned withactor_association=null.Environment
Additional Context
Affected code paths:
packages/db/20_view_contributor_repo_roles.sqlpackages/db/24_view_pr_labels_by_actor.sqlpackages/db/25_view_issue_labels_by_actor.sqlpackages/das/src/webhook/handlers/review.handler.tspackages/das/src/webhook/handlers/comment.handler.tspackages/das/src/api/miners/miners.service.tsThe downstream
gittensormirror scorer treatsactor_associationas a trust signal for scoring labels on repositories that do not opt into a trusted label pipeline. Missing maintainer attribution can therefore suppress valid maintainer-applied scoring labels.