"""Fake CLI: writes 1 MB to both stdout and stderr, each containing a sentinel token.

Callable directly as a subprocess; used by test_process_runner to verify that
ProcessRunner sanitizes secrets from both streams without deadlocking.
"""

import sys

SENTINEL = "DUAL_AGENT_TEST_SECRET_SENTINEL_TOKEN_xK9mQ"
FILLER_SIZE = 1024 * 1024  # 1 MB of padding
FILLER = "A" * FILLER_SIZE

if __name__ == "__main__":
    payload = FILLER + SENTINEL + "\n"
    sys.stdout.write(payload)
    sys.stdout.flush()
    sys.stderr.write(payload)
    sys.stderr.flush()
    sys.exit(0)
