feat(install): install TokenEconomizer by default at a pinned, patched commit (021)
make install clones microsoft/TokenEconomizer at the commit in plugins-lock.json, applies patches/tokeneconomizer.patch (child CLI under PYTHONSAFEPATH, temp files opened with O_EXCL|O_NOFOLLOW; upstream issue microsoft/TokenEconomizer#260), installs the plugin for Claude Code and, with codex on the PATH, for Codex, and sets toolprune=propose with a protect list and microskills=envfacts globally. A dirty clone stays untouched and fails the install; a host without git or python3 skips the step. Requirement 021, README and six install tests; the council-root install test stubs the step. 🎯 Fix: 91 % 💥 Break: 4 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 87 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e522e94b16
commit
41cdf0c40b
10 files changed
+429
-2
No files matched your search
+11
-1
@@ -24,7 +24,10 @@ SHIPPED = ORGANIZE / "config.default.json"
|
||||
DEFAULT = json.loads(SHIPPED.read_text(encoding="utf-8"))
|
||||
ROW_MEMORY = DEFAULT["memory_limits"]
|
||||
HOME_TOOLS = ("bash", "cp", "dirname", "find", "install", "ln", "mkdir", "python3", "rm")
|
||||
COUNCIL_PARTS = ("scripts/orchestrator.sh", "skills/kvb-org-organize/scripts/councilroot.py", "skills/kvb-org-organize/scripts/nofollow.py")
|
||||
COUNCIL_PARTS = (
|
||||
"scripts/orchestrator.sh", "scripts/tokeneconomizer.sh", "plugins-lock.json",
|
||||
"skills/kvb-org-organize/scripts/councilroot.py", "skills/kvb-org-organize/scripts/nofollow.py",
|
||||
)
|
||||
AGENT_ROOTS = {"sandbox": {"filesystem": {"allowWrite": ["~/.local/state/agents-shared", "~/.local/state/agents-release/**"]}}}
|
||||
CGROUP_KILL = """
|
||||
case "$*" in *try-restart*kvb-code-graph*)
|
||||
@@ -209,6 +212,13 @@ class TestInstall(unittest.TestCase):
|
||||
self.assertFalse([call for call in calls if "kvb-code-graph" in call])
|
||||
self.assertIn("graphs keep their watch only while a session runs", done.stderr)
|
||||
|
||||
def test_the_home_install_runs_the_tokeneconomizer_step_and_a_host_without_git_skips_it(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
done, _, _ = self.home_install(Path(tmp), binary=True)
|
||||
self.assertEqual(done.returncode, 0, done.stderr)
|
||||
self.assertIn("skills: git or python3 not found; skipped TokenEconomizer.", done.stderr)
|
||||
self.assertFalse((Path(tmp) / "home" / "Repositories").exists())
|
||||
|
||||
def test_reinstall_empties_the_skill_directories_in_place(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root = Path(tmp)
|
||||
|
||||
Reference in new issue
Block a user