Merge duplicate problems via rules organize alias map
ci / test (push) Waiting to run

- List every canonical problem (number, name, one cause) in organize_brief and ask for optional `## same problems` lines `N = M`.
- Record validated aliases into `rules/problems.json` with the organize commit, skipping unknown numbers, cycles, and bad lines with messages while still recording the rest of the organize; include `rules/problems.json` in `rules.revert()`.
- Resolve cited numbers, names, misses, 2nd-miss faults, drop lookups, and per-rule recurrence notes through the alias map while preserving existing problem numbers; show merged names under their canonical problem in `sisi retro`.
- Add tests with 3 real duplicate pairs from the blind set (watched failing on main first), update `test_the_product_stays_small` (2481 -> 2530, +49), and add CLAUDE.md guards to all touched test classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-12-01 17:02:03 -07:00
1 parent 68b6226aa6
commit 25b5e90c6b
5 files changed
+270 -25

No files matched your search

+7 -2
View File
@@ -10,6 +10,7 @@ import tempfile
import unittest
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
REAL_HOME = os.path.expanduser("~")
GAP = ("--gap", "the export dropped rows with empty names until the person noticed",
"--cause", "no check compared the row counts before and after", "--term", "evidence", "--level", "project")
@@ -27,6 +28,9 @@ class OrganizeEvidence(unittest.TestCase):
def setUp(self):
before = tree()
self.addCleanup(lambda: self.assertEqual(tree(), before, "a test wrote into the product tree"))
book = os.path.join(REAL_HOME, ".claude", "CLAUDE.md")
mine = self.read(book) if os.path.exists(book) else None
self.addCleanup(lambda: self.assertEqual(self.read(book) if os.path.exists(book) else None, mine, "a test wrote the person's own rules file"))
self.tmp = tempfile.mkdtemp(prefix="sisi-orgev-")
self.addCleanup(shutil.rmtree, self.tmp, True)
self.data = os.path.join(self.tmp, "data")
@@ -115,8 +119,9 @@ class OrganizeEvidence(unittest.TestCase):
self.assertIn("copied as it is", brief)
shape = brief.split("Answer with exactly this shape")[1].split("===")[0]
self.assertLess(shape.index("## project"), shape.index("## drops"))
self.assertLess(shape.index("## drops"), shape.index("## flags"))
self.assertEqual(len(brief.split("=== The first list now")[0].splitlines()), 40)
self.assertLess(shape.index("## drops"), shape.index("## same problems"))
self.assertLess(shape.index("## same problems"), shape.index("## flags"))
self.assertEqual(len(brief.split("=== The first list now")[0].splitlines()), 42)
proj_line = self.read(self.proj, ".sisi", "rules.md").splitlines()[0]
ans = self.write(os.path.join(self.tmp, "ans.md"),
"## user\n## project\n- Kept project rule [retro 2026-11-26]\n"