Skip to content

fix: trust bot-applied labels on entrius/* mirror repos (#911) - #913

Merged
anderdc merged 6 commits into
entrius:testfrom
plind-junior:fix/trusted-label-pipeline-911
May 1, 2026
Merged

fix: trust bot-applied labels on entrius/* mirror repos (#911)#913
anderdc merged 6 commits into
entrius:testfrom
plind-junior:fix/trusted-label-pipeline-911

Conversation

@plind-junior

Copy link
Copy Markdown
Contributor

Summary

Closes #911. Bot-applied scoring labels on entrius/* mirror repos are dropped at scoring time because the agentic-maintainer labeling worker has no row in contributor_repo_roles, so its label events surface with actor_association=NULL and fail the maintainer-association gate in _resolve_maintainer_set_label.

This adds an opt-in trusted_label_pipeline flag on RepositoryConfig and threads it through mirror label resolution. Default is off, so community repos running attacker-controllable auto-labelers (release-drafter, actions/labeler, etc.) keep the maintainer gate. Flipped on for the four existing entrius/* mirror repos whose labels come from an internal worker.

Changes

  • RepositoryConfig: add trusted_label_pipeline: bool = False with a docstring spelling out the threat model and when it's safe to flip on.
  • mirror/scoring.py: extract _label_actor_trusted(label, repo_config) helper; _resolve_maintainer_set_label now takes repo_config as a required arg and consults the helper.
  • master_repositories.json: set trusted_label_pipeline: true on entrius/allways, entrius/allways-ui, entrius/gittensor, entrius/gittensor-ui. No other repo or weight changes.
  • Tests: parametrized 12-case truth table for _label_actor_trusted (every actor_association × trusted/untrusted), end-to-end check that _calculate_pr_multipliers threads the flag, and a live-config invariant that any future entrius/* repo must opt in.

Related Issues

Fixes #911

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • Tests added/updated
  • Manually verified

Adds trusted_label_pipeline flag to RepositoryConfig and threads it through
mirror label resolution so the entrius agentic-maintainer labeling worker
(actor_association=NULL since it has no contributor_repo_roles row) can set
scoring labels on entrius/* repos. Default-off keeps the maintainer-association
gate in place for community repos that run attacker-controllable auto-labelers.
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Apr 30, 2026
…lper

- Restore additional_acceptable_branches dropped during rebase (jupyterlab,
  FastGPT, monero, nextcloud/desktop, nextcloud/server, zed) — added upstream
  in entrius#831 and lost when this branch was based on a stale snapshot.
- Add entrius/das-github-mirror at weight 0.2 with trusted_label_pipeline
  (deliverable entrius#4 from issue entrius#911).
- Inline _label_actor_trusted into _resolve_maintainer_set_label per the
  codebase's single-use-helper convention (entrius#818/entrius#811/entrius#801); drop the
  now-redundant TestLabelActorTrusted truth table since coverage lives in
  TestLabelResolution end-to-end.
Covered end-to-end by test_calculate_multipliers_threads_trusted_flag,
which exercises both flag values plus the multiplier application.
…test

- Shorten RepositoryConfig docstring; threat model lives in
  _resolve_maintainer_set_label so don't restate it.
- Drop test_trusted_label_pipeline_explicit_true: only verifies dataclass
  kwarg passthrough; True path is already covered by the loader test and
  the live-config invariant on entrius/* repos.

@anderdc anderdc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving — fully addresses all five deliverables from #911. Solid commit history with reasoning citations, clean diff, threat model preserved (community repos keep the maintainer gate via default-false flag).

@anderdc
anderdc merged commit 47e2e1a into entrius:test May 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bot-applied labels don't affect scoring multiplier (label_multiplier always 1.0x)

2 participants