docs(tools): add general tool workflow contract

This commit is contained in:
Xubin Ren
2026-05-21 14:44:34 +08:00
parent 44ef697aac
commit 7e3af8c38b
2 changed files with 75 additions and 20 deletions
+23
View File
@@ -171,6 +171,29 @@ class TestIsTemplateContent:
assert ContextBuilder._is_template_content("totally different", "memory/MEMORY.md") is False
# ---------------------------------------------------------------------------
# Bundled bootstrap templates
# ---------------------------------------------------------------------------
class TestBundledToolsTemplate:
def test_tools_template_balances_general_and_coding_workflows(self):
from importlib.resources import files as pkg_files
tpl = pkg_files("nanobot") / "templates" / "TOOLS.md"
content = tpl.read_text(encoding="utf-8")
assert "## General Tool Contract" in content
assert "Use the narrowest structured tool" in content
assert "Do not use `exec` as a universal workaround" in content
assert "## File and Coding Workflows" in content
assert "apply_patch" in content
assert "## Web and External Information" in content
assert "## Messaging and Media" in content
assert "## Scheduling and Background Work" in content
assert "pure coding" not in content.lower()
# ---------------------------------------------------------------------------
# _build_user_content
# ---------------------------------------------------------------------------