-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
337 lines (254 loc) · 11.8 KB
/
Makefile
File metadata and controls
337 lines (254 loc) · 11.8 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
SHELL := /bin/sh
GO ?= go
PYTHON ?= python3
GO_COVERAGE_THRESHOLD ?= 85
GO_PACKAGE_COVERAGE_THRESHOLD ?= 75
PYTHON_COVERAGE_THRESHOLD ?= 85
GAIT_BINARY ?= ./gait
ifeq ($(OS),Windows_NT)
GAIT_BINARY := ./gait.exe
endif
SDK_DIR := sdk/python
UV_PY := 3.11
GO_TEST_PACKAGES := $(shell GO=$(GO) $(PYTHON) scripts/list_go_test_packages.py)
GO_COVERAGE_PACKAGES := ./core/... ./cmd/gait
BENCH_PACKAGES := ./core/gate ./core/runpack ./core/scout ./core/guard ./core/registry ./core/mcp
BENCH_REGEX := Benchmark(EvaluatePolicyTypical|VerifyZipTypical|DiffRunpacksTypical|SnapshotTypical|DiffSnapshotsTypical|VerifyPackTypical|BuildIncidentPackTypical|InstallLocalTypical|VerifyInstalledTypical|DecodeToolCallOpenAITypical|EvaluateToolCallTypical)$$
BENCH_OUTPUT ?= perf/bench_output.txt
BENCH_BASELINE ?= perf/bench_baseline.json
GOSEC_CONCURRENCY ?= 1
.PHONY: fmt lint lint-fast codeql test test-fast test-scenarios prepush prepush-full github-guardrails github-guardrails-strict test-hardening test-hardening-acceptance test-chaos test-e2e test-acceptance test-v1-6-acceptance test-v1-7-acceptance test-v1-8-acceptance test-v2-3-acceptance test-v2-4-acceptance test-v2-5-acceptance test-v2-6-acceptance test-voice-acceptance test-context-conformance test-context-chaos test-packspec-tck test-script-intent-acceptance test-ui-acceptance test-ui-unit test-ui-e2e-smoke test-ui-perf test-claude-code-hook-contract test-adoption test-adapter-parity test-ecosystem-automation test-release-smoke test-install test-install-path-versions test-contracts test-intent-receipt-conformance test-ci-regress-template test-ci-portability-templates test-live-connectors test-skill-supply-chain test-runtime-slo test-ent-consumer-contract test-uat-local test-openclaw-skill-install test-beads-bridge test-docs-storyline test-docs-consistency test-demo-recording test-github-action-runtime-guard openclaw-skill-install build bench bench-check bench-budgets context-budgets skills-validate ecosystem-validate ecosystem-release-notes demo-90s demo-hero-gif homebrew-formula wiki-publish tool-allowlist-policy ui-build ui-sync ui-deps-check
.PHONY: hooks
.PHONY: docs-site-install docs-site-build docs-site-lint docs-site-check docs-site-validate
fmt:
gofmt -w .
(cd $(SDK_DIR) && uv run --python $(UV_PY) --extra dev ruff format)
lint:
$(PYTHON) scripts/validate_repo_skills.py
$(PYTHON) scripts/validate_community_index.py
bash scripts/check_repo_hygiene.sh
bash scripts/check_hooks_config.sh
$(GO) vet ./...
$(GO) run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.0.1 run ./...
# Keep gosec single-threaded to avoid nondeterministic upstream map-race panics.
$(GO) run github.com/securego/gosec/v2/cmd/gosec@v2.23.0 -concurrency $(GOSEC_CONCURRENCY) ./...
$(GO) build -o $(GAIT_BINARY) ./cmd/gait
$(GO) run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -mode=binary $(GAIT_BINARY)
(cd $(SDK_DIR) && uv run --python $(UV_PY) --extra dev ruff check)
(cd $(SDK_DIR) && uv run --python $(UV_PY) --extra dev mypy)
(cd $(SDK_DIR) && uv run --python $(UV_PY) --extra dev bandit -q -r gait)
lint-fast:
$(PYTHON) scripts/validate_repo_skills.py
$(PYTHON) scripts/validate_community_index.py
bash scripts/check_repo_hygiene.sh
bash scripts/check_hooks_config.sh
$(GO) vet ./...
$(GO) run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.0.1 run ./...
(cd $(SDK_DIR) && uv run --python $(UV_PY) --extra dev ruff check)
(cd $(SDK_DIR) && uv run --python $(UV_PY) --extra dev mypy)
codeql:
bash scripts/run_codeql_local.sh
test:
$(GO) test $(GO_TEST_PACKAGES) -cover > coverage-go-packages.out
cat coverage-go-packages.out
$(PYTHON) scripts/check_go_package_coverage.py coverage-go-packages.out $(GO_PACKAGE_COVERAGE_THRESHOLD)
$(GO) test $(GO_COVERAGE_PACKAGES) -coverprofile=coverage-go.out
$(PYTHON) scripts/check_go_coverage.py coverage-go.out $(GO_COVERAGE_THRESHOLD)
(cd $(SDK_DIR) && PYTHONPATH=. uv run --python $(UV_PY) --extra dev pytest --cov=gait --cov-report=term-missing --cov-fail-under=$(PYTHON_COVERAGE_THRESHOLD))
bash scripts/test_github_action_runtime_versions.sh
test-fast:
$(GO) test $(GO_TEST_PACKAGES)
(cd $(SDK_DIR) && PYTHONPATH=. uv run --python $(UV_PY) --extra dev pytest)
bash scripts/test_github_action_runtime_versions.sh
test-scenarios:
$(GO) test ./internal/scenarios -count=1 -tags=scenario -v
prepush:
$(MAKE) lint-fast
$(MAKE) test-fast
prepush-full:
$(MAKE) lint
$(MAKE) test
$(MAKE) test-scenarios
$(MAKE) codeql
github-guardrails:
bash scripts/configure_github_guardrails.sh
github-guardrails-strict:
GAIT_REQUIRED_REVIEWS=1 GAIT_REQUIRE_CODEOWNER_REVIEWS=true bash scripts/configure_github_guardrails.sh
test-hardening:
bash scripts/test_hardening.sh
test-hardening-acceptance:
bash scripts/test_hardening_acceptance.sh
test-chaos:
bash scripts/test_chaos_exporters.sh
bash scripts/test_chaos_service_boundary.sh
bash scripts/test_chaos_payload_limits.sh
bash scripts/test_chaos_sessions.sh
bash scripts/test_chaos_trace_uniqueness.sh
bash scripts/test_job_runtime_chaos.sh
bash scripts/test_context_chaos.sh
coverage:
$(GO) test $(GO_COVERAGE_PACKAGES) -coverprofile=coverage-go.out
$(GO) tool cover -func=coverage-go.out | tail -n 1
test-e2e:
$(GO) test ./internal/e2e -count=1
test-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_v1_acceptance.sh ./gait
test-v1-6-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_v1_6_acceptance.sh ./gait
test-v1-7-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_v1_7_acceptance.sh ./gait
test-v1-8-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_v1_8_acceptance.sh ./gait
test-v2-3-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_v2_3_acceptance.sh ./gait
test-v2-4-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_v2_4_acceptance.sh ./gait
test-v2-5-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_v2_5_acceptance.sh ./gait
test-v2-6-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_v2_6_acceptance.sh ./gait
test-voice-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_voice_acceptance.sh ./gait
test-context-conformance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_context_conformance.sh ./gait
test-context-chaos:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_context_chaos.sh ./gait
test-packspec-tck:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_packspec_tck.sh ./gait
test-script-intent-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_script_intent_acceptance.sh ./gait
test-ui-acceptance:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_ui_acceptance.sh ./gait
test-ui-unit:
cd ui/local && npm ci && npm run test
test-ui-e2e-smoke:
$(GO) build -o ./gait ./cmd/gait
bash scripts/test_ui_e2e_smoke.sh ./gait
test-ui-perf:
$(GO) build -o ./gait ./cmd/gait
$(PYTHON) scripts/check_ui_budgets.py ./gait perf/ui_budgets.json perf/ui_budget_report.json
test-claude-code-hook-contract:
bash scripts/test_claude_code_hook_contract.sh
test-adoption:
bash scripts/test_adoption_smoke.sh
test-adapter-parity:
bash scripts/test_adapter_parity.sh
test-ecosystem-automation:
bash scripts/test_ecosystem_release_automation.sh
bash scripts/test_ci_regress_template.sh
bash scripts/test_ci_portability_templates.sh
test-release-smoke: build
bash scripts/test_claude_code_hook_contract.sh ./gait
bash scripts/test_release_smoke.sh ./gait
test-install: build
bash scripts/test_install.sh ./gait
test-install-path-versions: build
bash scripts/test_cli_version_install_paths.sh ./gait
test-contracts: build
bash scripts/test_contracts.sh ./gait
bash scripts/test_ent_consumer_contract.sh ./gait
test-intent-receipt-conformance: build
bash scripts/test_intent_receipt_conformance.sh ./gait
test-ci-regress-template: build
bash scripts/test_ci_regress_template.sh
test-ci-portability-templates: build
bash scripts/test_ci_portability_templates.sh
test-github-action-runtime-guard:
bash scripts/test_github_action_runtime_versions.sh
test-ent-consumer-contract: build
bash scripts/test_ent_consumer_contract.sh ./gait
test-live-connectors:
bash scripts/test_live_connectors.sh
test-skill-supply-chain:
bash scripts/test_skill_supply_chain.sh
test-uat-local:
bash scripts/test_uat_local.sh
test-openclaw-skill-install:
bash scripts/test_openclaw_skill_install.sh
test-beads-bridge:
bash scripts/test_beads_bridge.sh
build:
$(GO) build ./cmd/gait
bench:
mkdir -p perf
GOMAXPROCS=1 $(GO) test $(BENCH_PACKAGES) -run '^$$' -bench '$(BENCH_REGEX)' -benchmem -count=5 | tee $(BENCH_OUTPUT)
bench-check: bench
$(PYTHON) scripts/check_bench_regression.py $(BENCH_OUTPUT) $(BENCH_BASELINE) perf/bench_report.json
$(PYTHON) scripts/check_resource_budgets.py $(BENCH_OUTPUT) perf/resource_budgets.json perf/resource_budget_report.json
$(GO) build -o ./gait ./cmd/gait
$(PYTHON) scripts/check_context_budgets.py ./gait perf/context_budgets.json perf/context_budget_report.json
bench-uat-check: bench
$(PYTHON) scripts/check_resource_budgets.py $(BENCH_OUTPUT) perf/resource_budgets_uat.json perf/resource_budget_report.json
$(GO) build -o ./gait ./cmd/gait
$(PYTHON) scripts/check_context_budgets.py ./gait perf/context_budgets.json perf/context_budget_report.json
bench-budgets:
$(GO) build -o ./gait ./cmd/gait
$(PYTHON) scripts/check_command_budgets.py ./gait perf/command_budget_report.json perf/runtime_slo_budgets.json
context-budgets:
$(GO) build -o ./gait ./cmd/gait
$(PYTHON) scripts/check_context_budgets.py ./gait perf/context_budgets.json perf/context_budget_report.json
test-runtime-slo: bench-budgets context-budgets
hooks:
git config core.hooksPath .githooks
skills-validate:
$(PYTHON) scripts/validate_repo_skills.py
ecosystem-validate:
$(PYTHON) scripts/validate_community_index.py
ecosystem-release-notes:
$(PYTHON) scripts/render_ecosystem_release_notes.py
demo-90s: build
bash scripts/demo_90s.sh
demo-hero-gif: build
bash scripts/record_runpack_hero_demo.sh
test-docs-storyline:
bash scripts/test_docs_storyline_acceptance.sh
test-docs-consistency:
bash scripts/test_docs_consistency.sh
test-demo-recording:
bash scripts/test_demo_recording_validation.sh
homebrew-formula:
@if [ -z "$(VERSION)" ]; then echo "VERSION is required (example: make homebrew-formula VERSION=vX.Y.Z)"; exit 2; fi
bash scripts/render_homebrew_formula.sh --version "$(VERSION)" --checksums dist/checksums.txt --out dist/gait.rb
wiki-publish:
@if [ -z "$(REPO)" ]; then REPO=Clyra-AI/gait; else REPO=$(REPO); fi; \
bash scripts/publish_wiki.sh --repo "$$REPO"
tool-allowlist-policy:
@if [ -z "$(INPUT)" ]; then echo "INPUT is required (example: make tool-allowlist-policy INPUT=examples/policy/external_tool_allowlist.json OUTPUT=gait-out/policy_external_allowlist.yaml)"; exit 2; fi
@if [ -z "$(OUTPUT)" ]; then echo "OUTPUT is required (example: make tool-allowlist-policy INPUT=examples/policy/external_tool_allowlist.json OUTPUT=gait-out/policy_external_allowlist.yaml)"; exit 2; fi
python3 scripts/render_tool_allowlist_policy.py --input "$(INPUT)" --output "$(OUTPUT)"
openclaw-skill-install:
@if [ -z "$(TARGET_DIR)" ]; then bash scripts/install_openclaw_skill.sh; else bash scripts/install_openclaw_skill.sh --target-dir "$(TARGET_DIR)"; fi
docs-site-install:
mkdir -p .cache/npm
cd docs-site && NPM_CONFIG_CACHE=../.cache/npm npm ci
docs-site-build: docs-site-install
cd docs-site && npm run build
docs-site-lint: docs-site-install
cd docs-site && npm run lint
docs-site-check:
$(PYTHON) scripts/check_docs_site_validation.py --report gait-out/docs_site_validation_report.json
docs-site-validate:
mkdir -p .cache/npm
cd docs-site && NPM_CONFIG_CACHE=../.cache/npm npm ci && npm run lint && npm run build
$(PYTHON) scripts/check_docs_site_validation.py --report gait-out/docs_site_validation_report.json
rm -rf docs-site/node_modules
ui-build:
bash scripts/ui_build.sh
ui-sync:
bash scripts/ui_sync_assets.sh
ui-deps-check:
bash scripts/check_ui_deps_freshness.sh