perf(skills): cut the tokens and start-up time every agent pays

Requirement 071, from the skeptic audit picks.

Output: radio.py show groups older rows per peer and class into one
line each (7 days 143,520 -> 3,229 bytes); rasci.py show is narrower
(7,081 -> 2,915 bytes) and archives tasks ended over 7 days ago into
rasci-archive.json, still listed by get, --all, artifacts and tools
and revived by any command that names them; make test runs quiet.

Hooks: hooks register as python3 -I -S (site import skipped), the
hook paths of watch, queue, radio, graph and log skip argparse, and
traceback, tempfile, configparser, tomllib, statistics and urllib load
lazily; councilroot.guard() serves watch and radio; the dream
reminder exits before Python when no row can be on. pre-bash 68 ms,
post-bash 50 ms.

Hub: names.json keeps only the entries every lookup needs (11.6 MB ->
11 KB, lookups identical) and phrasing is cached; a state build takes
55 instead of 104 ms.

Context: the commit-chain skills shrink from 3,330 to 1,192 words with
their names kept, details moved to chain.md and reference.md files read
on demand; descriptions capped at 25 words; .ignore and .rgignore keep
state and worktrees out of searches. overhead.py of
kvb-check-efficiency measures hook and script cost per call.

🎯 Fix: 93 %
💥 Break: 5 %
💸 Tokens: 107 %
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 83
🚦 Gate: ⚠️ tokens 107 % > 100 (on-demand reference files; resident text and daily cost fall): operator approved the commit

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-27 10:49:30 +00:00
1 parent 5c969be21c
commit 9403e17e97
53 files changed
+1219 -522

No files matched your search

+23
View File
@@ -504,5 +504,28 @@ class TestMeasure(GitRepo):
self.assertCleanedUp()
class TestOverhead(unittest.TestCase):
def run_overhead(self, skills: Path, *args: str) -> subprocess.CompletedProcess:
return subprocess.run([sys.executable, str(SCRIPTS / "overhead.py"), "--skills", str(skills), *args], capture_output=True, text=True, check=False, timeout=120)
def test_each_case_prints_one_line_with_its_timings_output_and_exit_code(self):
with tempfile.TemporaryDirectory() as folder:
script = Path(folder) / "kvb-org-radio" / "scripts" / "radio.py"
script.parent.mkdir(parents=True)
script.write_text("import sys\nsys.stdin.read()\nprint('row')\nsys.exit(4)\n", encoding="utf-8")
done = self.run_overhead(Path(folder), "--runs", "2", "--case", "python-empty", "--case", "radio-tool", "--flags=-I -S")
self.assertEqual(done.returncode, 0, done.stderr)
lines = done.stdout.splitlines()
self.assertEqual([line.split("\t")[0] for line in lines], ["python-empty", "radio-tool"])
for line in lines:
self.assertRegex(line, r"^[a-z-]+\t\d+ms\t\d+\t\d+\tcpu=\d+ms\t\d+B\trc=\d+$")
self.assertTrue(lines[1].endswith("\t4B\trc=4"))
def test_an_unknown_case_is_refused(self):
done = self.run_overhead(REPO_ROOT / "skills", "--runs", "1", "--case", "nope")
self.assertEqual(done.returncode, 2)
self.assertIn("unknown case nope", done.stderr)
if __name__ == "__main__":
unittest.main()