lhl
|
69aec7716c
|
feat(provenance): URI 统一 + resolver + 强验证(T12 架构审查整改)
- T12 (OV3, P1): 新建 src/genesis/parsers/resolver.py
- parse_source_uri: 解析 file.xlsx#Sheet!CellRef → SourceRef(格式非法 raise URIError)
- provenance_to_uri: Provenance 还原 URI(与 build_source_uri 互逆)
- resolve_source_uri: StructuredSource 内定位真实 CellValue
- validate_source_uris: 批量强验证 → ValidationResult(resolved/unresolved)
格式错误或源中不存在一律 unresolved(防 QA#8 编造 URI 作弊)
- URI 唯一生成入口 build_source_uri(provenance.py),无散落不一致
- 新增 test_resolver.py(13 用例);同步 design.md §9.2 + §6.8 第五步
- TDD: RED(模块缺失)→ GREEN(聚焦 10 passed)→ 全量 231 passed / 100.00%(1191 stmts/298 br)
|
2026-08-12 22:35:56 +08:00 |
|
lhl
|
6a54580ca4
|
feat(orchestrator): DataGate 机制化 + 任务级持久化(T14/T16 架构审查整改)
- T14 (OV5): 新建 src/genesis/orchestrator/datagate.py
- DataGate.load(source, selector) 机制化:子集加载 + 规模保护(超 500 行
无 selector 拒绝全量,1000 行 Excel 防上下文爆炸)+ token 预算(8000,
复用 CJK 保守估算)+ 未知表容错
- agent-runtime §4.2 原则→机制说明
- T16 (OV7): 新建 src/genesis/orchestrator/task_queue.py
- TaskQueue ABC + PersistentTaskQueue(SQLite 落盘)
- enqueue/poll/update_status/get/cancel/recover/close
- 幂等去重(§5.3 缓存结果)+ recover 将 running→failed、pending 保留
- api-design §5.2/5.3、agent-runtime §3.5/3.6、design §8.4.1 同步
- 新增 test_datagate.py(8 用例)+ test_task_queue.py(11 用例)
- TDD: RED(模块缺失)→ GREEN(聚焦 16 passed)→ 全量 218 passed / 100.00%(1140 stmts/278 br)
|
2026-08-12 15:43:10 +08:00 |
|
lhl
|
3decdfc31c
|
feat(rag): v1 rerank 精排 + bge-m3 多语言切换(T6/T11 架构审查整改)
- T6 (Issue6): RerankConfig(enabled/model=BAAI/bge-reranker-v2-m3/device)
- rag-layer-design §6.3 Rerank 精排:窗口=RRF top-10、候选≤top_k 跳过、
故障降级 RRF 原序;原 §6.3-6.6 顺延 6.4-6.7
- config-design §5 新增 rerank 段;design §5.5 检索策略加 rerank
- T11 (OV2): EmbeddingConfig.model 默认 bge-small-zh-v1.5 → BAAI/bge-m3(日文语料)
- rag-layer-design 选型表/依赖表/manifest/流程图同步 + 新增 §2.3 日文样本验证
- design.md / implementation-plan 4.3 / config-design embedding 同步
- 新增 test_rag_design_consistency.py 一致性门禁(6 用例防文档漂移)
- TDD: RED(默认模型仍旧 + rerank 字段不存在)→ GREEN → 全量 198 passed / 100.00%(996 stmts/252 br)
|
2026-08-12 11:32:28 +08:00 |
|
lhl
|
c170ec2edd
|
feat(config): 删死配置 + 同步文档(T5 架构审查整改)
- Issue5: 删除 QdrantStoreConfig / VectorStoreConfig.qdrant / task_queue.redis_url
- OV1: 同步 6 处文档(api-design §1/§4.3/§5/§6、rag-layer §9、agent-runtime §3、
design §5.5/§8.4.1、config-design、web-ui §4.1)+ tests/fixtures/rag.yaml
- TaskQueue 标注 v1 仅 InMemory,Redis/Valkey 为 v2 预留(Scope 缩减裁定)
- Storage Adapter 仅 ChromaAdapter,工厂移除 qdrant 分支
- 历史评审记录保留原样不改写
- 新增 3 用例,同步 2 个 qdrant 依赖用例;全量 189 passed / 100.00%(991 stmts/252 br)
|
2026-08-12 10:54:56 +08:00 |
|
lhl
|
8febc50eb8
|
feat(inference): CJK 保守 token 估算(T9 架构审查整改)
- Issue11: approximate_token_count 重写
- 新增 _is_cjk_char(CJK 统一表意/扩展A/假名/韩文/兼容/全角六大 Unicode 范围)
- CJK 字符按 1.5 token/字符(旧 4 字符 1 token 严重低估,裁剪失效致 API 超限)
- 其余字符仍 4 字符 1 token;最少 1 token
- 同步 config-design.md token_estimation 注释
- 新增 4 用例,全量 186 passed / 100.00%(995 stmts/252 br)
|
2026-08-12 09:54:20 +08:00 |
|
lhl
|
8239a37a99
|
feat(inference): LLM 客户端全异步化(T8 架构审查整改)
- Issue9: client.py 由同步 httpx.Client 全异步化
- LLMClient Protocol / HttpLLMClient.chat → async;httpx.AsyncClient + asyncio.sleep 退避
- __enter__/__exit__ → __aenter__/__aexit__(async with 生命周期闭环)
- engine.py chat/chat_structured/_call 全部 async + await
- FakeLLMClient.chat → async;测试用 anyio pytest 插件转换(engine 32 + client 10 用例)
- 同步 inference-engine spec 与 milestone3 review 的 httpx 描述
- 全量 182 passed / 100.00%(987 stmts/252 br)
|
2026-08-12 09:50:37 +08:00 |
|
lhl
|
1f931228e7
|
feat(inference): 引擎层统一注入防护(T4 架构审查整改)
- Issue4: engine.py 新增恒定系统指令 DEFAULT_SYSTEM_INSTRUCTION + 用户数据边界包裹
- _call 统一构造 [system 恒定指令, user 边界包裹数据],chat/chat_structured 全生效
- __init__ 支持 system_instruction 注入覆盖;声明「用户数据段指令不作为要求执行」
- FakeLLMClient 记录结构对齐真实 payload({role, content}),同步 2 处既有断言
- 同步 agent-runtime-design.md §8.1 标注已实现
- 新增 5 用例,全量 182 passed / 100.00%(987 stmts/252 br)
|
2026-08-12 09:44:33 +08:00 |
|
lhl
|
2f4397a8d6
|
feat(orchestrator): 会话状态机实现 + cancelled/resume(T3 架构审查整改)
- Issue3: 新建 src/genesis/state_machine.py(9 状态白名单转移)
- cancel 记录 cancelled_from 进 cancelled 终态,resume 回中断点
- 仅执行中状态可取消(awaiting_*/done 不可),非法转移抛 StateTransitionError
- 同步 agent-runtime-design.md §3.2(状态图/规则表 9 状态 + cancelled 行)
- 新增 10 用例(含覆盖补齐 2 项),全量 177 passed / 100.00%(981 stmts/252 br)
|
2026-08-12 09:39:34 +08:00 |
|
lhl
|
cf9600e437
|
feat(inference): chat_structured 解析重试走降级链(T2 架构审查整改)
- Issue2: 解析重试按 primary→fallback 顺序尝试,不再硬编码首选模型
- Issue10: 提取 names 局部变量,删除 4 处重复 _model_names(None)[0] 调用
- LLMError 不再 early return,继续降级链;全部失败按 last_was_parse_error 区分 parse_error/failed
- 新增 2 用例(解析/网络失败降级 fallback),同步更新 7 个既有用例至降级链语义
- 全量 165 passed / 100.00% 覆盖(941 stmts/242 br),fail_under=99 达标
|
2026-08-12 09:36:10 +08:00 |
|
lhl
|
25fc472d9b
|
feat(inference): chat_structured 接入 jsonschema 真校验(T1 架构审查整改)
- pyproject.toml 新增 jsonschema>=4.23 依赖
- engine.py: json.loads 后 jsonschema.validate,校验失败按解析失败重试(带错误信息)
- 新增 3 用例:违规重试成功/耗尽 parse_error 含详情/合法一次通过
- 全量 163 passed / 100.00% 覆盖(936 stmts/238 br),fail_under=99 达标
|
2026-08-12 09:32:02 +08:00 |
|
lhl
|
0a79b07356
|
docs: Phase3 Word 解析里程碑评审报告
|
2026-08-11 08:42:54 +08:00 |
|
lhl
|
31167c9314
|
chore: Phase3 Word 解析收尾(尾随换行/import 排序/契约注释)
|
2026-08-10 23:39:53 +08:00 |
|
lhl
|
16921ecbb4
|
test: 真实样本 Word 解析集成测试(模板/规则/说明书画属write)
|
2026-08-10 15:17:44 +08:00 |
|
lhl
|
7f29cc9cf3
|
feat: SourceParser 门面全量输入聚合 StructuredSource
|
2026-08-10 14:57:04 +08:00 |
|
lhl
|
9ab11da87d
|
feat: RuleDocParser 规则文档 Markdown 化与分类
|
2026-08-10 10:14:15 +08:00 |
|
lhl
|
00fcbf18c3
|
feat: WordTemplateParser 章构成/占位符/样式名提取
|
2026-08-10 09:38:37 +08:00 |
|
lhl
|
e8771aa797
|
test: docx 测试基建(新建/落盘/规则文档快捷构造)
|
2026-08-10 09:21:55 +08:00 |
|
lhl
|
7bc9175ebe
|
docs: Phase3 计划修订(Task1 前缀 test:、_heading_level 提取共享 helper、兜底分支覆盖)
|
2026-08-10 09:09:40 +08:00 |
|
lhl
|
129c75bb06
|
docs: Phase3 Word 解析实施计划(5任务TDD)
|
2026-08-10 08:50:00 +08:00 |
|
lhl
|
af3e756ba0
|
docs: Phase3 spec 工程审阅修正(做成说明书 ref→write、列表双通道、显式角色参数)
|
2026-08-10 00:45:35 +08:00 |
|
lhl
|
17cf385a6f
|
docs: Phase3 Word 解析优先设计(模板/规则/聚合三模块)
|
2026-08-09 23:05:28 +08:00 |
|
lhl
|
464423b7ef
|
chore: 一致性门禁收尾(plan 计数、尾换行、消息与注释润色)
|
2026-08-09 17:11:38 +08:00 |
|
lhl
|
f6172903b8
|
docs: 修正错误码一致性 spec/plan 计数笔误(LLM 错误码实为 4 条非 5)
|
2026-08-09 16:56:49 +08:00 |
|
lhl
|
bb38a47445
|
test: api §7 与异常树错误码一致性门禁测试(防文档漂移)
|
2026-08-09 16:48:12 +08:00 |
|
lhl
|
bfcfbaef92
|
docs: 错误码一致性测试实施计划(TDD 单任务)
|
2026-08-09 15:23:32 +08:00 |
|
lhl
|
49f6ca80d8
|
docs: 错误码一致性测试设计(api §7 ↔ 异常树机器验证)
|
2026-08-09 15:19:55 +08:00 |
|
lhl
|
f3a30256d5
|
chore: 清理 error_code 收尾(删冗余死代码行、补尾换行)
|
2026-08-09 13:58:53 +08:00 |
|
lhl
|
857bc789ed
|
docs: api §7 补 LLM_NETWORK_ERROR 行(对齐异常树错误码)
|
2026-08-09 13:51:21 +08:00 |
|
lhl
|
aa9c63df73
|
feat: engine 透传 error_code(与 error 同源取最后一次异常)
|
2026-08-09 13:48:00 +08:00 |
|
lhl
|
3b98412492
|
feat: 结果对象 error_code 字段(默认 None 向后兼容)
|
2026-08-09 13:44:19 +08:00 |
|
lhl
|
f61e7dadb7
|
feat: 异常树 error_code 类属性(对齐 api-design §7 错误码)
|
2026-08-09 13:38:59 +08:00 |
|
lhl
|
a0a40afd45
|
docs: LLM 错误码对齐实施计划(4 任务 TDD 分解)
|
2026-08-09 13:28:45 +08:00 |
|
lhl
|
1a3c829d4c
|
docs: Web UI 设计评审修订(v1.0→v1.1,7 项发现全修 + api §2.2 write_instruction)
|
2026-08-09 13:28:38 +08:00 |
|
lhl
|
69f04ecda2
|
docs: LLM 错误码对齐设计(error_code 字段 + api §7 对齐)
|
2026-08-09 10:00:24 +08:00 |
|
lhl
|
cb2deda08a
|
test: 清理 backlog——chat_structured 超限检测 + client 上下文管理器
|
2026-08-09 09:15:36 +08:00 |
|
lhl
|
a5eaec4de8
|
docs: 里程碑3.1 回顾归档(首次 retro)
|
2026-08-09 09:08:26 +08:00 |
|
lhl
|
8ec63d1c48
|
docs: 里程碑3.1 InferenceEngine 设计规格与实施计划
|
2026-08-09 08:36:47 +08:00 |
|
lhl
|
1eb07db123
|
docs: 里程碑3.1 InferenceEngine 交付报告与进度账本
|
2026-08-09 08:36:33 +08:00 |
|
lhl
|
14062d1954
|
fix: 客户端响应结构损坏归入 LLMResponseError;3xx 不再误判成功
|
2026-08-09 08:36:02 +08:00 |
|
lhl
|
8bc5e5e571
|
feat: InferenceEngine chat/chat_structured 全流程 + 文档补丁(补丁1/2/3)
|
2026-08-09 08:26:37 +08:00 |
|
lhl
|
add7b1503c
|
feat: HttpLLMClient(httpx + 重试退避/超时/鉴权)
|
2026-08-09 08:08:04 +08:00 |
|
lhl
|
59c1ea7abe
|
feat: PromptRegistry 注册/版本/渲染(jinja2)
|
2026-08-09 08:03:17 +08:00 |
|
lhl
|
71d38b90bf
|
feat: Token 估算(approximate 内置 / tiktoken 可选回落)
|
2026-08-09 05:58:16 +08:00 |
|
lhl
|
c2fad77698
|
feat: 推理引擎数据模型与异常层(types/exceptions)及 httpx/jinja2 依赖
|
2026-08-09 05:53:55 +08:00 |
|
lhl
|
2fbff07d3f
|
test: 覆盖率提升至 100%(fail_under 90→99,13 个防御/边界用例)
|
2026-08-09 04:49:29 +08:00 |
|
lhl
|
737911cf25
|
test: 补齐覆盖率工具(pytest-cov,fail_under=90,基线 96.67%)
|
2026-08-09 04:32:11 +08:00 |
|
lhl
|
ba092f2df7
|
docs: 里程碑2.5 交付报告(MIXED 段落解析闭环)
|
2026-08-09 04:25:31 +08:00 |
|
lhl
|
d93cc77bae
|
fix: 遗留清理(枚举同源/边界防御/断言补强)
|
2026-08-09 04:18:39 +08:00 |
|
lhl
|
75925168c7
|
test: MIXED 混合样本 + 端到端段落验证
|
2026-08-09 04:13:01 +08:00 |
|
lhl
|
bc79945352
|
docs: 记录里程碑2.5 Task11 实现验证日志
|
2026-08-09 04:07:28 +08:00 |
|