feat(capabilities): S6 Superpowers+S7 终验(文档/humanizer CJK 修复/验收脚本)
- prompts/superpowers_{review,answer_quality,minimal_code}.md + prompt_pack.py
- agentic_controller/answer_composer Superpowers 注入点(env 总闸,关态逐字节一致)
- compile_qa.sh: prompts/ 目录自动拷贝
- humanizer: CJK 逗号规则 + 引用保护收窄(只护标记本身,带引用句可润色)
- docs: README 能力矩阵+env 表 / ARCHITECTURE Gateway 章 / API §6 / PRD:17 /
TEST_CASES:126 多轮语义 / CHANGELOG
- tooling/cap/final_acceptance.sh 终验矩阵
- 终验: 金标 16/20 regressions=0, 多轮指代 PASS, 热加载 PID 不变 PASS,
Humanizer 开态「此外」消除且 22 引用保留, 五上游全绿, 7913 已释放
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+47
@@ -429,3 +429,50 @@ MinerU 不可用:502 降级信封,message 说明原因。读超时 600s。
|
||||
- SSE 消费用 `fetch` + `ReadableStream`(**禁止 EventSource**),解析器处理 `event:`/`data:`/`:` 三种行。
|
||||
- 流式持久化节奏:骨架 `POST /messages` → 每 3s `PATCH` 检查点 → 终态 `PATCH`。刷新中断恢复依赖此节奏。
|
||||
- 所有列表请求失败都渲染空态/离线态,**禁止**无限 loading 转圈。
|
||||
|
||||
|
||||
## §6 能力端点(Capability Gateway,2026-09-02 起)
|
||||
|
||||
### GET /api/capabilities
|
||||
|
||||
能力清单 + 默认值 + 当前会话开关 + QA 注册表合并。
|
||||
|
||||
- Query:`session_id`(可选;缺省返回默认开关)
|
||||
- 响应:
|
||||
```json
|
||||
{
|
||||
"capabilities": [
|
||||
{"name": "memory", "label": "多轮记忆", "description": "...",
|
||||
"provider": "sdk", "session_default": true, "enabled": true},
|
||||
{"name": "web_search", "label": "联网搜索", "...": "...",
|
||||
"provider": "qa_gateway", "session_default": false,
|
||||
"gated_by": "QA_V1_ENABLE_WEB_SEARCH", "enabled": false}
|
||||
],
|
||||
"defaults": {"memory": true, "web_search": false, "humanize": false},
|
||||
"installed": [{"name": "web_search", "description": "..."}],
|
||||
"load_warnings": []
|
||||
}
|
||||
```
|
||||
|
||||
### POST /api/capabilities/install
|
||||
|
||||
聊天内自助安装(BFF 透传 QA loopback)。热加载生效,不重启。
|
||||
|
||||
- 请求:`{"action": "register", "manifest": "<一段 YAML>", "apply": true}`
|
||||
或 `{"action": "unregister", "name": "<能力名>"}`
|
||||
- 响应(register):`{"ok": true, "installed": ["<name>"], "warnings": [],
|
||||
"diff": {"added": [...], "removed": [], "changed": []}, "hot_reload": true}`
|
||||
- manifest 白名单:provider ∈ {http, mcp, python, prompt_pack}、
|
||||
permission=read_only、单条目 ≤8KB、yaml 总大小 ≤1MB;坏条目跳过
|
||||
- 错误:400 VALIDATION(manifest 校验失败)/ 503 UPSTREAM_DOWN / 502 UPSTREAM_ERROR
|
||||
|
||||
### PATCH /api/sessions/{id}(§5 扩展)
|
||||
|
||||
`meta` 字段新增(2026-09-02):`{"meta": {"capabilities": {"web_search": true}}}`。
|
||||
白名单键:memory / web_search / humanize;非白名单键丢弃、值强转 bool;
|
||||
与既有 meta 深度合并(title_manual 等键不受影响)。
|
||||
|
||||
### POST /api/qa/chat 与 /api/qa/chat/stream(§4 扩展)
|
||||
|
||||
请求体新增 BFF 契约字段 `session_id`(BFF 剥离后注入上游 history/capabilities,
|
||||
不达 QA)。不传 session_id 时行为与既往一致。
|
||||
|
||||
Reference in New Issue
Block a user