✨ feat: 灵台引擎 Python 绑定与消息路径接入(WP-15/WP-03 交界)

- engine/bindings:nanobind 官方薄绑定包 hunjing-lingtai(LingtaiEngine RAII、HjStatus→LingtaiError 映射、HJ_ABI_VERSION 导出);scikit-build-core 构建,直接编译引擎源码自包含
- backend 以 editable 路径依赖接入;typings/lingtai.pyi 类型存根(mypy strict 全绿)
- app/core/lingtai.py:懒初始化单例 + LingtaiUnavailable fail-closed(禁止宿主第二实现降级)
- 迁移 3:message.parser_version;post_message 的 markdown 输入经 hj_transform 规范化为 canonical blocks(展开 code/mermaid/math 并标注 parser_version,契约第 4 节)
- 测试 29 项全绿:消息展开、Python/C++ golden 字节一致、引擎注入失败时消息路径显式 500(fail-closed 验证)
This commit is contained in:
chenxin committed 2026-09-10 11:26:40 +08:00
1 parent 127191c889
commit 491136c770
15 files changed
+314 -4

No files matched your search

+5
View File
@@ -13,6 +13,7 @@ dependencies = [
"asyncpg>=0.30",
"uuid-utils>=0.10",
"greenlet>=3.5.5",
"hunjing-lingtai",
]
[dependency-groups]
@@ -45,7 +46,11 @@ select = ["E", "F", "I", "UP", "B", "ASYNC"]
[tool.mypy]
python_version = "3.12"
strict = true
mypy_path = "typings"
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.uv.sources]
hunjing-lingtai = { path = "../engine/bindings", editable = true }