Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
**编码规范排期(§1.5)**:

- **P3+P4(当前棒)**:[`active/task_standards_backend_p3_p4_l3_ruff_v1.md`](active/task_standards_backend_p3_p4_l3_ruff_v1.md)
- **Tech-debt Epic(模块拆分)**:[`active/task_standards_backend_api_modularization_manifest_v1.md`](active/task_standards_backend_api_modularization_manifest_v1.md) · **禁止** 单 task 改全 Python 服务目录
- **Tech-debt Epic(模块拆分)**:[`done/task_standards_backend_api_modularization_manifest_v1.md`](done/task_standards_backend_api_modularization_manifest_v1.md) · **Epic CLOSE**(W1~W8 done · 2026-06-09)

**Wiki 排期导航(L2 · 防孤岛)**:[`../coding_wiki/concepts/task-schedule-ink-backend.md`](../coding_wiki/concepts/task-schedule-ink-backend.md) — pointer 至 RECENT,**不**替代排期真值。

Expand Down
5 changes: 3 additions & 2 deletions docs/tasks/RECENT_TASK_SCHEDULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,13 @@
|------|------|------|------|
| **P2 · L2** | [`done/task_standards_backend_l2_draft_v1.md`](done/task_standards_backend_l2_draft_v1.md) | **done** | R1 签收 · L2 active |
| **P3+P4** | [`done/task_standards_backend_p3_p4_l3_ruff_v1.md`](done/task_standards_backend_p3_p4_l3_ruff_v1.md) | **done** | PR [#145](https://github.com/Cyning12/ai-ink-brain-api-python/pull/145) · `.mdc` + Ruff CI |
| **Tech-debt Epic** | [`active/task_standards_backend_api_modularization_manifest_v1.md`](active/task_standards_backend_api_modularization_manifest_v1.md) | **in_progress** | W1~W7 **done** · **当前棒 W8**(Intent 栈拆分) |
| **Tech-debt Epic** | [`done/task_standards_backend_api_modularization_manifest_v1.md`](done/task_standards_backend_api_modularization_manifest_v1.md) | **done** | **Epic CLOSE** · W1~W8 **done**(2026-06-09) |
| **W1** | [`done/task_api_env_rag_env_consolidation_w1.md`](done/task_api_env_rag_env_consolidation_w1.md) | **done** | `rag_env` env 收敛 · index 零 `os.getenv` |
| **W6** | [`done/task_api_agent_loop_split_w6.md`](done/task_api_agent_loop_split_w6.md) | **done** | PR [#153](https://github.com/Cyning12/ai-ink-brain-api-python/pull/153) · agent tool runner + persist |
| **W7** | [`done/task_api_tools_registry_split_w7.md`](done/task_api_tools_registry_split_w7.md) | **done** | PR [#155](https://github.com/Cyning12/ai-ink-brain-api-python/pull/155) · tools RAG/Text2SQL 子模块 |
| **W8** | [`done/task_api_intent_stack_split_w8.md`](done/task_api_intent_stack_split_w8.md) | **done** | PR [#157](https://github.com/Cyning12/ai-ink-brain-api-python/pull/157) · intent rules + LLM 子模块 |

**执行顺序**:P3+P4 **done** → W1 **done** → W2~W7 **done** → **W8**(Intent 栈)
**执行顺序**:P3+P4 **done** → W1~W8 **done** · **Epic CLOSE**

### 1.3 semi_auto 退场双轨(**A+B done** · Epic CLOSE · 2026-06-08)

Expand Down
2 changes: 2 additions & 0 deletions docs/tasks/_views/done.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,7 @@
- `../done/task_api_env_rag_env_consolidation_w1.md`(2026-06-09 验收通过:Epic T1 W1 · `index.py` env 收敛至 `rag_env` · PR #146 · 50 `task_api_env_rag_env_consolidation_w1_reinspect_2026-06-09.md` · `CODING_BACKEND_L2@2026-06-09`)
- `../done/task_api_agent_loop_split_w6.md`(2026-06-09 验收通过:Epic W6 · agent tool runner + persist 子模块 · PR #153 · `CODING_BACKEND_L2@2026-06-09`)
- `../done/task_api_tools_registry_split_w7.md`(2026-06-09 验收通过:Epic W7 · tools RAG/Text2SQL 子模块 · PR #155 · `CODING_BACKEND_L2@2026-06-09`)
- `../done/task_api_intent_stack_split_w8.md`(2026-06-09 验收通过:Epic W8 · intent rules + LLM 子模块 · PR #157 · `CODING_BACKEND_L2@2026-06-09`)
- `../done/task_standards_backend_api_modularization_manifest_v1.md`(2026-06-09 Epic CLOSE:W1~W8 全 done · `CODING_BACKEND_L2@2026-06-09`)
- `../done/task_standards_backend_p3_p4_l3_ruff_v1.md`(2026-06-09 验收通过:P3+P4 L3 `.mdc` + Ruff CI · PR #145 · `CODING_BACKEND_L2@2026-06-09`)

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# W8 · Intent 栈拆分

> **状态**: active
> **状态**: done(PR [#157](https://github.com/Cyning12/ai-ink-brain-api-python/pull/157) · 2026-06-09)
> **slug**: `api-intent-stack-split`
> **git_branch**: `task/api-intent-w8`
> **风险**: Medium
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MANIFEST · 后端 Python 服务模块化 Tech-Debt Epic

> **状态**:active(Epic 母单 · **MANIFEST** · W1~W6 **done** · W7 当前棒
> **状态**:`done` — **Epic CLOSE**(W1~W8 均 done · 2026-06-09
> **schedule_ref**:编码规范 Epic · §1.5 Tech-debt
> **epic**:`standards-engineering` · 子主题 **`api-modularization`**
> **前置**:L2 [`CODING_BACKEND_L2_v1_zh.md`](../../standards/CODING_BACKEND_L2_v1_zh.md) **active**(P-01 路由薄层 · B-01)
Expand Down Expand Up @@ -31,10 +31,10 @@ L2 **P-01** 要求路由 **薄**(handler ~80 行软上限)、领域逻辑下

**完成态(Epic CLOSE 条件)**:

- [ ] 下表 **W1~W8** 子 task 均 **done**(或显式 **defer** 行 + 人签理由)
- [ ] 无子 task 在「非范围」外触及未列模块
- [ ] `_tech_graph` / `_manifest` 与拆分后 import 路径一致
- [ ] RECENT §1.5 更新为 **CLOSE**
- [x] 下表 **W1~W8** 子 task 均 **done**(或显式 **defer** 行 + 人签理由)
- [x] 无子 task 在「非范围」外触及未列模块
- [x] `_tech_graph` / `_manifest` 与拆分后 import 路径一致
- [x] RECENT §1.5 更新为 **CLOSE**

---

Expand All @@ -58,13 +58,13 @@ L2 **P-01** 要求路由 **薄**(handler ~80 行软上限)、领域逻辑下
| ID | 主题 | 现状行数 | 目标(摘要) | 建议 slug | 分支建议 | 风险 |
|----|------|----------|--------------|-----------|----------|------|
| **W1** | `rag_env` 收敛 | `rag_env` 234 · `index` 顶散落 env | 新代码零散落 `os.getenv`;`index` 顶层常量迁入 `rag_env` helper | `api-env-rag-env-consolidation` | `task/api-env-rag-env-w1` | Low · **done** PR [#146](https://github.com/Cyning12/ai-ink-brain-api-python/pull/146) |
| **W2** | Legacy chat 路由下沉 | `index` 内 chat/retrieve 大块 | 抽 `api/routes/legacy_chat.py`(或 `api/legacy_chat/`);`index` 仅 register | `api-routes-legacy-chat-split` | `task/api-routes-legacy-w2` | Medium |
| **W3** | Admin ingest 路由下沉 | `index` admin/sync 段 | 抽 `api/routes/admin_ingest.py`;ingest 仍调 `ingest_pipeline` | `api-routes-admin-ingest-split` | `task/api-routes-admin-w3` | Medium |
| **W4** | Unified JSON 路径 | `unified_chat` JSON handler 段 | 抽 `api/unified/json_handler.py`(名可调整) | `api-unified-json-split` | `task/api-unified-json-w4` | High |
| **W5** | Unified SSE 路径 | `unified_chat` stream 段 | 抽 `api/unified/sse_handler.py`;契约 `_contract_manifest` 必对照 | `api-unified-sse-split` | `task/api-unified-sse-w5` | High |
| **W2** | Legacy chat 路由下沉 | `index` 内 chat/retrieve 大块 | 抽 `api/routes/legacy_chat.py`(或 `api/legacy_chat/`);`index` 仅 register | `api-routes-legacy-chat-split` | `task/api-routes-legacy-w2` | Medium · **done** PR [#149](https://github.com/Cyning12/ai-ink-brain-api-python/pull/149) |
| **W3** | Admin ingest 路由下沉 | `index` admin/sync 段 | 抽 `api/routes/admin_ingest.py`;ingest 仍调 `ingest_pipeline` | `api-routes-admin-ingest-split` | `task/api-routes-admin-w3` | Medium · **done** PR [#150](https://github.com/Cyning12/ai-ink-brain-api-python/pull/150) |
| **W4** | Unified JSON 路径 | `unified_chat` JSON handler 段 | 抽 `api/unified/json_handler.py`(名可调整) | `api-unified-json-split` | `task/api-unified-json-w4` | High · **done** PR [#151](https://github.com/Cyning12/ai-ink-brain-api-python/pull/151) |
| **W5** | Unified SSE 路径 | `unified_chat` stream 段 | 抽 `api/unified/sse_handler.py`;契约 `_contract_manifest` 必对照 | `api-unified-sse-split` | `task/api-unified-sse-w5` | High · **done** PR [#152](https://github.com/Cyning12/ai-ink-brain-api-python/pull/152) |
| **W6** | Agent 循环 | `agent` ~1095 | 抽 tool 调度 / persist 子模块;`ChatBIAgent` 薄编排 | `api-agent-loop-split` | `task/api-agent-w6` | High · **done** PR [#153](https://github.com/Cyning12/ai-ink-brain-api-python/pull/153) |
| **W7** | Tool 注册表 | `tools` ~958 | `text2sql_*` vs RAG tools 分文件;保留 `get_tool_registry()` 入口 | `api-tools-registry-split` | `task/api-tools-w7` | Medium · **done** PR [#155](https://github.com/Cyning12/ai-ink-brain-api-python/pull/155) |
| **W8** | Intent 栈 | `intent_agent` 746 + `intent_router` 346 | 表驱动与 LLM 路径分文件;不混改 Unified | `api-intent-stack-split` | `task/api-intent-w8` | Medium |
| **W8** | Intent 栈 | `intent_agent` 746 + `intent_router` 346 | 表驱动与 LLM 路径分文件;不混改 Unified | `api-intent-stack-split` | `task/api-intent-w8` | Medium · **done** PR [#157](https://github.com/Cyning12/ai-ink-brain-api-python/pull/157) |

### 显式 defer(Epic 外 · 需单独立项)

Expand Down Expand Up @@ -112,10 +112,10 @@ L2 **P-01** 要求路由 **薄**(handler ~80 行软上限)、领域逻辑下

## Epic 验收标准

- [ ] W1~W8 均有对应 `task_*` 且状态 **done** 或 **defer(人签)**
- [ ] `index.py` 降至 **<400 行**(软上限 · 或 documented 例外)
- [ ] `unified_chat.py` 降至 **<800 行** 或拆为多文件 package(`api/unified/`)
- [ ] 无 open 子 task 违反 D1
- [x] W1~W8 均有对应 `task_*` 且状态 **done** 或 **defer(人签)**
- [x] `index.py` 降至 **<400 行**(软上限 · 或 documented 例外)— **349 行**
- [x] `unified_chat.py` 降至 **<800 行** 或拆为多文件 package(`api/unified/`)— **477 行**
- [x] 无 open 子 task 违反 D1
- [ ] Coding Wiki 可选 synthesis:`api-modularization-ink-backend`(关账后)

---
Expand All @@ -124,4 +124,5 @@ L2 **P-01** 要求路由 **薄**(handler ~80 行软上限)、领域逻辑下

| 日期 | 说明 |
|------|------|
| 2026-06-09 | Epic **CLOSE** · W8 done PR #157 · W1~W8 全绿 |
| 2026-06-09 | v1:Epic MANIFEST 初稿 · W1~W8 批次 |