angee.workflows_parties.steps
Workflow step implementations for the parties dedupe flow.
Three implementations compose one graph (the workflows_integrate archive canon): parties_dedupe_scan proposes deterministic duplicate pairs, parties_dedupe_gate suspends one rows-table Decision the human edits in the workflows inbox, and parties_dedupe_execute (mode=prepare then the stock map fan-out into mode=unit) applies the approved verbs through the parties manager owners. Steps run detached under system_context — the Decision is the authorization gate (assigned to the run creator), and the apply step performs only what its resolution approved.
DedupeScanStepImpl
class DedupeScanStepImpl(StepImpl)Propose the deterministic duplicate-party pairs for one review batch.
Delegates entirely to PartyQuerySet.duplicate_candidates (bounded, veto-filtered, deterministic order) and adds only the review projection: display names, the shared-handle evidence line, and a proposed survivor per pair — a real name beats a numeric one, then the richer handle set, then the older row (the fyltr _pick_primary heuristic, parties-native).
validate_config
@classmethod
def validate_config(cls, config: Any) -> NoneValidate the optional pair limit.
run
def run(step_run: Any, *, now: datetime) -> StepResultEmit the proposed pair rows, routing found or empty.
DedupeGateStepImpl
class DedupeGateStepImpl(StepImpl)Suspend one rows-table Decision over the scanned pair batch.
The human edits the batch in the workflows inbox: per pair a survivor (left/right) and a verb — merge, skip (decide later; the pair resurfaces on the next scan), or keep_separate (a durable MergeVeto; never suggested again). Identity cells are read-only and verified again at prepare time, so a tampered resolution never applies.
validate_config
@classmethod
def validate_config(cls, config: Any) -> NoneValidate optional decision action, assignee, and attempt settings.
run
def run(step_run: Any, *, now: datetime) -> StepResultAuthor the pair-review form from scan output and suspend one decision.
DedupeExecuteStepImpl
class DedupeExecuteStepImpl(StepImpl)Prepare a confirmed pair batch or execute one stock-map unit.
mode=prepare follows the gate and turns its completed decision into a plain verb list (skips dropped); the built-in map step consumes that list and targets a second step with mode=unit, which performs one idempotent verb: merge through PartyManager.merge (already-merged pairs report already_merged on retry) or keep_separate through MergeVetoManager.veto (idempotent by construction).
validate_config
@classmethod
def validate_config(cls, config: Any) -> NoneRequire an explicit prepare/unit execution mode.
run
def run(step_run: Any, *, now: datetime) -> StepResultPrepare the confirmed verb list or apply one pair verb.