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:
1 parent
5c969be21c
commit
9403e17e97
53 files changed
+1219
-522
No files matched your search
@@ -1,10 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
import re
|
||||
from datetime import UTC, datetime, timedelta, timezone
|
||||
|
||||
from .fields import LINE
|
||||
|
||||
PHRASED = 4096
|
||||
SPEECH_LIMIT = 1000
|
||||
SPOKEN_TEXT = 500
|
||||
SPOKEN_NAME = 60
|
||||
@@ -157,6 +159,11 @@ def phrase_parts(cls: str, sender: str, called: list[str], text: str) -> tuple[s
|
||||
class, and the rest of the row in maritime radio phraseology (SMCP
|
||||
style).
|
||||
"""
|
||||
return phrased(cls, sender, tuple(called), text)
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=PHRASED)
|
||||
def phrased(cls: str, sender: str, called: tuple[str, ...], text: str) -> tuple[str, str]:
|
||||
station = clip(sender, SPOKEN_NAME) or "unknown station"
|
||||
if cls == "mayday":
|
||||
head, end = f"this is {station} {station} {station}", "over"
|
||||
|
||||
Reference in new issue
Block a user