Fix cross-module fallout: stemmer, oracle, overlay cost, test fixtures

This commit is contained in:
swaits committed 2026-11-23 11:10:56 -07:00
1 parent ee6fc292d8
commit 2907e7df15
13 files changed
+218 -177

No files matched your search

+7 -8
View File
@@ -81,19 +81,18 @@ class StoreTests(SisiCase):
with open(os.path.join(self.data, name)) as f: # what the person taught sisi is personal data
return [json.loads(l) for l in f]
def test_note_propose_learn_append_with_context(self):
for cmd, fn in (("note", "notes.jsonl"), ("propose", "proposals.jsonl"), ("learn", "learn.jsonl")):
extra = ["--scope", "everywhere"] if cmd == "learn" else []
self.assertEqual(self.sisi(cmd, *(extra + ["first", "entry"]), env={"SISI_TOOL": "codex", "SISI_SESSION_ID": "s9"}).returncode, 0)
self.sisi(cmd, *(extra + ["second"]))
def test_note_propose_append_with_context_and_learn_records_a_statement(self):
for cmd, fn in (("note", "notes.jsonl"), ("propose", "proposals.jsonl")):
self.assertEqual(self.sisi(cmd, "first", "entry", env={"SISI_TOOL": "codex", "SISI_SESSION_ID": "s9"}).returncode, 0)
self.sisi(cmd, "second")
recs = self.read(fn)
self.assertEqual([r["text"] for r in recs], ["first entry", "second"])
self.assertEqual(recs[0]["cwd"], self.proj)
self.assertEqual((recs[0]["tool"], recs[0]["session"]), ("codex", "s9"))
self.assertIn("ts", recs[0])
# learn never reaches the other files
self.assertEqual(len(self.read("notes.jsonl")), 2)
self.assertEqual(len(self.read("proposals.jsonl")), 2)
r = self.sisi("learn", "--scope", "user", "always record the statement plainly")
self.assertEqual(r.returncode, 0, r.stderr)
self.assertIn("always record the statement plainly", self.sisi("oracle").stdout)
def test_empty_text_rejected(self):
self.assertEqual(self.sisi("note").returncode, 1)