on production_event(e):
    shadow_copy = duplicate(e)    # fork BEFORE handle runs, same input
    result = handle(e)            # production path, returns immediately
    emit(result)

    # dispatch async, off the request path
    spawn verify_shadow(shadow_copy, result)

# runs in the shadow, never blocks the response
def verify_shadow(shadow_copy, prod_result):
    expected = verification_handler(shadow_copy)
    if expected != prod_result:
        record_divergence(shadow_copy, expected, prod_result)
