-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (73 loc) · 3.76 KB
/
Makefile
File metadata and controls
89 lines (73 loc) · 3.76 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.PHONY: validate interop trend compact mcp privacy-policy metrics metrics-tokenizer lint-profile lint-profile-strict observed-behavior bootstrap-owner drift-check release-build release-check
PYTHON ?= python3
REPO_ROOT := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
OWNERS := $(shell test -d profiles && find profiles -mindepth 1 -maxdepth 1 -type d ! -name '.*' -exec basename {} \; || true)
INTEROP_ARTIFACTS := $(addsuffix /interop.v1.json,$(addprefix profiles/,$(OWNERS)))
COMPACT_ARTIFACTS := $(addsuffix /context.compact.json,$(addprefix profiles/,$(OWNERS)))
MCP_ARTIFACTS := $(addsuffix /mcp.context.resource.json,$(addprefix profiles/,$(OWNERS)))
PUBLIC_METRICS_ARTIFACTS := benchmarks/runs/public-metrics.json benchmarks/runs/public-metrics.md
validate:
$(PYTHON) -c "import pathlib; files=[]; [files.extend(sorted(pathlib.Path('.').glob(pattern))) for pattern in ('scripts/*.py', 'tests/test_*.py')]; [compile(path.read_text(encoding='utf-8'), str(path), 'exec') for path in files]"
$(PYTHON) -m unittest discover -s tests -p "test_*.py"
bash -n scripts/run_integration_hook.sh
$(PYTHON) scripts/check_publish_guard.py --all-tracked
$(PYTHON) scripts/validate_profile.py --allow-stale --check-raw-tracked
$(MAKE) lint-profile-strict
$(MAKE) observed-behavior
$(MAKE) privacy-policy
$(MAKE) interop
$(MAKE) compact
$(MAKE) mcp
$(MAKE) trend
$(MAKE) metrics
interop:
@for owner in $(OWNERS); do \
echo "==> export interop for $$owner"; \
$(PYTHON) scripts/export_interop_v1.py --owner-id "$$owner"; \
$(PYTHON) scripts/validate_interop_v1.py --owner-id "$$owner"; \
done
trend:
$(PYTHON) scripts/benchmark_trend_report.py
metrics:
$(PYTHON) scripts/benchmark_public_report.py
release-build:
rm -rf dist build *.egg-info
$(PYTHON) -m build
release-check:
@test -d dist || { echo "missing dist/; run make release-build"; exit 1; }
$(PYTHON) -m twine check dist/*
metrics-tokenizer:
@$(PYTHON) -c "import importlib.util, sys; sys.exit(0 if importlib.util.find_spec('tiktoken') else 1)" || { echo "Install hint: pip install tiktoken"; exit 1; }
$(PYTHON) scripts/benchmark_public_report.py --tokenizer-provider tiktoken --tokenizer-encoding cl100k_base
lint-profile:
$(PYTHON) scripts/lint_profile_quality.py
lint-profile-strict:
$(PYTHON) scripts/lint_profile_quality.py --strict
observed-behavior:
$(PYTHON) scripts/validate_observed_behavior.py
bootstrap-owner:
@test -n "$(OWNER)" || { echo "usage: make bootstrap-owner OWNER=<owner-id> [OWNER_ALIAS=<alias>]"; exit 1; }
$(PYTHON) "$(REPO_ROOT)/scripts/bootstrap_owner.py" --owner-id "$(OWNER)" $(if $(OWNER_ALIAS),--owner-alias "$(OWNER_ALIAS)",)
compact:
@for owner in $(OWNERS); do \
echo "==> export compact context for $$owner"; \
$(PYTHON) scripts/export_context_compact.py --owner-id "$$owner"; \
$(PYTHON) scripts/validate_context_compact.py --owner-id "$$owner"; \
done
mcp:
@for owner in $(OWNERS); do \
echo "==> export mcp resource for $$owner"; \
$(PYTHON) scripts/export_mcp_resource.py --owner-id "$$owner"; \
$(PYTHON) scripts/validate_mcp_resource.py --owner-id "$$owner"; \
done
privacy-policy:
@for owner in $(OWNERS); do \
test -f "profiles/$$owner/privacy-policy.v1.json" || { echo "missing privacy policy for $$owner"; exit 1; }; \
echo "==> validate privacy policy for $$owner"; \
$(PYTHON) scripts/validate_privacy_policy.py --owner-id "$$owner"; \
done
drift-check:
@for path in $(INTEROP_ARTIFACTS) $(COMPACT_ARTIFACTS) $(MCP_ARTIFACTS) $(PUBLIC_METRICS_ARTIFACTS) benchmarks/runs/trends.json benchmarks/runs/trends.md; do \
test -f "$$path" || { echo "missing artifact: $$path"; exit 1; }; \
done
git diff --exit-code -- $(INTEROP_ARTIFACTS) $(COMPACT_ARTIFACTS) $(MCP_ARTIFACTS) $(PUBLIC_METRICS_ARTIFACTS) benchmarks/runs/trends.json benchmarks/runs/trends.md