feat: enhance agent and board APIs with role-based tags and improved documentation
This commit is contained in:
23
backend/tests/test_template_size_budget.py
Normal file
23
backend/tests/test_template_size_budget.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# ruff: noqa: S101
|
||||
"""Template size guardrails for injected heartbeat context."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
HEARTBEAT_CONTEXT_LIMIT = 20_000
|
||||
TEMPLATES_DIR = Path(__file__).resolve().parents[1] / "templates"
|
||||
|
||||
|
||||
def test_heartbeat_templates_fit_in_injected_context_limit() -> None:
|
||||
"""Heartbeat templates must stay under gateway injected-context truncation limit."""
|
||||
targets = (
|
||||
"HEARTBEAT_LEAD.md",
|
||||
"HEARTBEAT_AGENT.md",
|
||||
"MAIN_HEARTBEAT.md",
|
||||
)
|
||||
for name in targets:
|
||||
size = (TEMPLATES_DIR / name).stat().st_size
|
||||
assert size <= HEARTBEAT_CONTEXT_LIMIT, (
|
||||
f"{name} is {size} chars (limit {HEARTBEAT_CONTEXT_LIMIT})"
|
||||
)
|
||||
Reference in New Issue
Block a user