Agent State Conflict Resolver avatar

Agent State Conflict Resolver

Pricing

from $2.00 / 1,000 state reconciliations

Go to Apify Store
Agent State Conflict Resolver

Agent State Conflict Resolver

Resolve conflicting structured state reports using per-field source authority, freshness and explicit invariants. Auditable JSON; abstains on unresolved conflicts.

Pricing

from $2.00 / 1,000 state reconciliations

Rating

0.0

(0)

Developer

Alessandro Bonometti

Alessandro Bonometti

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

Resolve conflicting structured reports about the same entity using explicit per-field source authority, freshness and invariants.

For example, Stripe reports payment refunded, a CRM reports payment paid, and a warehouse reports fulfillment shipped. Payment and fulfillment are separate fields: shipped does not contradict refunded automatically. Your contract declares which source has authority for each field and which combinations are forbidden.

Input

On Apify, paste the contract into the request JSON field. HTTP endpoints accept the contract directly.

Required: entity_id, evaluation_time (explicit ISO timestamp), sources, fields and observations. See the prefilled example.

Each field declares source_priority (highest first), max_age_seconds, min_confidence, require_provenance, tie_break (ABSTAIN, LATEST or VERSION), and optionally allowed_values.

Observations contain unique id, entity_id, source_id, field, value, observed_at, optional nonnegative integer version, confidence and provenance reference. Missing confidence is excluded; provenance is required when the field policy says so. Versions are compared only within the winning source, never across unrelated systems.

Optional invariants are explicit implications: {"id":"refund-hold","if":{"field":"payment","equals":"refunded"},"then":{"field":"fulfillment","equals":"held"}}.

Resolution

  1. Validate contract and exclude wrong entity, unauthorized source, stale/future, low confidence, missing provenance or out-of-domain observations.
  2. Select the highest-authority eligible source per field.
  3. Conflicting values within that source cause abstention by default. LATEST or VERSION may be explicitly enabled; tied winners remain unresolved.
  4. Check invariants on the candidate state.
  5. Return RESOLVED only when every required field and invariant is resolved. Otherwise canonical_state is null and next_safe_action is ESCALATE.

canonical_state is the state selected under your declared policy, not independently verified real-world truth. candidate_state exposes partial selections for diagnosis. Conflicts, resolved_conflicts, unresolved_conflicts, excluded_observations, provenance and invariant results explain each decision.

Patches are review-only proposals for eligible conflicting observations. They are withheld when anything remains unresolved. Nothing is executed or written to external systems. next_safe_action is limited to USE_CANONICAL_STATE, REVIEW_PATCHES or ESCALATE.

Confidence is the minimum caller-supplied confidence among winning observations. It is not a calibrated truth probability.

Boundaries

Version 0.1 uses normalized JSON field values and explicit IF-equals / THEN-equals invariants. Object keys are order-independent; arrays are order-sensitive. No LLM inference, free-text interpretation, connector, source authentication, provenance verification, database merge or persistence. Supply source normalization and authority through your integration. This service does not claim to discover semantic equivalence between arbitrary source labels.

At most 100 sources, 100 fields, 1,000 observations and 100 invariants per reconciliation. HTTP gateway body limit: 64 KiB.

Pricing

One dataset result per reconciliation, including UNRESOLVED results. Invalid contracts fail before producing a result. Consult the live Pricing tab for the current per-result and startup charges.

Contact

bonometti.work.ai@gmail.com