Files
trinity-rl/envs/decensor/tests/test_agentic_smoke.py
T
carsten 84d7fe4166 Trinity-Mini RL: envs, production recipe, and run scripts
Migrated from the rl-toolkit snapshot deployed for the 2026-09-15 production
run (toolkit e191cf1 plus uncommitted changes). PRIME-RL is now a submodule on
dphn/prime-rl@trinity; the v0 envs, parity tests, OPD experiment, and old
configs are not carried over.
2026-10-14 12:39:23 +00:00

50 lines
1.6 KiB
Python

from decensor_v1.scoring import ScoringConfig, Verdicts, score_decensor
from decensor_v1.taskset import DecensorTasksetConfig
from decensor_v1.text import validate_follow_up_message, word_band
def test_taskset_defaults_match_agentic_archive():
config = DecensorTasksetConfig()
assert config.num_examples == 2000
assert config.dataset_seed == 42
assert config.difficulty == "easy"
assert config.max_turns == 6
def test_archive_length_bands_and_follow_up_validation():
assert word_band("Be verbose") == (1400, 800, 2000)
message, error, details = validate_follow_up_message(
"<user-turn-output>Please explain the key tradeoffs here.</user-turn-output>"
)
assert error is None
assert message == "Please explain the key tradeoffs here."
assert details["word_count"] == 6
def test_scoring_returns_structured_result_for_valid_response():
completion = [
{
"role": "assistant",
"content": "<think>plan a concise answer</think> " + "answer " * 99,
}
]
result = score_decensor(
[{"role": "user", "content": "Explain it."}],
completion,
Verdicts(
refusal=1,
visible_answer_is_clear=1,
reasoning_has_safety_or_policy_discussion=0,
reasoning_trace_is_clear=1,
meta_commentary=0,
markdown_present=0,
markdown_is_correct=1,
),
response_format="plaintext",
word_requirement="Respond tersely",
is_truncated=False,
config=ScoringConfig(),
)
assert result.status == "scored"
assert result.reward == 0.9