mirror of
https://github.com/kenhuangus/wikiskill
synced 2026-09-22 23:34:25 +08:00
Paper-fidelity fixes: whole-log 15k cap (App.C), audit no/invalid proposals (Alg.1 line 19), exact trace paths for ReAct proposer, applicability conditions in SKILL.md
This commit is contained in:
@@ -67,3 +67,17 @@ def test_stratified_sample():
|
||||
s = stratified_sample(traces)
|
||||
assert sum(1 for x in s if not x.correct) == 5
|
||||
assert sum(1 for x in s if x.correct) == 3
|
||||
|
||||
|
||||
def test_stratified_sample_caps_whole_log():
|
||||
"""Paper App. C: the ENTIRE execution log is capped at 15,000 chars, not just
|
||||
the last message."""
|
||||
from wikiskill.agents import stratified_sample
|
||||
from wikiskill.datasets import Trajectory
|
||||
big = Trajectory(task_id="big", correct=False, tool_calls=[], final_answer=None,
|
||||
prediction=None,
|
||||
messages=[{"role": "system", "content": "s" * 9000},
|
||||
{"role": "assistant", "content": "a" * 9000}])
|
||||
(sampled,) = stratified_sample([big])
|
||||
assert sum(len(str(m.get("content", ""))) for m in sampled.messages) < 16000
|
||||
assert any("[truncated]" in str(m.get("content", "")) for m in sampled.messages)
|
||||
|
||||
Reference in New Issue
Block a user