[PR #1243] [MERGED] fix: deterministic file-path rules for PR area labels #1195

Closed
opened 2026-03-22 16:03:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1243
Author: @profvjreddi
Created: 3/16/2026
Status: Merged
Merged: 3/16/2026
Merged by: @profvjreddi

Base: devHead: fix/auto-label-deterministic-area


📝 Commits (1)

  • aa9758d fix: use deterministic file-path rules for PR area labels

📊 Changes

1 file changed (+133 additions, -93 deletions)

View changed files

📝 .github/workflows/auto-label.yml (+133 -93)

📄 Description

Summary

  • PR area labels now use deterministic file-path prefix matching instead of relying on the LLM
  • The LLM (llama3.1:8b) was mis-tagging PRs (e.g., #1242 got area: socratiq instead of area: book) because it only saw title/body text — no file paths
  • LLM is still used for type labels (bug, improvement, etc.) and issue area labels (where no file paths exist)

How it works

New step fetches changed files via pulls.listFiles() and matches against prefix rules:

File prefix Area label
book/tools/ area: tools
.github/ area: tools
book/ area: book
tinytorch/ area: tinytorch
kits/ area: kits
labs/ area: labs
socratiq/ area: socratiq
website/ area: website

Majority-wins when a PR touches multiple areas. Falls back to LLM only if no prefix matches.

Test plan

  • Run workflow manually on #1242 to verify it would pick area: book
  • Open a test PR touching tinytorch/ files to verify correct tagging
  • Open a test issue (no files) to verify LLM fallback still works

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1243 **Author:** [@profvjreddi](https://github.com/profvjreddi) **Created:** 3/16/2026 **Status:** ✅ Merged **Merged:** 3/16/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/auto-label-deterministic-area` --- ### 📝 Commits (1) - [`aa9758d`](https://github.com/harvard-edge/cs249r_book/commit/aa9758dba25a79a3e485f1d594568f8d6ead4708) fix: use deterministic file-path rules for PR area labels ### 📊 Changes **1 file changed** (+133 additions, -93 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/auto-label.yml` (+133 -93) </details> ### 📄 Description ## Summary - PR area labels now use **deterministic file-path prefix matching** instead of relying on the LLM - The LLM (`llama3.1:8b`) was mis-tagging PRs (e.g., #1242 got `area: socratiq` instead of `area: book`) because it only saw title/body text — no file paths - LLM is still used for **type labels** (bug, improvement, etc.) and **issue area labels** (where no file paths exist) ## How it works New step fetches changed files via `pulls.listFiles()` and matches against prefix rules: | File prefix | Area label | |-------------|-----------| | `book/tools/` | `area: tools` | | `.github/` | `area: tools` | | `book/` | `area: book` | | `tinytorch/` | `area: tinytorch` | | `kits/` | `area: kits` | | `labs/` | `area: labs` | | `socratiq/` | `area: socratiq` | | `website/` | `area: website` | Majority-wins when a PR touches multiple areas. Falls back to LLM only if no prefix matches. ## Test plan - [ ] Run workflow manually on #1242 to verify it would pick `area: book` - [ ] Open a test PR touching `tinytorch/` files to verify correct tagging - [ ] Open a test issue (no files) to verify LLM fallback still works --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 16:03:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#1195