fix(research): reuse existing handler instead of new __new__ forgeries
Independent Staging Quality Gate / validate (push) Successful in 11m55s
Independent Staging Quality Gate / publish (push) Successful in 3m28s

Gate run 2958 failed tests/test_api_server_growth_contract.py: the
evidence-card research script added two JyotishAPIHandler forgery sites.
Reuse capture_report_blocked_repairs_golden._handler(); output unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
Jesse_Chen
2026-09-27 01:40:47 +08:00
co-authored by Claude Opus 5.5
parent 45ed054f09
commit 560d4fc2dd
2 changed files with 10 additions and 5 deletions
@@ -36,3 +36,7 @@
- 复跑:Linux 临时工作树、`PYTHONHASHSEED=0` 重跑 `consult_evidence_card_run.py --skip-timing`,30 次里卡体量与逐字核对结果 30/30 与提交的库存 JSON 完全一致;10 次 Obama 问法的模型可见字符比提交值多 12 个(约 0.01%,推测为 Windows/Linux 环境差异),不影响任何结论。
- BUG-1054 我核对了代码:`consultation-workflow.ts` `timingKeys` 没有 `md`/`ad`/`pd` 与 `pratyantardashatimeline`,`projectAllowlistedTree` 按键白名单丢弃,结论成立。
- 结论:调研验收通过;7 项拍板清单交产品。门禁 run 2958(`d8d03b5a`)部署结果另行核对。
### 门禁补修(Claude,2026-09-27)
门禁 run 2958(`d8d03b5a`)红在 `tests/test_api_server_growth_contract.py` 两条:调研脚本 `consult_evidence_card_run.py` 新增了两处 handler 伪造点(全仓 33 > 上限 31;scripts/ 4 > 上限 2)。改为复用 `capture_report_blocked_repairs_golden._handler()`,伪造点回到 31 / 2。复核:growth contract + 调研测试通过;Python 门禁集 948 passed / 1 skipped;`steve_jobs × 父母` 重跑的投影、分类、卡体量、逐字核对、样例卡与提交的库存 JSON 逐项相同。验收时我只跑了调研相关的 3 个测试文件、没跑全量 Python 门禁集,是漏检;以后含 `scripts/**` 的调研提交一律跑全量门禁集再放行。
@@ -83,10 +83,11 @@ def _workflow_body(chart: dict[str, Any], question: dict[str, str]) -> dict[str,
def _run_workflow(body: dict[str, Any]) -> dict[str, Any]:
from jyotish_api_server import JyotishAPIHandler
# Reuse the existing golden-capture handler instead of adding another
# handler-forgery site (tests/test_api_server_growth_contract.py).
from capture_report_blocked_repairs_golden import _handler
handler = JyotishAPIHandler.__new__(JyotishAPIHandler)
return handler._compute_consultation_workflow(body)
return _handler()._compute_consultation_workflow(body)
def _project(jobs: list[dict[str, str]], summary_path: Path) -> list[dict[str, Any]]:
@@ -111,15 +112,15 @@ def _project(jobs: list[dict[str, str]], summary_path: Path) -> list[dict[str, A
def _time_layers(chart_body: dict[str, Any]) -> dict[str, float]:
"""Time local layers on one birth payload. VedAstro stays blocked."""
from capture_report_blocked_repairs_golden import _handler
from jyotish_api_server import (
JyotishAPIHandler,
_attach_local_consultation_layers,
_build_consultation_varga_spectrum,
_custom_research_dn_chart,
_planet_longitudes,
)
handler = JyotishAPIHandler.__new__(JyotishAPIHandler)
handler = _handler()
timings: dict[str, float] = {}
def elapsed(name: str, fn, *args, **kwargs):