Files
digital-psychology/docs/BACKEND_DESIGN/BD-2026-014-temporal-refresh.md
T
jackyu66gitandCursor 89756f65b4 feat(ECR-012–016): 合规、题库、时辰刷新、头像、MBTI OEJTS 与埋点
落地输入合规、探索题库、报告日/时辰刷新、账号头像、OEJTS 量表,并补齐 H5 埋点与 Admin 漏斗;同步 ESS 工件、切至自建 Git、清理 GitHub Actions。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 01:27:58 +08:00

47 lines
1.1 KiB
Markdown
Raw 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.
# BD-2026-014 — Temporal refresh (tips · star · rhythm)
Status: Approved
**ECR:** ECR-014
**Date:** 2026-08-13
**Change Level:** L2
**Risk:** Low
**Retrospective:** true(实现已部分在树,本 BD 冻结边界)
## Backend Change Boundary
### In
- `home_daily_tips` 表 · HomeDailyTipsRepo · DailyTips 响应装饰时辰窗
- report `refreshTemporalIfNeeded` on Get / GetLateststar|rhythm
- OpenAPI 字段说明
### Out
- 头像 · scalebank · 新建报告 id 换日
## Data flow
```text
GET /home/daily-tips
→ CurrentShichen → cache hit? return+decorate : fallback + async LLM warm
→ valid_until = next 时辰 start
GET /reports/latest|/:id (star|rhythm)
→ if as_of != today CST → in-place UpdateContent outlook/tips
→ stamp valid_until = next midnight CST
```
## Migration
YES — `000023_home_daily_tips`(若尚未应用则 migrate
## Test
- `TestCurrentShichenBoundaries` · `TestFallbackTipsChangeByShichen`
- `temporal_test.go` as_of / valid_until
- 可选:手工 GET 冒烟
## Rollback
- 停用 refresh 调用;表可保留