Skip to content

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

python
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

python
@classmethod
def validate_config(cls, config: Any) -> None

Validate the optional pair limit.

run

python
def run(step_run: Any, *, now: datetime) -> StepResult

Emit the proposed pair rows, routing found or empty.

DedupeGateStepImpl

python
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

python
@classmethod
def validate_config(cls, config: Any) -> None

Validate optional decision action, assignee, and attempt settings.

run

python
def run(step_run: Any, *, now: datetime) -> StepResult

Author the pair-review form from scan output and suspend one decision.

DedupeExecuteStepImpl

python
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

python
@classmethod
def validate_config(cls, config: Any) -> None

Require an explicit prepare/unit execution mode.

run

python
def run(step_run: Any, *, now: datetime) -> StepResult

Prepare the confirmed verb list or apply one pair verb.

Released under the AGPL-3.0 License.