Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (40 loc) · 1.78 KB
/
Copy pathMakefile
File metadata and controls
44 lines (40 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Test entry point for cmm-claude-code-setup. Each tests/test-*.sh is
# self-contained and exits non-zero on failure; this just runs them all.
TESTS := $(sort $(wildcard tests/test-*.sh))
# Window for `make measure`, in days. Override: make measure DAYS=120
DAYS ?= 30
# Restrict `make measure` to one model's tool calls (exact message.model id, as
# listed in section 9 of the report). Override: make measure MODEL=claude-opus-5-5
MODEL ?=
# An empty TESTS would run nothing and exit 0 — a partial checkout or a `make -C`
# from the wrong root would report clean having verified nothing. Fail loudly instead.
.PHONY: test
test:
$(if $(TESTS),,$(error no tests/test-*.sh found — run make from the repository root))
@fail=0; \
for t in $(TESTS); do \
if bash "$$t" >/dev/null 2>&1; then \
echo " PASS $$t"; \
else \
echo " FAIL $$t"; fail=1; \
fi; \
done; \
if [ $$fail -ne 0 ]; then \
echo ""; \
echo "Some tests failed. Re-run one for detail: bash tests/<name>.sh"; \
fi; \
exit $$fail
# Measure whether the enforcement stack reaches the conversation stream and
# whether agents change behaviour when it does. Read-only: walks the local
# Claude Code transcripts under ~/.config/claude-code/projects/.
#
# Use it as a BEFORE/AFTER check around any hook change. The number that matters
# is the STRONG anti-pattern rate falling *without* the WEAK rate rising to
# absorb it — that would be migration (head/tail -> sed/awk ranges), not
# improvement. Both scripts report hooks that EMITTED; a hook that exits 0
# silently leaves no trace, so absence is not proof it did not run.
.PHONY: measure
measure:
@python3 scripts/analyze-enforcement.py $(DAYS) $(if $(MODEL),--model $(MODEL))
@echo ""
@python3 scripts/analyze-antipatterns.py $(DAYS) $(if $(MODEL),--model $(MODEL))