# PROGRESS · 上游能力接入(任务 3–7,2026-09-03) 工作树:`/Users/jesse/Downloads/Copse/astrology/.worktrees/upstream-capabilities-20260903` 分支:`codex/upstream-capabilities-20260903`(跟踪 `origin/staging` @ `f2241463`) 任务书:`docs/tasks/TASK-upstream-sync-20260903.md` 未碰 `main`。未改 `.gitea/workflows/**`。 | 任务 | 状态 | 说明 | | --- | --- | --- | | 3 health 三窗 + 个人报告 | 未开 | 任务 6 之后 | | 4 VedAstro REST 桥 | 完成(已在 `45d13258`) | 进度里旧「未提交」已过时 | | 5 专业报告导出 | 未开 | 依赖任务 2 的 `pl9-export` | | 6 新字段透传 | 完成 | 聊天 + 报告 allowlist;golden 超集 | | 7 校正三项 | 未开 | 7c 依赖 2+6 | ## 任务 6 ### 做了什么 1. 新模块 `scripts/consultation_engine_field_bridge.py`:把引擎的行星友敌、应期种子、模块执行附录、Pratyantar 当前/下一段挂到咨询盘上。`jyotish_api_server.py` 只加薄钩子(attach、重建 prompt pack、审计三行、响应顶层新键)。`page.tsx` 未动(2041 行)。API 文件 11120 → **11141**(上限 11363)。 2. 聊天:折叠审计新增 Planetary Friendship / Ashtottari Dasha / Module Execution Audit。Ashtottari 三态仍是 `executed`,说明为 **参数敏感、未验证**。财富方法学主名改为 `finance-timing-strict`。 3. 报告:`interpretiveFacts.planetaryFriendship`(等级表,无自由文本)与 `pratyantarTimeline`(当前+下一段)。timing 种子读 `timing_narrative`。timing claim card 的 conclusion / timingBoundary 可引用 PD 日期。友谊表不进必选技法组,收据为 `partial`。 4. golden:在旧夹具上合并稳定新键(`timing_narrative` / `module_execution_audit` / `pratyantar_dasha_timeline`)。未把偶发的 `vedastro_gateway.official_raw_response` 写进夹具。 ### 测试 | 项 | 结果 | | --- | --- | | `tests/test_consultation_engine_field_bridge.py` | 5 passed | | `tests/test_api_server_growth_contract.py` | 3 passed | | `tests/test_consultation_contract_golden.py`(非 live HTTP) | 2 passed | | `test_consultation_foreground_times_out_vedastro_without_failing_local` | 绿。新增引擎预热 import,**不断言改值**。原值仍是 `official_closure_reason=foreground_optional_evidence_timeout`。原因:attach 首次 import `jyotish_engine` 会超过测试里 0.4s 假延迟,网关会先完成。 | | `tsc --noEmit` | 0 错 | | 相关前端测试(methodology / audit / interpretive facts / report v2 / plan / telemetry) | **60 pass / 0 fail** | | 改动文件 eslint | 0 error | 断言改动:无(超时测试只加预热 import)。 ### 虚构 smoke `1990-01-01 12:00 Beijing` timing 题走 `_compute_consultation_workflow`: | 行 | 状态 | 说明 | | --- | --- | --- | | Planetary Friendship | executed | 友敌等级表;不得当作确定性结论;9 行 | | Ashtottari Dasha | executed | 参数敏感、未验证 | | Module Execution Audit | executed | 附录可见;不得升格为确定性结论 | | `pratyantar_dasha_timeline` | ready | 当前 PD Rahu `2026-03-26`–`2026-09-07` | | `timing_narrative.status` | parameter_sensitive | 有 headline | 同输入两次 bundle hash 一致(前端测试)。未跑浏览器聊天,也没有 writer 的真实 `inputTokens`。 ### 每章体量(过滤后 bundle JSON 字节,代理 inputTokens) 无模型凭据,无法打真实 writer。代理:同主题过滤后的 bundle `JSON.stringify` 字节。before = 去掉友敌表、PD、timing 种子。 | 主题 | before | after | 比值 | | --- | --- | --- | --- | | general | 7384 | 7511 | 1.017 | | wealth | 9912 | 10039 | 1.013 | | education | 8640 | 8767 | 1.015 | | timing | 7489 | 8816 | 1.177 | p50 ≈ **1.016**,最大 1.177,低于 1.3 停工线。 ### 环境缺口 - 无登录态 / Chrome:网页聊天折叠表走查留给 `docs/testing/`。 - 无模型凭据:personal_full writer 的真实 `inputTokens` 未测。 - 合入前 staging health 可能仍停在任务 2 的 `f2241463` 或更早 SHA;部署后应对齐本提交。 ### 未做 任务 3 / 5 / 7。未改 `route_aliases.py`。未把 nadi/classical 接到网页路径。 ## 任务 4 ### 做了什么 1. 引入 `scripts/vedastro_rest_bridge.py`(对齐上游 `a6f47abd` 的 REST Calculate 调用)。**去掉 yn-1993 / Handan / 1993-04-17 14:49 默认值。** 默认改为虚构 smoke:Beijing `39.9042, 116.4074`,`12:00 01/01/1990 +08:00`,`LAHIRI`。 2. 本地 5 次/分钟限流。HTTP 429 与本地令牌耗尽均降为 `official_blocked`,不抛给调用方当硬错误。`match` 子命令返回 `official_blocked` / `match_subcommand_not_implemented`,不伪造合盘。 3. `scripts/vedastro_gateway.py`:官方健康改为打 `/api/Calculate` 的 `Status: Pass`;status 输出 `transport=rest`、`rate_limit_per_minute=5`、`mcp_bridge_role=protocol_probe_only`。`JYOTISH_SKIP_LOCAL_ENV=1` 时探测为 `not_probed`。 4. `scripts/vedastro_parity_matrix.py` 与 fast-path checklist:MCP/API Surface 的 `fastest_path_lane` 改为 `rest_adapter`;MCP 桥文件保留,只作协议探测。 5. `scripts/diagnose_vedastro_mode.py`、`scripts/vedastro_official_mcp_bridge.py` 文档、`docs/engine/README.md` 同步。 ### 测试(无网络) 未设置 `VEDASTRO_ENABLE_NETWORK=0` 污染进程时: ``` tests/test_vedastro_rest_bridge.py tests/test_vedastro_parity_matrix.py tests/test_vedastro_gateway.py tests/test_vedastro_runtime_mode_diagnostics.py tests/test_vedastro_fast_path_checklist.py tests/test_vedastro_official_mcp_bridge.py ``` **67 passed**(含任务 0 的 `test_import_yinduzhanxing.py`)。REST 桥测试用录制响应,不打真网。曾有一次 `active_backend=local_fallback` 失败是 pytest 进程被 `VEDASTRO_ENABLE_NETWORK=0` 污染,不是产品回归。 `tests/test_vedastro_rest_bridge.py` 断言默认 payload **不含** `14:49`。 ### 有网络手工跑 ``` .venv/bin/python -B scripts/vedastro_rest_bridge.py horoscope ``` 虚构 Beijing smoke。**`Status: Pass`,耗时 1.566 s。** 未打到 429。限流路径由单测覆盖:gateway 降 `official_blocked`。 ### 未做 未改 `jyotish_api_server.py` 的咨询路由。`/api/vedastro_gateway/status` 字段已在 gateway 模块与 `tests/test_vedastro_gateway.py` 锁住;本轮未起 Docker 打 staging 该端点。