diff options
| author | Morgan Lunt <morganl@anthropic.com> | 2026-09-24 20:34:21 -0700 |
|---|---|---|
| committer | Morgan Lunt <morganl@anthropic.com> | 2026-09-24 20:34:21 -0700 |
| commit | 5b8ec4b30f45b5e8b4c8a6efd63719730cf1a5ad (patch) | |
| tree | 5b9369e8b74682eb3bb54d39618d2bffbb7c6d9f /plugins/code-modernization/scripts/render_rules.py | |
| parent | 4672eac1e36ff37394189376217bdc6f2b2e2e4a (diff) | |
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.
Diffstat (limited to 'plugins/code-modernization/scripts/render_rules.py')
| -rw-r--r-- | plugins/code-modernization/scripts/render_rules.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 |', '|---|---|---|---|---|---|'] |
