From 18d01dcff40fbf9054d1b5c208e02fc077adafa2 Mon Sep 17 00:00:00 2001 From: Jesse_Chen Date: Sun, 18 Oct 2026 20:02:17 +0800 Subject: [PATCH] docs(tasks): marriage match p1 second fix brief (issue #79) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LutgzyJqNhPpZy1nFsJtN3 --- .../TASK-marriage-match-p1-fix-20261018-2.md | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docs/tasks/TASK-marriage-match-p1-fix-20261018-2.md diff --git a/docs/tasks/TASK-marriage-match-p1-fix-20261018-2.md b/docs/tasks/TASK-marriage-match-p1-fix-20261018-2.md new file mode 100644 index 00000000..206f81da --- /dev/null +++ b/docs/tasks/TASK-marriage-match-p1-fix-20261018-2.md @@ -0,0 +1,47 @@ +# TASK · 婚恋合盘第一期 · 第二份修复单(issue #79,第 2 次打回) + +- 日期:2026-10-18 +- 被验提交:`cf5a62c684b0523dbc33406bbdc5067eb513bb29`(分支 `codex/marriage-match-p1-20261017`) +- 前一份修复单:`docs/tasks/TASK-marriage-match-p1-fix-20261018.md`(F1、F2 已通过) +- 原任务书:`docs/tasks/TASK-marriage-match-p1-20261017.md` 第六版 +- 状态:**第 2 次打回,按循环规则等产品负责人拍板**(选项见 issue #79)。下文是改法,谁来做由产品定。 +- BUG 编号:不新开号 + +## 验收结论(Claude,Linux,合并最新 `origin/staging` `0d92f586` 后) + +| 项 | 结论 | 证据 | +| --- | --- | --- | +| 修复单 F1:只存两套配对结果 | 通过 | `structured_result` 与 `report` 都只有 `rules_version` / `default` / `raman`;旧历史接口加了 `rules_version is null` 过滤并有测试 | +| 修复单 F2:并发重读 | 通过 | `23505` 时重读已保存行 | +| 合并 staging | 只碰文档 | `CHANGELOG.md`、`docs/BUG_HISTORY.md` 冲突;`scripts/jyotish_engine.py` 与 sync8 自动合并,合并后相对 staging 只有本单的段落 | +| **全量 pytest** | **未通过** | 与 staging `0d92f586` 基线逐名比对,新增 2 个文件、3 条失败(见 G1、G2) | + +## G1 · scripts 根目录 Python 文件数超预算 + +`tests/test_python_hygiene_budget.py::test_scripts_root_py_count_does_not_grow`:`449 <= 446` 失败。本单在 `scripts/` 根目录新增 4 个(`marriage_match.py`、`marriage_match_api.py`、`marriage_match_cli.py`、`synastry_full_dossier.py`),删 1 个(`synastry.py`),净增 3。预算由 `TASK-python-hygiene-20261013` 定下(「新研究脚本放 `scripts/audit` 或 `scripts/research`」),早于本单任务书;任务书建议的放置位置与它冲突,按既有合同为准,**不改预算**。 + +改法: + +- `scripts/marriage_match.py` 留在根目录(与上游同路径,T1 要求逐字相同)。 +- 三个本地胶水模块搬进新子包 `scripts/marriage_match_service/`(名字可议,写进进度):`api.py`、`cli.py`、`full_dossier.py`,加 `__init__.py`。 +- 同步改调用处:`scripts/jyotish_api_server.py` 两处 `_load_local_module('marriage_match_api')`(改为能加载子包模块的写法,保持主文件只做薄注册、不增方法)、`scripts/jyotish_engine.py` 的 `cmd_marriage_match` import、`tests/test_marriage_match_api.py`、`tests/test_synastry_full_dossier.py`、`tests/test_marriage_match_product.py` 里改写过的那条(三栏注释里的「新值」同步更新)。 +- 验收:根目录计数 ≤ 446;`tests/test_api_server_growth_contract.py` 绿。 + +## G2 · 删掉的 `scripts/synastry.py` 还被调用清单引用 + +`tests/test_owner_case_purge_contract.py` 两条失败(`test_effective_view_matches_overlay_without_replacement_oracle`、`test_invocation_matrix_paths_counts_hash_and_boundaries`):`references/oracle/full_technique_invocation_matrix_2026_07_22.json` 仍列着 `scripts/synastry.py`,文件已删,`is_file()` 为假。AGENTS §7.8:删文件前先 grep `tests/` 与 `references/`。 + +改法: + +- 在该清单里把这一项改指向 `scripts/marriage_match.py`(或删除该项),并按该合同测试要求同步计数 / 哈希(看测试里怎么校验,按它的规则更新,不放宽断言)。 +- `references/oracle/compatibility_skill_readiness_dashboard_2026_07_20.json` 由 `scripts/compatibility_skill_readiness_dashboard.py` 生成,脚本里已改成 `marriage_match.py`;重新生成一次让 JSON 与脚本一致。 +- 验收:`python3 -m pytest tests/test_owner_case_purge_contract.py tests/test_python_hygiene_budget.py -q` 全绿;全量 pytest 失败名单与 staging 基线逐名一致。 + +## 不要做 + +- 不改 `ROOT_PY_BUDGET`;不改 `scripts/marriage_match.py`、`skills/jyotish-full-synastry-reading/**`。 +- 不动 F1/F2 已通过的存储逻辑。 + +## 交回前必跑 + +全量 `pytest tests` 与开工时 `origin/staging` 逐名比对(这两条正是全量才抓得到的)。