-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
735 lines (647 loc) Β· 26.5 KB
/
pyproject.toml
File metadata and controls
735 lines (647 loc) Β· 26.5 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
726
727
728
729
730
731
732
733
734
[build-system]
requires = ["uv_build>=0.9,<1"]
build-backend = "uv_build"
[project]
name = "codomyrmex"
version = "1.2.7"
description = "A Modular, Extensible Coding Workspace"
readme = "README.md"
requires-python = ">=3.11"
license = {file = "LICENSE"}
authors = [
{name = "Codomyrmex Contributors"}
]
maintainers = [
{name = "Codomyrmex Contributors"}
]
keywords = ["coding", "workspace", "modular", "development", "AI", "automation"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
]
dependencies = [
# Core toolkit for code analysis and LLM integration
"cased-kit>=1.9.0",
# For .env file support
"python-dotenv>=1.0.0",
# For schema validation (used in model_context_protocol)
"jsonschema>=4.23.0",
# For static analysis
"pylint>=3.0.0",
"bandit>=1.8.0",
"radon>=6.0.0",
"lizard>=1.17.0",
# For git operations
"GitPython>=3.1.0",
# For specific tutorials/recipes
"unidiff>=0.7.0",
"requests>=2.31.0",
# For dependency graph visualization (optional)
# "graphviz", # Also requires Graphviz system package to be installed
"pydantic>=2.8.0",
# Loguru - For logging.
"loguru>=0.7.0",
# Watchdog - For monitoring file system events.
"watchdog>=3.0.0",
# Diff Match Patch - For generating and applying patches.
"diff-match-patch>=20230430.0",
# For syntax highlighting (often a dependency for other tools)
"Pygments>=2.15.0",
# For rich terminal output
"rich>=13.0.0",
# For YAML parsing (used in skills, config_management, documents)
"pyyaml>=6.0.2",
# For progress bars
"tqdm>=4.65.0",
# For timezone support (used in logistics.schedule)
"pytz>=2024.1",
"beautifulsoup4>=4.14.3",
"markdownify>=1.2.2",
# For encryption module
"cryptography>=41.0.0",
# For templating module
"mako>=1.2.0",
"aiohttp>=3.13.3",
# numpy, scipy, networkx β uv sync --extra scientific
# fastapi, uvicorn β uv sync --extra api
# paramiko β uv sync --extra deployment
# fastavro, msgpack β uv sync --extra serialization
# mnemonic β uv sync --extra crypto
"psutil>=6.0.0",
"email-validator>=2.3.0",
"mlx-lm>=0.31.1",
"wasmtime>=42.0.0",
"matplotlib>=3.10.8",
# OpenGauss in-tree agent (CLI + ACP adapter tests import these)
"prompt-toolkit>=3.0.0",
"agent-client-protocol>=0.8.0",
]
[project.optional-dependencies]
# Module-specific optional dependencies
# Install with: uv sync --extra <module-name>
# Or install all: uv sync --all-extras
scientific = [
"numpy>=2.2.0",
"scipy>=1.7.0",
"networkx>=3.0.0",
]
api = [
"fastapi>=0.100.0",
"uvicorn>=0.23.0",
]
deployment = [
"paramiko>=3.3.0",
]
code_review = [
"safety>=2.3.0",
"typing-extensions>=4.0.0",
"vulture>=2.7.0",
]
language_models = [
"certifi>=2022.0.0",
"typing-extensions>=4.0.0",
"urllib3>=1.26.0",
]
cloud = [
"boto3>=1.28.0",
"google-cloud-storage>=2.10.0",
"azure-storage-blob>=12.17.0",
"azure-identity>=1.13.0",
"openstacksdk>=1.0.0",
]
serialization = [
"protobuf>=4.0.0",
"pandas>=2.0.0",
"pyarrow>=12.0.0",
"fastavro>=1.12.1",
"msgpack>=1.1.2",
]
parsing = [
"tree-sitter>=0.20.0",
]
modeling_3d = [
"moderngl>=5.6.0",
"pillow>=8.0.0",
# NOTE: pyarfoundation and pyvr are not available in PyPI - commented out
# "pyarfoundation>=0.1.0",
"pygame>=2.0.0",
"pyopengl>=3.1.0",
"pyrr>=0.10.3",
# "pyvr>=0.1.0",
"trimesh>=3.9.0",
]
performance = [
"psutil>=5.9.0",
]
observability = [
"opentelemetry-api>=1.20.0",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-exporter-otlp>=1.20.0",
"prometheus-client>=0.17.0",
"statsd>=4.0.0",
]
physical_management = [
"alembic>=1.7.0",
"dynaconf>=3.1.0",
"marshmallow>=3.0.0",
"mkdocs-material>=7.3.0",
"mkdocs>=1.2.0",
"pyserial>=3.5",
"smbus2>=0.4.0",
"sqlalchemy>=1.4.0",
"websockets>=10.0",
]
security_audit = [
"cryptography>=41.0.0",
"jinja2>=3.1.0",
"pyopenssl>=23.0.0",
"safety>=2.3.0",
]
static_analysis = [
"pyrefly>=0.16.0",
]
scrape = [
"firecrawl-py>=1.0.0",
]
fpf = [
"pillow>=10.0.0",
]
crypto = [
"pillow>=10.0.0",
"mnemonic>=0.21",
]
documents = [
"chardet>=5.0.0",
"pypdf>=3.0.0",
]
audio = [
"faster-whisper>=1.0.0", # Local Whisper STT (CTranslate2 backend)
"pyttsx3>=2.90", # Offline local TTS
"edge-tts>=6.1.0", # Free Microsoft Edge neural TTS
"pydub>=0.25.0", # Audio manipulation
"soundfile>=0.12.0", # Audio file I/O
]
video = [
"moviepy>=1.0.3", # Video processing
"opencv-python>=4.8.0", # Frame extraction, analysis
"pillow>=10.0.0", # Image processing
]
dark = [
"PyMuPDF>=1.23.0", # PDF rendering and page extraction
"pillow>=10.0.0", # Image processing for filters
]
formal_verification = [
"z3-solver>=4.8.0", # Z3 SMT solver (constraint solving, formal verification)
]
obsidian = [
"python-frontmatter>=1.0.0", # Robust YAML frontmatter parsing
"pyyaml>=6.0.2", # YAML frontmatter serialization
]
calendar = [
"google-api-python-client>=2.0.0",
"google-auth-httplib2>=0.2.0",
"google-auth-oauthlib>=1.0.0",
]
email = [
"google-api-python-client>=2.0.0",
"google-auth-httplib2>=0.2.0",
"google-auth-oauthlib>=1.0.0",
"agentmail>=0.2.17",
]
# LLM provider SDKs β install with: uv sync --extra llm_providers
# (openai, anthropic, google-* are heavy optional deps, not needed for all installs)
llm_providers = [
"openai>=1.0.0",
"anthropic>=0.64.0",
"google-genai>=1.0.0",
"tiktoken>=0.5.0", # OpenAI tokenizer (optional, co-installed with openai)
]
# Semantic search and vector DB β install with: uv sync --extra embedding
embedding = [
"sentence-transformers>=2.0.0",
"chromadb>=0.4.0",
]
# Docker containerization support β install with: uv sync --extra containerization
containerization = [
"docker>=6.0.0",
]
# Data visualization β install with: uv sync --extra data_visualization
data_visualization = [
"matplotlib>=3.10.0",
"seaborn>=0.13.0",
]
# Redis cache/queue support β install with: uv sync --extra cache
cache = [
"redis>=5.0.0",
]
# soul.py β Markdown-based persistent LLM agent memory β install with: uv sync --extra soul
soul = [
"soul-agent>=0.1.4", # Zero-database, file-based persistent agent memory
]
# openfang β Agent OS integration β binary installed separately via curl or cargo
openfang = [] # openfang binary installed separately; no Python deps
pai_pm = []
# NOTE: requires bun runtime (https://bun.sh) β no Python packages needed
# After install: cd src/codomyrmex/pai_pm/server && bun install
google_workspace = [
"google-api-python-client>=2.100.0",
"google-auth>=2.23.0",
"google-auth-httplib2>=0.2.0",
"google-auth-oauthlib>=1.1.0",
]
[project.urls]
Homepage = "https://github.com/docxology/codomyrmex"
Repository = "https://github.com/docxology/codomyrmex"
Issues = "https://github.com/docxology/codomyrmex/issues"
Documentation = "https://codomyrmex.readthedocs.io/"
Changelog = "https://github.com/docxology/codomyrmex/blob/main/CHANGELOG.md"
[tool.uv]
default-groups = ["dev"]
[tool.uv.build-backend]
module-root = "src"
source-include = ["src/codomyrmex/**"]
source-exclude = [
"**/.cursor/**",
"**/.git/**",
"**/__pycache__/**",
"**/htmlcov/**",
"**/.mypy_cache/**",
"**/.pytest_cache/**",
"**/tests/**",
"**/vendor/**",
"**/node_modules/**",
"**/*.pyc",
]
[dependency-groups]
dev = [
{include-group = "lint"},
{include-group = "test"},
"hypothesis>=6.151.9",
"sarif-tools>=3.0.0",
"desloppify[full]>=0.9.14",
]
docs = [
"mkdocs>=1.6.1",
"mkdocs-material>=9.7.3",
"mkdocstrings>=1.0.3",
"mkdocstrings-python>=2.0.3",
]
lint = ["ruff>=0.11.0", "ty"]
test = [
"pytest>=8.0.0",
"pytest-cov>=4.0.0",
"pytest-xdist>=3.0.0",
"pytest-timeout>=2.1.0",
"pytest-asyncio>=0.23.0",
"pytest-benchmark>=4.0.0",
"hypothesis>=6.0.0",
"fakeredis>=2.0.0",
"pyyaml>=6.0.2",
"mutmut>=3.4.0",
"fire>=0.5.0",
]
[project.scripts]
codomyrmex = "codomyrmex.cli:main"
[project.entry-points."claude.skills"]
codomyrmex = "codomyrmex.agents.pai:mcp_bridge"
[tool.coverage.run]
source = ["src/codomyrmex"]
# meme: experimental module (root AGENTS.md); omitted from aggregate coverage until stabilized.
omit = [
"*/tests/*",
"*/test_*.py",
"*/conftest.py",
"*/meme/*",
]
[tool.coverage.report]
fail_under = 40
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.pytest.ini_options]
testpaths = ["src/codomyrmex"]
pythonpath = ["src"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
# Coverage is opt-in: use `make test`, CI, or `pytest --cov=src/codomyrmex --cov-fail-under=40`.
# [tool.coverage.report] fail_under still applies whenever pytest runs with --cov.
addopts = [
"--import-mode=importlib",
"--verbose",
"--tb=short",
"--timeout=300",
"--timeout-method=thread",
]
markers = [
"unit: Unit tests (fast, isolated)",
"integration: Integration tests (may require external services)",
"smoke: Smoke tests that exercise code paths without explicit assertions",
"slow: Slow tests (>10s execution time)",
"performance: Performance and benchmarking tests",
"examples: Example validation tests",
"network: Tests requiring network access",
"database: Tests requiring database access",
"external: Tests requiring external services",
"security: Security-related tests",
"asyncio: Asynchronous tests",
"crypto: Cryptography tests",
"orchestrator: Orchestrator and workflow tests",
"soul: soul module tests (persistent markdown-memory LLM agents)",
"aider: Aider AI pair programming tests",
"openfang: openfang Agent OS integration tests",
"pai_pm: PAI Project Manager module tests (requires bun for server tests)",
"google_workspace: Google Workspace API and gws CLI tests",
]
filterwarnings = [
# Any warning not matched by a later rule becomes a test failure.
"error",
"ignore:The embodiment module is deprecated:DeprecationWarning",
"ignore:codomyrmex\\.collaboration\\.protocols\\.swarm is deprecated:DeprecationWarning",
"ignore:codomyrmex\\.defense is deprecated:DeprecationWarning",
"ignore:builtin type Swig.*has no __module__ attribute:DeprecationWarning",
"ignore:ast\\.Str is deprecated:DeprecationWarning",
"ignore:The verify_requirements argument is now a no-op:DeprecationWarning",
"ignore:datetime\\.datetime\\.utcnow\\(\\) is deprecated:DeprecationWarning",
"ignore::ResourceWarning",
"ignore::pytest.PytestCollectionWarning",
# requests warns on import when urllib3/chardet pins drift; do not use category path (imports requests during parse).
"ignore:.*doesn't match a supported version.*:Warning",
# google.api_core without grpcio-status; optional for storage client import chains during test collection.
"ignore:Please install grpcio-status.*:ImportWarning",
]
# Ruff configuration (replaces flake8, black, isort, pyupgrade)
[tool.ruff]
target-version = "py311"
line-length = 88
src = ["src"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Formatter conflicts
"COM812", # trailing comma (conflicts with ruff format)
"ISC001", # string concat (conflicts with ruff format)
"E501", # line too long (handled by formatter)
# Docstring rules (enable selectively later when docstring push begins)
"D", # all pydocstyle rules
# Type annotation noise (legacy codebase has ~33k missing annotations)
"ANN001", # missing type for function argument
"ANN002", # missing type for *args
"ANN003", # missing type for **kwargs
"ANN201", # missing return type for public function
"ANN202", # missing return type for private function
"ANN204", # missing return type for special method
"ANN401", # Dynamically typed Any
# Assert usage (44k violations β assert is intentional in this codebase)
"S101", # use of assert (tests already ignored via per-file)
# Import style (legacy pattern β import-inside-function is intentional for optional deps)
"PLC0415", # import outside top-level (6.7k β many lazy/optional imports)
# Magic values (too noisy for a config-heavy codebase)
"PLR2004", # magic value comparison
# TODO/FIXME management
"TD002", # missing TODO author
"TD003", # missing TODO link
"FIX002", # line contains TODO
# Complexity/style (keep code readable without enforcement)
"C901", # too complex
"B008", # function calls in argument defaults (FastAPI Depends pattern)
"PLR0913", # too many arguments (complex module configs)
"PLR0911", # too many return statements
"PLR0912", # too many branches
"PLR0915", # too many statements
# Exception handling style (enforce gradually)
"TRY003", # raise vanilla args (1.6k β would require exception refactor)
"EM101", # raw string in exception (refactor to variables β later)
"EM102", # f-string in exception (refactor to variables β later)
"BLE001", # blind except (1.9k β needs case-by-case audit)
# Logging style (legacy codebase uses f-strings in logging)
"G004", # logging f-string (2.2k β migrate to % format later)
# Private member access (common in test code and internal wiring)
"SLF001", # private member access (2.6k β internal module cross-refs)
# Try/except style
"TRY300", # try-consider-else
"TRY400", # error-instead-of-exception
# Pathlib enforcement (migrate gradually from os.path)
"PTH", # all pathlib rules (PTH100-PTH211, ~1.5k β migrate later)
# Argument/method unused (common in ABC/interface patterns)
"ARG001", # unused function argument
"ARG002", # unused method argument
"ARG005", # unused lambda argument (389 β lambda convention)
# Miscellaneous noise
"FBT", # boolean trap (FBT001/002/003 β too opinionated for this codebase)
"ERA001", # commented-out code (will clean up later in targeted pass)
"INP001", # implicit namespace package (scripts dir has no __init__.py by design)
"RUF009", # dataclass default mutable (false positives with Field())
# v1.1.2: Phase 2 triage additions
"NPY002", # numpy legacy random (348 β false positives on non-numpy code)
"N806", # non-lowercase variable (283 β scientific/mathematical naming)
"DTZ005", # tz-naive datetime.now() (470 β migrate to tz-aware later)
"PERF401", # manual list comprehension (302 β many are clearer as loops)
"RET504", # unnecessary assignment before return (128 β readability choice)
"S607", # partial executable path (315 β scripts call local tooling)
"T201", # print statement in library code (2,464 β keep in scripts/)
"PGH003", # bare type: ignore without code (100 β mypyβty migration)
# v1.1.3: Phase 3 triage additions
"EXE001", # shebang not executable (303 β scripts are run via python, not directly)
"S603", # subprocess without shell=True (240 β intentional subprocess usage)
"S311", # suspicious non-crypto random (163 β false positives on test data)
"S106", # hardcoded password func arg (136 β test fixtures, not real credentials)
"S108", # hardcoded temp file (116 β test fixtures use /tmp intentionally)
"S105", # hardcoded password string (86 β test fixtures)
"S110", # try-except-pass (91 β intentional silencing in optional dep imports)
"S310", # suspicious url open (54 β intentional URL fetching in tools)
"PT011", # pytest.raises too broad (133 β acceptable in integration tests)
"PLW0603", # global statement (65 β singletons and module-level caches)
"RUF012", # mutable class default (67 β false positives with ClassVar patterns)
"PYI056", # unsupported method call on __all__ (78 β dynamic module export)
"DTZ001", # datetime without tzinfo (79 β migrate with DTZ005 later)
"A002", # builtin argument shadowing (131 β id/type/format common in domain)
"G201", # logging exc_info (84 β intentional exception logging)
"TRY301", # raise within try (85 β re-raise patterns)
"ASYNC109", # async function with timeout (46 β intentional async patterns)
"RUF001", # ambiguous unicode (42 β intentional unicode in docs/strings)
"PLW2901", # redefined loop name (41 β common pattern in mutation)
"SIM115", # open file with context handler (35 β many are in with blocks already)
"PLW1510", # subprocess.run without check (213 β return code handled manually)
"N803", # invalid argument name (32 β mathematical/domain naming)
"RUF002", # ambiguous unicode in docstring (32 β intentional unicode)
"E722", # bare except (28 β legacy pattern, refactor later)
"S324", # hashlib insecure hash (24 β MD5/SHA1 for checksums, not crypto)
"DTZ006", # datetime.fromtimestamp without tz (21 β migrate with DTZ later)
"A001", # builtin variable shadowing (24 β id/type/list common in domain)
"ASYNC221", # run process in async function (17 β intentional subprocess in async)
"SIM105", # suppressible exception (17 β contextlib.suppress explicit style)
"SIM117", # multiple with statements (17 β readability choice)
"S104", # hardcoded bind all interfaces (16 β dev servers bind 0.0.0.0)
"SIM102", # collapsible if (75 β readability choice, many are intentional)
"F841", # local variable assigned but unused (auto-fix can break logic)
# v1.1.4: Phase 4 β final triage to zero
# Imports & naming (472 total)
"F401", # unused import (405 β re-exports, conditional imports, __all__ driven)
"E402", # import not at top (40 β sys.path setup patterns)
"A004", # builtin import shadowing (15 β json/logging module naming)
"N814", # camelcase imported as constant (14 β Qt/API style conventions)
"N801", # invalid class name (13 β domain-specific abbreviations)
"N802", # invalid function name (8 β camelCase overrides from ABCs)
"N817", # camelcase imported as acronym (8 β API convention)
"N813", # camelcase imported as lowercase (2 β naming convention)
"N815", # mixed case variable in class scope (4 β domain naming)
"N818", # error suffix on exception name (4 β existing API surface)
"E741", # ambiguous variable name (10 β l/O/I in math contexts)
"E731", # lambda assignment (6 β short callbacks)
# Testing patterns (43 total)
"PT017", # pytest assert in except (14 β intentional assertion patterns)
"PT028", # pytest parameter with default (4 β fixture patterns)
"PT012", # pytest raises multiple statements (3 β integration test patterns)
"PT018", # pytest composite assertion (1 β acceptable)
"PT019", # pytest fixture param without value (1)
"RUF043", # pytest raises ambiguous pattern (7 β regex patterns intentional)
# Performance (16 total)
"PERF402", # manual list copy (13 β readability over micro-optimization)
"PERF403", # manual dict comprehension (3)
# Security (remaining, all audited)
"S113", # request without timeout (13 β internal tool calls)
"S602", # subprocess popen with shell=True (13 β scripts require shell)
"S112", # try-except-continue (11 β intentional retry patterns)
"S608", # hardcoded SQL (6 β ORM query builders, not raw SQL injection)
"S301", # suspicious pickle (5 β serialization module, sandboxed)
"S604", # call with shell=True (4 β script orchestration)
"S102", # exec builtin (3 β dynamic module loading)
"S307", # suspicious eval (3 β config parsing)
"S314", # suspicious XML ElementTree (3 β internal parsing)
"S103", # bad file permissions (2)
"S107", # hardcoded password default (2 β test fixtures)
"S202", # tarfile unsafe members (2 β controlled archives)
"S605", # start process with shell (2)
"S701", # jinja2 autoescape false (2 β internal templates)
"S702", # mako templates (2 β internal templates)
"S303", # suspicious insecure hash (1 β checksum, not crypto)
# Try/except patterns (19 total)
"TRY002", # raise vanilla class (12 β custom exception migration later)
"TRY004", # type check without TypeError (3)
"TRY401", # verbose log message (4 β intentional detailed logging)
# Datetime (18 total)
"DTZ003", # datetime.utcnow (10 β migrate to tz-aware later)
"DTZ901", # datetime.min/max (7 β sentinel values)
"DTZ007", # strptime without zone (1)
"DTZ011", # date.today (1)
# Async patterns (9 total)
"ASYNC230", # blocking open in async (5 β intentional sync-in-async bridge)
"ASYNC240", # blocking path in async (4)
# Type annotations (9 total)
"ANN205", # missing return type static method (4)
"ANN206", # missing return type class method (5)
"PYI036", # bad exit annotation (7 β __exit__ typing)
"UP045", # non-PEP604 Optional (2 β compatibility)
# Code quality (remaining)
"RUF003", # ambiguous unicode comment (8 β intentional)
"EXE005", # shebang not first line (7 β encoding declaration before shebang)
"PLC0206", # dict index missing items (7 β intentional dict iteration)
"RUF006", # asyncio dangling task (5 β fire-and-forget by design)
"RUF034", # useless if-else (4 β readability)
"SIM103", # needless bool (4)
"SIM108", # if-else instead of ternary (3 β readability)
"SIM113", # enumerate for loop (2)
"RUF059", # unused unpacked variable (2)
"B023", # function uses loop variable (3 β closures are intentional)
"B007", # unused loop control variable (2)
"B904", # raise without from (2 β legacy patterns)
"B024", # ABC without abstract method (1)
"B027", # empty method without abstract (1)
"PLW0602", # global variable not assigned (3)
"PLW1641", # eq without hash (3 β intentional unhashable)
"PLR0124", # comparison with itself (1 β NaN check)
"PLR0133", # comparison of constant (1)
"G003", # logging string concat (2)
"LOG015", # root logger call (2)
"F811", # redefined while unused (2 β overload patterns)
"F822", # undefined export (3 β lazy module __getattr__)
"F823", # undefined local (2 β conditional definition)
"F821", # undefined name (4 β TYPE_CHECKING imports)
"F403", # undefined local with import star (1 β __init__ re-export)
"ARG004", # unused static method argument (3)
"FURB116", # f-string number format (1)
"TD004", # missing todo colon (1)
"S324", # (already added, duplicate safe)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403", "E402"]
# Optional / skip-guard imports in unit+integration tests (availability probes, lazy imports).
"src/codomyrmex/tests/**/*.py" = ["F401"]
"tests/**/*" = ["S101", "PLR2004", "ANN", "B011", "SLF001", "ARG", "PT011", "S106", "S108", "S310"]
"scripts/**/*.py" = ["T20", "INP001", "ANN", "S101", "BLE001", "EXE001", "E402", "PLW1510", "F401"]
"**/mcp_tools.py" = ["ANN", "ARG001"]
# These tests use patch() for path-constant injection (COGNILAYER_DB redirect)
# or method-boundary isolation with real side_effect functions β Zero-Mock compliant.
"**/tests/integration/hermes/test_rotation.py" = ["TID251"]
"**/tests/unit/agentic_memory/test_cognilayer_bridge.py" = ["TID251"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"unittest.mock" = { msg = "Zero-Mock Policy: Use real functional implementations and authentic fixtures instead of mocks." }
"mock" = { msg = "Zero-Mock Policy: Use real functional implementations and authentic fixtures instead of mocks." }
"pytest_mock" = { msg = "Zero-Mock Policy: Use real functional implementations and authentic fixtures instead of mocks." }
"monkeypatch" = { msg = "Zero-Mock Policy: Do not patch internals. Use real implementations." }
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
# ty type checker (replaces mypy β faster, from Astral team)
[tool.ty.environment]
python-version = "3.11"
# Excluded: ty panics on this module (infer_expression_type_impl cycle limit).
[tool.ty.src]
include = ["src/codomyrmex"]
exclude = ["src/codomyrmex/physical_management/object_manager.py"]
[tool.ty.rules]
# v1.1.1: Tightened from initial lenient config
possibly-unresolved-reference = "ignore"
possibly-unbound = "warn"
unresolved-import = "ignore"
possibly-missing-argument = "ignore"
unsupported-base = "ignore"
deprecated = "ignore"
invalid-argument-type = "ignore"
not-subscriptable = "ignore"
unresolved-attribute = "ignore"
unused-ignore-comment = "warn"
# v1.1.0: Mutation testing configuration (expanded from 3 β 6 files)
[tool.mutmut]
paths_to_mutate = [
"src/codomyrmex/cache/",
"src/codomyrmex/concurrency/",
"src/codomyrmex/events/",
]
tests_dir = [
"src/codomyrmex/tests/unit/cache/",
"src/codomyrmex/tests/unit/concurrency/",
"src/codomyrmex/tests/unit/events/",
]
do_not_mutate = [
"*/vendor/*",
"*/htmlcov/*",
"*/__pycache__/*",
"*/tests/*",
]
also_copy = ["src/codomyrmex/tests/unit/mcp/", "src/codomyrmex/tests/unit/agents/", "src/codomyrmex/tests/unit/validation/", "src/codomyrmex/tests/unit/security/", "src/codomyrmex/tests/unit/orchestrator/", "src/codomyrmex/tests/unit/events/", "src/codomyrmex/tests/unit/cache/", "src/codomyrmex/tests/unit/concurrency/", "conftest.py"]
pytest_add_cli_args = ["--no-cov", "-p", "no:timeout", "-p", "no:benchmark", "--override-ini=addopts=", "--rootdir=.."]
debug = false