[Phase 1] Build unified normalization path for webhook + poller #7

Open
opened 2026-07-14 01:19:30 +00:00 by starsetbyte · 0 comments
Owner

Context

The existing Forgejo issue poller and the new webhook path must feed the same idempotent normalization function. This prevents double-processing and ensures consistent event shape regardless of delivery mechanism.

What to build

  1. Define a single normalize_forgejo_event() function that accepts:

    • Source (webhook or poll)
    • Raw Forgejo payload (for webhook) or issue/PR state (for poll)
    • Delivery ID (webhook) or synthetic key (poll: repo:issue_number:action:updated_at)
  2. The function produces the canonical normalized event with actor/origin fields.

  3. Deduplication keys:

    • Webhook: delivery_id from X-Forgejo-Delivery header
    • Poll: repository:issue_number:action:updated_at hash
    • Both produce an Aether correlation_id after normalization
  4. The existing homelab-tagged issue polling loop becomes one ingestion rule:

    • Issue with homelab or cross label -> translate to Aether offer/task-discovery event
    • Does NOT independently assign work outside the Aether protocol
  5. Both paths share the same SQLite deduplication table.

Acceptance

  • Single normalization function handles both webhook and poll inputs
  • Deduplication table shared across both paths
  • Poll-generated events produce valid correlation IDs
  • Existing poller behavior preserved (homelab/cross label detection)
  • No double-processing when webhook and poll both see the same event
## Context The existing Forgejo issue poller and the new webhook path must feed the same idempotent normalization function. This prevents double-processing and ensures consistent event shape regardless of delivery mechanism. ## What to build 1. Define a single `normalize_forgejo_event()` function that accepts: - Source (`webhook` or `poll`) - Raw Forgejo payload (for webhook) or issue/PR state (for poll) - Delivery ID (webhook) or synthetic key (poll: `repo:issue_number:action:updated_at`) 2. The function produces the canonical normalized event with actor/origin fields. 3. Deduplication keys: - Webhook: `delivery_id` from `X-Forgejo-Delivery` header - Poll: `repository:issue_number:action:updated_at` hash - Both produce an Aether `correlation_id` after normalization 4. The existing homelab-tagged issue polling loop becomes one ingestion rule: - Issue with `homelab` or `cross` label -> translate to Aether offer/task-discovery event - Does NOT independently assign work outside the Aether protocol 5. Both paths share the same SQLite deduplication table. ## Acceptance - [ ] Single normalization function handles both webhook and poll inputs - [ ] Deduplication table shared across both paths - [ ] Poll-generated events produce valid correlation IDs - [ ] Existing poller behavior preserved (homelab/cross label detection) - [ ] No double-processing when webhook and poll both see the same event
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starsetbyte/aether#7
No description provided.