Given a list of log lines logs, a list of error substrings patterns, and an integer window_size, write a function that scans the logs in order and returns alert payloads for matching errors. A line should produce an alert if it contains any pattern and includes a valid JSON object with keys service, code, and message. Deduplicate alerts so the same (service, code, message) is emitted at most once within the last window_size matching alerts.