feat(ECR-012–016): 合规、题库、时辰刷新、头像、MBTI OEJTS 与埋点

落地输入合规、探索题库、报告日/时辰刷新、账号头像、OEJTS 量表,并补齐 H5 埋点与 Admin 漏斗;同步 ESS 工件、切至自建 Git、清理 GitHub Actions。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-13 01:27:58 +08:00
co-authored by Cursor
parent 13860bf1ef
commit 89756f65b4
227 changed files with 7405 additions and 1407 deletions
+33
View File
@@ -0,0 +1,33 @@
# CODE_REVIEW — ECR-012 Input compliance
**Date:** 2026-08-13
**Reviewer:** Agent (ESS REVIEWER)
**Verdict:** **Approve**
## Backend Review
```text
Backend Review:
☑ Design Compliance — 对齐 BD-2026-012textsafe 纯函数 · 写库前 Check
☑ Layer boundary respected — Handler/Service 调用;无 Controller→DB
☑ Domain independent
☑ Repository used(无新增直连)
☑ API contract — 40060OpenAPI 已注
☑ Migration — N/A(无 schema
☑ Observability — 错误码可观测
☑ Error handling — textsafe.ErrRejected → 40060
☑ Tests included — internal/textsafe + TEST_REPORT 手工/API 表
☑ Rollback considered — 去掉 Check 即可
☑ No architecture regression
☑ Matches Change Boundary
☑ Trace — BD-2026-012 · TEST_REPORT/ECR-012.md
```
## Residual(接受)
- 非第三方审核 SaaSSpec Out
- Ops CMS 全文案未纳入
## Decision
**Approve** → ECR-012 可 Closed(合入时勿带密钥 / test-results
+33
View File
@@ -0,0 +1,33 @@
# CODE_REVIEW — ECR-013 Scale bank explore
**Date:** 2026-08-13
**Reviewer:** Agent (ESS REVIEWER)
**Verdict:** **Approve**
## Backend Review
```text
Backend Review:
☑ Design Compliance — 对齐 BD-2026-013embed · EnsurePublished · 无题目录表)
☑ Layer boundary respected — Handler → Service → scalebank|Repo
☑ Domain independent
☑ Repository used — SaveResult / LatestResult / EnsurePublished
☑ API contract — OpenAPI `/scale-bank/*` + scales result
☑ Migration — N/Aupsert scales 元数据)
☑ Observability — 标准 envelope / 40411
☑ Error handling — category 404 · result 404 · profile 校验
☑ Tests — scalebank unit · TestScaleBankResultRoundtrip · ScalePage vitest
☑ Rollback considered
☑ No architecture regression — icon allowlist 抽到 lib
☑ Matches Change Boundary — 无临床类
☑ Trace — BD-2026-013 · TEST_REPORT/ECR-013.md
```
## Residual(接受)
- 题量较大(50–180)体验可后续 ECR 优化
- 工作区另有 tips/星座日刷/头像等 WIP,须另开 ECR,不并入本 Approve
## Decision
**Approve** → ECR-013 可 Closed / 合入(勿带 test-results、密钥、scraped 全量原始文件若未纳入)
+63
View File
@@ -0,0 +1,63 @@
# CODE_REVIEW — ECR-014 Temporal refresh (tips · star · rhythm)
**Date:** 2026-08-13
**Reviewer:** Agent (ESS REVIEWER)
**Verdict:** **Approve**
**Retrospective:** true
```text
ESS Mode: L2
Phase: REVIEWER
ECR: ECR-014
Action: CONTINUE
Forbidden: production code edits this turn
```
## Process debt(强制记录)
本变更 **实现早于 ECR**(倒序)。TEST_REPORT / HANDOFF 已标明 Retro。
**不得**解读为「正序 Approved → Coding」样板路径。Intake 门禁对后续 L2 仍适用。
## Acceptance ↔ Evidence
| Acceptance | Evidence | OK |
|------------|----------|----|
| daily-tips `shichen` / `shichen_name` / `valid_until` | `DailyTips` JSON + `decorateTips` · OpenAPI `HomeDailyTips` | ✓ |
| star/rhythm 跨日原地更新 + `valid_until` | `refreshTemporalIfNeeded` on Get/Latest · engines set fields · `temporal_test` | ✓ |
| OpenAPI 一致 | `EnvelopeHomeDailyTips` · GrowthReport.summary 说明 | ✓ |
| go test | 复跑 home + report **PASS** | ✓ |
| ess-validate coding | **PASS** | ✓ |
| CODE_REVIEW 记 Retro | 本文 | ✓ |
## Backend Review
```text
Backend Review:
☑ Design Compliance — 对齐 BD-2026-014cache 时辰 · GET 换日原地 UpdateContent · 不新开报告 id
☑ Layer boundary respected — Handler → Service → Repo
☑ Domain independent
☑ Repository used — HomeDailyTipsRepo · Reports.UpdateContent
☑ API contract — OpenAPI 已批契约扩展
☑ Migration exists — 000023 home_daily_tips(本地表已存在)
☑ Observability — tips db 错误 logrefresh 失败软回退旧报告
☑ Error handling defined
☑ Tests included — shichen · temporal as_of/valid_until
☑ Rollback considered — BD 已写
☑ No architecture regression
☑ Matches Change Boundary — 未见头像/scalebank/textsafe 并入本 ECR 交付叙述
☑ Trace — BD-2026-014 · TEST_REPORT/ECR-014.md · 本 Review
```
## Residual(接受,不阻断)
- `refreshTemporalIfNeeded` 在 UpdateContent 失败时静默返回旧报告(可用性优先;可后续加指标)
- 同日仅缺 `valid_until``stampValidUntil` 改内存、未必立刻落库(下次 GET 仍可装饰)
- 无独立 HTTP integration 冒烟(单元 + 契约足够本 L2 Risk=Low
## Out of scope(正确排除)
头像 → ECR-015 · scalebank → ECR-013 · textsafe → ECR-012
## Decision
**Approve** → ECR-014 可 **Closed** / 合入(勿带密钥、`test-results/`、未纳入 Scope 的刮题库原始大文件)
+47
View File
@@ -0,0 +1,47 @@
# CODE_REVIEW — ECR-015 Account avatar
**Date:** 2026-08-13
**Reviewer:** Agent (ESS REVIEWER)
**Verdict:** **Approve**
**Retrospective:** true
```text
ESS Mode: L2
Phase: REVIEWER
ECR: ECR-015
Forbidden: production edits this turn
```
## Process debt
实现早于 ECR(倒序)。**非**正序样板路径。
## Acceptance ↔ Evidence
| Item | OK |
|------|-----|
| Upload ≤2MB jpeg/png/webp | Store + handler 40114 |
| 超限/坏类型 | store_test PASS |
| media 公开读 · 拒穿越 | ResolveAbs + MediaHandler |
| me.avatar_url · H5 默认图 | types/SDK/MinePage/default-avatar.png |
| OpenAPI | upload/media 已述 |
| go test avatar · ess-validate coding | PASS |
## Backend Review
```text
☑ Design Compliance — BD-2026-015
☑ Layer boundary · Repository · Migration 000018
☑ API contract · Security (size/type/path)
☑ Tests · Rollback · Change Boundary(未吞 OpenLogin/题库)
☑ Trace — TEST_REPORT · 本 Review
```
## Residual(接受)
- 手工 UI 冒烟未在本机浏览器执行(单测覆盖核心安全边界)
- 无对象存储(Spec Out
## Decision
**Approve** → ECR-015 **Closed**
+12
View File
@@ -0,0 +1,12 @@
# CODE_REVIEW — ECR-016 MBTI OEJTS
**Verdict:** **Approve**
**Retrospective:** true · Process debt:倒序实现
## Backend Review
☑ BD-2026-016 · jungian 计分 · mbti-full 会员锁 · migrations 019022 · tests PASS · OpenAPI
## Decision
**Approve** → Closed
+36
View File
@@ -0,0 +1,36 @@
# CODE_REVIEW — WIP sweep 2026-08-13
**Scope:** ECR-012~016 相关实现 + 本地脏树抽检
**Verdict:** **PASS(测试)** · 无阻断级 must-fix;有 residual
## Tests
| Suite | Result |
|-------|--------|
| `go test` API unit(除 integration | **PASS** |
| `go test ./internal/integration/` | **PASS** |
| `npm run test:h5` | **PASS** 16 files / 41 tests |
| `vue-tsc --noEmit` | **PASS**typecheck + MinePage 拆分已清) |
## Hotspots
| Area | Assessment |
|------|------------|
| avatar Store/ResolveAbs | 大小/类型/UUID 文件名/拒 `..`;单测覆盖 |
| temporal refresh | GET 换日原地 UpdateContent;失败软回退 |
| daily-tips | 时辰缓存 + 异步 LLM;不阻塞 |
| scalebank + R8 H5 | slug 响应式;有结果直接展示 |
| textsafe | Check → 40060 路径存在 |
| mbti-full lock | service Locked / 40310 |
## Residual(不阻断合入判定,建议后续 ECR/L1)
1. ~~H5 typecheck~~ **已清**`@types/node` + TabBar/MatchCompare/ReportRich
2. ~~MinePage.vue 超 400 行~~ **已拆**`useMinePage` + `mine/*` + `mineCatalog`
3. **avatar** 信任 Content-Type/扩展名,未做 magic-byte 校验(常见可接受 Residual
4. **temporal** UpdateContent 失败静默返回旧报告(无 metrics)
5. Vitest 中 `router-link` stub 警告(测试噪音)
## Decision
功能回归测试 **绿**typecheck / MinePage 行数债已清。剩余 avatar magic-byte、temporal 软失败为可选 Residual。