-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
407 lines (370 loc) · 11.1 KB
/
Copy pathpyproject.toml
File metadata and controls
407 lines (370 loc) · 11.1 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
[project]
name = "agentflow-runtime"
version = "1.5.0"
description = "Real-time data platform serving context to AI agents"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
dependencies = [
"argon2-cffi>=23,<26",
"bcrypt>=5,<6",
"confluent-kafka>=2.5,<3",
"fastapi>=0.111,<1",
"uvicorn[standard]>=0.30,<1",
"dagster>=1.13.1,<2",
"duckdb>=1.1,<2",
"httpx>=0.27,<1",
"opentelemetry-exporter-otlp-proto-grpc>=1.41,<2",
"opentelemetry-instrumentation-fastapi>=0.62b0,<1",
"opentelemetry-instrumentation-httpx>=0.62b0,<1",
"opentelemetry-sdk>=1.41,<2",
"pandera>=0.20,<1",
"prometheus-client>=0.21,<1",
"pyarrow>=17,<25",
"pydantic>=2.9,<3",
"pydantic-settings>=2.5,<3",
"pyyaml>=6,<7",
"sqlglot>=30,<31",
"structlog>=24.4,<27",
]
[project.optional-dependencies]
flink = [
"apache-flink==2.3.0",
]
cloud = [
"boto3>=1.35,<2",
"pyiceberg[pyiceberg-core]>=0.7,<1",
]
llm = [
"anthropic>=0.39,<1",
]
load = [
"locust>=2.29,<3",
# benchmark_freshness.py: production QueryCache semantics (TTL + key
# invalidation) without a Redis server on the benchmark host.
"fakeredis>=2.21,<3",
]
integrations = [
# langchain-core >=1.2.22 closes CVE-2026-26013 (SSRF via image_url) and
# CVE-2026-34070 (path traversal in legacy load_prompt). Bumping the
# langchain umbrella forces a transitive resolve of langchain-core that
# satisfies these floors. langchain-text-splitters >=1.1.2 closes
# GHSA-fv5p-p927-qmxr (SSRF redirect bypass). See audit p9.
"langchain>=0.3.30,<2",
"langchain-core>=1.2.22,<2",
"langchain-text-splitters>=1.1.2,<2",
"langsmith>=0.7.31,<1",
"llama-index-core>=0.12,<1",
]
contract = [
"schemathesis==4.21.10",
]
dev = [
"bandit>=1.9,<2",
"build>=1.2,<2",
"hatchling>=1.25,<2",
"hypothesis>=6,<7",
"jsonschema>=4,<5",
"pandas>=2.2,<4",
"pytest>=8.3,<10",
"pytest-asyncio>=0.24,<2",
"pytest-cov>=5,<8",
"testcontainers[kafka]>=4.9,<5",
"ruff>=0.6,<1",
"mypy>=1.11,<3",
"types-PyYAML>=6,<7",
"types-redis>=4.6,<6",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src"]
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/README.md",
"/LICENSE",
"/CHANGELOG.md",
"/pyproject.toml",
"/requirements.txt",
]
exclude = [
"/config/webhooks.yaml",
"/config/api_keys.yaml",
"/config/tenants.yaml",
"/docker/**/secrets/**",
"/.github/**",
"/.tmp*/",
"/notebooks/**",
"/audit_*.md",
"/audit_codex/**",
"/.env*",
"/k8s/**",
"/helm/**",
"/examples/**",
"/integrations/**",
"/sdk/**",
"/sdk-ts/**",
"/tests/**",
"/docs/**",
"/mutants/**",
"/.dora/**",
]
[tool.ruff]
target-version = "py311"
line-length = 100
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "UP", "S", "B", "A", "C4", "PT"]
ignore = ["S101", "S311"]
[tool.ruff.lint.per-file-ignores]
# Operational tooling: sys.path bootstrap before imports (E402) and
# fixed-argv subprocess calls to git/npm/mutmut (S603/S607) are the
# intentional script idiom, same as the tests/** allowance below.
"scripts/**/*.py" = [
"E402",
"S603",
"S607",
]
"tests/**/*.py" = [
"S603",
"S607",
"S608",
"S310",
"S104",
"S106",
"N802",
"N805",
"E402",
"B017",
"PT011",
"A002",
"E501",
]
"src/orchestration/dags/daily_batch.py" = [
"S608",
]
"src/serving/api/routers/lineage.py" = [
"S608",
]
"src/serving/api/routers/slo.py" = [
"S608",
]
"src/serving/api/routers/stream.py" = [
"S608",
]
"src/serving/backends/clickhouse_backend.py" = [
"S310",
"S608",
"E501",
]
"src/serving/backends/duckdb_backend.py" = [
"S608",
"E501",
]
"src/serving/semantic_layer/nl_engine.py" = [
"S608",
]
"src/serving/semantic_layer/query/entity_queries.py" = [
"S608",
]
"src/serving/semantic_layer/query/nl_queries.py" = [
"S608",
]
"src/serving/semantic_layer/search_index.py" = [
"S608",
]
# Raw-vault INSERT builder: table/column names are internal constants (vault
# table names + pydantic model fields / the curated VAULT_DB_COLUMNS map), and
# every value is parameter-bound (%s). Safe-by-construction interpolation of
# identifiers, which placeholders cannot carry.
"warehouse/agentflow/dv2/loaders/pg_vault_writer.py" = [
"S608",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = ["-p", "no:schemathesis", "--basetemp=.tmp/pytest-basetemp"]
cache_dir = ".tmp/pytest-cache"
markers = [
"integration: marks tests requiring Docker services",
"requires_docker: marks tests that require local Docker",
]
asyncio_mode = "auto"
[tool.mutmut]
# This list is the *declared* mutation-target policy, enforced by
# tests/unit/test_mutmut_policy.py (paths exist, define real logic, cover the
# security-critical surfaces). It is a superset of what the CI gate actually
# mutates: scripts/mutation_report.py drives the gate from its own
# MODULE_TARGETS, which now mutates sdk/agentflow/retry.py,
# src/serving/semantic_layer/sql_guard.py, src/serving/masking.py,
# src/serving/api/rate_limiter.py, src/serving/semantic_layer/query/sql_builder.py,
# src/serving/semantic_layer/query/nl_queries.py, src/serving/api/auth/manager.py
# AND src/serving/api/auth/key_rotation.py live -- every declared serving surface
# is now mutated. The serving modules are mutated as a top-level `serving` package
# against duckdb-free narrow tests: mutmut's trampoline rejects a module name
# starting with `src.`, which (not duckdb) was the real blocker. (The gate runner
# also strips the repo's relative pytest --basetemp inside the mutmut workspace --
# under py3.11 it breaks coverage->mutant mapping for file-I/O targets like
# key_rotation; see scripts/mutation_report.py.) manager.py runs at an honest 0.80
# threshold (not 0.90): it is a
# large stateful auth class whose residual survivors are equivalent mutants
# (structured-logging args, model_copy updates equal to their defaults, redis-url
# strings masked by the `_redis = None` override, the env-only-dead write path) --
# every behaviour-reachable mutant, including every auth-bypass and throttle
# off-by-one, is killed. See scripts/mutation_report.py.
paths_to_mutate = [
"src/serving/api/auth/manager.py",
"src/serving/api/auth/key_rotation.py",
"src/serving/masking.py",
"src/serving/semantic_layer/query/engine.py",
"src/serving/semantic_layer/query/entity_queries.py",
"src/serving/semantic_layer/query/metric_queries.py",
"src/serving/semantic_layer/query/nl_queries.py",
"src/serving/semantic_layer/query/sql_builder.py",
"src/serving/semantic_layer/sql_guard.py",
"src/processing/outbox.py",
"src/serving/api/rate_limiter.py",
]
also_copy = [
"src",
"config",
"sdk",
]
tests_dir = [
"tests/unit",
"tests/property",
"tests/integration/test_outbox.py",
]
mutate_only_covered_lines = true
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
# Strict-by-default: every function under src/ must carry full type
# annotations, with ZERO per-module relaxations (the last one, the formerly
# PyFlink-stub-gated flink_jobs package, was hand-annotated 2026-06-05). A
# new untyped def anywhere in src/ now fails mypy. The strict invariant is
# gated by tests/unit/test_typing_policy.py.
disallow_untyped_defs = true
check_untyped_defs = true
ignore_missing_imports = true
[tool.agentflow.dependency-profiles.profiles.runtime]
editable-installs = ["."]
[tool.agentflow.dependency-profiles.profiles.dev-tools]
editable-installs = [".[dev]"]
[tool.agentflow.dependency-profiles.profiles.test]
editable-installs = [".[dev,cloud]"]
[tool.agentflow.dependency-profiles.profiles.test-sdk]
editable-installs = [".[dev,cloud]", "./sdk"]
[tool.agentflow.dependency-profiles.profiles.test-integrations]
editable-installs = [".[dev,cloud]", "./sdk", "./integrations[mcp]"]
[tool.agentflow.dependency-profiles.profiles.load]
editable-installs = [".[load,cloud]"]
[tool.agentflow.dependency-profiles.profiles.perf]
editable-installs = [".[dev,load,cloud]"]
[tool.agentflow.dependency-profiles.profiles.contract]
editable-installs = [".[dev,cloud,contract]", "./sdk"]
[tool.agentflow.dependency-profiles.profiles.e2e]
editable-installs = [".[dev]", "./sdk"]
[[tool.agentflow.dependency-profiles.targets]]
name = "backup.backup"
kind = "workflow"
path = ".github/workflows/backup.yml"
job = "backup"
profile = "dev-tools"
[[tool.agentflow.dependency-profiles.targets]]
name = "ci.lint"
kind = "workflow"
path = ".github/workflows/ci.yml"
job = "lint"
profile = "dev-tools"
[[tool.agentflow.dependency-profiles.targets]]
name = "ci.schema-check"
kind = "workflow"
path = ".github/workflows/ci.yml"
job = "schema-check"
profile = "dev-tools"
[[tool.agentflow.dependency-profiles.targets]]
name = "ci.test-unit"
kind = "workflow"
path = ".github/workflows/ci.yml"
job = "test-unit"
profile = "test-integrations"
[[tool.agentflow.dependency-profiles.targets]]
name = "ci.test-integration"
kind = "workflow"
path = ".github/workflows/ci.yml"
job = "test-integration"
profile = "test-sdk"
[[tool.agentflow.dependency-profiles.targets]]
name = "ci.helm-schema-live"
kind = "workflow"
path = ".github/workflows/ci.yml"
job = "helm-schema-live"
profile = "dev-tools"
[[tool.agentflow.dependency-profiles.targets]]
name = "ci.perf-check"
kind = "workflow"
path = ".github/workflows/ci.yml"
job = "perf-check"
profile = "perf"
[[tool.agentflow.dependency-profiles.targets]]
name = "benchmark-arm.benchmark-arm"
kind = "workflow"
path = ".github/workflows/benchmark-arm.yml"
job = "benchmark-arm"
profile = "perf"
[[tool.agentflow.dependency-profiles.targets]]
name = "chaos.chaos-smoke"
kind = "workflow"
path = ".github/workflows/chaos.yml"
job = "chaos-smoke"
profile = "test"
[[tool.agentflow.dependency-profiles.targets]]
name = "chaos.chaos-full"
kind = "workflow"
path = ".github/workflows/chaos.yml"
job = "chaos-full"
profile = "test"
[[tool.agentflow.dependency-profiles.targets]]
name = "contract.contract"
kind = "workflow"
path = ".github/workflows/contract.yml"
job = "contract"
profile = "contract"
[[tool.agentflow.dependency-profiles.targets]]
name = "e2e.e2e"
kind = "workflow"
path = ".github/workflows/e2e.yml"
job = "e2e"
profile = "e2e"
[[tool.agentflow.dependency-profiles.targets]]
name = "load-test.load-test"
kind = "workflow"
path = ".github/workflows/load-test.yml"
job = "load-test"
profile = "load"
[[tool.agentflow.dependency-profiles.targets]]
name = "mutation.mutation"
kind = "workflow"
path = ".github/workflows/mutation.yml"
job = "mutation"
profile = "test"
[[tool.agentflow.dependency-profiles.targets]]
name = "performance.perf-baseline"
kind = "workflow"
path = ".github/workflows/performance.yml"
job = "perf-baseline"
profile = "perf"
[[tool.agentflow.dependency-profiles.targets]]
name = "perf-regression.perf-smoke"
kind = "workflow"
path = ".github/workflows/perf-regression.yml"
job = "perf-smoke"
profile = "perf"
[[tool.agentflow.dependency-profiles.targets]]
name = "staging-deploy.staging"
kind = "workflow"
path = ".github/workflows/staging-deploy.yml"
job = "staging"
profile = "e2e"