Skip to content

keeper: retire sweep vocabulary (Sweep to Outcome, sweep to run, ConditionalSource to Poller) #540

Description

@mfw78

From a keeper-naming review (2026-07-22). Target: L1 nexum-sdk::keeper (the trait) + L2 videre-sdk::keeper. Must land before the M5 cleave.

The 2026-07-14 keeper vocabulary freeze kept Verdict and rejected sweep, but the L2 videre-sdk keeper (introduced in #454) ships Sweep, .sweep(), and SweepReport, re-introducing the rejected term. Two further problems: the Sweep enum is named after the loop that consumes it rather than what it is (a per-watch poll outcome), and ConditionalSource reads as a stream/producer when it evaluates one watch and returns one outcome.

Decided renames

Current New Crate
Sweep (enum: Submit/WaitBlock/Backoff/Drop) Outcome videre-sdk::keeper
Keeper::sweep() (one pass over the watch set) Keeper::run() videre-sdk::keeper
SweepReport RunReport videre-sdk::keeper
ConditionalSource<H> (trait) Poller<H> nexum-sdk::keeper

Notes

  • Poller::Outcome (the associated type) is unchanged. The SDK's generic default impl becomes type Outcome = Outcome (the renamed enum); the L3 CoW strategies keep type Outcome = Verdict. The type Outcome = Outcome line is deliberate: the enum is the SDK's default outcome type, and a strategy may substitute its own.
  • L3 shepherd-sdk::cow::Verdict stays as-is. It is the CoW-typed outcome (Post/WaitTimestamp/WaitBlock/TryNextBlock over GPv2OrderData); this change does not unify it with the L2 generic Outcome, only retires sweep and the weak Source trait name.
  • There is already a free run() in videre-sdk (the top-level driver used as run(keeper.sweep(...))). A run() method and a free run() coexist in Rust, but keep them cognitively distinct: the method is one pass over the watch set, the free function is the driver. Rename the free one if it reads ambiguously.
  • Sweep the word sweep out of docs, comments, and test-file names too (for example composable-cow/tests/sweep.rs, and doc verbs like "sweep the watch set once" become "run"/"poll").
  • Poller::label() default returns "conditional"; align it (for example "poller") or leave it, no behaviour keys off it.

Why pre-cleave

After the M5 three-repo split, nexum-sdk (L1, the Poller trait) and videre-sdk (L2, Outcome/run/RunReport) live in separate repos, so this becomes a coordinated two-repo rename. Done now in the monorepo it is a single PR.

Acceptance criteria

  • No Sweep, SweepReport, Keeper::sweep, or ConditionalSource symbols remain; Outcome, RunReport, Keeper::run, and Poller are in their place.
  • sweep is gone from keeper docs, comments, and test names.
  • L3 Verdict is untouched; the build and the keeper tests pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/sdknexum-sdk / shepherd-sdk, proc macros, cargo-nexumdebtCode works but makes future work harder.dxDeveloper experience is suffering.effort/hoursFew hours. Single PR.p2-annoyingNot broken, but annoying enough to matter.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions