Revert "Merge branch 'p3-problem-suggest'"
ci / test (push) Waiting to run

This reverts commit 2e3a114c8e, reversing
changes made to 0660ee13d6.
This commit is contained in:
swaits committed 2026-12-01 16:51:04 -07:00
1 parent 6edfa6d860
commit 68b6226aa6
3 files changed
+3 -66

No files matched your search

-35
View File
@@ -32,12 +32,6 @@ class Problems(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(os.path.expanduser("~"), ".claude", "CLAUDE.md")
def own():
with open(book, encoding="utf-8") as f:
return f.read()
mine = own() if os.path.exists(book) else None
self.addCleanup(lambda: self.assertEqual(own() if os.path.exists(book) else None, mine, "a test wrote the person's own rules file"))
self.tmp = tempfile.mkdtemp(prefix="sisi-prob-")
self.addCleanup(shutil.rmtree, self.tmp, True)
self.data = os.path.join(self.tmp, "data")
@@ -361,34 +355,5 @@ class Problems(unittest.TestCase):
self.assertTrue(any("bravo issue" in l for l in faults_lines), faults_lines)
def test_near_duplicate_new_name_suggests_but_still_records_and_real_pairs(self):
real = [("claimed tool behaviour or timing from memory in a question or fault brief",
"Unmeasured claims about tool behaviour", True),
("push not gated on the test run's exit code",
"a gating command's exit status was hidden by a display filter", True),
("a trial or test of sisi changed the real machine's sisi setup",
"setup for new machines validated only on the machine that already had everything", False)]
for old, new, alike in real: # the threshold on the three real pairs (0.75, 0.333 suggest; 0.286 does not)
self.assertEqual(retro._sim(old, new) >= retro.SIMILAR, alike, (old, new))
n = 0
for old, new, alike in real:
for name in (old, new):
n += 1
rc, out, _ = self.sisi("retro", *GAP, "--improve", "Suggestion test rule number %d here" % n, "--problem", name)
self.assertEqual(rc, 0, out) # never refused: every name records exactly as given
self.assertEqual(self.records()[-1]["problem"], name)
if name is new and alike:
self.assertIn("this looks like problem %d '%s'; if it is, record it with --problem %d next time"
% (n - 1, old, n - 1), out)
else:
self.assertNotIn("this looks like", out, name)
rc, out, _ = self.sisi("retro", *GAP, "--improve", "Suggestion test unrelated rule here",
"--problem", "export drops empty names")
self.assertEqual(rc, 0, out)
self.assertNotIn("this looks like", out)
self.assertEqual(self.records()[-1]["problem"], "export drops empty names")
self.assertIn("looks like #1", self.sisi("retro")[1]) # report listing names the top lookalike pair
if __name__ == "__main__":
unittest.main()