Devstral Small 2: serve.sh, baseline.py without thinking args, repair rate, activation error message fix, stop rule in chain (run base 21000)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
@@ -43,8 +43,8 @@ def activation_messages(text, is_error=False):
|
||||
return []
|
||||
msgs = (obj.get("activation") or {}).get("messages") or obj.get("messages") or []
|
||||
out = [str(m.get("message", ""))[:300] for m in msgs if isinstance(m, dict) and m.get("severity") == "E"]
|
||||
if not out and is_error:
|
||||
out = [str(obj.get("message") or text)[:300]]
|
||||
if not out and (is_error or obj.get("success") is False):
|
||||
out = [str(obj.get("error") or obj.get("message") or text)[:300]] # {"success":false,"error":...} of a failed write
|
||||
return out
|
||||
|
||||
|
||||
|
||||
@@ -91,6 +91,26 @@ def trajectory_stats(path):
|
||||
"final_report": final, "agent_seconds": round((t_last or 0) - (t_first or 0), 1)}
|
||||
|
||||
|
||||
def repair_stats(path):
|
||||
"""Repair rate: pushes whose source changed after a failed push of the same object / pushes after a failed push."""
|
||||
import hashlib
|
||||
last = None # (object, md5, failed)
|
||||
after = changed = 0
|
||||
for line in open(path):
|
||||
e = json.loads(line)
|
||||
if e.get("tool") != "sap_push_source" or (e["result"].startswith("Tool ") and e["is_error"]):
|
||||
continue
|
||||
args = e.get("args", {})
|
||||
key = (str(args.get("objectName", "")).upper(), str(args.get("includeType", "")))
|
||||
md5 = hashlib.md5(str(args.get("source", "")).encode()).hexdigest()
|
||||
if last and last[2] and last[0] == key:
|
||||
after += 1
|
||||
changed += md5 != last[1]
|
||||
last = (key, md5, e["is_error"] or '"success":false' in e["result"].replace(" ", ""))
|
||||
return {"pushes_after_error": after, "pushes_changed_after_error": changed,
|
||||
"repair_rate": round(changed / after, 3) if after else None}
|
||||
|
||||
|
||||
class Runner:
|
||||
def __init__(self, tasks_root, runs_root):
|
||||
self.tasks_root = tasks_root
|
||||
|
||||
Reference in New Issue
Block a user