fix(report): stop listing reports via PostgREST JSON paths (BUG-574)
Staging PostgREST rejects the executiveSummary JSON-path alias, so GET /api/reports 500s. Persist a plain card_summary column from the Markdown excerpt instead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# PROGRESS · 报告列表 500:PostgREST JSON 路径(2026-09-07)
|
||||
|
||||
工作树:`.worktrees/report-list-500-20260907`
|
||||
分支:`codex/report-list-500-20260907`
|
||||
基线:`origin/staging` @ `ad9283d1`(任务书写 `5c644f92`,开工 fetch 后 HEAD 为准)
|
||||
任务书:`TASK-report-list-500-20260907.md`
|
||||
未改 `.gitea/workflows/**`,不提升 main。
|
||||
|
||||
## 开工回执
|
||||
|
||||
- 目标:`GET /api/reports` 恢复 200;卡片摘要改普通列;列表错误日志能看到 PostgREST `code`/`hint`。
|
||||
- 最大风险:应用若在迁移前部署,`select card_summary` 会再次 500。必须先 `Migrate Staging Database` 再部署 web。
|
||||
|
||||
## 任务状态
|
||||
|
||||
| 任务 | 状态 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| 1 止血:去掉 JSON 路径 select | 完成 | `REPORT_LIST_COLUMNS` 只含普通列 `card_summary` |
|
||||
| 2 `card_summary` 列 + worker 写入 | 完成 | 迁移 `20260907010000`;`complete_personal_report_job` 从 `executiveSummary.summary` 写入(与 MD「摘要」截取同源);旧行不回填 |
|
||||
| 3 观测 | 完成 | `sanitizedErrorReason` 读取非 Error 的 `code`/`hint`,不记 message/details |
|
||||
| 4 部署后 smoke | blocked | 清单已写入 `docs/operations/personal-report-staging.md`;需迁移+部署+真实登录会话。本环境无 staging 登录态 |
|
||||
|
||||
## 偏离
|
||||
|
||||
任务书写「由 worker 从 MD 摘要段写入」。实现上 worker 仍通过 `extractLongformSummary(..., 500)` 写入封面 `executiveSummary.summary`,完成 RPC 在同一事务拷到 `card_summary`。没有另开一次 PostgREST JSON 路径 select,也没有改 RPC 参数签名。
|
||||
|
||||
## 质量门(本机跑过)
|
||||
|
||||
```text
|
||||
tsx --test tests/safe-error-reason.test.ts tests/personal-report-longform-md.test.ts \
|
||||
tests/personal-report-migration.test.ts tests/personal-report-api.test.ts
|
||||
# 77 passed
|
||||
|
||||
tsx --test --test-concurrency=1 tests/database-personal-report-card-summary.test.ts
|
||||
# 1 passed(Docker Postgres 真迁移:可空、authenticated 只读、service_role 可写、500 接受、501 拒绝、complete RPC 写入摘要)
|
||||
|
||||
./node_modules/.bin/tsc --noEmit
|
||||
# pass
|
||||
```
|
||||
|
||||
## 推送
|
||||
|
||||
未推。产品要求只快进 staging、不提升 main。
|
||||
@@ -100,6 +100,7 @@
|
||||
| `TASK-report-longform-parity-20260905.md`(仓库根) | `PROGRESS-report-longform-parity-20260905.md` | 长报告对齐全量版并挂入产品附录 | 待验收 | `codex/report-longform-parity-20260905`(任务 6 待部署后核对) |
|
||||
| `TASK-report-longform-gaps2-20260906.md`(仓库根) | `PROGRESS-report-longform-gaps2-20260906.md` | 长报告真实参数组合下的装配缺口 | 待验收 | `codex/report-longform-gaps2-20260906`(BUG-561/562 `cfcd369d`;补洞 BUG-564 `e4d16b75`) |
|
||||
| `TASK-report-md-page-20260906.md` | `PROGRESS-report-md-page-20260906.md` | 长报告 Markdown 直接作为报告页 | 已合入 | `cfcd369d` / `809bdf13`(BUG-563 lint 随后修) |
|
||||
| `TASK-report-list-500-20260907.md`(仓库根) | `PROGRESS-report-list-500-20260907.md` | 列表 PostgREST JSON 路径 500 | 执行中 | `codex/report-list-500-20260907`(BUG-574) |
|
||||
|
||||
### 前端基础与工程
|
||||
|
||||
|
||||
Reference in New Issue
Block a user