autotune, autoskill and confidence each carried their own idea of what an improvement is, and autotune's two efficiency rules were the same sentence twice. They now route to one skill that names three axes to move at once — fewer tokens, less time, higher quality — and the rules that decide when a proposal counts: at least one axis better, none damaged, quality never the currency, observed friction instead of a guessed percentage. Applying its own rule, autotune gets shorter rather than longer. The test holds the coupling, so a later rewrite cannot silently drop a route. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
28 lines
884 B
Python
28 lines
884 B
Python
"""The self-improving skills must share the optimize objective."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
REPO_ROOT = Path(__file__).resolve().parents[1]
|
|
SKILLS = REPO_ROOT / "skills"
|
|
ROUTERS = ("autotune", "autoskill", "confidence")
|
|
|
|
|
|
class TestOptimizeObjective(unittest.TestCase):
|
|
def test_skill_names_the_three_axes(self):
|
|
text = (SKILLS / "optimize" / "SKILL.md").read_text(encoding="utf-8")
|
|
self.assertIn("name: optimize", text)
|
|
for axis in ("**Tokens**", "**Time**", "**Quality**"):
|
|
self.assertIn(axis, text)
|
|
|
|
def test_routers_point_at_it(self):
|
|
for skill in ROUTERS:
|
|
text = (SKILLS / skill / "SKILL.md").read_text(encoding="utf-8")
|
|
self.assertIn("`optimize` skill", text, f"{skill} does not route to optimize")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|