Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
executable file
Β·725 lines (612 loc) Β· 26.9 KB
/
Copy pathjustfile
File metadata and controls
executable file
Β·725 lines (612 loc) Β· 26.9 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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
#!/usr/bin/env just --justfile
# π΅ Discogsography Justfile
# Task automation for Python/Rust microservices platform
# Run 'just --list' to see all available commands
# Set shell for Windows compatibility
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
# Default recipe shows help
default:
@just --list
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Development & Setup
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Install all dependencies and setup development environment
[group('setup')]
install:
uv sync --all-extras
# Install all dependencies including editable packages for all services (used in CI)
[group('setup')]
install-all:
uv sync --all-extras
uv pip install -e api
uv pip install -e brainzgraphinator
uv pip install -e brainztableinator
uv pip install -e common
uv pip install -e dashboard
uv pip install -e explore
uv pip install -e graphinator
uv pip install -e insights
uv pip install -e mcp-server
uv pip install -e schema-init
uv pip install -e tableinator
# Install dependencies for E2E testing (frozen lockfile, subset of packages)
[group('setup')]
install-e2e:
uv sync --all-extras --frozen
uv pip install -e common
uv pip install -e dashboard
uv pip install -e explore
# Install JavaScript dependencies for Explore frontend tests
[group('setup')]
install-js:
cd explore && npm ci
# Initialize pre-commit hooks for development
[group('setup')]
init:
uv run pre-commit install
@echo 'β
Pre-commit hooks installed!'
# Configure Discogs app credentials (run against the API container)
[group('setup')]
configure-discogs consumer-key consumer-secret container="discogsography-api":
docker exec {{ container }} discogs-setup \
--consumer-key {{ consumer-key }} \
--consumer-secret {{ consumer-secret }}
# Update pre-commit hooks to latest versions
[group('setup')]
update-hooks:
uv run pre-commit autoupdate --freeze
# Check for outdated dependencies (Python, Rust, Docker)
[group('setup')]
check-updates:
@echo 'π Python dependency updates:'
uv run pip list --outdated
@echo ''
@echo 'π¦ Rust dependency updates:'
@if [ -d 'extractor' ]; then \
cargo install cargo-run-bin --quiet 2>/dev/null || true; \
cd extractor && cargo bin --install --quiet 2>/dev/null || true && cargo bin cargo-outdated; \
else \
echo 'No Rust project found'; \
fi
@echo ''
@echo 'π³ Docker image updates:'
@docker images --format "table \{\{.Repository\}\}:\{\{.Tag\}\}\t\{\{.CreatedSince\}\}" | head -20 || echo 'Docker not available'
# Update all dependencies to latest versions (Python, Rust, pre-commit, Docker)
[group('setup')]
update-deps:
@echo 'π Running comprehensive dependency update...'
@./scripts/update-project.sh --no-backup --skip-tests
@echo ''
@echo 'β
All dependencies updated!'
@echo 'π‘ Run "just test-all" to verify everything still works'
# Update uv itself to the latest version (only if installed via standalone script)
[group('setup')]
update-uv:
#!/usr/bin/env bash
set -euo pipefail
# `uv self update` only works for the standalone installer. Managed installs
# (package manager, GitHub Actions runner image, pipx, brew) intentionally
# refuse to self-update and exit non-zero. Detect that case and return 0 so
# callers (scripts/update-project.sh, CI) don't surface a spurious error.
if output=$(uv self update 2>&1); then
echo "$output"
else
exit_code=$?
if echo "$output" | grep -q "standalone installation scripts"; then
echo "βοΈ Skipping uv self-update: uv was not installed via the standalone installer"
exit 0
fi
echo "$output" >&2
exit "$exit_code"
fi
# Lock Python dependencies with upgrades (respects >= constraints)
[group('setup')]
lock-upgrade:
uv lock --upgrade
# Sync all Python dependencies including dev and optional extras
[group('setup')]
sync:
uv sync --all-extras --dev
# Sync all Python dependencies with upgrades
[group('setup')]
sync-upgrade:
uv sync --all-extras --dev --upgrade
# Update npm dependencies in Explore frontend
[group('setup')]
update-npm:
cd explore && npm update --save
# Update Rust dependencies (lock file only, within Cargo.toml constraints)
[group('setup')]
update-cargo:
cd extractor && cargo update
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Code Quality & Linting
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Run all pre-commit hooks on all files
[group('quality')]
lint:
uv run pre-commit run --all-files
# Run Python-specific linters (ruff & mypy)
[group('quality')]
lint-python:
uv run ruff check .
uv run mypy .
# Type-check Python with mypy (AGF validation gate; `just lint` also runs mypy via pre-commit)
[group('quality')]
typecheck:
uv run mypy .
# AGF validation gate for `bh work check` / `bh work submit`: lint, typecheck, unit tests
[group('quality')]
check: lint typecheck test
# Format all Python code with ruff
[group('quality')]
format:
uv run ruff format .
# Run security checks with bandit
[group('quality')]
security:
uv run bandit -r . -c pyproject.toml
# Run pip-audit (Python dependency vulnerability scan)
[group('quality')]
pip-audit:
#!/usr/bin/env bash
set -e
IGNORE_ARGS=""
if [[ -f .pip-audit-ignores ]]; then
while IFS= read -r line; do
vuln_id=$(echo "$line" | sed 's/#.*//' | tr -d '[:space:]')
[[ -z "$vuln_id" ]] && continue
IGNORE_ARGS="$IGNORE_ARGS --ignore-vuln $vuln_id"
done < .pip-audit-ignores
fi
# shellcheck disable=SC2086
uv run pip-audit --desc $IGNORE_ARGS
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Testing
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Run unit tests (excluding E2E and live-service integration tests)
[group('test')]
test:
uv run pytest -m 'not e2e and not integration'
# Run integration tests that need a live RabbitMQ (CI supplies one; set RABBITMQ_HOST)
[group('testing')]
test-rabbitmq-integration:
# -n0 (no xdist) + -s so output streams live instead of being buffered and lost
# if the run is killed; an explicit per-test timeout bounds any broker hang.
uv run pytest tests/common/test_rabbitmq_integration.py -m integration \
-p no:randomly -n0 -s -v --timeout=45 --timeout-method=thread
# Dedicated disposable PG/Neo4j only; fixture owns the entire graph, so no xdist.
[group('testing')]
test-canonical-pairs-integration:
uv run pytest tests/integration/test_canonical_pairs.py -m integration \
-n0 -v --timeout=60 --timeout-method=thread
# Owned immutable-generation controls, exclusive PG/Neo4j and serial tests.
[group('testing')]
test-collection-snapshots-integration:
uv run pytest tests/integration/test_collection_snapshots.py -m integration \
-n0 -v --timeout=180 --timeout-method=thread \
--cov=api --cov=common --cov=schema-init \
--cov-report=xml --cov-report=json --cov-report=term-missing
# Run JavaScript unit tests for Explore frontend
[group('test')]
test-js:
cd explore && npx vitest run
# Run JavaScript tests with coverage
[group('test')]
test-js-cov:
cd explore && npx vitest run --coverage
# Run tests with coverage report
[group('test')]
test-cov:
uv run pytest --cov --cov-report=xml --cov-report=json --cov-report=term -m 'not e2e'
# Run end-to-end browser tests
[group('test')]
test-e2e:
uv run pytest tests/dashboard/test_dashboard_ui.py -v
# Run all tests including E2E
[group('test')]
test-all:
uv run pytest
# Run all service tests in parallel for maximum speed
[group('test')]
test-parallel:
#!/usr/bin/env bash
set -e
echo "π Running all service tests in parallel..."
# Run each service test in background
uv run pytest tests/api/ -v > /tmp/test-api.log 2>&1 &
pid_api=$!
uv run pytest tests/common/ -v > /tmp/test-common.log 2>&1 &
pid_common=$!
uv run pytest tests/dashboard/ -v > /tmp/test-dashboard.log 2>&1 &
pid_dashboard=$!
uv run pytest tests/explore/ -m 'not e2e' -v > /tmp/test-explore.log 2>&1 &
pid_explore=$!
uv run pytest tests/insights/ -v > /tmp/test-insights.log 2>&1 &
pid_insights=$!
uv run pytest tests/brainzgraphinator/ -v > /tmp/test-brainzgraphinator.log 2>&1 &
pid_brainzgraphinator=$!
uv run pytest tests/graphinator/ -v > /tmp/test-graphinator.log 2>&1 &
pid_graphinator=$!
uv run pytest tests/mcp-server/ -v > /tmp/test-mcp-server.log 2>&1 &
pid_mcp_server=$!
uv run pytest tests/schema-init/ -v > /tmp/test-schema-init.log 2>&1 &
pid_schema_init=$!
uv run pytest tests/tableinator/ -v > /tmp/test-tableinator.log 2>&1 &
pid_tableinator=$!
uv run pytest tests/brainztableinator/ -v > /tmp/test-brainztableinator.log 2>&1 &
pid_brainztableinator=$!
(cd explore && npx vitest run) > /tmp/test-js.log 2>&1 &
pid_js=$!
if [ -d "extractor" ]; then
(cd extractor && cargo test) > /tmp/test-extractor.log 2>&1 &
pid_extractor=$!
fi
# Wait for all tests and track results
failed=0
wait $pid_api || { echo "β API tests failed"; cat /tmp/test-api.log; failed=1; }
wait $pid_common || { echo "β Common tests failed"; cat /tmp/test-common.log; failed=1; }
wait $pid_dashboard || { echo "β Dashboard tests failed"; cat /tmp/test-dashboard.log; failed=1; }
wait $pid_explore || { echo "β Explore tests failed"; cat /tmp/test-explore.log; failed=1; }
wait $pid_insights || { echo "β Insights tests failed"; cat /tmp/test-insights.log; failed=1; }
wait $pid_brainzgraphinator || { echo "β Brainzgraphinator tests failed"; cat /tmp/test-brainzgraphinator.log; failed=1; }
wait $pid_graphinator || { echo "β Graphinator tests failed"; cat /tmp/test-graphinator.log; failed=1; }
wait $pid_mcp_server || { echo "β MCP server tests failed"; cat /tmp/test-mcp-server.log; failed=1; }
wait $pid_schema_init || { echo "β Schema-init tests failed"; cat /tmp/test-schema-init.log; failed=1; }
wait $pid_tableinator || { echo "β Tableinator tests failed"; cat /tmp/test-tableinator.log; failed=1; }
wait $pid_brainztableinator || { echo "β Brainztableinator tests failed"; cat /tmp/test-brainztableinator.log; failed=1; }
wait $pid_js || { echo "β JS tests failed"; cat /tmp/test-js.log; failed=1; }
if [ -n "$pid_extractor" ]; then
wait $pid_extractor || { echo "β Extractor tests failed"; cat /tmp/test-extractor.log; failed=1; }
fi
if [ $failed -eq 0 ]; then
echo "β
All service tests passed!"
# Show summary
echo ""
echo "π Test Summary:"
grep -h "passed" /tmp/test-*.log | tail -10
else
echo "β Some tests failed. Check logs above for details."
exit 1
fi
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Service-Specific Tests
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Run api service tests with coverage
[group('test')]
test-api:
uv run pytest tests/api/ -v \
--cov --cov-config=.coveragerc.api --cov-report=xml --cov-report=json --cov-report=term
# Run common/shared library tests with coverage
[group('test')]
test-common:
uv run pytest tests/common/ -v \
--cov --cov-config=.coveragerc.common --cov-report=xml --cov-report=json --cov-report=term
# Run dashboard service tests with coverage
[group('test')]
test-dashboard:
uv run pytest tests/dashboard/ -v \
--cov --cov-config=.coveragerc.dashboard --cov-report=xml --cov-report=json --cov-report=term
# Run explore service tests with coverage
[group('test')]
test-explore:
uv run pytest tests/explore/ -m 'not e2e' -v \
--cov --cov-config=.coveragerc.explore --cov-report=xml --cov-report=json --cov-report=term
# Run Rust extractor tests (same as extractor-test)
[group('test')]
test-extractor:
cd extractor && cargo test
# Run Rust extractor tests with coverage (requires cargo-llvm-cov)
[group('test')]
test-extractor-cov:
cd extractor && \
cargo llvm-cov test --verbose --lcov --output-path lcov.info
# Run insights service tests with coverage
[group('test')]
test-insights:
uv run pytest tests/insights/ -v \
--cov --cov-config=.coveragerc.insights --cov-report=xml --cov-report=json --cov-report=term
# Run brainzgraphinator service tests with coverage
[group('test')]
test-brainzgraphinator:
uv run pytest tests/brainzgraphinator/ -v \
--cov --cov-config=.coveragerc.brainzgraphinator --cov-report=xml --cov-report=json --cov-report=term
# Run graphinator service tests with coverage
[group('test')]
test-graphinator:
uv run pytest tests/graphinator/ -v \
--cov --cov-config=.coveragerc.graphinator --cov-report=xml --cov-report=json --cov-report=term
# Run mcp-server tests with coverage
[group('test')]
test-mcp-server:
uv run pytest tests/mcp-server/ -v \
--cov --cov-config=.coveragerc.mcp-server --cov-report=xml --cov-report=json --cov-report=term
# Run schema-init service tests with coverage
[group('test')]
test-schema-init:
uv run pytest tests/schema-init/ -v \
--cov --cov-config=.coveragerc.schema-init --cov-report=xml --cov-report=json --cov-report=term
# Run tableinator service tests with coverage
[group('test')]
test-tableinator:
uv run pytest tests/tableinator/ -v \
--cov --cov-config=.coveragerc.tableinator --cov-report=xml --cov-report=json --cov-report=term
# Run brainztableinator service tests with coverage
[group('test')]
test-brainztableinator:
uv run pytest tests/brainztableinator/ -v \
--cov --cov-config=.coveragerc.brainztableinator --cov-report=xml --cov-report=json --cov-report=term
# E2E workflow: dashboard unit tests establishing coverage baseline
[group('test')]
test-e2e-unit-dashboard:
uv run pytest tests/dashboard/ -v -m 'not e2e' \
--cov=dashboard --cov=explore --cov=common \
--cov-report=xml --cov-report=json --cov-report=term
# E2E workflow: explore unit tests appending to coverage baseline
[group('test')]
test-e2e-unit-explore:
uv run pytest tests/explore/ -v -m 'not e2e' \
--cov=dashboard --cov=explore --cov=common \
--cov-append --cov-report=xml --cov-report=json --cov-report=term
# E2E workflow: dashboard E2E tests for a given browser (desktop)
[group('test')]
test-e2e-dashboard browser:
uv run pytest tests/dashboard/test_dashboard_ui.py -v -m e2e \
--browser {{ browser }} \
--cov=dashboard --cov=explore --cov=common --cov-append \
--cov-report=xml --cov-report=json --cov-report=term
# E2E workflow: dashboard E2E tests with mobile device emulation
[group('test')]
test-e2e-dashboard-mobile browser device:
uv run pytest tests/dashboard/test_dashboard_ui.py -v -m e2e \
--browser {{ browser }} \
--device "{{ device }}" \
--cov=dashboard --cov=explore --cov=common --cov-append \
--cov-report=xml --cov-report=json --cov-report=term
# E2E workflow: explore E2E tests for a given browser (desktop)
[group('test')]
test-e2e-explore browser:
uv run pytest tests/explore/test_explore_ui.py -v -m e2e \
--browser {{ browser }} \
--cov=dashboard --cov=explore --cov=common --cov-append \
--cov-report=xml --cov-report=json --cov-report=term
# E2E workflow: explore E2E tests with mobile device emulation
[group('test')]
test-e2e-explore-mobile browser device:
uv run pytest tests/explore/test_explore_ui.py -v -m e2e \
--browser {{ browser }} \
--device "{{ device }}" \
--cov=dashboard --cov=explore --cov=common --cov-append \
--cov-report=xml --cov-report=json --cov-report=term
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Python Services
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Run the API service (user accounts & JWT authentication)
[group('services')]
api:
uv run python api/api.py
# Run the dashboard service (monitoring UI)
[group('services')]
dashboard:
uv run python dashboard/dashboard.py
# Run the explore service (graph exploration and trends)
[group('services')]
explore:
uv run python -m explore.explore
# Run insights service locally
[group('services')]
insights:
uv run python insights/insights.py
# Run the graphinator service (Neo4j graph builder)
[group('services')]
graphinator:
uv run python graphinator/graphinator.py
# Run the schema-init service (one-time Neo4j and PostgreSQL schema initialization)
[group('services')]
schema-init:
uv run python schema-init/schema_init.py
# Run the brainzgraphinator service (MusicBrainz β Neo4j enrichment)
[group('services')]
brainzgraphinator:
uv run python brainzgraphinator/brainzgraphinator.py
# Run the brainztableinator service (MusicBrainz β PostgreSQL)
[group('services')]
brainztableinator:
uv run python brainztableinator/brainztableinator.py
# Run the Rust extractor (high-performance Discogs data ingestion)
[group('services')]
extractor: extractor-run
# Run the MCP server (AI assistant knowledge graph interface)
[group('services')]
mcp-server:
uv run python -m mcp_server.server
# Run the tableinator service (PostgreSQL table builder)
[group('services')]
tableinator:
uv run python tableinator/tableinator.py
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Rust Development
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Build Rust extractor in release mode
[group('rust')]
extractor-build:
cd extractor && \
cargo build --release
# Run Rust extractor tests
[group('rust')]
extractor-test:
cd extractor && \
cargo test
# Run Rust extractor benchmarks
[group('rust')]
extractor-bench:
cd extractor && \
cargo bench
# Run Rust extractor in release mode
[group('rust')]
extractor-run:
cd extractor && \
cargo run --release
# Lint Rust code with clippy (treats warnings as errors)
[group('rust')]
extractor-lint:
cd extractor && \
cargo clippy --all-targets -- -D warnings
# Format Rust code
[group('rust')]
extractor-fmt:
cargo fmt --manifest-path extractor/Cargo.toml
# Check Rust code formatting (for CI/pre-commit)
[group('rust')]
extractor-fmt-check:
cd extractor && \
cargo fmt --check
# Run cargo-audit (Rust advisory database scan)
[group('rust')]
extractor-audit:
cargo audit --file Cargo.lock
# Run cargo-deny (Rust license and policy check)
[group('rust')]
extractor-deny:
cargo deny --manifest-path extractor/Cargo.toml check
# Clean Rust build artifacts
[group('rust')]
extractor-clean:
cd extractor && \
cargo clean
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Docker Operations
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Start all Docker services in background
[group('docker')]
up:
docker compose up -d
# Stop all Docker services
[group('docker')]
down:
docker compose down
# Show logs from all services (follow mode)
[group('docker')]
logs:
docker compose logs -f
# Rebuild all Docker images and restart services
[group('docker')]
rebuild:
docker compose down
docker compose build
docker compose up -d
# Build specific service Docker images
[group('docker')]
build:
docker compose build \
api \
brainzgraphinator \
brainztableinator \
dashboard \
explore \
extractor-discogs \
extractor-musicbrainz \
graphinator \
insights \
schema-init \
tableinator
# Build production Docker images
[group('docker')]
build-prod:
docker compose \
-f docker-compose.yml \
-f docker-compose.prod.yml \
build
# Deploy services in production mode
[group('docker')]
deploy-prod:
docker compose \
-f docker-compose.yml \
-f docker-compose.prod.yml \
up -d
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Monitoring & Utilities
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Monitor RabbitMQ queues in real-time
[group('monitor')]
monitor:
uv run python utilities/monitor_queues.py
# Check for errors in service logs
[group('monitor')]
check-errors:
uv run python utilities/check_errors.py
# Monitor system resources and performance
[group('monitor')]
system-monitor:
uv run python utilities/system_monitor.py
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Cleanup
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Clean project directory of temporary files and caches
[group('clean')]
clean:
@echo 'π§Ή Cleaning project directory...'
@find . -type d -name '__pycache__' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name '.pytest_cache' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name '.ruff_cache' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name '.mypy_cache' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name '.coverage' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name 'htmlcov' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name 'dist' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name 'build' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type d -name '*.egg-info' ! -path './.claude/*' -exec rm -rf {} + 2>/dev/null || true
@find . -type f -name '*.pyc' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '*.pyo' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '*.pyd' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '.DS_Store' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '*.orig' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '*.rej' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '*.bak' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '*.swp' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '*.swo' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name '*~' ! -path './.claude/*' -delete 2>/dev/null || true
@echo 'π¦ Running cargo clean for the Rust workspace...'
@if command -v cargo >/dev/null 2>&1 && [ -f 'Cargo.toml' ]; then \
cargo clean 2>/dev/null || true; \
fi
@if [ -d 'extractor/target' ]; then \
rm -rf extractor/target; \
fi
@if [ -d 'extractor/.bin' ]; then \
rm -rf extractor/.bin; \
fi
@if [ -d '.hypothesis' ]; then \
rm -rf .hypothesis; \
fi
@if [ -d '.benchmarks' ]; then \
rm -rf .benchmarks; \
fi
@if [ -d '.venv' ]; then \
rm -rf .venv; \
fi
@if [ -d 'target' ]; then \
rm -rf target; \
fi
@if [ -d 'rust-version/target' ]; then \
rm -rf rust-version/target; \
fi
@if [ -d '.worktrees' ]; then \
echo 'π³ Removing target/ directories in git worktrees under .worktrees/...'; \
find .worktrees -type d -name target -prune -exec rm -rf {} + 2>/dev/null || true; \
fi
@if [ -d 'data' ]; then \
rm -rf data; \
fi
@find . -type f -name '.coverage' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name 'coverage.xml' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name 'coverage.json' ! -path './.claude/*' -delete 2>/dev/null || true
@find . -type f -name 'lcov.info' ! -path './.claude/*' -delete 2>/dev/null || true
@echo 'β
Project cleaned!'
@echo 'π Preserved: .claude, .git, uv.lock'
# Deep clean including Docker volumes (use with caution!)
[group('clean')]
deep-clean: clean
@echo 'π³ Cleaning Docker...'
@docker compose down -v --remove-orphans 2>/dev/null || true
@docker system prune -f 2>/dev/null || true
@echo 'β
Deep clean done!'