-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathMakefile
More file actions
203 lines (159 loc) · 5.66 KB
/
Copy pathMakefile
File metadata and controls
203 lines (159 loc) · 5.66 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
# ============================================================================
# Cognithor · Agent OS – Makefile
# ============================================================================
.DEFAULT_GOAL := help
SHELL := /bin/bash
VENV := $(HOME)/.cognithor/venv
PYTHON := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
COGNITHOR := $(VENV)/bin/cognithor
# ============================================================================
# Hilfe
# ============================================================================
.PHONY: help
help: ## Zeigt diese Hilfe
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
# ============================================================================
# Installation
# ============================================================================
.PHONY: install
install: ## Vollständige Installation (interaktiv)
@./install.sh
.PHONY: install-minimal
install-minimal: ## Minimal-Installation (nur Core)
@./install.sh --minimal
.PHONY: install-full
install-full: ## Komplette Installation inkl. Voice
@./install.sh --full
.PHONY: venv
venv: ## Erstellt Virtual Environment
python3 -m venv $(VENV)
$(PIP) install --upgrade pip setuptools wheel
.PHONY: dev
dev: venv ## Installiert im Entwicklungsmodus
$(PIP) install -e ".[all,dev]"
# ============================================================================
# Starten
# ============================================================================
.PHONY: run
run: ## Startet Cognithor CLI
$(COGNITHOR)
.PHONY: run-debug
run-debug: ## Startet mit Debug-Logging
$(COGNITHOR) --log-level DEBUG
.PHONY: init
init: ## Erstellt nur Verzeichnisstruktur
$(COGNITHOR) --init-only
# ============================================================================
# Systemd
# ============================================================================
.PHONY: systemd-install
systemd-install: ## Installiert Systemd-Services
@./install.sh --systemd
.PHONY: start
start: ## Startet Cognithor als Systemd-Service
systemctl --user start cognithor
.PHONY: stop
stop: ## Stoppt Cognithor-Service
systemctl --user stop cognithor
.PHONY: restart
restart: ## Neustart Cognithor-Service
systemctl --user restart cognithor
.PHONY: status
status: ## Zeigt Service-Status
systemctl --user status cognithor
.PHONY: logs
logs: ## Zeigt Live-Logs
journalctl --user -u cognithor -f
.PHONY: enable
enable: ## Aktiviert Autostart
systemctl --user enable cognithor
# ============================================================================
# Tests
# ============================================================================
.PHONY: test
test: ## Alle Tests ausführen
$(PYTHON) -m pytest tests/ -q
.PHONY: test-v
test-v: ## Tests mit ausführlicher Ausgabe
$(PYTHON) -m pytest tests/ -v --tb=short
.PHONY: test-cov
test-cov: ## Tests mit Coverage-Report
$(PYTHON) -m pytest tests/ --cov=jarvis --cov-report=term-missing --cov-report=html
.PHONY: test-fast
test-fast: ## Nur schnelle Unit-Tests (ohne Integration)
$(PYTHON) -m pytest tests/ -q -m "not slow and not integration"
.PHONY: test-integration
test-integration: ## Nur Integration-Tests
$(PYTHON) -m pytest tests/test_integration/ -v --tb=short
.PHONY: smoke
smoke: ## Smoke-Test (Installation prüfen)
$(PYTHON) scripts/smoke_test.py
.PHONY: first-boot
first-boot: ## First Boot — Erster Start mit echtem Ollama (komplett)
$(PYTHON) scripts/first_boot.py
.PHONY: first-boot-quick
first-boot-quick: ## First Boot — Nur System + Modelle (kein Agent-Loop)
$(PYTHON) scripts/first_boot.py --quick
.PHONY: live
live: ## Live Smoke-Test (mit echtem Ollama)
$(PYTHON) scripts/live_smoke_test.py --verbose
.PHONY: live-quick
live-quick: ## Live Smoke-Test ohne LLM
$(PYTHON) scripts/live_smoke_test.py --skip-llm
.PHONY: health
health: ## Health-Check (Laufzeit)
$(PYTHON) scripts/health_check.py
.PHONY: health-json
health-json: ## Health-Check als JSON
$(PYTHON) scripts/health_check.py --json
# ============================================================================
# Code-Qualität
# ============================================================================
.PHONY: lint
lint: ## Ruff Linter
$(PYTHON) -m ruff check src/ tests/
.PHONY: lint-fix
lint-fix: ## Ruff Auto-Fix
$(PYTHON) -m ruff check --fix src/ tests/
.PHONY: format
format: ## Ruff Formatter
$(PYTHON) -m ruff format src/ tests/
.PHONY: typecheck
typecheck: ## MyPy Type-Checking
$(PYTHON) -m mypy src/jarvis/ --ignore-missing-imports
.PHONY: check
check: lint typecheck test ## Alles prüfen (lint + types + tests)
# ============================================================================
# Metriken
# ============================================================================
.PHONY: stats
stats: ## Projekt-Statistiken
@echo ""
@echo "═══ Cognithor · Projekt-Statistiken ═══"
@echo ""
@echo "Source Code:"
@find src/jarvis -name "*.py" | xargs wc -l | tail -1
@echo ""
@echo "Tests:"
@find tests -name "*.py" | xargs wc -l | tail -1
@echo ""
@echo "Module:"
@find src/jarvis -name "*.py" | wc -l
@echo ""
@echo "Test-Dateien:"
@find tests -name "test_*.py" | wc -l
@echo ""
# ============================================================================
# Aufräumen
# ============================================================================
.PHONY: clean
clean: ## Build-Artefakte entfernen
rm -rf build/ dist/ *.egg-info src/*.egg-info
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -name "*.pyc" -delete 2>/dev/null || true
rm -rf .pytest_cache .ruff_cache .mypy_cache htmlcov
.PHONY: uninstall
uninstall: ## Deinstallation
@./install.sh --uninstall