Skip to content

symfonic.agent.receipt_history

receipt_history

Exact facade-to-kernel adapter for authenticated receipt turn history.

snapshot_receipt_history

snapshot_receipt_history(request)

Validate and snapshot text history before any receipt handle or claim.

Source code in src/symfonic/agent/receipt_history.py
def snapshot_receipt_history(request):
    """Validate and snapshot text history before any receipt handle or claim."""
    if type(request.history) is not tuple:
        _refuse()
    if not request.history:
        return request, ()
    messages = tuple(_message(item) for item in request.history)
    return replace(request, history=tuple(item[1] for item in messages)), tuple(
        item[0] for item in messages
    )