mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
Ponytail build-laziness doctrine (bundled with Fable, 0.19.0) (#313)
* feat(agents): vendor trimmed ponytail doctrine (full + ethos) * feat(agents): compose ponytail doctrine layer, bundled with fable * docs: document ponytail doctrine bundled with fable-mode * style: add trailing newline to ponytail doctrine files test * docs: changelog + map/rag for ponytail doctrine (0.19.0) user-facing docs skipped: Fable precedent absent from README/deployment/usage; ponytail is default-off internal. --------- Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""The two ponytail doctrine files load with the right content split."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from roboco.agents.factories._base import _get_prompts_base_path, _load_layer
|
||||
|
||||
_PROMPTS = _get_prompts_base_path()
|
||||
|
||||
|
||||
def test_full_doctrine_has_ladder_and_no_frontmatter() -> None:
|
||||
text = _load_layer(_PROMPTS / "doctrine" / "ponytail.md")
|
||||
assert text, "ponytail.md is missing or empty"
|
||||
assert "# Ponytail Doctrine" in text
|
||||
assert "## The ladder" in text
|
||||
assert "## RoboCo preamble" in text
|
||||
assert "## Intensity" in text # dev doctrine carries the intensity table
|
||||
assert "Forces the laziest solution" not in text # YAML frontmatter stripped
|
||||
|
||||
|
||||
def test_ethos_doctrine_lacks_ladder_and_no_frontmatter() -> None:
|
||||
text = _load_layer(_PROMPTS / "doctrine" / "ponytail-ethos.md")
|
||||
assert text, "ponytail-ethos.md is missing or empty"
|
||||
assert "# Ponytail Doctrine (ethos)" in text
|
||||
assert "## The ladder" not in text
|
||||
assert "## Intensity" not in text # ethos gets no dial — restrained stance
|
||||
assert "## RoboCo preamble" in text
|
||||
assert "Forces the laziest solution" not in text
|
||||
@@ -0,0 +1,69 @@
|
||||
"""Role-scoped Ponytail doctrine composed when fable_mode_enabled is on.
|
||||
|
||||
Ponytail is bundled with Fable (no separate flag). Developers get the full
|
||||
ladder; every other role gets the ethos-only cut (no ladder). Absent
|
||||
entirely when the flag is off.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
from roboco.agents.factories._base import compose_prompt
|
||||
from roboco.config import settings
|
||||
from roboco.models import AgentRole, Team
|
||||
|
||||
|
||||
def test_doctrine_absent_when_flag_disabled() -> None:
|
||||
with patch("roboco.config.settings.fable_mode_enabled", False):
|
||||
prompt = compose_prompt(AgentRole.DEVELOPER, Team.BACKEND, "be-dev-1")
|
||||
assert "# Ponytail Doctrine" not in prompt
|
||||
|
||||
|
||||
def test_full_ladder_for_developer() -> None:
|
||||
with patch("roboco.config.settings.fable_mode_enabled", True):
|
||||
prompt = compose_prompt(AgentRole.DEVELOPER, Team.BACKEND, "be-dev-1")
|
||||
assert "# Ponytail Doctrine" in prompt
|
||||
assert "## The ladder" in prompt
|
||||
|
||||
|
||||
def test_ethos_only_for_non_developer() -> None:
|
||||
with patch("roboco.config.settings.fable_mode_enabled", True):
|
||||
prompt = compose_prompt(AgentRole.QA, Team.BACKEND, "be-qa-1")
|
||||
assert "# Ponytail Doctrine (ethos)" in prompt
|
||||
assert "## The ladder" not in prompt
|
||||
|
||||
|
||||
def test_every_role_gets_some_doctrine() -> None:
|
||||
with patch("roboco.config.settings.fable_mode_enabled", True):
|
||||
for role in AgentRole:
|
||||
prompt = compose_prompt(role, None, f"probe-{role.value}")
|
||||
assert "Ponytail" in prompt, f"missing for role={role.value}"
|
||||
|
||||
|
||||
def test_frontmatter_not_leaked() -> None:
|
||||
with patch("roboco.config.settings.fable_mode_enabled", True):
|
||||
prompt = compose_prompt(AgentRole.DEVELOPER, Team.BACKEND, "be-dev-1")
|
||||
assert "Forces the laziest solution" not in prompt
|
||||
|
||||
|
||||
def test_intensity_injected_for_developer() -> None:
|
||||
with (
|
||||
patch("roboco.config.settings.fable_mode_enabled", True),
|
||||
patch("roboco.config.settings.ponytail_intensity", "ultra"),
|
||||
):
|
||||
prompt = compose_prompt(AgentRole.DEVELOPER, Team.BACKEND, "be-dev-1")
|
||||
assert "Operative intensity: ultra" in prompt
|
||||
|
||||
|
||||
def test_intensity_not_applied_to_non_developer() -> None:
|
||||
with (
|
||||
patch("roboco.config.settings.fable_mode_enabled", True),
|
||||
patch("roboco.config.settings.ponytail_intensity", "ultra"),
|
||||
):
|
||||
prompt = compose_prompt(AgentRole.QA, Team.BACKEND, "be-qa-1")
|
||||
assert "Operative intensity" not in prompt # ethos gets no dial
|
||||
|
||||
|
||||
def test_intensity_config_default() -> None:
|
||||
assert settings.ponytail_intensity == "full"
|
||||
Reference in New Issue
Block a user