diff options
| author | Morgan Lunt <morganl@anthropic.com> | 2026-09-24 20:15:45 -0700 |
|---|---|---|
| committer | Morgan Lunt <morganl@anthropic.com> | 2026-09-24 20:15:45 -0700 |
| commit | 696904602b2bdf3e0ddd07ae1221f9eb3e3b8e62 (patch) | |
| tree | 9888e8e8a4465f5886dcfa1087702d691178acb1 /plugins/code-modernization/scripts/tests | |
| parent | cafefb304bde4070c6c0877528ee49c1252eff85 (diff) | |
code-modernization: rate rules by what the system is for, and make live runs finish
Two problems from running the commands on real repositories:
- The P0 definition was money- and regulation-shaped, so a music-library
tool got no P0 rules and its behavior contract came out empty. P0 now
means the system's core purpose depends on the rule, or a wrong result is
costly or irreversible (money, legal, data integrity, security or safety,
or the central calculation or decision the system exists to perform).
- Citations came back as lists of ranges, and the rule renderer numbered
RULE-NNN in a different order from the document. Each rule now cites one
range and the numbers read in sequence.
Commands that start subagents now say to run them in the foreground and
wait, because a headless session ends when the model stops talking even if
it said it was waiting for a background agent.
Diffstat (limited to 'plugins/code-modernization/scripts/tests')
| -rw-r--r-- | plugins/code-modernization/scripts/tests/test_rules_tools.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/code-modernization/scripts/tests/test_rules_tools.py b/plugins/code-modernization/scripts/tests/test_rules_tools.py index f0bbc391..632b2250 100644 --- a/plugins/code-modernization/scripts/tests/test_rules_tools.py +++ b/plugins/code-modernization/scripts/tests/test_rules_tools.py @@ -1,5 +1,6 @@ import json import os +import re import subprocess import sys import tempfile @@ -149,6 +150,8 @@ class RenderTests(unittest.TestCase): headings = [line for line in text.splitlines() if line.startswith('### ')] self.assertEqual(len(headings), 2, headings) self.assertNotIn('\n# injected heading', text) + ids = [int(n) for n in re.findall(r'^### RULE-(\d+): ', text, re.M)] + self.assertEqual(ids, list(range(1, len(ids) + 1)), 'rule numbers read in sequence down the document') self.assertIn('Rules requiring SME confirmation', text) self.assertIn('Is it 5 or 6?', text) self.assertIn('Coverage gaps', text) |
