-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
204 lines (189 loc) · 6.88 KB
/
pyproject.toml
File metadata and controls
204 lines (189 loc) · 6.88 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
# AI Memory Module - Project Configuration
# Python 3.10+
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "ai-memory"
version = "2.3.2"
description = "AI Memory Module - Vector-based memory system for AI agents"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
authors = [
{name = "BMAD Team"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
# Vector Database
"qdrant-client[grpc]>=1.17.0,<2.0.0",
# HTTP Client
"httpx>=0.27.0,<1.0.0",
# Environment Configuration
"pydantic>=2.0.0,<3.0.0",
"pydantic-settings>=2.0.0,<3.0.0",
# Logging
"structlog>=24.0.0,<26.0.0",
# Monitoring
"prometheus-client>=0.21.0,<1.0.0",
# Auth (for Prometheus bcrypt hash generation)
"bcrypt>=4.0.0,<6.0.0",
# Anthropic SDK for conversation capture
"anthropic>=0.89.0,<1.0.0",
# Retry logic with exponential backoff
"tenacity>=8.0.0,<10.0.0",
# AST-based code chunking
"tree-sitter>=0.21.0,<1.0.0",
"tree-sitter-python>=0.21.0,<1.0.0",
"tree-sitter-javascript>=0.21.0,<1.0.0",
"tree-sitter-typescript>=0.21.0,<1.0.0",
"tree-sitter-go>=0.21.0,<1.0.0",
"tree-sitter-rust>=0.21.0,<1.0.0",
# Token counting for smart truncation
"tiktoken>=0.5.0,<1.0.0",
# Numpy for vector operations (topic drift computation)
"numpy>=1.26.0,<3.0.0",
# Security scanning - Layer 3 NER-based PII detection (SPEC-009)
"spacy>=3.8.0,<4.0.0",
# Cron schedule parsing for evaluator-scheduler daemon (S-16.5, DEC-110)
"croniter>=2.0.0,<7.0.0",
# Auto-instrumentation for Anthropic SDK calls (SPEC-020 §6)
"opentelemetry-instrumentation-anthropic>=0.1,<1.0.0",
]
[project.optional-dependencies]
observability = [
# LLM Observability — Langfuse tracing (SPEC-020, PLAN-008)
"langfuse>=4.0.6,<4.1.0",
]
dev = [
# Testing
"pytest>=9.0.3,<10.0.0",
"pytest-asyncio>=1.0.0,<2.0.0",
"pytest-cov>=7.0.0,<8.0.0",
"pytest-mock>=3.15.0,<4.0.0",
"pytest-timeout>=2.4.0,<3.0.0",
"pytest-randomly>=3.15.0,<4.0.0",
"pytest-rerunfailures>=14.0.0,<17.0.0",
"hypothesis>=6.0.0,<7.0.0",
"requests>=2.33.1,<3.0.0",
"psutil>=7.0.0,<8.0.0",
# E2E Testing
"pytest-playwright>=0.7.0,<1.0.0",
"playwright>=1.50.0,<2.0.0",
# Code Quality
"black==26.3.1",
"ruff>=0.15.9,<1.0.0",
"isort>=5.13.0,<9.0.0",
"mypy>=1.20.0,<2.0.0",
# Security Scanning
"bandit[toml]>=1.7.0,<2.0.0",
"detect-secrets>=1.4.0",
# Structured logging
"python-json-logger>=4.1.0,<5.0.0",
# YAML processing with format preservation
"ruamel.yaml>=0.19.0,<1.0.0",
# YAML parsing (required by tests/unit/test_sops_encryption.py)
"PyYAML>=6.0,<7.0",
# Include observability deps so CI has langfuse for tests
"langfuse>=4.0.6,<4.1.0",
# Streamlit dashboard (CI validation of docker/streamlit/app.py)
"streamlit==1.56.0",
]
[project.urls]
Homepage = "https://github.com/Hidden-History/ai-memory"
Documentation = "https://github.com/Hidden-History/ai-memory#readme"
Repository = "https://github.com/Hidden-History/ai-memory"
# Setuptools configuration for src layout
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
"*" = ["py.typed"]
# Pytest configuration (migrated from pytest.ini)
[tool.pytest.ini_options]
pythonpath = ["src", "scripts"]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short --strict-markers -m 'not regression'"
norecursedirs = ["archived", ".git", "__pycache__", ".pytest_cache"]
markers = [
"integration: integration tests requiring Docker stack",
"slow: marks tests as slow running (may require Docker services)",
"performance: performance/benchmark tests (NFR validation)",
"requires_qdrant: Tests requiring Qdrant service on port 26350",
"requires_embedding: Tests requiring Embedding service on port 28080",
"requires_docker_stack: Tests requiring full Docker stack",
"requires_api: Tests requiring Monitoring API service on port 28000",
"requires_streamlit: Tests requiring Streamlit dashboard on port 28501",
"quarantine: Quarantined flaky tests excluded from default CI runs",
"regression: Regression tests requiring live Langfuse + Qdrant (excluded from default pytest run)",
]
# Coverage configuration
[tool.coverage.run]
source = [
"src/memory",
".claude/hooks/scripts",
"scripts/memory",
]
branch = true
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/conftest.py",
"*/_archived/*",
"*/archived/*",
]
[tool.coverage.report]
fail_under = 70
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
# Ruff configuration
[tool.ruff]
target-version = "py310"
line-length = 88
exclude = [".git", ".venv", "__pycache__", "build", "dist"]
[tool.ruff.lint]
select = ["E", "W", "F", "B", "C4", "UP", "SIM", "RUF"]
ignore = ["E501"] # Line length handled by black
# Note: "I" (isort) removed — CI runs standalone isort which conflicts with ruff's I001 on aliased imports
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101", "ARG"]
"src/memory/__init__.py" = ["E402", "RUF022"] # E402: configure_logging() before imports; RUF022: __all__ grouped by story
"src/memory/connectors/**/*.py" = ["E402"] # E402: atexit.register(langfuse_shutdown) before imports (by design)
"src/memory/evaluator/__init__.py" = ["E402"] # E402: TRACE_CONTENT_MAX constant before relative imports
"src/memory/trace_flush_worker.py" = ["E402"] # E402: sys.path.insert before imports
"tests/test_monitoring_api.py" = ["E402"] # E402: sys.modules mock before imports
"tests/test_agent_sdk_wrapper.py" = ["E402"] # E402: sys.modules mock before imports
"tests/test_best_practices_auto_activation.py" = ["E402"] # E402: sys.path.insert before imports
"tests/test_enable_quantization.py" = ["E402"] # E402: sys.path.insert before imports
"tests/test_ingest_markdown.py" = ["E402"] # E402: sys.path.insert before imports
"tests/test_search_cli.py" = ["E402"] # E402: sys.path.insert before imports
"tests/integration/test_sdk_integration.py" = ["E402"] # E402: sys.modules mock before imports
"tests/unit/connectors/**/*.py" = ["E402"] # E402: conftest logger setup before imports
# Black configuration
[tool.black]
line-length = 88
target-version = ["py310", "py311", "py312"]
# isort configuration (Black-compatible)
[tool.isort]
profile = "black"
line_length = 88
known_first_party = ["memory"]