#!/usr/bin/env python3 """Enforce the documented pytest skipped-test budget (US-037). The CI test job captures pytest output with ``-rs`` and passes the report to this script. The gate fails closed when the report cannot be parsed and fails when the executed skip count exceeds the approved baseline. """ from __future__ import annotations import argparse import re import sys from collections.abc import Sequence from pathlib import Path SKIP_BUDGET = 82 _ANSI_ESCAPE_RE = re.compile(r"\x1b\[[0-?]*[ -/]*[@-~]") _COUNTER_RE = re.compile( r"(?P\d+)\s+" r"(?P