# 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 | 进行中 | 迁移+部署已对齐 `72dd5e9d`;未登录列表 401。登录态 GET 列表/详情/创建仍待真实会话 | ## 偏离 任务书写「由 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 ``` ## 推送 - `b466a6fc` fix(report): stop listing reports via PostgREST JSON paths (BUG-574) - `72dd5e9d` docs: record BUG-574 fix SHA b466a6fc - `git push origin HEAD:staging`:`ad9283d1..72dd5e9d` - Independent Staging Quality Gate [run 2458](https://git.copse.top/root/Jyotisha/actions/runs/2458) success - 自动 Deploy staging [run 2459](https://git.copse.top/root/Jyotisha/actions/runs/2459) 按设计停在待迁移(`20260907010000_personal_report_card_summary.sql`) - Migrate Staging Database [run 2460](https://git.copse.top/root/Jyotisha/actions/runs/2460) success:`applied 20260907010000_personal_report_card_summary.sql` - Deploy staging [run 2461](https://git.copse.top/root/Jyotisha/actions/runs/2461) success - `https://staging.jyotisha.chat/api/health`:`deployment.gitCommit=72dd5e9d7a0c5f3cdce68c46d4a219597350b013`,`database.latestMigration=20260907010000_personal_report_card_summary.sql`,`requiredMigrationsPresent=true` - 未登录 `GET /api/reports` → 401 `请先登录`(不再是列表 500) - 登录态列表 200 / 新报告卡片摘要仍待真实会话走查 - 未提升 `main`