-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
399 lines (374 loc) · 12.3 KB
/
pyproject.toml
File metadata and controls
399 lines (374 loc) · 12.3 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
[project]
name = "aether"
version = "0.1.0"
description = "Agentic home automation system for Home Assistant"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.11"
authors = [
{ name = "Project Aether Team" }
]
keywords = ["home-assistant", "automation", "agents", "langgraph"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
# LangGraph for agent orchestration (Constitution: State)
"langgraph>=0.2.0,<2.0.0",
"langchain-core>=0.3.0,<2.0.0",
"langchain-openai>=0.2.0,<2.0.0",
# OpenAI for LLM (Research Decision #6)
"openai>=1.50.0,<3.0.0",
# FastAPI for HTTP API (Research Decision #8)
"fastapi>=0.115.0,<1.0.0",
"uvicorn[standard]>=0.32.0,<1.0.0",
"websockets>=13.0,<15.0",
# Database (Research Decision #5: PostgreSQL)
"sqlalchemy[asyncio]>=2.0.0,<3.0.0",
"asyncpg>=0.30.0,<1.0.0",
"alembic>=1.14.0,<2.0.0",
# MLflow for observability (Constitution: Observability)
"mlflow>=3.5.0,<4.0.0",
# Pydantic for validation
"pydantic>=2.10.0,<3.0.0",
"pydantic-settings>=2.6.0,<3.0.0",
# CLI
"typer>=0.14.0,<1.0.0",
"rich>=13.9.0,<15.0.0",
# Scheduling (Feature 10: Scheduled & Event-Driven Insights)
"apscheduler>=3.10.0,<4.0.0",
# Utilities
"httpx>=0.28.0,<1.0.0",
"python-dotenv>=1.0.0,<2.0.0",
"structlog>=24.4.0,<26.0.0",
"langchain-google-genai>=4.2.0,<5.0.0",
"slowapi>=0.1.9,<1.0.0",
"pyjwt>=2.0.0,<3.0.0",
"bcrypt>=4.0.0,<5.0.0",
"webauthn>=2.7.0,<3.0.0",
"cryptography>=46.0.4,<48.0.0",
"google-auth>=2.28.0,<3.0.0",
# YAML schema validation (Feature 26: YAML Schema Compiler/Validator)
"jsonschema>=4.20.0,<5.0.0",
"a2a-sdk[http-server]>=0.3.24",
"prometheus-fastapi-instrumentator>=7.1.0",
]
[project.scripts]
aether = "src.cli.main:app"
[project.urls]
Homepage = "https://github.com/dsaridak/home_agent"
Documentation = "https://github.com/dsaridak/home_agent#readme"
Repository = "https://github.com/dsaridak/home_agent"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src"]
# =============================================================================
# RUFF CONFIGURATION (Constitution: Quality Gates)
# =============================================================================
[tool.ruff]
target-version = "py311"
line-length = 100
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate (commented-out code)
"PL", # Pylint
"RUF", # Ruff-specific rules
]
ignore = [
# Import patterns (lazy imports for circular import avoidance and test isolation)
"PLC0415", # import-outside-top-level
"E402", # module-import-not-at-top-of-file
# FastAPI / framework patterns
"B008", # function-call-in-default-argument (FastAPI Depends() pattern)
"ARG001", # unused-function-argument (required by framework signatures, callbacks)
"ARG002", # unused-method-argument (same)
# Complexity (legitimate in agent orchestration; track and reduce over time)
"PLR0912", # too-many-branches
"PLR0911", # too-many-return-statements
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # magic-value-comparison
# Line length (ruff format handles code; remaining E501 are URLs, strings, comments)
"E501", # line-too-long (enforced by ruff format, not linter)
# Acceptable patterns
"PLW0603", # global-statement (singleton patterns)
"PLW0602", # global-variable-not-assigned
"ERA001", # commented-out-code (tracked as tech debt, not a lint blocker)
"SIM117", # multiple-with-statements (often more readable as-is)
"RUF012", # mutable-class-default (Pydantic/SQLAlchemy models use this)
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"ARG", # Unused arguments OK in tests (fixtures)
"PLR2004", # Magic values OK in tests
]
[tool.ruff.lint.isort]
known-first-party = ["src"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
# =============================================================================
# MYPY CONFIGURATION (Constitution: Quality Gates)
# =============================================================================
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_ignores = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = false # third-party decorators lack py.typed; re-enable when upstream adds stubs
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_configs = true
show_error_codes = true
show_column_numbers = true
# Per-module overrides — third-party libs without py.typed / stubs
[[tool.mypy.overrides]]
module = [
"mlflow.*",
"testcontainers.*",
"factory.*",
"apscheduler.*",
]
ignore_missing_imports = true
# Modules with pre-existing type errors — strict checks relaxed until cleanup.
# New modules MUST pass strict mypy. Burn this list down module-by-module.
# Reduced from 75 (2026-02-09) to 70 (2026-02-14) after decomposition.
# Removed: settings, llm, tracing.mlflow (now pass strict mypy).
# Note (2026-03-08): Most listed modules pass strict mypy individually but fail
# in full-tree checking due to cascading errors from inter-module imports.
# Burn-down strategy: fix error-source modules (agents, ha.*) first, then
# remove downstream modules (dal, tools, tracing) that only fail from imports.
[[tool.mypy.overrides]]
module = [
# Agents layer — complex LLM kwargs and dynamic dispatch
"src.agents.architect",
"src.agents.behavioral_analyst",
"src.agents.dashboard_designer",
"src.agents.data_scientist",
"src.agents.developer",
"src.agents.diagnostic_analyst",
"src.agents.energy_analyst",
# API layer
"src.api.auth",
"src.api.ha_verify",
"src.api.main",
"src.api.middleware",
"src.api.routes.activity_stream",
"src.api.routes.auth",
"src.api.routes.chat",
"src.api.routes.flow_grades",
"src.api.routes.ha_zones",
"src.api.routes.insight_schedules",
"src.api.routes.insights",
"src.api.routes.model_ratings",
"src.api.routes.optimization",
"src.api.routes.passkey",
"src.api.routes.proposals",
"src.api.routes.system",
"src.api.routes.usage",
"src.api.schemas.conversations",
"src.api.schemas.proposals",
# CLI
"src.cli.commands.chat",
# DAL layer
"src.dal.areas",
"src.dal.automations",
"src.dal.base",
"src.dal.conversations",
"src.dal.devices",
"src.dal.entities",
"src.dal.flow_grades",
"src.dal.llm_usage",
"src.dal.queries",
"src.dal.services",
"src.dal.sync",
# Diagnostics
"src.diagnostics.entity_health",
"src.diagnostics.error_patterns",
"src.diagnostics.log_parser",
# Graph layer
"src.graph",
"src.graph.workflows",
"src.graph.workflows.*",
# HA client — httpx dynamic response handling
"src.ha.automation_deploy",
"src.ha.automations",
"src.ha.base",
"src.ha.behavioral",
"src.ha.client",
"src.ha.diagnostics",
"src.ha.entities",
"src.ha.helpers",
"src.ha.history",
# Core
"src.llm_call_context",
"src.scheduler.service",
# Storage
"src.storage.checkpoints",
"src.storage.entities.automation_proposal",
"src.storage.entities.conversation",
"src.storage.entities.message",
"src.storage.entities.passkey_credential",
# Tools
"src.tools",
"src.tools.agent_tools",
"src.tools.analysis_tools",
"src.tools.approval_tools",
"src.tools.dashboard_tools",
"src.tools.diagnostic_tools",
"src.tools.insight_schedule_tools",
"src.tools.specialist_tools",
# Tracing
"src.tracing",
"src.tracing.scorers",
]
disallow_untyped_defs = false
disallow_incomplete_defs = false
warn_return_any = false
warn_unused_ignores = false
check_untyped_defs = false
disable_error_code = [
"type-arg",
"attr-defined",
"no-untyped-call",
"override",
"arg-type",
"assignment",
"return-value",
"type-var",
"name-defined",
"import-untyped",
"index",
"misc",
"comparison-overlap",
"call-overload",
"union-attr",
"operator",
"var-annotated",
"typeddict-unknown-key",
"typeddict-item",
"abstract",
]
# =============================================================================
# PYTEST CONFIGURATION (Constitution: Reliability & Quality)
# =============================================================================
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra", # Show extra test summary
"-q", # Quiet mode
"--strict-markers", # Strict marker enforcement
"--strict-config", # Strict config enforcement
"--durations=20", # Show 20 slowest tests for optimization
]
asyncio_mode = "auto"
# Global per-test timeout: prevents any single test from hanging the suite.
# Unit tests should complete in well under 10s; integration tests can override
# via @pytest.mark.timeout(60). See Constitution Principle V.
timeout = 10
timeout_method = "thread"
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"ignore::ResourceWarning",
"ignore::pytest.PytestUnraisableExceptionWarning",
]
markers = [
"unit: Unit tests (fast, isolated)",
"integration: Integration tests (require services)",
"e2e: End-to-end tests (full system)",
"slow: Slow tests (skip with -m 'not slow')",
"requires_postgres: Tests requiring PostgreSQL container",
]
# =============================================================================
# COVERAGE CONFIGURATION (Constitution: 80% min, 95% critical paths)
# =============================================================================
[tool.coverage.run]
source = ["src"]
branch = true
parallel = true
omit = [
"src/__init__.py",
"tests/*",
# Lifecycle/entry: covered by integration and e2e (hard to unit-test in isolation)
"src/api/main.py",
"src/agents/registry.py",
"src/scheduler/service.py",
# Webhook handlers and action log: integration/e2e coverage
"src/api/routes/webhooks.py",
"src/hitl/action_log.py",
# HA event stream/handler: integration and e2e
"src/ha/event_stream.py",
"src/ha/event_handler.py",
# LLM usage tracking: integration
"src/llm/usage.py",
# MLflow feedback, runs, and init (observability): integration
"src/tracing/mlflow_feedback.py",
"src/tracing/mlflow_runs.py",
"src/tracing/mlflow_init.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"@abstractmethod",
]
fail_under = 80
show_missing = true
skip_covered = true
[tool.coverage.html]
directory = "htmlcov"
[dependency-groups]
dev = [
# Testing (Constitution: Reliability & Quality)
"pytest>=8.3.0",
"pytest-cov>=6.0.0",
"pytest-asyncio>=0.24.0",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.0", # Parallel test execution
"pytest-timeout>=2.3.0,<3.0.0", # Per-test timeout to prevent hangs
"factory-boy>=3.3.0",
"testcontainers>=4.8.0", # PostgreSQL integration tests
"httpx>=0.28.0", # FastAPI TestClient
"aiosqlite>=0.22.1", # Async SQLite for testing
# Linting & Formatting (Constitution: Quality Gates)
"ruff>=0.8.0",
"mypy>=1.13.0",
"pre-commit>=4.0.0",
# Security scanning (used by CI)
"bandit>=1.7.0,<2.0.0",
# Type stubs
"types-python-dateutil>=2.9.0",
"types-PyYAML>=6.0.0",
"sqlalchemy[mypy]>=2.0.0",
]