Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ These rules apply to every AI agent (hive agents, Copilot CLI, Claude Code, Code
## Working style

- Keep changes surgical and PR-sized; one concern per PR.
- Sign commits (`git commit -s`); PR titles start with an emoji (`✨` feature, `πŸ›` fix, `πŸ“–` docs, `πŸ“` proposal, `🌱` chore, `⚠️` breaking); `πŸ“` is for proposals only.
- Sign commits (`git commit -s`); PR titles start with an emoji (`✨` feature, `πŸ›` fix, `πŸ“–` docs or proposal, `🌱` chore, `⚠️` breaking); `πŸ“` fails the PR Type gate.
- Every PR with a user-visible `src/` code change needs a `changelog.d/<category>-<slug>.md` fragment at the repository root whose body is a single `- ` bullet.
- Do not hand-edit `src/docs` file:line citations; when CI's citation guard reports drift, run `python3 src/scripts/check-docs-citations.py --fix`.

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ When a fix PR merges with `Closes #N`, `Fixes #N`, or `Resolves #N`, the issue c
## Pull requests

- Target `v5` for all code and documentation contributions (the active development branch). `v4` is feature-frozen and accepts security and critical fixes only (see the base-branch table above).
- Start PR titles with the repository's emoji convention: `✨ feature: ...`, `πŸ› fix: ...`, `πŸ“– docs: ...`, `πŸ“ proposal: ...`, `⚠️` for a breaking change, `🌱` for chores and everything else. `πŸ“` is for proposals only β€” a documentation PR is `πŸ“– docs: ...`, and the required `PR Type` check fails the swap.
- Start PR titles with the repository's emoji convention: `✨ feature: ...`, `πŸ› fix: ...`, `πŸ“– docs: ...`, `πŸ“– proposal: ...`, `⚠️` for a breaking change, `🌱` for chores and everything else. The required `PR Type` check accepts only `⚠ ✨ πŸ› πŸ“– πŸš€ 🌱`, so `πŸ“` fails it; the hive rewrites a leading `πŸ“` on `proposal:`/`rfc:` to `πŸ“–`.
- Include `Fixes #<issue>` lines for issues the PR closes.
- Credit the issue's author with a `Co-authored-by:` trailer on the commit when the PR resolves somebody else's issue β€” see [Crediting issue authors](#crediting-issue-authors).
- Describe what changed, why, and how you tested it.
Expand Down
1 change: 1 addition & 0 deletions changelog.d/fixed-17105.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- PR titles for proposals now use the `πŸ“– proposal:` prefix, which the required `PR Type` check accepts (`πŸ“` never passed it); existing `πŸ“ proposal:`/`πŸ“ RFC` titles are still recognised as RFC documents and are rewritten to `πŸ“–` when the hive opens a PR (#17105).
2 changes: 1 addition & 1 deletion src/docs/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ These keys sit next to `rfc_channel_id`. All of them default off, and with none
| `rfc_include_private` | `false` | Authorizes posting RFCs from private repositories to the channel. |

- **Announcer rule.** Rich mode means `rfc_format: card` or `rfc_threads: true`. A hive in rich mode without `rfc_announcer: true` posts nothing and logs `rfc notify: rich mode requires rfc_announcer; not posting` once. It keeps recording transitions, so turning on the announcer later does not backfill old ones. Set `rfc_announcer: true` on exactly one hive per channel. Line mode ignores the key.
- **RFC documents proposed as pull requests (rich mode only).** A pull request is an RFC document when its title starts with `πŸ“ proposal:` or `πŸ“ RFC`, or it adds or changes `docs/rfc-*.md` or `src/docs/rfc-*.md`. The announcer posts `RFC doc proposed: #N <title> - <url> (by @author)` when one opens, titled by the document's first heading when the hive read it, and `RFC doc accepted (RFC #M): ...` when it merges, attributed to the RFC issue its body links (`Closes`/`Refs #M` or an issue URL), or `RFC doc accepted: ...` when it links none the hive tracks. PRs already open when the hive takes its baseline are not announced, and a PR closed without merging posts nothing. Each poll lists pull requests updated since the last poll, plus the changed files of those whose title does not already mark them. Line mode stays issues-only.
- **RFC documents proposed as pull requests (rich mode only).** A pull request is an RFC document when its title starts with `πŸ“– proposal:` or `πŸ“– RFC` (a leading `πŸ“` still counts), or it adds or changes `docs/rfc-*.md` or `src/docs/rfc-*.md`. The announcer posts `RFC doc proposed: #N <title> - <url> (by @author)` when one opens, titled by the document's first heading when the hive read it, and `RFC doc accepted (RFC #M): ...` when it merges, attributed to the RFC issue its body links (`Closes`/`Refs #M` or an issue URL), or `RFC doc accepted: ...` when it links none the hive tracks. PRs already open when the hive takes its baseline are not announced, and a PR closed without merging posts nothing. Each poll lists pull requests updated since the last poll, plus the changed files of those whose title does not already mark them. Line mode stays issues-only.
- **Lifecycle changes (rich mode only).** On the announcer the hive also posts one line per change to an open RFC: `RFC decisions: 2 β†’ 1 open: ...` when the open count under *Decisions for maintainers* changes (at most one per RFC per 30 minutes; changes inside that window collapse into the next notice with the latest count), `RFC target: v5 β†’ v6: ...` and `RFC status: <old> β†’ <new>: ...` (values cut to 100 characters) when the RFC field table changes (a body that no longer parses is not a change), and `RFC needs a decision: ...` when `stage/045-needs-decision` or `needs-human` is added. A retitle posts nothing: with `rfc_threads` it edits the opened card in place and renames the thread. An RFC opened by the same author with the same title (lowercased, RFC prefix, leading bracketed tags such as `[v5 RFC]` or `[v6]` and emoji removed, leading/trailing punctuation stripped, whitespace collapsed) as an open RFC in the same repo opened up to an hour earlier gets no card: the hive posts `RFC duplicate filed as #M - <url>` once into the first RFC's thread, and closing the duplicate posts nothing. These lines are never cards. With `rfc_threads` they go into the RFC's thread; otherwise to the channel. The 30-minute and one-hour windows are fixed. Line mode posts none of them.
- **Private rule (every mode, line mode included).** An RFC in a private or `internal` repository is not posted unless `rfc_include_private: true`. This keeps its title and link out of the channel. The hive resolves each repo's visibility once and caches it for an hour. A repo whose visibility cannot be resolved counts as private (fail closed). A withheld transition is still recorded, so it is never posted later.

Expand Down
2 changes: 1 addition & 1 deletion src/pkg/github/pr_request_watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func TestPRRequestWatcher_QuarantinesAfterMaxAge(t *testing.T) {

// The hive-open-pr choke point corrects a title emoji that contradicts the
// Conventional Commits type (hivecommons/hive#13131: "πŸ“ docs: …" failed the
// repo's PR Type gate; πŸ“ is the proposal emoji, docs is πŸ“–).
// repo's PR Type gate; πŸ“ is not a prefix the gate accepts, docs is πŸ“–).
func TestPRRequestWatcher_CorrectsTitleEmojiToConvention(t *testing.T) {
var createdTitle string
inner := newPRMockServer(t, "", nil)
Expand Down
7 changes: 4 additions & 3 deletions src/pkg/github/pr_title.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ func NormalizePRTitle(title string) string {

// The PR-title emoji convention (CONTRIBUTING.md, AGENTS.md): one emoji
// per change kind, checked by the repository's `PR Type` gate. πŸ“– is
// documentation and πŸ“ is a proposal β€” hivecommons/hive#13131 opened a docs
// PR as "πŸ“ docs: …" and failed the gate on exactly that swap.
// documentation and proposals alike (the gate accepts only the kubebuilder
// set ⚠ ✨ πŸ› πŸ“– πŸš€ 🌱, so πŸ“ fails it, hivecommons/hive#17105);
// hivecommons/hive#13131 opened a docs PR as "πŸ“ docs: …" and failed too.
const (
PRTitleEmojiFeature = "✨"
PRTitleEmojiFix = "πŸ›"
PRTitleEmojiDocs = "πŸ“–"
PRTitleEmojiProposal = "πŸ“"
PRTitleEmojiProposal = "πŸ“–"
PRTitleEmojiBreaking = "⚠️"
PRTitleEmojiOther = "🌱"
)
Expand Down
6 changes: 4 additions & 2 deletions src/pkg/github/pr_title_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ func TestNormalizePRTitleEmoji(t *testing.T) {
// hivecommons/hive#13131: a docs PR opened as πŸ“ failed the PR Type gate.
{name: "docs under proposal emoji", input: "πŸ“ docs: describe Prow dco-signoff labels as coexisting with hive's dco pair", want: "πŸ“– docs: describe Prow dco-signoff labels as coexisting with hive's dco pair"},
{name: "docs already right", input: "πŸ“– docs: explain exit 77", want: "πŸ“– docs: explain exit 77"},
{name: "proposal keeps its emoji", input: "πŸ“ proposal: central stage engine", want: "πŸ“ proposal: central stage engine"},
{name: "rfc is a proposal", input: "πŸ“– rfc: opportunity lab", want: "πŸ“ rfc: opportunity lab"},
{name: "proposal keeps its emoji", input: "πŸ“– proposal: central stage engine", want: "πŸ“– proposal: central stage engine"},
// hivecommons/hive#17105: πŸ“ is not in the PR Type gate's set.
{name: "legacy proposal emoji is normalised", input: "πŸ“ proposal: central stage engine", want: "πŸ“– proposal: central stage engine"},
{name: "rfc is a proposal", input: "πŸ“ rfc: opportunity lab", want: "πŸ“– rfc: opportunity lab"},
{name: "fix under docs emoji", input: "πŸ“– fix(ci): retry GHCR", want: "πŸ› fix(ci): retry GHCR"},
{name: "fix under lock emoji", input: "πŸ”’ fix: polkit defaults", want: "πŸ› fix: polkit defaults"},
{name: "feat", input: "πŸ› feat: owner-only sharing", want: "✨ feat: owner-only sharing"},
Expand Down
8 changes: 5 additions & 3 deletions src/pkg/github/review_priority.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ func reviewRank(c ReviewClass) int {
}

// Title-prefix signals, checked in this order. The emoji set follows
// CONTRIBUTING.md's PR-title convention (πŸ› fix, πŸ“– docs, πŸ“ proposal, ...;
// see PRTitleEmoji* in pr_title.go β€” a proposal triages with docs); the word
// CONTRIBUTING.md's PR-title convention (πŸ› fix, πŸ“– docs or proposal, ...;
// see PRTitleEmoji* in pr_title.go β€” a proposal triages with docs). The
// literal πŸ“ stays so pre-existing "πŸ“ RFC: …" / "πŸ“ Epic: …" titles, which
// have no word-prefix match, still classify by title; the word
// prefixes are the conventional-commit forms agents and humans both use
// ("fix:", "fix(proxy):", "refactor:", "test:") plus the "[lane]" prefix that
// classify.classifyLane already treats as the most explicit routing signal.
Expand All @@ -71,7 +73,7 @@ func reviewRank(c ReviewClass) int {
var (
reviewFixEmojiPrefixes = []string{"πŸ›", "πŸ”’", "πŸ›‘", "πŸš‘", "πŸ”₯"}
reviewTestEmojiPrefixes = []string{"πŸ§ͺ", "βœ…"}
reviewDocsEmojiPrefixes = []string{PRTitleEmojiDocs, PRTitleEmojiProposal, "πŸ—", "β™»"}
reviewDocsEmojiPrefixes = []string{PRTitleEmojiDocs, PRTitleEmojiProposal, "πŸ“", "πŸ—", "β™»"}

reviewFixWordPrefixes = []string{"fix", "hotfix", "bugfix", "security", "sec", "[scanner]", "[ci-maintainer]", "[sec-check]"}
reviewTestWordPrefixes = []string{"test", "tests", "coverage", "[quality]"}
Expand Down
1 change: 1 addition & 0 deletions src/pkg/github/review_priority_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func TestClassifyReviewClass(t *testing.T) {
{"architect prefix", "[architect] refactor: drop dead snapshot dir", nil, ReviewClassRefactorDocs},
{"refactor word", "refactor: collapse duplicate status builders", nil, ReviewClassRefactorDocs},
{"docs emoji", "πŸ“– docs: explain exit 77 netfilter", nil, ReviewClassRefactorDocs},
{"legacy proposal emoji", "πŸ“ RFC: agent memory tiers", nil, ReviewClassRefactorDocs},
{"docs word", "docs: explain exit 77 netfilter", nil, ReviewClassRefactorDocs},
{"docker is not docs", "docker: bump base image", nil, ReviewClassUnknown},
{"strategist prefix", "[strategist] planning: propose triage policy", nil, ReviewClassRefactorDocs},
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/rfcnotify/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func merged(pr Issue, at time.Time) Issue {
}

func TestIsRFCPR(t *testing.T) {
for _, title := range []string{"πŸ“ proposal: Discord RFC cards", "πŸ“ RFC: threads", "πŸ“ rfc - lowercase"} {
for _, title := range []string{"πŸ“ proposal: Discord RFC cards", "πŸ“ RFC: threads", "πŸ“ rfc - lowercase", "πŸ“– proposal: Discord RFC cards", "πŸ“– RFC: threads"} {
if !IsRFCPR(title, nil) {
t.Errorf("IsRFCPR(%q) = false, want true", title)
}
Expand Down
10 changes: 6 additions & 4 deletions src/pkg/rfcnotify/rfcnotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// conventions hivecommons/hive uses (for example #12062 and #16075).
//
// In rich mode an RFC document proposed as a pull request is tracked too:
// a PR is an RFC when its title starts with `πŸ“ proposal:` or `πŸ“ RFC`, or
// a PR is an RFC when its title starts with `πŸ“`/`πŸ“–` then `proposal:` or `RFC`, or
// it adds or changes docs/rfc-*.md or src/docs/rfc-*.md (IsRFCPR).
package rfcnotify

Expand Down Expand Up @@ -189,12 +189,14 @@ func IsRFC(title string, labels []string) bool {
}

// IsRFCPR reports whether a pull request proposes an RFC document: its title
// starts with `πŸ“ proposal:` or `πŸ“ RFC`, or files add or change
// starts with `πŸ“`/`πŸ“–` then `proposal:` or `RFC`, or files add or change
// docs/rfc-*.md or src/docs/rfc-*.md.
func IsRFCPR(title string, files []string) bool {
t := strings.ToLower(strings.TrimSpace(title))
if strings.HasPrefix(t, "πŸ“ proposal:") || strings.HasPrefix(t, "πŸ“ rfc") {
return true
for _, emoji := range []string{"πŸ“", "πŸ“–"} {
if strings.HasPrefix(t, emoji+" proposal:") || strings.HasPrefix(t, emoji+" rfc") {
return true
}
}
for _, f := range files {
if IsRFCDoc(f) {
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/scheduler/gh_auth_instructions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ func TestGHAuthInstructions_DoesNotContradictItselfOnGHTOKEN(t *testing.T) {

// The PR-title convention the repo's PR Type gate enforces is spelled out
// where the agent reads how to open a PR, with the one swap that failed
// hivecommons/hive#13131 called out (πŸ“ is proposal, docs is πŸ“–).
// hivecommons/hive#13131 called out (docs and proposals are both πŸ“–).
func TestGHAuthInstructions_NamesThePRTitleEmojiConvention(t *testing.T) {
block := ghAuthBlock(t)
for _, want := range []string{"✨ feature", "πŸ› fix", "πŸ“– docs", "πŸ“ proposal", "⚠️ breaking", "🌱 chore", `"πŸ“– docs: …"`, "πŸ“ is for proposals only"} {
for _, want := range []string{"✨ feature", "πŸ› fix", "πŸ“– docs", "πŸ“– proposal", "⚠️ breaking", "🌱 chore", `"πŸ“– docs: …"`} {
if !strings.Contains(block, want) {
t.Errorf("hive-open-pr instructions lack %q", want)
}
Expand Down
6 changes: 3 additions & 3 deletions src/pkg/scheduler/lane_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ func (s *Scheduler) ghAuthInstructions() string {
--body "<body citing the issue>" --issues <N>
--body-file <path> is accepted in place of --body, exactly as gh accepts it.
Title convention (the repo's required "PR Type" check reads the first
character): ✨ feature, πŸ› fix, πŸ“– docs, πŸ“ proposal, ⚠️ breaking, 🌱 chore/other.
A docs PR is "πŸ“– docs: …" β€” πŸ“ is for proposals only, and the hive corrects an
emoji that contradicts the type ("πŸ“ docs:" β†’ "πŸ“– docs:") when it opens the PR.
character): ✨ feature, πŸ› fix, πŸ“– docs/proposal, ⚠️ breaking, 🌱 chore/other.
A docs PR is "πŸ“– docs: …" and a proposal is "πŸ“– proposal: …"; the hive corrects
an emoji that contradicts the type ("πŸ“ proposal:" β†’ "πŸ“– proposal:") when it opens the PR.
Pass --issues <N> naming the issue this PR is for whenever the work started
from an issue: the hive verifies the body actually references that issue and
refuses the request otherwise, and it always refuses an empty body.
Expand Down
Loading