-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpyproject.toml
More file actions
435 lines (422 loc) · 12.7 KB
/
Copy pathpyproject.toml
File metadata and controls
435 lines (422 loc) · 12.7 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "cognithor"
version = "0.99.0"
description = "Cognithor · Agent OS — Local-first autonomous agent operating system"
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE", "NOTICE"]
requires-python = ">=3.12"
authors = [
{ name = "Alexander Söllner" },
]
keywords = ["ai", "agent", "ollama", "local-first", "automation"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
# Core
"pydantic>=2.10,<3",
"pydantic-settings>=2.7,<3",
"httpx>=0.28,<1",
"pyyaml>=6.0,<7",
# Hashing (Hashline Guard)
"xxhash>=3.0,<4",
# Logging
"structlog>=25.4,<26",
# CLI
"rich>=13.0,<14",
"prompt-toolkit>=3.0,<4",
# Async
"anyio>=4.0,<5",
# Security
"cryptography>=46.0.5",
# .env file loading
"python-dotenv>=1.0,<2",
# Crew-Layer template scaffolder (Feature 3)
"jinja2>=3.1,<4",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0,<9",
"pytest-asyncio>=0.24,<1",
"pytest-cov>=6.0,<7",
"pytest-httpx>=0.30",
"hypothesis>=6.0,<7",
"ruff>=0.9,<1",
"mypy>=1.14,<2",
"pre-commit>=3.5,<5",
# NOTE: Local sub-packages (cognithor-bench, insurance-agent-pack) are
# NOT listed here because direct file references are forbidden in
# PyPI-published metadata (see PyPI rejection of v0.94.0 publish).
# Install them separately in dev/CI:
# pip install -e ./cognithor_bench
# pip install -e ./examples/insurance-agent-pack
]
# Enterprise-quality test tooling (Sprints 1-3 production-readiness).
# Heavyweight; install with `pip install -e ".[dev,quality]"` only when
# running mutation, soak, chaos, SLO, or arch-fitness suites locally.
# CI installs them on dedicated `quality-*` jobs that run nightly /
# weekly rather than on every PR.
quality = [
"cosmic-ray>=8.3", # mutation testing
"import-linter>=2.0", # architecture fitness
"pytest-benchmark>=4.0", # SLO p95/p99 gates
"locust>=2.20", # 24h soak harness
"cyclonedx-bom>=4.0", # SBOM generation
"pip-audit>=2.7", # supply-chain CVE scan
]
memory = [
"numpy>=2.0,<3",
"sqlite-vec>=0.1",
"beautifulsoup4>=4.12",
]
vector = [
"faiss-cpu>=1.7",
]
mcp = [
"mcp>=1.7,<2",
]
telegram = [
"python-telegram-bot>=21.0,<22",
]
web = [
"fastapi>=0.115,<1",
"uvicorn[standard]>=0.34,<1",
"websockets>=14.0,<15",
]
voice = [
"faster-whisper>=1.0",
"piper-tts>=1.0",
"sounddevice>=0.5",
]
elevenlabs = [
"elevenlabs>=1.0",
]
google-chat = [
"google-auth>=2.0",
"google-api-core>=2.0",
]
discord = [
"discord.py>=2.0",
]
slack = [
"slack-sdk>=3.0",
]
matrix = [
"matrix-nio>=0.24",
]
whatsapp = [
"aiohttp>=3.9",
]
signal = [
"aiohttp>=3.9",
]
teams = [
"aiohttp>=3.9",
]
irc = [
"irc>=20.0",
]
twitch = [
"twitchio>=2.0",
]
documents = [
"fpdf2>=2.7,<3",
"python-docx>=1.0,<2",
"pymupdf>=1.23",
"python-pptx>=0.6",
"openpyxl>=3.1",
"typst>=0.1",
]
search = [
"trafilatura>=2.0",
"ddgs>=9.0,<10",
# trafilatura -> justext imports lxml.html.clean, which lxml 6.x moved
# into the separate lxml-html-clean package.
"lxml-html-clean>=0.4",
]
cron = [
"apscheduler>=3.10,<4",
"croniter>=1.0",
]
postgresql = [
"psycopg[binary]>=3.1",
"psycopg-pool>=3.1",
"pgvector>=0.2",
]
distributed = [
"redis>=5.0,<6",
]
browser = [
"playwright>=1.40",
]
desktop = [
"pyautogui>=0.9",
"pywinauto>=0.6.8",
"mss>=9.0",
"pyperclip>=1.8",
"Pillow>=10.0",
]
encryption = [
"sqlcipher3>=0.6.0",
"keyring>=25.0",
]
identity = [
"chromadb>=1.5.0",
"sentence-transformers>=5.0.0",
"numpy>=2.0,<3",
]
worm = [
"boto3>=1.28",
]
blockchain = [
"web3>=7.0.0",
]
arc = [
"arc-agi>=0.3.0",
"numpy>=2.0,<3",
"scipy>=1.14",
]
arc-gpu = [
"cognithor[arc]",
"torch>=2.2.0",
]
autogen = [
# Single pin-point for AutoGen-source-compat shim.
# Referenced by:
# - tests/test_compat/test_autogen/ (signature parity, behaviour tests)
# - cognithor_bench/src/cognithor_bench/adapters/autogen_adapter.py (lazy import)
# See spec §6 (Single Pin-Point) and §8.4 acceptance criteria.
"autogen-agentchat==0.7.5",
# autogen-ext provides OpenAIChatCompletionClient which the bench-adapter
# imports directly. Without it, `cognithor-bench --adapter autogen` raises
# a misleading ImportError. Pinned to the same minor as autogen-agentchat.
"autogen-ext[openai]==0.7.5",
]
all = [
"cognithor[memory,vector,mcp,telegram,web,search,cron,documents,identity,desktop,arc,encryption]",
]
full = [
"cognithor[all,voice,elevenlabs,postgresql,google-chat,discord,slack,matrix,whatsapp,signal,teams,irc,twitch,distributed,browser,encryption,dev]",
]
[project.urls]
Homepage = "https://github.com/Alex8791-cyber/cognithor"
Repository = "https://github.com/Alex8791-cyber/cognithor"
"Bug Tracker" = "https://github.com/Alex8791-cyber/cognithor/issues"
[project.scripts]
cognithor = "cognithor.__main__:main"
jarvis = "cognithor.__main__:main"
[tool.hatch.build.targets.wheel]
packages = ["src/cognithor"]
# Templates (.jinja / .yaml / non-.py files) are shipped automatically by the
# `packages` discovery — Hatch walks the package tree and includes all files,
# not just .py. The earlier explicit `force-include` of the templates
# directory caused PyPI to reject the wheel with "Duplicate filename in local
# headers" because the same files landed twice (once via packages, once via
# force-include). Keep it out — packages alone is correct.
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
markers = [
"slow: marks tests as slow",
"integration: marks tests requiring external services",
"security_contract: marks security contract invariant tests",
"benchmark: performance budget tests (spec §8.5)",
]
filterwarnings = [
# starlette uses deprecated multipart import — third-party, can't fix
"ignore::PendingDeprecationWarning:starlette",
# asyncio transport cleanup after event loop is closed (Windows + Linux)
"ignore:Exception ignored in.*Transport:pytest.PytestUnraisableExceptionWarning",
# Mock artifacts: coroutines created by AsyncMock but never awaited
"ignore:coroutine .* was never awaited:RuntimeWarning",
]
[tool.ruff]
target-version = "py312"
line-length = 100
src = ["src", "tests"]
# Crew scaffolder templates are Jinja2 source trees, not Python packages —
# they use ``{{ project_name }}`` in directory/file names and ship ``.jinja``
# templates that aren't valid Python until rendered.
extend-exclude = ["src/cognithor/crew/templates"]
[tool.ruff.lint]
select = [
"E", "W", "F", "I", "N", "UP", "B", "SIM", "TCH", "RUF",
]
ignore = [
"RUF001", # Ambiguous EN DASH in strings (korrekt im Deutschen)
"RUF002", # Ambiguous EN DASH in docstrings
"RUF003", # Ambiguous EN DASH in comments
"RUF012", # Mutable class defaults — dataclass pattern, harmless
"N806", # Non-lowercase variable in function — Windows API constants
"N801", # Invalid class name — test naming conventions
"N802", # Invalid function name — intentional conventions
"N805", # Invalid first argument name — intentional
"N811", # Constant imported as non-constant — intentional
"N814", # Camelcase imported as constant — intentional
"N818", # Error suffix on exception name — intentional
"E402", # Module import not at top — conditional imports by design
"E741", # Ambiguous variable name — l, O, I in math code
"SIM117", # Multiple with statements — style preference only
"SIM103", # Needless bool — style preference
"SIM108", # If-else-block instead of if-exp — readability preference
"SIM112", # Uncapitalized env vars — intentional
"SIM115", # Open file with context handler — controlled usage
"B027", # Empty method without abstract decorator — intentional pattern
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Re-exports in __init__.py are intentional
"tests/test_install_fixes.py" = ["E501"] # Embedded shell/JS scripts in strings
"tests/test_packs/test_installer.py" = ["TC003"] # Path used in runtime test bodies via pytest fixtures
"tests/test_gateway/test_video_cleanup.py" = ["TC003"] # Path used in runtime test bodies via pytest fixtures
"src/cognithor/crew/task.py" = ["TC001"] # CrewAgent must be imported at runtime for Pydantic model_rebuild()
"src/cognithor/crew/compiler.py" = ["TC001"] # CrewAgent/CrewTask/CrewProcess used at runtime in pure-function signatures
"src/cognithor/crew/compiler_hierarchical.py" = ["TC001"] # CrewAgent/CrewTask used at runtime in pure-function signatures
"src/cognithor/crew/crew.py" = ["TC001"] # CrewAgent/CrewTask/CrewProcess must be imported at runtime for Pydantic validation
# Hardware-Aware Runtime: dataclasses + manifest models are accessed at runtime
# (e.g. `manifest.tiers` iteration, `Solution.blockers` access). Ruff's TC001
# over-flags these because of `from __future__ import annotations`.
"src/cognithor/system/apply_engine.py" = ["TC001"]
"src/cognithor/system/capabilities.py" = ["TC001"]
"src/cognithor/system/drift_detector.py" = ["TC001"]
"src/cognithor/system/sanity.py" = ["TC001", "SIM102"]
"src/cognithor/system/wizard/cli.py" = ["TC001"]
"src/cognithor/system/doctor.py" = ["TC001"]
"src/cognithor/system/solver.py" = ["TC001"]
[tool.coverage.report]
# Current floor: ~61% (measured 2026-04-29 over the full ~14k-test suite).
# The original 89 % target stays as a roadmap goal — raise this number as
# coverage improves. CI uses `--cov-fail-under` with this same value so the
# gate is *active* (catches regressions) without blocking the pipeline at
# an aspirational threshold the suite does not yet meet.
fail_under = 60
show_missing = true
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
# Disabled: ``[[tool.mypy.overrides]]`` is intentionally over-defensive
# (covers both ``foo`` and ``foo.*``). When some entries don't trigger,
# that's a sign the install is healthy, not a config bug.
warn_unused_configs = false
# Cookiecutter-style template trees contain literal ``{{ project_name }}``
# placeholder directories that mypy refuses to ingest as Python packages.
# They are not on the runtime path; skip the lot.
exclude = [
"src/cognithor/crew/templates/.*",
# Bundled plugin packs are loaded dynamically by PackLoader at runtime.
# They contain duplicate ``src/__init__.py`` entries that confuse mypy's
# module resolver; the packs ship their own typing discipline.
"src/cognithor/_bundled_packs/.*",
]
# Third-party libraries without published type stubs. We keep ``--strict`` for
# our own code, but tell mypy not to follow these into untyped territory.
[[tool.mypy.overrides]]
module = [
"agents",
"agents.*",
"aiohttp",
"aiohttp.*",
"apscheduler",
"apscheduler.*",
"arc_agi",
"arc_agi.*",
"arcengine",
"arcengine.*",
"asyncpg",
"asyncpg.*",
"bashlex",
"bashlex.*",
"boto3",
"boto3.*",
"botbuilder",
"botbuilder.*",
"botocore",
"botocore.*",
"discord",
"discord.*",
"faiss",
"faiss.*",
"faster_whisper",
"faster_whisper.*",
"fitz",
"google.auth",
"google.auth.*",
"google.oauth2",
"google.oauth2.*",
"llama_cpp",
"llama_cpp.*",
"nacl",
"nacl.*",
"nio",
"nio.*",
"ollama",
"ollama.*",
"olm",
"olm.*",
"openpyxl",
"openpyxl.*",
"psutil",
"psutil.*",
"pdf2image",
"pdf2image.*",
"pdfplumber",
"pdfplumber.*",
"piper",
"piper.*",
"playwright",
"playwright.*",
"plyer",
"plyer.*",
"psycopg",
"psycopg.*",
"psycopg_pool",
"psycopg_pool.*",
"pypdf",
"pypdf.*",
"pywinauto",
"pywinauto.*",
"pvporcupine",
"pvporcupine.*",
"pyautogui",
"pyautogui.*",
"pyperclip",
"pyperclip.*",
"pytesseract",
"pytesseract.*",
"redis",
"redis.*",
"vllm",
"vllm.*",
"vosk",
"vosk.*",
"ddgs",
"ddgs.*",
"duckduckgo_search",
"duckduckgo_search.*",
"pysqlcipher3",
"pysqlcipher3.*",
"scipy",
"sqlcipher3",
"sqlcipher3.*",
"scipy.*",
"slack_bolt",
"slack_bolt.*",
"slack_sdk",
"slack_sdk.*",
"watchdog",
"watchdog.*",
"yaml",
]
ignore_missing_imports = true