Files
Jyotisha/docs/tasks/PROGRESS-report-sensitivity-crash-20260904.md
T

102 lines
5.5 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.
# PROGRESS · consultation_workflow 全量 500(出生时间敏感度 float 崩溃)(2026-09-04
工作树:`/Users/jesse/Downloads/Copse/astrology/.worktrees/report-sensitivity-crash-20260904`
分支:`codex/report-sensitivity-crash-20260904`
基线:任务书写 `285c5722`;开工 `git fetch``origin/staging` HEAD 为 `45e00f46`(含本任务书)。
任务书:仓库根 `TASK-report-sensitivity-crash-20260904.md`
未改 `_high_rigor_birth_payload` 的 float 口径,未改前端 worker,未改 `.gitea/workflows/**`,不提升 main。
| 任务 | 状态 | BUG |
| --- | --- | --- |
| 1 类型修复 + 降级加固 + 回归测试 | 完成 | BUG-524 |
| 2 staging 部署后真实 personal_full | 引擎已修好;产品报告被另一处挡住 | BUG-524 / BUG-526 |
| 3 聊天路径回归确认 | 默认模型缺计费配置,未跑到引擎 | BUG-524 |
## 开工复现
`.venv/bin/python -m pytest tests/test_consultation_workflow_birth_time_sensitivity.py -q --tb=short` 修复前:
```
.FFFFFF.F
TypeError: 'float' object cannot be interpreted as an integer
```
栈与任务书一致:`execute_consultation_workflow``_build_birth_time_sensitivity``_birth_datetime_from_args`。payload 仍把 hour/minute 解析为 float(该用例本身通过)。不带敏感度字段的聊天形状因默认 `confirmed` 早退,修复前也能过。
## 实现要点
- `_birth_datetime_from_args``datetime(int(year), int(month), int(day), int(hour), int(minute), _arg_second(args))`
- `execute_consultation_workflow`:敏感度构建的 `ValueError` 不再升成打死端点的 `BadRequest`;其余异常降级为:
```
schema=jyotish.report_birth_time_sensitivity.v1
status=not_applicable
availability=not_available
blocked=true
reason=birth_time_sensitivity_unavailable
```
`status` 留在前端已有 Zod 枚举(`not_applicable` / `candidate_window_only`)内,避免降级对象被 `consultationWorkflowResponseSchema` 打成 `workflow_contract_invalid`。真正的缺字段/非法主题仍由 `_high_rigor_birth_payload` 等抛 `BadRequest`
## 本地 HTTP 对照(虚构 1993-06-15 10:30
引擎 `.venv/bin/python scripts/jyotish_api_server.py --port 5200``swisseph_available=true`
| 请求 | HTTP | success | sensitivity.status |
| --- | --- | --- | --- |
| career / marriage / wealth / timing / healthprovisional + representative_time 10:30 | 200 | true | candidate_window_only |
| 不带敏感度字段(聊天形状) | 200 | true | not_applicable |
五份主题响应喂给 `buildReportEvidenceBundleV2`claimCards = career / health_pressure / marriage / timing / wealth5 张),blockedSections 空。
## 测试
`.venv/bin/python -m pytest tests/test_consultation_workflow_birth_time_sensitivity.py tests/test_flexible_birth_time_engine.py tests/test_consultation_workflow_domains.py -q`
```
............................................................
```
9 条新回归 + 既有 flexible/domains 全部通过。
质量门(staging 现行:`--profile quick --skip-yoga-logic --skip-frontend-runtime`):
```
585 passed, 1 skipped, 201 warnings in 436.00s (0:07:15)
Quality gate passed.
elapsed_ms: 751689
```
该次 pytest argv 尚未包含新文件(CORE 钉是门跑完后补上的)。随后把 `tests/test_consultation_workflow_birth_time_sensitivity.py` 列入 `CORE_PYTEST_TARGETS`,并加 `test_quality_gate_runs_this_file`。补钉后:
```
.venv/bin/python -m pytest tests/test_consultation_workflow_birth_time_sensitivity.py -q
.......... [100%]
```
10 passed。
## Staging 真实验证(2026-09-04
`GET https://staging.jyotisha.chat/api/health``.deployment.gitCommit` = `7b1354a79bb8e9b92c3c816fdc01f5f8de2860b7`。运行中 API 已含 `int(args.hour/minute)` 与敏感度降级。未提升 main。下文无账号、姓名、出生资料。
### 引擎(BUG-524)已在部署树上修好
从 web 容器对虚构 smoke 盘 `POST http://api:5200/api/consultation_workflow``birth_time_accuracy=provisional`float 时分):HTTP 200`success=true``birth_time_sensitivity.status=candidate_window_only`,约 74s,响应约 1.2MB。
### 任务 2 · 产品 personal_full 未闭环
登录后点「生成完整报告」。`request_id` `527f95f3-ac2e-4ed7-9b49-3c6ea4be02e8``failed` / `calculation_unavailable`,约 16.5sjob 3/3,进度停在 30%`generating_report`),无 `personal_report_sections` 行。
同期 API 访问日志**没有** `POST /api/consultation_workflow`。Postgres 在 08:59:04 / 08:59:10 / 08:59:20 UTC 三次 `permission denied for table agentic_rectification_cases`SQL 即 worker 对 `candidate_accepted` 的直接 SELECT。`20260814010000_immutable_skill_registry.sql` 已收回该表的 `service_role` 表级权限。资料状态为 `accepted`,worker 因此走进这张锁死表,从未到达已修好的引擎。记为 **BUG-526**(BUG-525 已被采集拒答占用)。
事故行 `85616e32-…`07:38 UTC)同样是约 18s / 3 次 attempt / 无章节;当时 web 容器已 recreate,无法回收那一窗的 Postgres 句。不能把 07:38 也写成 TypeError,只能说与本次 16s 失败形态相同。
任务 2 欠的章节正文、telemetry、`inputTokens` / 2 倍线对照因此仍缺。
### 任务 3 · 聊天未跑到引擎
新开对话点「时运」芯片。产品提示「当前服务的计费配置尚未完成,本次不会扣点」。web 日志 `reason=feature_pricing_missing`。API 无 consultation_workflow。默认聊天模型缺咨询计费配置,与 BUG-524 无关。