Scrypath.Operator.Reconcile (scrypath v0.3.5)

Copy Markdown View Source

Report-first reconciliation returned by Scrypath.reconcile_sync/2.

A reconcile report combines sync visibility, failed work, drift signals, and rebuild visibility before any recovery action is executed. Per-class failed-work pileup counts (failed_work_counts) use the same taxonomy as FailedWork rows for triage at a glance.

When include_index_contract_drift: true is passed in operator options, index_contract_drift is populated from the same builder as Scrypath.index_contract_drift/2, adding one live get_settings read. If that read fails, the entire reconcile returns {:error, reason} so operators are not shown a false-green report.

Summary

Types

t()

@type t() :: %Scrypath.Operator.Reconcile{
  actions: [Scrypath.Operator.RecoveryAction.t()],
  drift_signals: [atom()],
  failed_work: [Scrypath.Operator.FailedWork.t()],
  failed_work_counts: Scrypath.Operator.ReasonClassCounts.t(),
  index: String.t(),
  index_contract_drift: Scrypath.Operator.IndexContractDrift.Report.t() | nil,
  mode: :inline | :manual | :oban | atom(),
  reindex: Scrypath.Operator.Reconcile.ReindexVisibility.t(),
  schema: module(),
  status: Scrypath.Operator.Status.t()
}

Functions

apply_action(action, opts)

@spec apply_action(
  Scrypath.Operator.RecoveryAction.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}

run(schema_module, config, operator_opts)

@spec run(module(), keyword(), keyword()) :: {:ok, t()} | {:error, term()}