feat(срез 2.2): инструмент verify_estimate_file (проверь смету) + агентный путь; bump 2026-07-17e
smeta_mcp.tool_verify_estimate_file: parse .gge → estimate_verify + verify_gge_summary (ФОТ=ЗПраб+ЗПмаш, точное тождество Summary). Калибровка показала: реконструкция итога из позиций .gge невозможна (материалы отдельно) — честно проверяем коды+самосогласов.+дубли. claude_bridge: +verify_estimate_file и +find_expertise_remarks в allowedTools, mount estimate_verify.py+code_validator.py в Docker. Фикстура broken_totals.gge, 3 passed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -142,6 +142,24 @@ def verify(est: dict, tol: float = _TOL) -> dict:
|
||||
return {"ok": not errors, "errors": errors, "warnings": warnings, "checked": checked}
|
||||
|
||||
|
||||
def verify_gge_summary(totals: dict, tol: float = _TOL) -> dict:
|
||||
"""Самосогласованность Summary из gge_tools.parse_gge_file — ТОЧНЫЕ тождества,
|
||||
реально держащиеся на сданных .gge (калибровано: держится до копейки):
|
||||
ФОТ (Salary) == ЗП рабочих (WorkersSalary) + ЗП машинистов (MachinistSalary).
|
||||
Реконструкция полного итога из позиций .gge НЕ делается (материалы/лимитированные
|
||||
живут отдельно — Σпозиций≠Total); полная арифметика — на этапе составления движком."""
|
||||
errors: list[dict] = []
|
||||
checked = 0
|
||||
ktol = round(tol * 100)
|
||||
s, ws, ms = totals.get("Salary"), totals.get("WorkersSalary"), totals.get("MachinistSalary")
|
||||
if None not in (s, ws, ms):
|
||||
checked += 1
|
||||
if abs(_k(s) - _k(ws + ms)) > ktol:
|
||||
errors.append({"rule": "ФОТ ≠ ЗП рабочих + ЗП машинистов",
|
||||
"expected": _rr(ws + ms), "actual": _rr(s)})
|
||||
return {"errors": errors, "checked": checked}
|
||||
|
||||
|
||||
def from_gge_parsed(parsed: dict) -> dict:
|
||||
"""Маппинг выхода gge_tools.parse_gge_file → нормализованная схема verify.
|
||||
ВНИМАНИЕ: parse_gge_file часто НЕ даёт стоимость позиции (деньги в Totals/Current,
|
||||
|
||||
Reference in New Issue
Block a user