# mcplisten Makefile
#
# Targets:
#   make test      — run the full test suite
#   make fuzz      — run all adversary fuzz harnesses (smoke: 1000 examples/property)
#   make fuzz-A    — run only the core pagination drain harness
#   make fuzz-B    — run only the CLI argv harness
#   make fuzz-C    — run only the StdioMCPClient protocol harness
#   make gate      — run the pre-push gate

PYTHON ?= python3
EXAMPLES ?= 1000

.PHONY: test fuzz fuzz-A fuzz-B fuzz-C gate

test:
	$(PYTHON) -m pytest tests/ -q

# Adversary fuzz harnesses (cycle_18/adversary/02).
# Each harness prints "OK: N mutations, 0 crashes" on success and exits 0.
# On a real regression it exits 1 and writes a finding to benchmarks/adversarial/findings.jsonl.
# NOTE: known-OPEN findings (e.g. F-A5, F-B2/B3) are reported as expected; the harness
# only escalates to exit 1 on UNEXPECTED crashes. Run all three to exercise every surface.
fuzz: fuzz-A fuzz-B fuzz-C

fuzz-A:
	$(PYTHON) -m benchmarks.adversarial.fuzz.surface_a_core --examples $(EXAMPLES)

fuzz-B:
	$(PYTHON) -m benchmarks.adversarial.fuzz.surface_b_cli --examples $(EXAMPLES)

fuzz-C:
	$(PYTHON) -m benchmarks.adversarial.fuzz.surface_c_stdio --examples $(EXAMPLES)

gate:
	bash .pre-push-gate.sh
