-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
197 lines (160 loc) · 9.56 KB
/
Copy pathMakefile
File metadata and controls
197 lines (160 loc) · 9.56 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
.PHONY: help web web-ci macos-menu-test macos-menu-package transport-types transport-types-check snapshots-check snapshots-refresh build all test test-resource-lint test-concurrent test-concurrent-repeat test-live test-live-openai test-live-anthropic test-live-codex test-live-xai test-live-images test-live-runtime docker-build docker-smoke docker-e2e docker-e2e-scheduler-required docker-e2e-scheduler-live-canary docker-e2e-validate docker-live-acceptance fmt fmt-check lint check ci run clean
WEB_DIR := web-gui/app
OPENAPI_TOOLS_DIR := web-gui/openapi-tools
CONCURRENT_REPEATS ?= 3
DOCKER_IMAGE ?= holon:dev
CONCURRENT_LIFECYCLE_TESTS := \
runtime_tasks \
runtime_waiting_and_reactivation \
runtime_waiting_and_delivery_regressions \
http_events \
http_tasks
CONCURRENT_TESTS := $(CONCURRENT_LIFECYCLE_TESTS) wt204_parallel_worktree_workflow
ANTHROPIC_COMPATIBLE_LIVE_TESTS := \
live_deepseek_anthropic_accepts_context_management \
live_xiaomi_token_plan_accepts_context_management \
live_xiaomi_anthropic_accepts_context_management \
live_xiaomi_token_plan_anthropic_accepts_context_management \
live_zai_anthropic_accepts_context_management \
live_zai_anthropic_builtin_web_search_reports_prime_backend \
live_bigmodel_anthropic_accepts_context_management \
live_bigmodel_anthropic_builtin_web_search_reports_backend \
live_minimax_anthropic_accepts_context_management
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-24s\033[0m %s\n", $$1, $$2}'
web: ## Build the web GUI (requires Node.js 24). Produces web-gui/app/dist
@if [ -s "$$HOME/.nvm/nvm.sh" ]; then . "$$HOME/.nvm/nvm.sh" && nvm use; fi; \
cd $(WEB_DIR) && npm ci && npm run build
web-ci: ## Test and build the web GUI with one clean dependency install
@if [ -s "$$HOME/.nvm/nvm.sh" ]; then . "$$HOME/.nvm/nvm.sh" && nvm use; fi; \
cd $(OPENAPI_TOOLS_DIR) && npm ci && npm run check && \
cd ../../$(WEB_DIR) && npm ci && npm test && npm run build
macos-menu-test: ## Build and test the native macOS menu app
swift test --package-path apps/macos/HolonMenu
macos-menu-package: ## Package a universal (x86_64 + arm64) Holon.app and DMG
rustup target add aarch64-apple-darwin x86_64-apple-darwin
cargo build --release --locked --target aarch64-apple-darwin --target x86_64-apple-darwin
mkdir -p target/universal-macos/release
lipo -create target/aarch64-apple-darwin/release/holon target/x86_64-apple-darwin/release/holon \
-output target/universal-macos/release/holon
scripts/package-macos-menu-app.sh target/universal-macos/release/holon dist
transport-types: ## Refresh OpenAPI and generated TypeScript transport types
cargo test --test openapi_snapshot refresh_openapi_snapshot -- --ignored
@if [ -s "$$HOME/.nvm/nvm.sh" ]; then . "$$HOME/.nvm/nvm.sh" && nvm use; fi; \
cd $(OPENAPI_TOOLS_DIR) && npm ci && npm run generate
transport-types-check: ## Check OpenAPI and generated TypeScript transport type drift
cargo test --test openapi_snapshot
@if [ -s "$$HOME/.nvm/nvm.sh" ]; then . "$$HOME/.nvm/nvm.sh" && nvm use; fi; \
cd $(OPENAPI_TOOLS_DIR) && npm ci && npm run check
snapshots-check: ## Check CLI, OpenAPI, HTTP route, runtime status, and model tool schema snapshots
cargo test --test cli_snapshot
cargo test --test openapi_snapshot
cargo test --test http_route_snapshot
cargo test --test runtime_status_inventory_snapshot
cargo test --test tool_schema_inventory_snapshot
snapshots-refresh: ## Refresh CLI, OpenAPI, HTTP route, runtime status, and model tool schema snapshots
cargo test --test cli_snapshot refresh_cli_snapshot -- --ignored
cargo test --test openapi_snapshot refresh_openapi_snapshot -- --ignored
cargo test --test http_route_snapshot refresh_http_route_inventory_snapshot -- --ignored
cargo test --test runtime_status_inventory_snapshot refresh_runtime_status_enum_inventory_snapshot -- --ignored
cargo test --test tool_schema_inventory_snapshot refresh_tool_schema_inventory_snapshot -- --ignored
build: ## Build all Rust targets (cargo build --all-targets)
cargo build --all-targets
all: web build ## Build everything: web GUI then Rust
test: ## Run the full Rust test suite serially
cargo test --all-targets -- --test-threads=1
test-resource-lint: ## Audit permanent test temp directories against the reasoned allowlist
python3 scripts/check-test-temp-resources.py
test-concurrent: ## Run runtime lifecycle integration tests with Rust's default test threads
@set -eu; \
for test_target in $(CONCURRENT_TESTS); do \
cargo test --test "$$test_target"; \
done
test-concurrent-repeat: ## Repeat core concurrent lifecycle tests (CONCURRENT_REPEATS=3)
@set -eu; \
repeat=1; \
while [ "$$repeat" -le "$(CONCURRENT_REPEATS)" ]; do \
echo "Concurrent lifecycle test pass $$repeat/$(CONCURRENT_REPEATS)"; \
for test_target in $(CONCURRENT_LIFECYCLE_TESTS); do \
cargo test --test "$$test_target"; \
done; \
repeat=$$((repeat + 1)); \
done
test-live: ## Run the baseline and configured-provider live smoke tests
@printf '%s\n' \
'Requires configured provider credentials and network access.' \
'Runs two configured-chain baseline probes plus one smoke request per configured provider.' \
'Test binaries: live_llm_baseline (selected tests), live_provider_smoke'
cargo test --test live_llm_baseline live_llm_baseline_configured_chain_smoke -- --ignored --nocapture
cargo test --test live_llm_baseline live_llm_baseline_tool_roundtrip -- --ignored --nocapture
cargo test --test live_provider_smoke -- --ignored --nocapture
test-live-openai: ## Run OpenAI Responses and Chat Completions live tests
@printf '%s\n' \
'Requires configured OpenAI credentials and network access.' \
'Test binaries: live_openai, live_openai_chat_completions'
cargo test --test live_openai -- --ignored --nocapture
cargo test --test live_openai_chat_completions -- --ignored --nocapture
test-live-anthropic: ## Run Anthropic and Anthropic-compatible live tests
@printf '%s\n' \
'Requires Anthropic/Claude auth plus any provider-specific credentials exercised by the compatible suite.' \
'Compatible probes include DeepSeek, Xiaomi, Z.ai, BigModel, and MiniMax; the cache matrix may be high cost.' \
'Test binaries: live_llm_baseline (Anthropic cache test), live_anthropic, live_anthropic_cache, live_anthropic_compatible'
cargo test --test live_llm_baseline live_llm_baseline_anthropic_prompt_cache_hit -- --ignored --nocapture
cargo test --test live_anthropic -- --ignored --nocapture
cargo test --test live_anthropic_cache -- --ignored --nocapture
@set -eu; \
for live_test in $(ANTHROPIC_COMPATIBLE_LIVE_TESTS); do \
cargo test --test live_anthropic_compatible "$$live_test" -- --exact --ignored --nocapture; \
done
test-live-codex: ## Run OpenAI Codex live tests
@printf '%s\n' \
'Requires Codex CLI ChatGPT auth state, network access, and image support for the image probe.' \
'Test binaries: live_codex, live_openai_codex_compact'
cargo test --test live_codex -- --ignored --nocapture
cargo test --test live_openai_codex_compact -- --ignored --nocapture
test-live-xai: ## Run xAI live tests
@printf '%s\n' \
'Requires configured xAI credentials and network access.' \
'Test binary: live_xai'
cargo test --test live_xai -- --ignored --nocapture
test-live-images: ## Run provider-backed image and vision live tests
@printf '%s\n' \
'Requires an OpenAI-compatible vision credential and a Volcengine Ark image credential, plus network access.' \
'Test binaries: live_view_image, live_volcengine_image'
cargo test --test live_view_image -- --ignored --nocapture
cargo test --test live_volcengine_image -- --ignored --nocapture
test-live-runtime: ## Run end-to-end runtime and workspace-tool live tests
@printf '%s\n' \
'Requires the selected continuity/workspace model credentials, network access, and git.' \
'Defaults: deepseek-anthropic/deepseek-v4-pro for continuity; configured default model for workspace tools.' \
'Test binaries: live_prompt_continuity, live_workspace_tools'
cargo test --test live_prompt_continuity -- --ignored --nocapture
cargo test --test live_workspace_tools -- --ignored --nocapture
docker-build: ## Build the local Holon runtime image
docker build --tag "$(DOCKER_IMAGE)" .
docker-smoke: docker-build ## Start the image and verify the real service readiness boundary
scripts/docker-smoke.sh "$(DOCKER_IMAGE)"
docker-e2e: docker-build ## Run the release core Docker E2E suite with a real LLM
python3 scripts/docker-e2e.py --image "$(DOCKER_IMAGE)" --skip-build --suite core
docker-e2e-scheduler-required: docker-build ## Run the deterministic scheduler release gate
python3 scripts/docker-e2e.py --image "$(DOCKER_IMAGE)" --skip-build --profile scheduler-required --scheduler-matrix --timeout 120
docker-e2e-scheduler-live-canary: docker-build ## Run the real-model scheduler canary
python3 scripts/docker-e2e.py --image "$(DOCKER_IMAGE)" --skip-build --profile scheduler-live-canary --scheduler-matrix --timeout 120
docker-e2e-validate: ## Validate the Docker E2E manifest and runner unit tests
python3 scripts/docker-e2e.py --validate-manifest
python3 -m unittest tests.test_docker_e2e_runner tests.test_scheduler_drill
docker-live-acceptance: docker-e2e ## Compatibility alias for docker-e2e
fmt:
cargo fmt
fmt-check: ## Check formatting without modifying files
cargo fmt --all -- --check
lint: ## Run clippy
cargo clippy --all-targets
check: ## Quick local check (formatting + clippy + compile check)
RUSTFLAGS="-D warnings" cargo check --all-targets
ci: web-ci fmt-check lint build snapshots-check test-resource-lint test ## Run the full CI checks locally
run:
cargo run -- serve
clean: ## Remove Rust build artifacts
cargo clean