From 5b8ec4b30f45b5e8b4c8a6efd63719730cf1a5ad Mon Sep 17 00:00:00 2001 From: Morgan Lunt Date: Thu, 24 Sep 2026 20:34:21 -0700 Subject: code-modernization: harden the numeric tolerance and say what Rehost and Replace mean Follow-ups from review of the tolerance check: an absolute tolerance above 1e-6 is refused like a relative one above 1%, numbers are compared as exact decimals rather than doubles, dotted runs such as 1.2.3 or 10.0.0.1 are text that must match exactly, and the self-check now changes the leading digit of every sampled number to prove the tolerance cannot hide a real change. The business-rules header says how many rules there were at extraction, since later steps add rules. The assessment says what to do when it recommends Rehost or Replace, which change no code and so have no build command. --- plugins/code-modernization/scripts/render_rules.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/code-modernization/scripts/render_rules.py') diff --git a/plugins/code-modernization/scripts/render_rules.py b/plugins/code-modernization/scripts/render_rules.py index b815a2d7..f098a5cf 100644 --- a/plugins/code-modernization/scripts/render_rules.py +++ b/plugins/code-modernization/scripts/render_rules.py @@ -112,7 +112,8 @@ def main(argv): stats = result.get('stats') or {} doc = [f'# Business Rules — {one_line(system, 80)}', '', - f"{len(rules)} confirmed rules ({sum(1 for r in rules if r.get('priority') == 'P0')} P0). " + f"At extraction: {len(rules)} confirmed rules ({sum(1 for r in rules if r.get('priority') == 'P0')} P0); " + f"later steps may add or correct rules below. " f"Each citation was checked by a second agent that read the cited lines; " f"{len(result.get('rejectedRules') or [])} candidate rules were refuted and left out.", '', '| ID | Name | Category | Priority | Source | Confidence |', '|---|---|---|---|---|---|'] -- cgit