
Apply explicit row-scoped identity decisions
Source:R/identity_decisions.R
apply_identity_decisions.RdEach list record needs a selector containing original_row_id and source content column values, action (accept or retain_unresolved), scope, conflict, reason, evidence_reference and evidence_fingerprint. Acceptance also needs selected_dtxsid and correspondence=TRUE. Authoritative registry membership is validated separately; unavailable validation cannot grant acceptance. Ambiguous selectors and changed evidence fail without applying decisions.
Details
A combined source may be accepted as a registered mixture without splitting. Keeping an aggregate unresolved records its scope but does not accept a representative component. A repeated source CAS on split children remains candidate evidence until component correspondence is explicitly reviewed. Flags, manual picks and bulk suggestion acceptance cannot resolve these scope conflicts. Selecting a configured source DTXSID also requires its exact source membership evidence to be validated; lookup agreement and a separate successful ID lookup cannot promote unavailable or rejected source evidence. A different validated identity can explicitly resolve conflicting source metadata while retaining its original validation outcomes and provenance. Existing flags and reasons are preserved by this function. The fingerprint row argument is the current row position, while the selector uses source lineage and content; these may differ after reordering.
Examples
if (FALSE) { # \dontrun{
decision <- list(
selector = list(original_row_id = 27L, chemical_name = "Registered combination"),
action = "accept", scope = "registered_mixture", conflict = "none",
selected_dtxsid = "DTXSID123", correspondence = TRUE,
reason = "Source composition matches the registered combined entity",
evidence_reference = "Reviewed source composition and authoritative registry record",
evidence_fingerprint = identity_evidence_fingerprint(state$resolution_state, 27L)
)
state <- apply_identity_decisions(state, list(decision))
} # }