v0.2.67 — 架构改造大版本
12 个架构改造 commit,涵盖分层修复、连接池化、SQLAlchemy Core 迁移、348 个测试防护网。
分层修复
- 消除 core→api 反向依赖,新增
core/dispatcher.pyDispatcher protocol task_manager.py三拆:db_adapter.py+db_schema.py+ 业务方法api/sse.py瘦身 1466→94 行,阶段编排状态机下沉为core/phase_runner.py
数据库层
- 修生产连接饱和("FATAL: too many clients already"):改为进程级共享 SQLAlchemy Engine(QueuePool),16 线程并发只占 3 个连接(旧代码 16 个)
- 删除全部手写方言转换规则
- 新增
schema_migrations表,补 Postgres 此前不执行 migrations 的缺陷
可观测性
每次 job 启动生成 job_run_id(12 hex),server.log 每行携带 [run:xxx]。
测试抓出的 3 个生产 bug
sweep_wedged_running产物检查被 except 吞掉 → 误杀保护从未生效run_migrations在 Postgres dict 行上row[0]KeyError → PG 库二次启动崩- SQLite Core 路径默认值列落 NULL →
api_tokens.revoked为 NULL 导致认证失败