feat(upstream): merge a6f47abd engine, MCP, and orchestrator
Three-way-merge calculation modules and pl9-export into the product fork while keeping commercial API routes, Raman ayanamsa, and the consultation contract as a keypath superset. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,14 +5,15 @@
|
||||
上游只读克隆:`/Users/jesse/Downloads/Copse/astrology/.upstream-readonly/yinduzhanxing`(HTTPS + `gh auth git-credential`;未写入、未提交、未推送)
|
||||
任务书:`docs/tasks/TASK-upstream-sync-20260903.md`
|
||||
|
||||
未碰 `main`。未改 `.gitea/workflows/**`。任务 2 未开。
|
||||
未碰 `main`。未改 `.gitea/workflows/**`。任务 2 已合完,未提交。
|
||||
|
||||
## 基线与 rebase
|
||||
|
||||
| 点 | SHA | 说明 |
|
||||
| --- | --- | --- |
|
||||
| 开工基线 | `58cae371` | 当时的 `origin/staging`(含并行规则那段任务书) |
|
||||
| 当前 HEAD | `01a45363` | rebase 到已含整备 0–3 的 `origin/staging` |
|
||||
| rebase 后 HEAD | `01a45363` | rebase 到已含整备 0–3 的 `origin/staging` |
|
||||
| 任务 0/1/4 提交 | `45d13258` | 快照 + 真相层 + VedAstro REST;任务 2 尚未提交 |
|
||||
| 整备合入 | `b6a70aa7`、`2415e751`、`01a45363` | 岁差参考集 / 发布门与产品 URL / 整备进度与状态板 |
|
||||
| 上游 pin | `a6f47abd2c9b7c6baa911ea00c971e1ec902380c` | `source_committed_at=2026-09-03T05:33:11Z` |
|
||||
| 上游 tree | `650551ddcaddce0dacc76360efca425158ebb8d4` | `source_tree_sha256=790fd5c05ffd6c1a17c6347259143d3c174e0e425246ea2207a8405f7bf6eaed` |
|
||||
@@ -25,9 +26,9 @@ rebase 无冲突。任务 2 的 ours 以 rebase 后的工作树为准,没有
|
||||
|
||||
| 任务 | 状态 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| 0 快照 / golden / 冲突表 | 完成(未提交) | 只写了导入记录、上游镜像、golden、新测试;语义合并六路径保持 `review_required` |
|
||||
| 1 真相层 | 完成(未提交) | 116 项注册表、覆盖层 25+Ashtottari、根 SKILL 三段、徽章、`6.9.15` 版本目录 |
|
||||
| 2 引擎三方合并 | 未开 | 工作清单见下方冲突表(rebase 后复核) |
|
||||
| 0 快照 / golden / 冲突表 | 完成(`45d13258`) | 导入记录、上游镜像、golden、新测试;语义合并六路径保持 `review_required` |
|
||||
| 1 真相层 | 完成(`45d13258`) | 116 项注册表、覆盖层 25+Ashtottari、根 SKILL 三段、徽章、`6.9.15` 版本目录 |
|
||||
| 2 引擎三方合并 | 合完(未提交) | 零/低/高冲突文件已按硬红线 5 裁决;API 保持商业文件;golden 已重采;quick 门 Python 段与任务 1 同绿 |
|
||||
|
||||
任务 4 写在 `PROGRESS-upstream-capabilities-20260903.md`。
|
||||
|
||||
@@ -168,6 +169,148 @@ tests/test_import_yinduzhanxing.py
|
||||
4. 上游 25 项的 command/output_path 按本仓实文件改过,没有把 `classical_astrology.py` / ziwei 研究脚本带进来。
|
||||
5. 为避免 capability audit 把 `report`/`timing` 域误判成 thematic-report API,从网页未执行项的 domains 里拿掉了这些触发词;ID 与覆盖层不变。
|
||||
|
||||
## 下一步
|
||||
## 任务 2
|
||||
|
||||
任务 2:rebase 后的冲突表,从零冲突文件 `jaimini.py` / `muhurta.py` / `western_timing_engine.py` / `solar_return.py` 开始 `git merge-file`。
|
||||
三方基线:ours = `45d13258` 工作树,base = `5db72537`,theirs = `a6f47abd`。硬红线 3 校正文件跳过。`technique_registry.json` 已在任务 1 处理。
|
||||
|
||||
### 零冲突文件(全取 merge-file,0 hunk)
|
||||
|
||||
| 文件 | 取舍 | 测试 |
|
||||
| --- | --- | --- |
|
||||
| `scripts/jaimini.py` | theirs 新函数 | `test_jaimini.py` + `test_jaimini_rangacharya_api.py` 绿 |
|
||||
| `scripts/muhurta.py` | theirs +1600 | `test_muhurta.py` 绿。`test_muhurta_factor_probe` 的 `full_scoring_status` 基线已是 `factor_only_scoring_observation`,与本合并无关 |
|
||||
| `scripts/western_timing_engine.py` | theirs +230 | `test_western_timing_engine.py` / `test_western_chart_engine.py` 绿 |
|
||||
| `scripts/solar_return.py` | theirs +84 | 无专属测试;`py_compile` 过 |
|
||||
|
||||
### 低冲突计算模块
|
||||
|
||||
| 文件 | hunks | 取舍 | 理由 |
|
||||
| --- | ---: | --- | --- |
|
||||
| `scripts/tajika_kernel.py` | 0 | merge-file | 无冲突 |
|
||||
| `scripts/varga.py` | 1 | theirs + `mapping_status` / `normalize_varga_ascendant` | 计算正确性;`test_varga_bphs` 绿。`test_varga_vedastro_mode` 在 HEAD 已红(D2 Ascendant Leo vs Sagittarius),不是本轮新增 |
|
||||
| `scripts/tajika.py` | 1 | theirs 新年主/PyJHora sidecar 辅助函数 | 纯新增;import 在本仓可解析。工作机路径只作可选探测 |
|
||||
| `scripts/gulika.py` | 1 | theirs 新 Upagraha 函数 + `DAY_RULERS` 常量 | 新函数。`calculate_gulika` 默认 Raman;PyJHora smoke 测例显式 `ayanamsa="lahiri"` |
|
||||
| `scripts/kp_system.py` | 3 | theirs `kp_maturity_profile` / `build_kp_report_pack` | 无守护读取 oracle,已带入 4 个 JSON(打开过,无出生资料)。另两个已在本仓的 hash/workflow 文件一并读取 |
|
||||
| `scripts/ashtottari_dasha.py` | 5 | 手工:保留 paksha 白名单(改从 `ashtottari_rule_profiles` 导入)+ theirs 候选规则族 | 任务 1 已解冻的 `rahu_from_lagna_lord_kendra_trikona_plus_paksha_daynight`。纯计算模块 `ashtottari_rule_profiles.py` 一并带入 |
|
||||
| `scripts/narayana_dasha.py` | 4 | theirs 新 profile/序列函数;**去掉** Gemini/Sagittarius 1993 平局硬编码 | 默认 `legacy_*` 保持本仓 AD 行为。`test_narayana_dasha.py` 绿 |
|
||||
| `scripts/ayanamsa_utils.py` | 5 | **全部 ours** | 商业岁差 API(`DEFAULT_AYANAMSA_NAME` / `UnsupportedAyanamsaError`)。auto-merge 曾把 `apply_ayanamsa` 的未知岁差改成吞掉 ValueError,已撤回 |
|
||||
| `scripts/domain_calculation_service.py` | 5 | **hunks ours**;补 `is_supported_ayanamsa_name` import | `position_mode` 不取(引擎尚未接)。transit 校验是 theirs 非冲突插入 |
|
||||
| `scripts/run_quality_gate.py` | 4 | **全部 ours**(CORE 列表 / glob 展开 / 门禁范围) | 不让上游换掉商业 quick 列表。profile 里多了未使用的 `test_timeout_seconds` 与 `--test-timeout` 参数,未接入 pytest 调用 |
|
||||
| `scripts/report_orchestrator.py` | 1 | ours 商业 `CANONICAL_DOMAINS` import | `build_report_language_contract_audit` 本仓无模块,本地 fallback `blocked` |
|
||||
| `scripts/report_pack_contract.py` | 1(新文件) | theirs 合同壳 + 缺失研究模块 fallback | 不拖 `canonical_jyotish_profile` / dashboard 研究脚本 |
|
||||
|
||||
KP 带入(无隐私):
|
||||
|
||||
- `references/oracle/kp_exact_cusp_closure_dashboard_2026_08_22.json`
|
||||
- `references/oracle/kp_exact_cusp_mainline_status_2026_08_22.json`
|
||||
- `references/oracle/kp_12_cusp_numeric_oracle_readiness_2026_07_23.json`
|
||||
- `references/oracle/kp_real_event_replay_gate_2026_07_30.json`
|
||||
|
||||
### 产品面数据(ours==base,0 hunk,快进 theirs)
|
||||
|
||||
- `references/interpretation_template_registry.json` +145
|
||||
- `references/ai-reading-workflow-prompt.md` +9
|
||||
- `references/mandatory-verification-gate-protocol.md` +39
|
||||
|
||||
无 `1993-04-17` / `14:49` / nadi 清单。
|
||||
|
||||
### 高冲突入口
|
||||
|
||||
#### `scripts/unified_consultation_orchestrator.py`(18 hunks)
|
||||
|
||||
**18 hunks 全 ours**(商业路由/reader 合同/分盘命名)。再手工:health `focus_techniques` 对齐上游并保留 `non-medical boundary`;`route_surface_contract` 用本仓 `normalize_domain`(wealth 为运行时名,finance 为别名,**不**引入会把 wealth 改成 finance 的 `route_aliases.py`);`evidence_packet_required_sections` health 加 D6/D8/D30/Narayana/功能吉凶/transit/non_medical;专家判断影子层因缺 `expert_judgment` 返回 `blocked`;不取 `build_full_spectrum_invocation_plan`。`test_unified_consultation_orchestrator.py` 全绿。
|
||||
|
||||
#### `scripts/jyotish_engine.py`(25 hunks)
|
||||
|
||||
| hunk | 函数 | 取舍 | 理由 |
|
||||
| ---: | --- | --- | --- |
|
||||
| 1 | 顶层 import | 手工 | `Path` / `SimpleNamespace` / `Any` + `re` / `contextlib` / `io` |
|
||||
| 2 | import | 手工 | 只留 `build_guided_topics`;本地 stub `build_report_theme_catalog` / `attach_calculation_profile`;不导入缺失的 startrack / calculation_profile_contract |
|
||||
| 3 | `_calc_sidereal_planets_for_jd` | theirs 速度旗标 + 补 `calc_flags` | 计算正确性;ours 同函数无商业改动 |
|
||||
| 4 | 新 PL9/报告辅助函数(~9107 行) | theirs + 消毒 | 纯新增且 import 可解析或已守护。去掉 1993 候选表加载、Domi 控制样本、`14:49`、本机路径 |
|
||||
| 5 | envelope / startrack | 手工 stub | `_build_response_envelope` **原样返回 payload**,避免 CLI/API 合同变形 |
|
||||
| 6 | `_add_chart_args` | ours | `DEFAULT_AYANAMSA_NAME`;不接 `position-mode` / `chesta-profile` CLI(shadbala 无该参数) |
|
||||
| 7 | `_build_ai_prompt_pack` 岁差默认 | 手工 | name=`DEFAULT_AYANAMSA_NAME`,display=`Raman`(产品默认,不再写 Lahiri) |
|
||||
| 8 | `compute_chart_data` | theirs 速度旗标 + 补 `calc_flags` | 计算正确性;签名保持无 `position_mode` |
|
||||
| 9 | `cmd_chart` | ours | 不包 envelope |
|
||||
| 10 | `cmd_dasha` 日期轴 | ours | 商业 MD 用完整年数从出生前回推,与 balance 展示数学等价 |
|
||||
| 11 | `cmd_dasha` AD 字段 | theirs | 超集:`start_datetime` + `pratyantar_dasha_timeline` |
|
||||
| 12 | `cmd_dasha` result | ours | 不接缺失的 `canonical_jyotish_profile` |
|
||||
| 13 | `cmd_shadbala` | ours | 无 `chesta_profile`;不覆盖本地 ranking |
|
||||
| 14 | `_resolve_tajika_year_lord` | theirs | 新年主辅助;缺 `calc_panchadhikari_year_lord` 时 try/except 回退 |
|
||||
| 15 | `cmd_tajika` return | ours | 不包 envelope |
|
||||
| 16 | natal foundation helpers | theirs | 内部已 try/except;full-reading 暂未接线 |
|
||||
| 17 | `cmd_full_reading` friendship | theirs | `planetary_friendship` 模块 |
|
||||
| 18 | `build_pl9_style_export_packet` 后半 + `cmd_pl9_export` | 手工 | 收到 `cmd_pl9_export` 为止;**不取** visual-ocr / classical / nadi |
|
||||
| 19–20 | `main` 岁差/`position-mode` | ours | 商业岁差 API |
|
||||
| 21 | `pl9-export` argparse | 手工 | 只注册 `pl9-export`,不注册 visual-ocr |
|
||||
| 22–23 | `main` 岁差应用 | ours | fail-closed `UnsupportedAyanamsaError` |
|
||||
| 24 | 命令表 | 手工 | 加 `pl9-export`;不加 classical/nadi/visual |
|
||||
| 25 | `pl9-export` 输出 | 手工 | json / markdown / pdf / **authority**(MCP 工具需要);缺模块降级 blocked |
|
||||
|
||||
`cmd_classical_*` / `cmd_nadi_*` 未取。auto-merge 进来的 argparse 与 dispatch 已删。缺失研究模块一律 stub / `_try_attr_import`,不拖脚本。
|
||||
|
||||
消毒:`_load_1993_candidate_segment_table` 恒返回 `None`;`_is_domi_pl9_control_case` 恒 `False`;Domi 视觉页 PDF/fixture 合同(原按空日期 + 控制样本时刻触发)整段不导入。`scripts/tajika.py` 的 PyJHora sidecar 只认 `JYOTISH_PYJHORA_PYTHON` / `python3.14` / `python3`,不带本机用户路径。`scripts/narayana_dasha.py` 把 `observed_pl9_1993_case_only` 改成 `observed_pl9_control_case_only`(答案泄漏字面量守卫)。
|
||||
|
||||
虚构 Beijing 1990-01-01 12:00:`full-reading`(quick 门 `test_cli_smoke` 全绿)、`pl9-export --format json` schema=`pl9_style_professional_export_v1`、树内 `status=failed` 为 0;岁差日志 `[Ayanamsa] raman`。缺研究文件的段是 `blocked`(可接受)。
|
||||
|
||||
#### `scripts/jyotish_api_server.py`(38 hunks)
|
||||
|
||||
**全部 ours。** 商业路由、`_request_ayanamsa`、咨询工作流、校正入口都不让上游改。auto-merge 曾把 nadi leaf assistant 整段插进来(+1500 行,会打穿 growth cap 11363),已整文件回到合并前的商业版本(11120 行)。nadi 路由不取。`test_api_server_growth_contract.py`、`test_commercial_domain_calculation_contract.py` 绿。
|
||||
|
||||
任务 5 的 `/api/professional_report_reference` 仍按任务书另开,不在本文件加功能体。
|
||||
|
||||
#### `mcp_server.py`(11 hunks)
|
||||
|
||||
| hunk | 取舍 | 理由 |
|
||||
| ---: | --- | --- |
|
||||
| 1 | ours(空) | `varga_evidence_matrix` / `full_spectrum_invocation_plan` / `domain_profile_builder` 本仓没有 |
|
||||
| 2 | theirs | `_single_varga_engine_call` / `_dasha_at_date` 纯辅助 |
|
||||
| 3 | 手工 | 只加 `engine_observations`;不调缺失的 `build_domain_profile` |
|
||||
| 4 | 手工 | 保留 D10,并入 D4/D11/D16/D24 |
|
||||
| 5–6 | ours(空) | calculation archive / varga matrix 模块缺失 |
|
||||
| 7 | ours | 商业 `calculate_transit` 体 |
|
||||
| 8 | theirs | 给 transit 补 `ayanamsa`/`date` |
|
||||
| 9 | theirs | `_build_execution_receipt` |
|
||||
| 10 | theirs | `route_surface_contract`(编排器已有) |
|
||||
| 11 | ours(空) | `_attach_requested_official_formal_varga_audit` 未带入 |
|
||||
|
||||
三个新工具(`get_pl9_expert_reader_report` / `get_pl9_full_report_authority` / `route_jyotish_question`)是非冲突插入,已保留。`route_jyotish_question` 对缺失 `knowledge_registry` 返回 blocked。
|
||||
|
||||
H03 曾让 `_attach_top_reader_contract` 直接调用 `_build_engine_observations()`。该函数依赖本仓没有的 `load_external_profiles`,NameError 会打断整个 `strict-evidence-collector`,咨询/报告里的 `career_strict_evidence` / `confidence_boundary` 随之消失。现已在调用处 try/except,缺模块时写入 `status=blocked`。`tests/test_cli_smoke.py` 相关 4 条与 thematic 报告 5 条已绿。
|
||||
|
||||
校正:`active_rectification_*` 按硬红线 3 跳过。
|
||||
|
||||
### 被触碰的既有断言(任务 2)
|
||||
|
||||
| 文件 | 原值 | 现在 | 原因 |
|
||||
| --- | --- | --- | --- |
|
||||
| `tests/test_gulika.py` PyJHora smoke | 隐式 Lahiri(函数写死 `SIDM_LAHIRI`) | 显式 `ayanamsa="lahiri"` | 函数现接收岁差,产品默认 Raman;该 oracle 是 Lahiri |
|
||||
| `tests/test_report_orchestrator_reader_contract.py` `source_mode` | `archive` | `git` | 任务 1 快照已改成 git,这条测试当时没跟上 |
|
||||
|
||||
### 因缺文件而 blocked(有守护,未拖研究脚本)
|
||||
|
||||
- `_event_replay_contract` / 1993 候选分段表:不导入
|
||||
- `_load_rectification_evidence_contract`:缺 JSON 时 blocked
|
||||
- `_profile_aware_benchmark_appendix` / ch10 ashtama / chara-narayana 书测 JSON:缺则空或 blocked
|
||||
- MCP `engine_observations`:`evidence_maturity` 不在本仓 → blocked
|
||||
- MCP `route_jyotish_question`:`knowledge_registry` 不在本仓 → blocked
|
||||
- 专家判断影子层:`expert_judgment` 不在本仓 → blocked
|
||||
- `full_report_quality_gate` / `kp_monthly_report_packet` / startrack / calculation archive:blocked
|
||||
- `report_quality_gate.reason=full_report_quality_gate_absent`
|
||||
|
||||
### 基线已红、本轮未新增
|
||||
|
||||
- `tests/test_varga_vedastro_mode.py`:HEAD 的 `calc_varga(..., mode="vedastro")` 已与 golden 不一致
|
||||
- `tests/test_muhurta_factor_probe.py::test_muhurta_factor_probe_keeps_full_scoring_blocked`:HEAD 已是 `factor_only_scoring_observation`
|
||||
- `frontend/tests/class-name-definition-contract.test.ts`:`ayanamsa-preference` 无 CSS 规则。`origin/staging` 同文件同红(整备岁差选择器只复用了 `sheet-section`)。任务 2 未改 `frontend/**`,fail 数不高于基线。
|
||||
|
||||
### 门禁与契约
|
||||
|
||||
- `run_quality_gate.py --profile quick` Python 段:**503 passed, 1 skipped**(与任务 1 相同)。随后 `npm test`:**2607 pass / 1 fail**,即上面的 CSS 基线项;lint 未跑到,单独 `npm run lint`:**0 error**(73 warning,不修)。
|
||||
- `./node_modules/.bin/tsc --noEmit`:**0**(symlink 的主仓 `node_modules`,不提交)。
|
||||
- golden 已重采:14 个 case 全是超集(咨询链每题多 `routing.audit_route` / `document_route` / `registry_route` / `route_aliases` / `runtime_route`,以及 `runtime_evidence_log.{finance_astrology_support_review,kp_western_support,specialized_indian_closure_review}`;wealth skip_false 与 timing skip_true 另多 VedAstro gateway 键)。无丢键、无类型变化。career / wealth / health 的 `/api/consultation_workflow` 全部 HTTP 200。
|
||||
- `tests/test_api_server_growth_contract.py`、`tests/test_commercial_domain_calculation_contract.py` 绿。隐私扫描 `public_release_privacy_scan` / `commercial_privacy_artifact_scan`:**pass, 0 findings**。
|
||||
- `next build` 本轮未跑(前端字节未改)。staging 部署验收留到推送之后。
|
||||
|
||||
未 push。未提升 `main`。任务 3 / 5 / 6 / 7 按任务书另开 `codex/upstream-capabilities-20260903`。
|
||||
|
||||
Reference in New Issue
Block a user