Sort merged pull requests into release note sections
Your task
Every release, someone spends an afternoon turning merged pull requests into release notes. An agent drafts them now, and it must never oversell: a dry, accurate note is fine, an invented feature is not.
Write route_release_note_entries(pr_records): the rule your agent follows to place each merged pull request.
pr_records(list of str): one merged pull request each, writtenlabel|citation|summary, for example"feature|PR-101|adds dark mode toggle to settings". The citation names the pull request the entry came from.- Return one section per record, in input order:
"customer"(the customer-facing notes),"internal"(the internal changelog) or"unsorted"(left for a person).
Rules, for each record:
- Split on
|. If there are not exactly 3 fields:"unsorted". - Trim whitespace from both ends of all 3 fields. Lowercase the label and the summary.
- An empty citation:
"unsorted". - A label of
chore,refactor,test,ci,build,depsorinternal:"internal". - Any label other than
feature,fix,perforui:"unsorted". - A summary that contains
blazing,revolutionary,seamless,best-in-class,game-changingorworld-classanywhere, even inside a longer word:"unsorted". - Otherwise:
"customer".
Examples
route_release_note_entries(pr_records: list[str]) -> list[str]Example 1
Input
route_release_note_entries(["feature|PR-101|adds dark mode toggle to settings", "chore|PR-102|bump lockfile deps", "feature||new export button"])Output
["customer", "internal", "unsorted"]Example 2
Input
route_release_note_entries(["fix|PR-110|Blazing fast search fix"])Output
["unsorted"]Example 3
Input
route_release_note_entries([" perf | PR-7 | reduces page load time "])Output
["customer"]