docs(#3255): correct the reaper invariant the swarm webhook test guards

The test's doc named knowledge::ensure_webhook as one of two hive-side
reapers. That function is gone; its replacement matches the full URL and
cannot touch another hive's hook.

The assertion arm stays. The hazard is not what this repository's source
says, it is what is deployed — a hive still running the previous version
reaps by suffix until it is upgraded, so the arm guards the transition
rather than a current code path. Recorded when to drop it.
This commit is contained in:
atlas 2026-08-19 19:26:21 +02:00 committed by mara
commit 84125b0806
2 changed files with 27 additions and 21 deletions

View file

@ -170,13 +170,14 @@ pub(super) enum DeliveryKind {
/// The route prefix a registered `target_url` must point at.
///
/// ⚠️ Deliberately **not** `/webhook/knowledge` or `/webhook/config-pr`, the
/// paths the per-hive receivers use. Both hive-side registrars delete any
/// hook whose URL ends with *their* path but has a different base — see
/// `hive-c0re`'s `forge::ensure_config_pr_webhook` and
/// `workers::knowledge::ensure_webhook`. A swarm-level hook under those
/// paths would therefore be deleted by every hive on every boot, and the
/// symptom is a hook that silently stops existing. `webhook_urls_survive_the_hive_side_reapers`
/// pins that.
/// paths the per-hive receivers use. A hive-side registrar deletes any hook
/// whose URL ends with *its* path but has a different base — see
/// `hive-c0re`'s `forge::ensure_config_pr_webhook`. A swarm-level hook under
/// such a path would therefore be deleted by every hive on every boot, and
/// the symptom is a hook that silently stops existing.
/// `webhook_urls_survive_the_hive_side_reapers` pins that, and its own doc
/// records why `/webhook/knowledge` stays in the check even though the
/// knowledge registrar no longer reaps.
const ROUTE_PREFIX: &str = "/webhook/forge/";
impl DeliveryKind {
@ -632,17 +633,22 @@ mod tests {
}
}
/// A cross-daemon invariant with nothing else to enforce it: both
/// per-hive registrars in `hive-c0re` **delete** hooks whose URL ends
/// with their own path but carries a different base — see
/// `forge::ensure_config_pr_webhook` and `knowledge::ensure_webhook`.
/// A cross-daemon invariant with nothing else to enforce it: a per-hive
/// registrar in `hive-c0re` **deletes** hooks whose URL ends with its
/// own path but carries a different base. A controller URL matching such
/// a suffix would be deleted by every hive on every boot — the swarm hook
/// would simply cease to exist, with the cause in a different daemon's
/// startup sweep. Serving these under `/webhook/forge/` is what avoids
/// it, and this is the only place that says so in a form that fails.
///
/// While the swarm-level hooks live alongside the per-hive ones, a
/// controller URL matching either suffix would be deleted by every hive
/// on every boot: the swarm hook would simply cease to exist, with the
/// cause in a different daemon's startup sweep. Serving these under
/// `/webhook/forge/` is what avoids it, and this is the only place that
/// says so in a form that fails.
/// `forge::ensure_config_pr_webhook` still reaps that way. The knowledge
/// registrar no longer does — it was replaced by a removal that matches
/// the full URL, so it cannot touch another hive's hook. **The
/// `/webhook/knowledge` arm is kept anyway**, because the hazard is not
/// this repository's current code: it is whatever is *deployed*, and a
/// hive still running the previous version reaps by suffix until it is
/// upgraded. Drop that arm once no such hive can exist, not when the
/// source stops mentioning it.
#[test]
fn webhook_urls_survive_the_hive_side_reapers() {
for suffix in ["/webhook/knowledge", "/webhook/config-pr"] {