-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
445 lines (390 loc) Β· 25 KB
/
Makefile
File metadata and controls
445 lines (390 loc) Β· 25 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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# Aegis Stack CLI Development Makefile
# This Makefile is for developing the Aegis Stack CLI tool itself.
# Generated projects have their own Makefiles for application development.
# Run tests (excluding slow tests)
test: ## Run tests (excluding slow tests - use 'test-all' for everything)
@uv run pytest -n auto --dist=loadgroup -m "not slow"
# Run all tests including slow ones
test-all: ## Run all tests including slow ones (for CI/CD)
@uv run pytest -n auto --dist=loadgroup
# Run tests serially (skip xdist; useful for debugging flakes)
test-serial: ## Run tests serially without xdist
@uv run pytest -m "not slow"
# Show full per-test timing (no filter, parallel, ranked by duration)
test-perf: ## Run all tests with full duration ranking
@uv run pytest -n auto --dist=loadgroup --durations=0
# Run linting
lint: ## Run linting with ruff
@uv run ruff check .
# Auto-fix linting issues
fix: ## Auto-fix linting and formatting issues
@uv run ruff check . --fix
@uv run ruff format .
# Format code only
format: ## Format code with ruff
@uv run ruff format .
# Run type checking
typecheck: ## Run type checking with ty
@uv run ty check
# Run all checks (lint + typecheck + fast tests)
check: lint typecheck test ## Run all checks (fast tests only)
# Run comprehensive checks (includes slow tests)
check-all: lint typecheck test-all ## Run comprehensive checks (includes slow tests)
# Install dependencies
install: ## Install dependencies with uv
uv sync --all-extras
# Clean up cache files
clean: ## Clean up cache files
@find . -type d -name "__pycache__" -exec rm -rf {} +
@find . -type f -name "*.pyc" -delete
# Serve documentation locally
docs-serve: ## Serve documentation locally on port 8001 (no live reload, avoids dev server starvation on image-heavy pages)
@uv run mkdocs serve --dev-addr 0.0.0.0:8001 --no-livereload
# Build documentation
docs-build: ## Build the static documentation site
@uv run mkdocs build
# CLI Development Commands
cli-test: ## Test CLI commands locally
@uv run python -m aegis --help
@echo "β
CLI command working"
# ============================================================================
# REDIS DEVELOPMENT COMMANDS
# For experimenting with Redis/arq without generating new projects
# ============================================================================
redis-start: ## Start Redis container for arq experiments
@echo "π Starting Redis for arq development..."
@docker run -d --name aegis-redis -p 6379:6379 --rm redis:7-alpine redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru
@echo "β
Redis running on localhost:6379"
@echo "π‘ Use 'make redis-stop' to stop"
redis-stop: ## Stop Redis container
@echo "βΉοΈ Stopping Redis..."
@docker stop aegis-redis 2>/dev/null || echo "Redis container not running"
redis-cli: ## Connect to Redis CLI
@echo "π§ Connecting to Redis CLI..."
@docker exec -it aegis-redis redis-cli
redis-logs: ## Show Redis logs
@echo "π Showing Redis logs..."
@docker logs -f aegis-redis
redis-stats: ## Show Redis memory and connection stats
@echo "π Redis stats..."
@docker exec -it aegis-redis redis-cli info memory
@echo ""
@docker exec -it aegis-redis redis-cli info clients
redis-reset: ## Reset Redis (clear all data)
@echo "π Resetting Redis data..."
@docker exec -it aegis-redis redis-cli flushall
@echo "β
Redis data cleared"
redis-queues: ## Show all arq queues and their depths
@echo "π arq Queue Status:"
@echo "===================="
@echo -n "default: "; docker exec -it aegis-redis redis-cli zcard arq:queue 2>/dev/null | tr -d '\r' || echo "0"; echo " jobs"
@echo ""
@echo "π Additional Queue Info:"
@echo -n "In Progress: "; docker exec -it aegis-redis redis-cli hlen arq:in-progress 2>/dev/null | tr -d '\r' || echo "0"
@echo -n "Results: "; docker exec -it aegis-redis redis-cli --raw eval "return #redis.call('keys', 'arq:result:*')" 0 2>/dev/null || echo "0"
redis-workers: ## Show active arq workers
@echo "π· Active Workers:"
@echo "=================="
@docker exec -it aegis-redis redis-cli smembers arq:workers 2>/dev/null || echo "No active workers"
redis-failed: ## Show failed job count
@echo "β Failed Jobs:"
@echo "==============="
@docker exec -it aegis-redis redis-cli hlen arq:failed 2>/dev/null || echo "0"
redis-monitor: ## Monitor Redis commands in real-time
@echo "π Monitoring Redis commands (Ctrl+C to stop)..."
@docker exec -it aegis-redis redis-cli monitor
redis-info: ## Show comprehensive Redis info
@echo "βΉοΈ Redis System Information:"
@echo "============================="
@docker exec -it aegis-redis redis-cli info server
@echo ""
@echo "π Memory Usage:"
@echo "================"
@docker exec -it aegis-redis redis-cli info memory
@echo ""
@echo "π₯ Client Connections:"
@echo "======================"
@docker exec -it aegis-redis redis-cli info clients
# Show help
help: ## Show this help message
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
# ============================================================================
# MEDIA/GIF GENERATION COMMANDS
# For converting screen recordings to high-quality GIFs
# ============================================================================
gif: ## Convert MP4 to high-quality GIF (usage: make gif INPUT=recording.mp4)
ifndef INPUT
@echo "Usage: make gif INPUT=path/to/video.mp4 [OUTPUT=output.gif] [FPS=15] [WIDTH=1200] [START=0] [END=10]"
@echo ""
@echo "Options:"
@echo " INPUT - Required. Path to input MP4 file"
@echo " OUTPUT - Optional. Output GIF path (default: same name as input with .gif)"
@echo " FPS - Optional. Frames per second (default: 15, max 30)"
@echo " WIDTH - Optional. Output width in pixels (default: 1200)"
@echo " START - Optional. Start time in seconds (default: beginning)"
@echo " END - Optional. End time in seconds (default: end of video)"
@exit 1
endif
@echo "π¬ Converting $(INPUT) to GIF..."
@mkdir -p .gif-frames
@ffmpeg $(if $(START),-ss $(START)) -i "$(INPUT)" $(if $(END),-to $(END)) -vf "fps=$(or $(FPS),15),scale=$(or $(WIDTH),1200):-1:flags=lanczos" -y .gif-frames/frame_%04d.png
@gifski -o "$(or $(OUTPUT),$(basename $(INPUT)).gif)" --fps $(or $(FPS),15) --quality 90 .gif-frames/*.png
@rm -rf .gif-frames
@echo "β
Created: $(or $(OUTPUT),$(basename $(INPUT)).gif)"
gif-quick: ## Quick lower-quality GIF (smaller file, usage: make gif-quick INPUT=recording.mp4)
ifndef INPUT
@echo "Usage: make gif-quick INPUT=path/to/video.mp4"
@exit 1
endif
@echo "β‘ Quick GIF conversion..."
@ffmpeg -i "$(INPUT)" -vf "fps=10,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -y "$(basename $(INPUT)).gif"
@echo "β
Created: $(basename $(INPUT)).gif"
gif-demo: ## Convert demo recording to GIF (usage: make gif-demo NAME=overseer)
ifndef NAME
@echo "Usage: make gif-demo NAME=overseer"
@echo " Converts demos/recordings/NAME.mov -> docs/images/NAME-demo.gif"
@echo ""
@echo "Workflow:"
@echo " 1. Record screen on Mac"
@echo " 2. Save to demos/recordings/NAME.mov"
@echo " 3. Run: make gif-demo NAME=NAME"
@exit 1
endif
@$(MAKE) gif INPUT=demos/recordings/$(NAME).mov OUTPUT=docs/images/$(NAME)-demo.gif FPS=30 WIDTH=1920
# ============================================================================
# TEMPLATE TESTING TARGETS
# For rapid iteration on cookiecutter template changes
#
# These targets help with the development workflow when modifying the
# cookiecutter templates in aegis/templates/cookiecutter-aegis-project/
#
# Typical workflow:
# 1. Make changes to template files
# 2. Run 'make test-template-quick' for fast feedback
# 3. Run 'make test-template' for full validation
# 4. Run 'make clean-test-projects' to cleanup
# ============================================================================
test-template-quick: ## Quick template test - generate basic project without validation
@echo "π Quick template test - generating basic project..."
@chmod -R +w ../test-basic-stack 2>/dev/null || true
@rm -rf ../test-basic-stack
@env -u VIRTUAL_ENV uv run aegis init test-basic-stack --output-dir .. --no-interactive --force --yes
@echo "π¦ Setting up virtual environment and CLI..."
@cd ../test-basic-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-basic-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "β
Basic test project generated in ../test-basic-stack/"
@echo " CLI command 'test-basic-stack' is now available"
@echo " Run 'cd ../test-basic-stack && make check' to validate"
test-template: ## Full template test - generate project and run validation
@echo "π‘οΈ Full template test - generating and validating project..."
@chmod -R +w ../test-basic-stack 2>/dev/null || true
@rm -rf ../test-basic-stack
@env -u VIRTUAL_ENV uv run aegis init test-basic-stack --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-basic-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-basic-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-basic-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Testing CLI script installation..."
@cd ../test-basic-stack && env -u VIRTUAL_ENV uv run test-basic-stack --help >/dev/null && echo "β
CLI script 'test-basic-stack --help' works" || echo "β οΈ CLI script test failed"
@cd ../test-basic-stack && env -u VIRTUAL_ENV uv run test-basic-stack health quick >/dev/null 2>&1 && echo "β
CLI script 'test-basic-stack health quick' works" || echo "βΉοΈ Health command test skipped (requires running backend)"
@echo "β
Template test completed successfully!"
@echo " Test project available in ../test-basic-stack/"
@echo " CLI command 'test-basic-stack' is available"
test-template-with-components: ## Test template with scheduler component included
@echo "π§© Component template test - generating project with scheduler..."
@chmod -R +w ../test-component-stack 2>/dev/null || true
@rm -rf ../test-component-stack
@env -u VIRTUAL_ENV uv run aegis init test-component-stack --components scheduler --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-component-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-component-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-component-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Testing CLI script installation..."
@cd ../test-component-stack && env -u VIRTUAL_ENV uv run test-component-stack --help >/dev/null && echo "β
CLI script 'test-component-stack --help' works" || echo "β οΈ CLI script test failed"
@cd ../test-component-stack && env -u VIRTUAL_ENV uv run test-component-stack health quick >/dev/null 2>&1 && echo "β
CLI script 'test-component-stack health quick' works" || echo "βΉοΈ Health command test skipped (requires running backend)"
@echo "β
Component template test completed successfully!"
@echo " Test project available in ../test-component-stack/"
@echo " CLI command 'test-component-stack' is available"
clean-test-projects: ## Remove all generated test project directories
@echo "π§Ή Cleaning up test projects..."
@chmod -R +w ../test-basic-stack ../test-component-stack ../test-worker-stack ../test-database-stack ../test-full-stack ../test-auth-stack ../test-ai-stack ../test-ai-memory-stack ../test-ai-sqlite-stack 2>/dev/null || true
@rm -rf ../test-basic-stack ../test-component-stack ../test-worker-stack ../test-database-stack ../test-full-stack ../test-auth-stack ../test-ai-stack ../test-ai-memory-stack ../test-ai-sqlite-stack 2>/dev/null || true
@echo "β
Test projects cleaned up"
# ============================================================================
# STACK MATRIX TESTING TARGETS
# For comprehensive testing of all component combinations
#
# These targets implement the Stack Generation Matrix Testing plan:
# 1. test-stacks: Test generation of all valid combinations
# 2. test-stacks-build: Test that all stacks build and pass checks
# 3. test-stacks-runtime: Test Docker runtime integration (future)
# 4. test-stacks-full: Complete matrix testing pipeline
# ============================================================================
test-stacks: ## Test all stack combinations generation (fast)
@echo "π§ͺ Testing all stack combination generation..."
@uv run pytest tests/cli/test_stack_generation.py -v --tb=short
@echo "β
All stack combinations generate successfully!"
test-stacks-build: ## Test all stacks build and pass checks (slow)
@echo "π¨ Testing all stacks build and validation..."
@echo "β οΈ This is slow - testing dependency installation and code quality for all combinations"
@uv run pytest tests/cli/test_stack_validation.py -v -m "slow" --tb=short
@echo "β
All stacks build and pass quality checks!"
test-stacks-quick: ## Run Phase 2 against base, everything, insights only (fast feedback)
@echo "β‘ Running stack validation against representative subset..."
@uv run pytest tests/cli/test_stack_validation.py::test_stack_full_validation \
-v -m "slow" --tb=short \
-k "base or everything or insights"
@echo "β
Quick stack validation completed!"
test-stacks-runtime: ## Test all stacks runtime integration with Docker (future)
@echo "π³ Runtime integration testing not yet implemented"
@echo "βΉοΈ Will test Docker Compose startup and health checks for all combinations"
test-stacks-full: ## Full stack matrix testing pipeline (comprehensive but slow)
@echo "π Running complete stack matrix testing pipeline..."
@echo "π Phase 1: Stack Generation Testing"
@make test-stacks
@echo ""
@echo "π Phase 2: Stack Build and Validation Testing"
@make test-stacks-build
@echo ""
@echo "π Phase 3: Kitchen Sink (everything stack: all services + components)"
@make test-everything
@echo ""
@echo "π Complete stack matrix testing completed successfully!"
@echo " All component/service combinations can generate, build, and pass quality checks"
test-everything: ## Generate and run ALL tests inside the kitchen-sink stack
@echo "π§ͺ Running full kitchen-sink stack test (all services + core components)..."
@uv run pytest tests/cli/test_stack_validation.py -v -m "slow" -k "everything" --tb=short
@echo "β
Kitchen sink passes full validation."
# Enhanced template testing with specific component combinations
test-template-database: ## Test template with database component
@echo "ποΈ Testing database component template..."
@chmod -R +w ../test-database-stack 2>/dev/null || true
@rm -rf ../test-database-stack
@env -u VIRTUAL_ENV uv run aegis init test-database-stack --components database --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-database-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-database-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-database-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Testing CLI script installation..."
@cd ../test-database-stack && env -u VIRTUAL_ENV uv run test-database-stack --help >/dev/null && echo "β
CLI script 'test-database-stack --help' works" || echo "β οΈ CLI script test failed"
@cd ../test-database-stack && env -u VIRTUAL_ENV uv run test-database-stack health status --help >/dev/null && echo "β
Health commands available" || echo "β οΈ Health command test failed"
@echo "β
Database template test completed successfully!"
@echo " Test project available in ../test-database-stack/"
test-template-worker: ## Test template with worker component
@echo "π§ Testing worker component template..."
@chmod -R +w ../test-worker-stack 2>/dev/null || true
@rm -rf ../test-worker-stack
@env -u VIRTUAL_ENV uv run aegis init test-worker-stack --components worker --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-worker-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-worker-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-worker-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Testing CLI script installation..."
@cd ../test-worker-stack && env -u VIRTUAL_ENV uv run test-worker-stack --help >/dev/null && echo "β
CLI script 'test-worker-stack --help' works" || echo "β οΈ CLI script test failed"
@cd ../test-worker-stack && env -u VIRTUAL_ENV uv run test-worker-stack health status --help >/dev/null && echo "β
Health commands available" || echo "β οΈ Health command test failed"
@echo "β
Worker template test completed successfully!"
@echo " Test project available in ../test-worker-stack/"
test-template-auth: ## Test template with auth service
@echo "π Testing auth service template..."
@chmod -R +w ../test-auth-stack 2>/dev/null || true
@rm -rf ../test-auth-stack
@env -u VIRTUAL_ENV uv run aegis init test-auth-stack --services auth --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-auth-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-auth-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-auth-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Testing CLI script installation..."
@cd ../test-auth-stack && env -u VIRTUAL_ENV uv run test-auth-stack --help >/dev/null && echo "β
CLI script 'test-auth-stack --help' works" || echo "β οΈ CLI script test failed"
@cd ../test-auth-stack && env -u VIRTUAL_ENV uv run test-auth-stack health status --help >/dev/null && echo "β
Health commands available" || echo "β οΈ Health command test failed"
@echo "β
Auth service template test completed successfully!"
@echo " Test project available in ../test-auth-stack/"
test-template-ai: ## Test template with AI service
@echo "π€ Testing AI service template..."
@chmod -R +w ../test-ai-stack 2>/dev/null || true
@rm -rf ../test-ai-stack
@env -u VIRTUAL_ENV uv run aegis init test-ai-stack --services ai --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-ai-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-ai-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-ai-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Testing CLI script installation..."
@cd ../test-ai-stack && env -u VIRTUAL_ENV uv run test-ai-stack --help >/dev/null && echo "β
CLI script 'test-ai-stack --help' works" || echo "β οΈ CLI script test failed"
@cd ../test-ai-stack && env -u VIRTUAL_ENV uv run test-ai-stack health status --help >/dev/null && echo "β
Health commands available" || echo "β οΈ Health command test failed"
@cd ../test-ai-stack && env -u VIRTUAL_ENV uv run test-ai-stack ai version >/dev/null && echo "β
AI service commands available" || echo "β οΈ AI command test failed"
@echo "π€ Testing PydanticAI installation..."
@cd ../test-ai-stack && env -u VIRTUAL_ENV uv run python -c "import pydantic_ai; print('β
PydanticAI v' + pydantic_ai.__version__ + ' installed')" || echo "β οΈ PydanticAI import test failed"
@echo "β
AI service template test completed successfully!"
@echo " Test project available in ../test-ai-stack/"
test-template-ai-memory: ## Test AI service with memory backend (default)
@echo "π§ Testing AI service with memory backend..."
@chmod -R +w ../test-ai-memory-stack 2>/dev/null || true
@rm -rf ../test-ai-memory-stack
@env -u VIRTUAL_ENV uv run aegis init test-ai-memory-stack --services ai --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-ai-memory-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-ai-memory-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-ai-memory-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Verifying memory backend..."
@test ! -f ../test-ai-memory-stack/app/models/conversation.py && echo "β
No SQLModel conversation tables (memory mode)" || echo "β SQLModel tables should not exist in memory mode"
@grep -q '"persistence": "memory"' ../test-ai-memory-stack/app/services/ai/health.py && echo "β
Health shows memory persistence" || echo "β οΈ Health persistence check failed"
@echo "β
AI memory backend template test completed!"
test-template-ai-sqlite: ## Test AI service with SQLite persistence
@echo "πΎ Testing AI service with SQLite persistence..."
@chmod -R +w ../test-ai-sqlite-stack 2>/dev/null || true
@rm -rf ../test-ai-sqlite-stack
@env -u VIRTUAL_ENV uv run aegis init test-ai-sqlite-stack --services "ai[sqlite]" --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-ai-sqlite-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-ai-sqlite-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-ai-sqlite-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Verifying SQLite backend..."
@test -f ../test-ai-sqlite-stack/app/models/conversation.py && echo "β
SQLModel conversation tables exist" || echo "β SQLModel tables missing"
@grep -q '"persistence": "sqlite"' ../test-ai-sqlite-stack/app/services/ai/health.py && echo "β
Health shows sqlite persistence" || echo "β οΈ Health persistence check failed"
@grep -q 'from app.core.db import db_session' ../test-ai-sqlite-stack/app/services/ai/conversation.py && echo "β
SQLite imports present" || echo "β SQLite imports missing"
@echo "β
AI SQLite persistence template test completed!"
test-template-full: ## Test template with all components (worker + scheduler + database)
@echo "π Testing full component template..."
@chmod -R +w ../test-full-stack 2>/dev/null || true
@rm -rf ../test-full-stack
@env -u VIRTUAL_ENV uv run aegis init test-full-stack --components worker,scheduler,database --output-dir .. --no-interactive --force --yes
@echo "π¦ Installing dependencies and CLI..."
@cd ../test-full-stack && chmod -R +w .venv 2>/dev/null || true && rm -rf .venv && env -u VIRTUAL_ENV uv sync --extra dev --extra docs
@cd ../test-full-stack && env -u VIRTUAL_ENV uv pip install -e .
@echo "π Running validation checks..."
@cd ../test-full-stack && env -u VIRTUAL_ENV make check
@echo "π§ͺ Testing CLI script installation..."
@cd ../test-full-stack && env -u VIRTUAL_ENV uv run test-full-stack --help >/dev/null && echo "β
CLI script 'test-full-stack --help' works" || echo "β οΈ CLI script test failed"
@cd ../test-full-stack && env -u VIRTUAL_ENV uv run test-full-stack health status --help >/dev/null && echo "β
Health commands available" || echo "β οΈ Health command test failed"
@echo "β
Full stack template test completed successfully!"
@echo " Test project available in ../test-full-stack/"
@echo " Includes: backend, frontend, worker queues, scheduler, Redis, database"
# Quick component testing for development workflow
test-component-quick: ## Quick test of specific component (set COMPONENT=worker|scheduler)
ifndef COMPONENT
@echo "β Usage: make test-component-quick COMPONENT=worker"
@echo " Available components: worker, scheduler"
@exit 1
endif
@echo "β‘ Quick testing $(COMPONENT) component..."
@chmod -R +w ../test-$(COMPONENT)-quick 2>/dev/null || true
@rm -rf ../test-$(COMPONENT)-quick
@env -u VIRTUAL_ENV uv run aegis init test-$(COMPONENT)-quick --components $(COMPONENT) --output-dir .. --no-interactive --force --yes
@echo "β
$(COMPONENT) component generated successfully in ../test-$(COMPONENT)-quick/"
@echo " Run 'cd ../test-$(COMPONENT)-quick && make check' to validate"
# ``test-parity*`` and ``test-engines*`` targets were removed in PR #401
# when Cookiecutter was retired β Copier is now the sole template engine,
# so parity/dual-engine harnesses became dead weight. The backing
# ``tests/test_template_parity.py`` + ``--engine=`` plugin no longer exist;
# ``make test-stacks-full`` is the canonical full-coverage entry point.
.PHONY: test lint fix format typecheck check install clean docs-serve docs-build cli-test gif gif-quick gif-demo redis-start redis-stop redis-cli redis-logs redis-stats redis-reset redis-queues redis-workers redis-failed redis-monitor redis-info test-template-quick test-template test-template-with-components test-template-database test-template-worker test-template-auth test-template-ai test-template-full test-component-quick test-stacks test-stacks-build test-stacks-runtime test-stacks-full test-everything clean-test-projects help
# Default target
.DEFAULT_GOAL := help