Files
group_xinghuo_jinrong/docs/superpowers/plans/2026-09-11-query-interpret-split.md
T
zhanghongyu_0626 aea97a243c feat(analyst): Introduce interpret functionality and enhance chat API
- Added `interpret` flag to `AnalystChatRequest` for optional immediate interpretation of queries.
- Implemented new `POST /api/analyst/interpret` endpoint for on-demand data interpretation based on the latest query snapshot.
- Updated `AnalystAgent` to handle interpretation logic, including error handling and response formatting.
- Enhanced `AnalystQueryPage` to include a button for triggering interpretations, improving user interaction.
- Updated frontend API calls to support the new interpret functionality, ensuring seamless integration with existing workflows.

This update significantly enhances the analytical capabilities of the application, allowing users to request interpretations of their queries directly.
2026-09-11 12:15:18 +08:00

1.0 KiB

问数 / 解读拆分 Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: TDD per task.

Goal: 问数默认只返回表;各角色问数页按钮触发 /api/analyst/interpret,上下文仅最近一次问数。

Architecture: AnalystAgent.run(interpret=False) 跳过 _generate_verified_answer;新方法 interpret() 复用护栏;FastAPI 两路由;前端双请求。

Tech Stack: FastAPI · Pydantic · React · Ant Design

Global Constraints

  • 问数鉴权不变;客户 self 域尾注仍在解读成功路径追加。
  • 不 commit 除非用户要求。

Task 1: Schema + agent.run flag

  • ChatRequest.interpret: bool = False
  • InterpretRequest model
  • run(..., interpret=False) 分支 + 测试

Task 2: agent.interpret + route

  • interpret() 方法 + POST /api/analyst/interpret
  • 测试 deny echo + success

Task 3: Frontend + memory

  • analyst.ts + AnalystQueryPage 按钮与解读区
  • MEMORY / TODO / REQUIREMENTS 更新
  • pytest + npm run test