Skip to content

feat(config): add review.labeling_rules deterministic label suggestions #2045

Description

@JSONbored

Add review.labeling_rules — a list of {label, when} entries with deterministic path/title/keyword criteria that SUGGEST (and optionally auto-apply when autoLabelEnabled) labels on a PR. No scoring labels. Empty (default) ⇒ no labels suggested (byte-identical). Decomposed from #1959; complements the existing PR-type labeler.

Deliverables

  • Add a LabelingRule type ({ label, whenPaths?, titleContains?, descriptionContains? }) and labelingRules: LabelingRule[] to FocusManifestReviewConfig in src/signals/focus-manifest.ts (mirror the parseReviewPreMergeChecks shape at :703)
  • Parse review.labeling_rules with public-safe label strings, deterministic when criteria, and the MAX_PATH_INSTRUCTIONS cap; refuse any scoring/reserved label names
  • Evaluate rules deterministically at the review path; apply labels only when repository autoLabelEnabled is set (respect src/settings/pr-type-label.ts wiring), otherwise surface as advisory suggestions
  • Wire reviewConfigToJson round-trip + present + EMPTY literals; unit tests for each when criterion, autoLabel on/off arms, cap, invalid entry drop
  • Document review.labeling_rules in .gittensory.yml.example

References

  • src/signals/focus-manifest.ts:703 (parseReviewPreMergeChecks pattern)
  • src/signals/focus-manifest.ts:89 (autoLabelEnabled field key)
  • src/settings/pr-type-label.ts
  • part of #1959 (epic #1953)

Part of #1959.


size: M · gittensor:feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions