Skip to content

symfonic.agent.backend.receipt_selection

receipt_selection

Optional stock conversation port for accepted rendered-selection evidence.

ReceiptSelectionAdapter

receipt_linked_selection

receipt_linked_selection(transcript)

The opt-in linked manifest must name the selected successful attempt.

Source code in src/symfonic/agent/backend/receipt_selection.py
def receipt_linked_selection(self, transcript):
    """The opt-in linked manifest must name the selected successful attempt."""
    if transcript._selection_failed or transcript._linked_selection_failed:
        raise ContractViolationError("private linked selection refused")
    selected = transcript._selected_linked_selection
    if selected is None:
        return None
    from symfonic.agent.backend.linked_selection_spans import linked_selection_spans

    eligible = tuple(span for span in transcript._wire_candidate_spans
                     if span.publication.owner.identity_version == 1
                     and (not span.line.startswith("[linked] ")
                          or span.linked_edge is not None))
    direct = tuple(span for span in eligible
                   if not span.line.startswith("[linked] "))
    if (transcript._successful_linked_selection is not selected
            or linked_selection_spans(direct, eligible) != transcript._successful_spans):
        raise ContractViolationError("private linked selection refused")
    return selected

receipt_selection

receipt_selection(transcript)

Only the selected successful reply's exact captured attempt qualifies.

Source code in src/symfonic/agent/backend/receipt_selection.py
def receipt_selection(self, transcript):
    """Only the selected successful reply's exact captured attempt qualifies."""
    if transcript._selection_failed:
        raise ContractViolationError("private rendered selection refused")
    selected = transcript._selected_selection
    if selected is None:
        return None
    if (transcript._successful_selection is not selected
            or tuple(span for span in transcript._wire_candidate_spans
                     if span.publication.owner.identity_version == 1
                     and not span.line.startswith("[linked] "))
            != transcript._successful_direct_spans):
        raise ContractViolationError("private rendered selection refused")
    return selected