Files
xsl 7bcbb8d40b
CI / lint / typecheck / import-linter / tests / secrets (push) Canceled after 0s
feat(agent,report): 会话持久化与画像注入、报告反馈与预约留资——PM/开发双Agent迭代1-3
- agent: ag_conversation/ag_message 表(迁移0007),上下文组装注入最近报告画像摘要
  (report.profile.latest_profile_summary 经 apps 层闭包注入,同层不互调),历史带最近
  AGENT_HISTORY_TURNS=10 轮;POST/GET /agent/conversations 与消息历史接口
- agent 修复:ChatRequest.conversation_id 改 str(雪花ID超2^53,JS Number丢精度);
  _build_context 挪进 reserve commit 后同一 try,异常走 refund 兜底
- report: rp_feedback(维度反馈 upsert,认同率/修正率 SQL 可算,T-P3-21 最小版——
  L1 记忆未建,不回写结论)+ rp_reservation(预约留资幂等,T-P3-22,预约率口径
  行数/full_report.card_view 去重曝光,门槛≥8%),迁移0008
- 测试:全量 606 passed;ruff/mypy/lint-imports 全绿;E2E 真实 deepseek-v4-flash 验证
  画像注入与历史携带
2026-09-11 21:50:58 +08:00

36 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# `packages/report/` — 美学报告(占位)
**职责**(架构 §4.1):触发判定、生成编排、版本管理、分享。
**不负责**:具体的视觉分析与文案生成(调 AI 能力层)。
`profile.py` 对外提供「最近一份 succeeded 报告的画像摘要」(Agent 上下文
注入用,P0-2);rp_report / rp_input 仍只有本域 repo 可触,外部一律走这里。
## 待实现
- 表:`rp_report` `rp_input` `rp_share`
- 架构 §7.1 的 24 步生成链路(这是全系统最复杂的一条)
## 这条链路上不能妥协的四件事
1. **原图生命周期**:直传 COS 临时桶 → Worker 拉取 → 第 14 步**显式删除** →
桶级 2 小时生命周期兜底(TD-20 / CR-02)。`rp_input` 只存派生特征与图片元信息。
2. **失败即退款**:任何步骤失败 → `tk_task` 转 failed → `billing.refund()`。
3. **分步可恢复**:视觉分析结果必须落中间态,LLM 或渲染失败时不重跑视觉分析
(也就不需要用户重新上传)。
4. **生成后校验不可跳过**:禁忌违反、色值在板内、维度引用存在、无医疗/贬损表述。
最多重试 2 次,仍失败降级为规则直出模板文案,**绝不放行违规内容**。
## 结论反馈(T-P3-21 最小可用版,迭代 3 落地)
`feedback_service.py` + `rp_feedback`:维度级「准/不准 + 可选修正」,同维度
重复反馈 = 覆盖更新(upsert)。**有意裁剪**:原文要求的「修正后置信度置 1.0
并即时写 L1 记忆」未做——L1 记忆系统未建,本迭代只落表,认同率/修正率
两项指标可从 SQL 直接算出,不回写报告结论。
## 预约留资(T-P3-22,迭代 3 落地)
`reservation_service.py` + `rp_reservation`:topic 预留通用性(首期
full_report)。指标口径:**预约率 = rp_reservation(topic='full_report') 行数
÷ 埋点 full_report.card_view 去重曝光数**;决策门槛 ≥8%(产品方案 §2.2.3)。