Classification by recorded facts only: no name parser or tier words, no guessed classes; sisi workers classify prints the question for a cheap worker and --record validates and stores its answer; identity (maker, class) and release date drive supersession, inheritance, tie-break; route and session start ask only when it matters. done / next: proof on a copy, repeat runs, report

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Sonnet 5.5 committed 2026-11-23 16:45:08 -07:00
1 parent d6bdb799c5
commit d36550d00f
15 files changed
+619 -677

No files matched your search

+18 -15
View File
@@ -4,7 +4,7 @@ predecessor's bad record does not block it. Invented ids. Requirement ids: R-7.2
import random, unittest
from support import *
from sisi import routing
from test_model_supersession import cand, attempts, pick, NOW
from test_model_supersession import cand, attempts, pick, NOW, R1, R2, R3, R4
def assessed(cands, records, worker, difficulty=2, kind="impl", **kw):
@@ -12,9 +12,12 @@ def assessed(cands, records, worker, difficulty=2, kind="impl", **kw):
return r["assessments"].get(worker), r
m_ = {'5.1': '2026-01-01', '5.2': '2026-03-01', '5.3': '2026-06-01', '5.4': '2026-09-01', '5.10': '2026-10-01'}
class InheritanceTests(unittest.TestCase):
def test_a_new_version_inherits_the_record_of_its_predecessor_and_says_so(self):
old, new = cand("prov/abc-5.3", cost=1.0), cand("prov/abc-5.4", cost=2.0)
old, new = cand("prov/abc-5.3", rel="2026-06-01", cost=1.0), cand("prov/abc-5.4", rel="2026-09-01", cost=2.0)
records = attempts("prov/abc-5.3", 12, 11, difficulty=2)
a, r = assessed([old, new], records, "prov/abc-5.4")
self.assertEqual((a["tier"], a["capable"], a["inherited_from"]), ("a", True, "prov/abc-5.3"))
@@ -24,7 +27,7 @@ class InheritanceTests(unittest.TestCase):
self.assertIn("11 of 12", line)
def test_it_walks_back_one_predecessor_at_a_time(self):
cands = [cand("prov/abc-5.2", cost=1.0), cand("prov/abc-5.3", cost=1.0), cand("prov/abc-5.4", cost=1.0)]
cands = [cand("prov/abc-5.2", rel="2026-03-01", cost=1.0), cand("prov/abc-5.3", rel="2026-06-01", cost=1.0), cand("prov/abc-5.4", rel="2026-09-01", cost=1.0)]
records = attempts("prov/abc-5.2", 12, 12, difficulty=2) + attempts("prov/abc-5.3", 3, 3, difficulty=2)
a, _ = assessed(cands, records, "prov/abc-5.4")
self.assertEqual(a["inherited_from"], "prov/abc-5.2") # 5.3 has only a thin record
@@ -33,17 +36,17 @@ class InheritanceTests(unittest.TestCase):
self.assertEqual(a["inherited_from"], "prov/abc-5.3") # now the closest thick one
def test_a_predecessors_bad_record_does_not_block_the_newer_model(self):
cands = [cand("prov/abc-5.3", cost=1.0), cand("prov/abc-5.4", cost=1.0, standing=70.0)]
cands = [cand("prov/abc-5.3", rel="2026-06-01", cost=1.0), cand("prov/abc-5.4", rel="2026-09-01", cost=1.0, standing=70.0)]
records = attempts("prov/abc-5.3", 12, 2, difficulty=2)
a, _ = assessed(cands, records, "prov/abc-5.4")
self.assertFalse(a["bad"])
self.assertEqual(a["tier"], "standing") # it starts from its benchmark, not from the old verdict
bare = assessed([cands[0], cand("prov/abc-5.4", cost=1.0)], records, "prov/abc-5.4")[0]
bare = assessed([cands[0], cand("prov/abc-5.4", rel="2026-09-01", cost=1.0)], records, "prov/abc-5.4")[0]
self.assertFalse(bare["bad"])
self.assertFalse(bare["capable"])
def test_the_models_own_thick_record_replaces_the_inherited_one(self):
cands = [cand("prov/abc-5.3", cost=1.0), cand("prov/abc-5.4", cost=1.0)]
cands = [cand("prov/abc-5.3", rel="2026-06-01", cost=1.0), cand("prov/abc-5.4", rel="2026-09-01", cost=1.0)]
records = attempts("prov/abc-5.3", 12, 12, difficulty=2) + attempts("prov/abc-5.4", 9, 1, difficulty=2)
a, _ = assessed(cands, records, "prov/abc-5.4")
self.assertTrue(a["bad"])
@@ -53,30 +56,30 @@ class InheritanceTests(unittest.TestCase):
self.assertEqual((a["tier"], a.get("inherited_from")), ("a", None))
def test_a_thin_record_that_already_contradicts_is_not_papered_over(self):
cands = [cand("prov/abc-5.3", cost=1.0), cand("prov/abc-5.4", cost=1.0)]
cands = [cand("prov/abc-5.3", rel="2026-06-01", cost=1.0), cand("prov/abc-5.4", rel="2026-09-01", cost=1.0)]
records = attempts("prov/abc-5.3", 12, 12, difficulty=2) + attempts("prov/abc-5.4", 3, 0, difficulty=2)
a, _ = assessed(cands, records, "prov/abc-5.4")
self.assertIsNone(a.get("inherited_from"))
self.assertFalse(a["capable"])
def test_nothing_is_inherited_across_classes_or_makers(self):
flash, new = cand("prov/abc-5.3-flash", cost=1.0), cand("prov/abc-5.4", cost=1.0)
flash, new = cand("prov/abc-5.3-flash", cls="flash", rel="2026-06-01", cost=1.0), cand("prov/abc-5.4", rel="2026-09-01", cost=1.0)
records = attempts("prov/abc-5.3-flash", 12, 12, difficulty=2)
self.assertFalse(assessed([flash, new], records, "prov/abc-5.4")[0]["capable"])
other = cand("prov/xyz-5.4", cost=1.0, maker="xyz")
self.assertFalse(assessed([cand("prov/abc-5.3"), other], attempts("prov/abc-5.3", 12, 12, difficulty=2), "prov/xyz-5.4")[0]["capable"])
other = cand("prov/xyz-5.4", rel="2026-09-01", cost=1.0, maker="xyz")
self.assertFalse(assessed([cand("prov/abc-5.3", rel="2026-06-01"), other], attempts("prov/abc-5.3", 12, 12, difficulty=2), "prov/xyz-5.4")[0]["capable"])
def test_nothing_is_inherited_by_an_unreadable_class(self):
cands = [cand("prov/abc-6.2-sol"), cand("prov/abc-6.3-sol")]
cands = [cand("prov/abc-6.2-sol", known=False), cand("prov/abc-6.3-sol", known=False)]
records = attempts("prov/abc-6.2-sol", 12, 12, difficulty=2)
self.assertFalse(assessed(cands, records, "prov/abc-6.3-sol")[0]["capable"])
def test_inherited_evidence_counts_as_a_judged_record_before_a_benchmark(self):
"""Difficulty 2 and 3: proof comes before benchmark, and an inherited record is proof."""
new = cand("prov/abc-5.4", cost=5.0)
new = cand("prov/abc-5.4", rel="2026-09-01", cost=5.0)
rival = cand("prov/xyz-2.0", cost=0.1, maker="xyz", standing=90.0)
records = attempts("prov/abc-5.3", 12, 12, difficulty=3)
who, r = pick([cand("prov/abc-5.3", cost=5.0), new, rival], records, 3)
who, r = pick([cand("prov/abc-5.3", rel="2026-06-01", cost=5.0), new, rival], records, 3)
self.assertEqual(who, "prov/abc-5.4")
self.assertTrue(r["judged_first"])
@@ -90,7 +93,7 @@ class InheritanceTests(unittest.TestCase):
def test_a_model_with_no_data_of_its_own_is_routable_through_its_predecessor(self):
from sisi import workers
old, new, lone = cand("prov/abc-5.3"), cand("prov/abc-5.4"), cand("prov/xyz-9.9", maker="xyz")
old, new, lone = cand("prov/abc-5.3", rel="2026-06-01"), cand("prov/abc-5.4", rel="2026-09-01"), cand("prov/xyz-9.9", rel="2026-09-01", maker="xyz")
for c in (old, new, lone):
c["price_source"] = None
old["price_source"] = "fixture"
@@ -103,7 +106,7 @@ class InheritanceTests(unittest.TestCase):
seen = 0
for _ in range(300 * ITERS):
versions = rng.sample(["5.1", "5.2", "5.3", "5.4", "5.10"], rng.randint(2, 4))
cands = [cand("prov/abc-%s" % v, cost=rng.choice([None, 1.0, 2.0])) for v in versions]
cands = [cand("prov/abc-%s" % v, rel=m_[v], cost=rng.choice([None, 1.0, 2.0])) for v in versions]
records = []
for c in cands:
for d in (1, 2, 3):