Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
228 lines (204 loc) · 7.84 KB
/
Copy pathpyproject.toml
File metadata and controls
228 lines (204 loc) · 7.84 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
[project]
name = "codeflow-harness"
version = "0.1.7"
description = "Concurrent, multi-turn Agent Harness with context governance, checkpoint recovery, SRT sandboxing, and evaluation"
requires-python = ">=3.12,<3.13"
license = "Apache-2.0"
license-files = ["LICENSE", "LICENSES/*", "NOTICES.md"]
authors = [
{name = "Hackerismydream"}
]
keywords = ["ai", "agent", "cli", "terminal", "context-management", "skill-evolution"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"typer>=0.20.0,<1.0.0",
"litellm>=1.82.1,<1.92.0",
"pydantic>=2.12.0,<3.0.0",
"pydantic-settings>=2.14.2,<3.0.0",
"httpx>=0.28.0,<1.0.0",
"loguru>=0.7.3,<1.0.0",
"rich>=14.0.0,<15.0.0",
"croniter>=6.0.0,<7.0.0",
"pyyaml>=6.0",
"prompt-toolkit>=3.0.0",
"json-repair>=0.30.0",
# Token 估算是运行时直接提供的功能,应与供应商碰巧安装的分词器依赖保持独立。
"tiktoken>=0.7.0,<1.0.0",
"questionary>=2.0.0,<3.0.0",
"watchfiles>=0.21,<2.0",
"tomli-w>=1.2.0",
# OAuth 供应商登录(Codex/GitHub Copilot)会在引导期间导入此包,因此它必须是
# 运行时依赖;否则通过 `uv tool install codeflow-harness` 安装的用户一选择 OAuth
# 供应商就会遇到“oauth_cli_kit not installed”。
"oauth-cli-kit>=0.1.6,<1.0.0",
"portalocker>=3.2.0",
"mcp>=1.27.0",
"orjson>=3.11.6,<4.0",
# KNN 模型路由器(routing/knn_router.py)的嵌入 KNN。目前它也是经 lancedb
# 引入的传递依赖;直接固定可确保上游未来移除后路由仍能工作。
"numpy>=2.0,<3.0",
"pillow>=12.3,<13.0",
"packaging>=24.0,<26.0",
]
[project.optional-dependencies]
channel-feishu = ["lark-oapi>=1.5.0,<2.0.0"]
channel-wecom = ["wecom-aibot-sdk-python>=0.1.5"]
channel-qq = ["qq-botpy>=1.2.0,<2.0.0"]
channels = [
"codeflow-harness[channel-feishu,channel-qq,channel-wecom]",
]
tools = [
"readability-lxml>=0.8.4,<1.0.0",
"oauth-cli-kit>=0.1.6,<1.0.0",
]
retrieval = [
"torch>=2.0.0",
"transformers>=4.45.0",
]
semantic-memory = [
"fastembed>=0.7.3,<1",
]
sandbox = [
"boxlite==0.9.5",
"anyio>=4.0",
]
dev = [
"pytest>=8.0,<10.0",
"pytest-asyncio>=0.23.0",
"ruff>=0.6.0",
]
eval = []
[project.scripts]
codeflow = "codeflow.cli.commands:run"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["codeflow"]
# 预构建、自包含的 TUI 包 ui-tui/dist/entry.js 会以 codeflow/ui-tui/dist 路径打入
# wheel,使 `uv tool install` 无需源码检出即可得到可用的 `codeflow`。下方自定义构建
# 钩子 hatch_build.py 会按条件加入该文件;静态 force-include 在被 Git 忽略的
# dist/ 缺失时会硬失败,破坏 `git clone && uv sync`。发布构建必须先运行
# `npm ci --prefix ui-tui && make build-tui`。
[tool.hatch.build.targets.wheel.hooks.custom]
path = "hatch_build.py"
[tool.hatch.build]
include = [
"codeflow/**/*.py",
"codeflow/plugin/**/codeflow-plugin.toml",
"codeflow/templates/**/*.md",
"codeflow/skills/**/*.md",
"codeflow/skills/**/*.sh",
# 追踪仪表板查看器(无依赖 Node 服务端加静态客户端)。
"codeflow/tracing/viewer/**/*.js",
"codeflow/tracing/viewer/**/*.css",
"codeflow/tracing/viewer/**/*.html",
"codeflow/tracing/viewer/**/*.json",
"codeflow/sandbox/srt-settings.json",
]
[tool.hatch.build.targets.sdist]
include = [
"codeflow/",
"hatch_build.py",
"README.md",
"LICENSE",
]
[tool.hatch.build.targets.sdist.force-include]
"ui-tui/dist/entry.js" = "ui-tui/dist/entry.js"
[tool.uv]
constraint-dependencies = [
"aiohttp>=3.13.4",
"pip>=26.1.2",
"pyjwt>=2.13.0",
"python-engineio>=4.13.3",
"python-dotenv>=1.2.2",
"starlette>=1.3.1",
]
[tool.uv.sources]
codeflow-harness = { workspace = true }
[tool.ruff]
line-length = 120
target-version = "py312"
extend-exclude = ["benchmarks/**/data", "benchmarks/**/results", "benchmarks/**/output"]
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "S101", "S105", "S106", "S107", "S506", "S605", "S607"]
ignore = ["E501"]
[tool.ruff.lint.per-file-ignores]
# 测试约定:断言、夹具中的硬编码凭据、命名、重定义、未使用变量、延迟导入和含糊
# 名称在测试中属于惯用写法,不适用于产品代码。可自动修复但会造成大量变更的
# E702/F401/I001 留给格式化分支。
"tests/**" = ["E402", "E741", "F811", "F841", "N802", "N805", "N806", "N817", "N818", "S101", "S105", "S106", "S107", "S607"]
# 追踪探针工厂以目标类为参数,并为可读性沿用类名,例如
# `def _install_llm(LLMProvider: type)`。
"codeflow/tracing/instrument.py" = ["N803"]
# CLI 启动顺序与延迟导入,长期接受。
"codeflow/cli/commands.py" = ["E402"]
"codeflow/cli/cron_commands.py" = ["E402"]
# 其他延迟导入或启动顺序导入,允许使用。
"codeflow/eval_engine/engine.py" = ["E402"]
"codeflow/memory_engine/skill_local/registry.py" = ["E402"]
"scripts/skill_forge_full_e2e.py" = ["E402"]
# 断言;转换或保留的取舍在 v2 中跟踪。
"codeflow/agent/subagent/manager.py" = ["S101"]
"codeflow/cli/doctor_commands.py" = ["S101"]
"codeflow/cli/onboard_commands.py" = ["S101"]
"codeflow/memory_engine/contract_test.py" = ["S101"]
# scripts/:开发工具,允许使用部分路径子进程和断言。
"scripts/check_commit_file.py" = ["S607"]
"scripts/check_commit_messages.py" = ["S607"]
"scripts/check_large_files.py" = ["S607"]
# evolver 与 appworld 基准按设计使用 Git/Bash 子进程驱动(S607);K 是 SOP 领域中
# 每任务试验次数的术语(N803/N806);*_PASS/*_TOKEN 常量是结果标签和信标标记,
# 不是凭据(S105);断言与上方转换或保留批次一起跟踪(S101)。
"codeflow/evolver/tree/git_ops.py" = ["S607"]
"codeflow/evolver/launch/config.py" = ["S607"]
"codeflow/evolver/launch/contract.py" = ["S607"]
"codeflow/evolver/launch/runner.py" = ["S607"]
"codeflow/evolver/orchestrator/nodes/semantic.py" = ["S101"]
"codeflow/evolver/scheduler/cold_start_bandit.py" = ["N803", "N806"]
"codeflow/evolver/scheduler/tree_aware_bandit.py" = ["N803"]
"codeflow/evolver/scheduler/tree_loader.py" = ["S101"]
"codeflow/evolver/analysis/stability_bucket.py" = ["S105"]
"codeflow/evolver/applier/beacon_guard.py" = ["S105"]
"codeflow/evolver/judge/prompts.py" = ["S105"]
"benchmarks/appworld/evolve/adapter.py" = ["N803", "S105"]
"benchmarks/appworld/evolve/editor.py" = ["N806"]
"benchmarks/appworld/evolve/sandbox.py" = ["S607"]
# benchmarks/:评测框架,允许相应命名、含糊名称、未使用变量和部分路径子进程。
"benchmarks/clawbench/stream.py" = ["S607"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
addopts = [
"-m",
"not (real_llm or llm_judge or real_vm or real_channel or external_runtime or e2e)",
]
markers = [
"real_llm: calls a live model or embedding endpoint and may incur cost; opt-in",
"llm_judge: uses an LLM as a grader for extraction quality (extra cost / non-determinism); opt-in",
"real_vm: boots or connects to a real virtual machine; opt-in",
"real_channel: connects to an external messaging channel; opt-in",
"external_runtime: requires a runtime or executable outside the Python test environment; opt-in",
"e2e: spawns a real subprocess through the TUI autotest runtime; opt-in",
]
[dependency-groups]
dev = [
"json-repair>=0.59.5",
"oauth-cli-kit>=0.1.6",
"pexpect>=4.9",
"pip-audit>=2.10.0",
"pre-commit>=4.6.0",
"pyte>=0.8",
"pytest>=9.0.3",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.1.0",
"ruff>=0.15.11,<0.16",
"sqlmodel>=0.0.27,<1.0.0",
]