forge_notify: replace issue-tag comments with doc references (tracker-tag lint)

This commit is contained in:
damocles 2026-06-13 12:10:23 +02:00 committed by mara
commit e9dec143e5

View file

@ -32,7 +32,7 @@ const TOKEN_RETRY_MAX: u32 = 20;
/// a `new <kind>` label. Later activity that lands on the state-change
/// path because it carries no `latest_comment_url` (e.g. a bodiless
/// review submission) fires well outside this window, so we must not
/// claim it's "new" — see #1637.
/// claim it's "new" — see docs/forge.md, "new vs activity on".
const NEW_ITEM_TOLERANCE_SECS: i64 = 120;
/// Spawn point: called once from `hive serve`. Returns immediately if the forge is not
@ -588,7 +588,8 @@ fn format_state_change_notification(
// time. A review submitted with no body carries no
// `latest_comment_url`, so it lands here instead of on the comment
// path — and its event time is well after `created_at`. Labeling
// that "new PR" is misleading (#1637): agents dismiss it as a
// that "new PR" is misleading (see docs/forge.md, "new vs activity
// on"): agents dismiss it as a
// duplicate of the original open notification. When we can't confirm
// creation, fall back to a neutral "activity on" label.
let looks_new = notification_is_creation(notif, subject.as_ref());
@ -647,7 +648,8 @@ fn format_state_change_notification(
/// `created_at`: within `NEW_ITEM_TOLERANCE_SECS` ⇒ creation. When
/// either timestamp is missing or unparseable we default to `true`,
/// preserving the prior "new" behavior rather than masking a genuine
/// new item behind the neutral fallback. See #1637.
/// new item behind the neutral fallback. See docs/forge.md, "new vs
/// activity on".
fn notification_is_creation(
notif: &serde_json::Value,
subject: Option<&serde_json::Value>,
@ -1083,7 +1085,7 @@ mod tests {
let subject = serde_json::json!({ "created_at": "2026-06-13T11:18:40+02:00" });
assert!(notification_is_creation(&fresh, Some(&subject)));
// Review hours later on the same PR → not a creation (#1637).
// Review hours later on the same PR → not a creation.
let later = serde_json::json!({ "updated_at": "2026-06-13T14:55:00+02:00" });
assert!(!notification_is_creation(&later, Some(&subject)));