Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
140 lines (121 loc) · 4.53 KB
/
Copy pathpyproject.toml
File metadata and controls
140 lines (121 loc) · 4.53 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "agent-control-plane"
version = "0.27.0"
description = "Embeddable governance framework for agentic AI — approval gates, policy engine, budget tracking, kill switches, event sourcing, crash recovery"
readme = "README.md"
authors = [{ name = "Ryan Williams" }]
license = { file = "LICENSE" }
requires-python = ">=3.11"
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",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
keywords = ["ai", "agents", "governance", "control-plane", "approval", "policy"]
dependencies = [
"sqlalchemy>=2.0",
"pydantic>=2.0",
]
[project.optional-dependencies]
asyncpg = ["asyncpg>=0.28"]
dev = [
"pytest>=8.0",
"pytest-asyncio>=0.23",
"aiosqlite>=0.20",
"greenlet>=3.0",
"ruff>=0.4",
"mypy>=1.10",
"pylint>=3.0",
"pre-commit>=3.7",
"fastapi>=0.111",
"httpx>=0.27",
"openapi-spec-validator>=0.7",
"jsonschema>=4.0",
"PyYAML>=6.0",
"import-linter>=2.0",
]
[project.urls]
Homepage = "https://github.com/ryanwi/agent-control-plane"
Repository = "https://github.com/ryanwi/agent-control-plane"
Issues = "https://github.com/ryanwi/agent-control-plane/issues"
[tool.hatch.build.targets.wheel]
packages = ["src/agent_control_plane"]
[tool.ruff]
line-length = 120
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM", "C90", "N", "RUF", "ASYNC"]
[tool.ruff.lint.per-file-ignores]
# __all__ in these files is organized by topic, not alphabetically
"src/agent_control_plane/__init__.py" = ["RUF022"]
"src/agent_control_plane/types/__init__.py" = ["RUF022"]
# ASYNC240 targets trio/anyio users; this project uses plain asyncio + aioSQLite
"examples/*.py" = ["ASYNC240"]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.mypy]
python_version = "3.11"
strict = true
warn_unreachable = true
[tool.pylint.main]
source-roots = ["src"]
[tool.pylint.format]
max-line-length = 120
[tool.pylint.design]
max-args = 9
max-positional-arguments = 5
max-public-methods = 21
max-attributes = 12
max-locals = 15
max-returns = 6
[tool.pylint.messages_control]
disable = [
"C", # convention — covered by Ruff
"E0704", # misplaced-bare-raise — false positive: bare raise inside helper called from except
"E1102", # not-callable — false positive: SQLAlchemy func.* uses __getattr__ magic
"R0801", # duplicate-code — too noisy across modules
"R0903", # too-few-public-methods — false positive for protocols/dataclasses
"W0212", # protected-access — intentional in facade/registry patterns
"W0511", # fixme — TODO comments are fine
"W0603", # global-statement — intentional in extension registry pattern
"W0718", # broad-exception-caught — intentional in resilience wrappers (resilient.py, async_resilient.py); non-resilience sites audited and each re-raises, fails-closed, or is an infrastructure path (transaction cleanup, plugin loading, audit logging)
]
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
[tool.importlinter]
root_packages = ["agent_control_plane"]
[[tool.importlinter.contracts]]
name = "Engines must not depend on concrete storage backends"
type = "forbidden"
source_modules = ["agent_control_plane.engine"]
forbidden_modules = [
"agent_control_plane.storage.sqlalchemy_sync",
"agent_control_plane.storage.sqlalchemy_async",
]
# TokenBudgetTracker.from_session() is a public convenience factory that wires
# the tracker to an existing AsyncSession. The import is lazy (inside the method
# body) so it doesn't affect import-time coupling; callers who don't use
# from_session() pay no dependency cost. Accepted exception to this contract.
ignore_imports = [
"agent_control_plane.engine.token_budget_tracker -> agent_control_plane.storage.sqlalchemy_async",
]
[[tool.importlinter.contracts]]
name = "Engines must not depend on the MCP gateway"
type = "forbidden"
source_modules = ["agent_control_plane.engine"]
forbidden_modules = ["agent_control_plane.mcp"]
[[tool.importlinter.contracts]]
name = "Evaluators must not depend on engines (they are plugged in, not downstream)"
type = "forbidden"
source_modules = ["agent_control_plane.evaluators"]
forbidden_modules = ["agent_control_plane.engine"]