把独立年度方法参考算进结果指纹,标准版不再白算这一章。
跑了修复单点名的测试、两次真算 PyJHora,以及 200 张英文扫描。 Co-Authored-By: Grok (agent loop)
This commit is contained in:
co-authored by
Grok (agent loop)
parent
683bd2fbc3
commit
c899e36509
@@ -85,6 +85,26 @@ def reset_reference_cache() -> None:
|
||||
_CACHE.clear()
|
||||
|
||||
|
||||
def mask_report_fingerprint_lines(markdown: str) -> str:
|
||||
"""Blank the report-id and result-fingerprint lines before a byte compare.
|
||||
|
||||
Including this chapter changes ``result_hash``, so those two identity lines
|
||||
move. Everything else, after the chapter itself is stripped, must not.
|
||||
"""
|
||||
output: list[str] = []
|
||||
for line in (markdown or "").splitlines(keepends=True):
|
||||
body = line.rstrip("\r\n")
|
||||
ending = line[len(body):]
|
||||
stripped = body.strip()
|
||||
if stripped.startswith("- 报告 ID: `") and stripped.endswith("`"):
|
||||
output.append(f"- 报告 ID: `FINGERPRINT`{ending}")
|
||||
elif stripped.startswith("- 计算结果摘要: `") and stripped.endswith("`"):
|
||||
output.append(f"- 计算结果摘要: `FINGERPRINT`{ending}")
|
||||
else:
|
||||
output.append(line)
|
||||
return "".join(output)
|
||||
|
||||
|
||||
def strip_annual_method_chapter(markdown: str) -> str:
|
||||
"""Drop this chapter so older full-text checks still see the previous report."""
|
||||
lines = (markdown or "").splitlines(keepends=True)
|
||||
|
||||
Reference in New Issue
Block a user