Models table: one most-efficient row per provider per class, spread load by plan windows

Research brief asks for provider and efficiency columns (published allowance with URL and
5h/week/month request windows), at most one row per provider per class, most efficient first,
and is marked as a sisi chore; ASK sends it to a hard-class worker with web search.
research_record refuses missing provider/efficiency and duplicate provider+class rows.
The wheel weights each worker by its plan's share left (sisi's own delegations against the
table's request windows, floored at 0.05); sisi models prints estimated plan use.
research_days 7 -> 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-12-02 08:47:02 -07:00
1 parent 25b5e90c6b
commit 2175b566a8
4 files changed
+295 -32

No files matched your search

+25 -13
View File
@@ -34,6 +34,18 @@ TWO = ONE + "| beta | host subagent model `beta` | routine | free | quick | |\n"
LIMIT = "You have hit your usage limit for this model"
def rec(text):
"""A table as `sisi models research --record` takes it: each row with a provider of its own and an efficiency cell."""
out, i = [], 0
for line in text.splitlines(True):
body = line.rstrip("\n")
if line.startswith("| worker"): body += " provider | efficiency |"
elif line.startswith("|---"): body += "---|---|"
elif line.startswith("|"): i, body = i + 1, body + " plan %d | 5h: 100 req |" % (i + 1)
out.append(body + ("\n" if line.endswith("\n") else ""))
return "".join(out)
def tree():
"""A fingerprint of the product tree, so a test that writes into it is caught."""
out = hashlib.sha1()
@@ -1616,9 +1628,9 @@ cli.main(["tick"])
self.assertIn("Only the cheapest models on the shared plan", brief) # the person's words bind the researcher
answer = os.path.join(self.tmp, "table.md")
self.assertEqual(self.sisi("models", "research", "--record", self.write(answer, "a few words of prose"))[0], 1)
self.write(answer, "| worker | how to call it | use for | cost | good at, bad at | notes |\n|---|---|---|---|---|---|\n"
"| small | host subagent `small` | routine | flat | fast; weak at design | |\n"
"Fallback order: routine: small, then the lead.\n")
self.write(answer, rec("| worker | how to call it | use for | cost | good at, bad at | notes |\n|---|---|---|---|---|---|\n"
"| small | host subagent `small` | routine | flat | fast; weak at design | |\n"
"Fallback order: routine: small, then the lead.\n"))
self.assertEqual(self.sisi("models", "research", "--record", answer)[0], 0)
self.assertIn("| small |", self.sisi("models")[1])
self.assertNotIn("models table", self.hook("tick", sid="s2")[1])
@@ -1653,7 +1665,7 @@ cli.main(["tick"])
def test_research_record_writes_models_shared_and_rejects_bad_shared(self):
answer = os.path.join(self.tmp, "answer.md")
personal = ("| worker | maker | how to call it | use for | cost | good at, bad at | notes |\n|---|---|---|---|---|---|---|\n"
personal = rec("| worker | maker | how to call it | use for | cost | good at, bad at | notes |\n|---|---|---|---|---|---|---|\n"
"| small | x | host subagent `small` | routine | flat | fast | |\nFallback order: routine: small.\n")
shared = ("researched 2026-11-25\n\n| model | maker | class | score | released | list price | benchmarks | good at, bad at |\n|---|---|---|---|---|---|---|---|\n"
"| small | x | routine | 40.0 | | free | TB4 40% | fast |\n")
@@ -1749,8 +1761,8 @@ cli.main(["tick"])
def test_a_model_is_in_exactly_one_class_and_the_wheel_never_mixes_classes(self):
answer = os.path.join(self.tmp, "table.md")
mixed = HEADER + ("| opus | host subagent model `opus` | hard | per use | hardest | |\n"
"| sonnet | host subagent model `sonnet` | ordinary, hard | per use | everything | |\n")
mixed = rec(HEADER + ("| opus | host subagent model `opus` | hard | per use | hardest | |\n"
"| sonnet | host subagent model `sonnet` | ordinary, hard | per use | everything | |\n"))
self.write(answer, mixed + "Fallback order: none.\n")
rc, out, _ = self.sisi("models", "research", "--record", answer) # check a
self.assertEqual((rc, "| sonnet | host subagent model `sonnet` | ordinary, hard |" in out), (1, True))
@@ -2176,7 +2188,7 @@ cli.main(["tick"])
self.assertIn("gemini-3.8-flash-medium", tick)
self.assertIn("sisi models research --record FILE", tick)
# recording a new table clears the marker
ans = self.write(os.path.join(self.tmp, "ans.md"), WORKERS + "Fallback order: sonnet\n")
ans = self.write(os.path.join(self.tmp, "ans.md"), rec(WORKERS) + "Fallback order: sonnet\n")
self.assertEqual(self.sisi("models", "research", "--record", ans)[0], 0)
self.assertNotIn("gemini-3.8-flash-medium", self.hook("tick", sid="s6")[1])
@@ -2788,7 +2800,7 @@ cli.main(["tick"])
def test_a_table_with_no_usable_row_is_refused_and_enforces_nothing(self):
answer = os.path.join(self.tmp, "table.md")
self.write(answer, HEADER + "| small | host subagent `small` | quick jobs | flat | fast | |\nFallback order: none.\n")
self.write(answer, rec(HEADER + "| small | host subagent `small` | quick jobs | flat | fast | |\nFallback order: none.\n"))
rc, out, _ = self.sisi("models", "research", "--record", answer)
self.assertEqual((rc, "routine, ordinary or hard" in out), (1, True))
self.table(HEADER + "| small | host subagent `small` | quick jobs | flat | fast | |\n")
@@ -2962,11 +2974,11 @@ cli.main(["tick"])
self.assertNotIn("out until", brief)
self.assertIn("sisi judge WORKER out", brief)
answer = os.path.join(self.tmp, "table.md")
clean = HEADER + "| small | host subagent `small` | routine | flat | fast | |\nFallback order: none.\n"
clean = rec(HEADER + "| small | host subagent `small` | routine | flat | fast | |\nFallback order: none.\n")
self.write(answer, clean)
self.assertEqual(self.sisi("models", "research", "--record", answer)[0], 0)
for notes in ("out till 2999-01-01", "out until next week", "Out Until 2999-1-1", "out until 2999-01-01"):
self.write(answer, HEADER + "| small | host subagent `small` | routine | flat | fast | %s |\nFallback order: none.\n" % notes)
self.write(answer, rec(HEADER + "| small | host subagent `small` | routine | flat | fast | %s |\nFallback order: none.\n" % notes))
rc, out, _ = self.sisi("models", "research", "--record", answer)
self.assertEqual((rc, "| small |" in out, "delete the" in out, "judge the worker instead" in out), (1, True, True, False), notes) # a table writer is told to delete it, not to invent a verdict
self.assertEqual(self.read(self.data, "models.md").strip(), clean.strip())
@@ -3034,14 +3046,14 @@ cli.main(["tick"])
new = ("| worker | maker | how to call it | use for | cost | good at, bad at | notes |\n|---|---|---|---|---|---|---|\n"
"| sonnet | anthropic | host subagent `sonnet` | hard | paid | x | |\n| glm-5.4 | zhipu | opencode glm-5.4 | hard | flat | x | |\n"
"| haiku | anthropic | host subagent `haiku` | hard | paid | x | |\n")
self.assertEqual(models.rows(new)[0], ["sonnet", "host subagent `sonnet`", "hard", "paid", "x", "", "anthropic"])
self.assertEqual(models.rows(new)[0], ["sonnet", "host subagent `sonnet`", "hard", "paid", "x", "", "anthropic", "", ""])
for _ in range(50):
self.assertEqual(models.choose(new, "hard", review="sonnet", rand=random.random)[0], "glm-5.4")
answer = os.path.join(self.tmp, "table.md")
for text in (new, WORKERS):
self.assertEqual(self.sisi("models", "research", "--record", self.write(answer, text + "Fallback order: none.\n"))[0], 0)
self.assertEqual(self.sisi("models", "research", "--record", self.write(answer, rec(text) + "Fallback order: none.\n"))[0], 0)
brief = self.sisi("models", "research")[1]
self.assertIn("| worker | maker | how to call it |", brief)
self.assertIn("| worker | provider | maker | how to call it |", brief)
self.assertIn("enabled providers", brief)
def test_a_failed_check_alone_forces_the_retro_and_says_so(self):