Skip to content

feat(event-drain): C2-S2 drain runner + Muse detector (#17077) - #17103

Merged
developing-today-fleet[bot] merged 5 commits into
mainfrom
archer/2352f-c2s2-event-drain
Nov 30, 2026
Merged

developing-today-fleet[bot] merged 5 commits into
mainfrom
archer/2352f-c2s2-event-drain

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

C2-S2 (#17077): event drain runner + Muse detector

Slice C2-S2 of #9570, from the merged design record doc/2026-11-26T07-52-58Z_design_c2_event_pipeline/ (PR #15450), §9/§4 D2/D4/D5/§6. Hard edge C2-S1 verified landed on main firsthand before this work (PR #15925 merged for #15834: derive.ts/drain.ts/thresholds.ts + 5-minute age cron).

What lands

  • scripts/fleet/event-drain/drain_events.py — the drain runner. For each due kind (drain-due:<kind> set) it reads events rows past drain:<kind> up to the high water read at drain start, ensures a task minds each item via fleet queue enqueue, advances the persisted cursor after each fully handled row, and clears drain-due:<kind> only after the cursor reaches the high water (D4 step 4). A failed drain leaves the signal set and resumes from the last fully handled row. It makes no claim, merges nothing, closes nothing (D5). One report per drain: counts by kind, tasks created/found, quota current + projected (the projected line says so when C4 has no prediction yet).
  • Dedupe keys: issue/PR packets use the coverage-reconcile importer's canonical keys (repo-health:v1:triage:<repo>:issue:<n>, repo-health:v1:pr:<repo>:pr:<n>) — the no-twin-tasks property D5 names; the design's gh:<repo>#<n> shorthand predates the importer's canonical form. Kinds with no importer equivalent use the design's keys (ci:<repo>:<run_id>, mention:<comment_id>).
  • test_drain_events.py — the §6 drain-runner oracles, each test naming its oracle: cursor stops at the start high water when rows arrive mid-drain; failure mid-drain leaves the signal set + cursor at the last fully handled row; a replay creates no second task (fake enqueue sees the same dedupe key). Plus signal-clearing, importer key-form, log-only-kind, observe-mode, quota-line, and thresholds drift guards.
  • detector/event-drain-detect.sh + detector/event-drain.json — the Muse detector and event-drain hook definition, following the enrolment wake pattern (~/hooks/scripts/ + ~/hooks/definitions/): polls the drain-due:* keys and wakes Muse naming the due kinds; unconfigured/unreachable store is a silent inconclusive poll, never a false "drained".
  • README.md — the pieces, the run modes, and the wake path.

Verification

Refs #17077, #9570. Authored by lane 2352-F (bravo SUSTAIN) via the Git-API contents route; full-diff self-review before merge per standing rule (CI is not a gate).


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

scripts/fleet/event-drain/drain_events.py
scripts/fleet/event-drain/test_drain_events.py
scripts/fleet/event-drain/detector/event-drain-detect.sh
scripts/fleet/event-drain/detector/event-drain.json
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 278fa85e-aaf0-4a96-9626-b8c059285bde

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants