mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-22 14:39:28 +00:00
search-with-proof: readiness from the budget with a probe, 4096-token tool turns, 40-step tasks
HTTP start waits up to 90 s (CLI 30 s) with TCP then HTTP probing; app stdout and stderr tails are recorded; tool-call turns get 4096 output tokens with one retry on truncation; tasks get 40 steps with reminders. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
72ab4c8925
commit
da804472b9
@@ -9,7 +9,11 @@ class SearchBudget:
|
||||
# Recalibrated 2026-10-05 on the first three measured searches: settled cost was ~$0.003 per model call,
|
||||
# but worst-case reservations (~$0.027 per call) exhausted the old $0.05 task allowance after 2-4 calls.
|
||||
spend_usd: float = 2.00
|
||||
# Both ceilings bound each task: $0.40 and 40 model steps.
|
||||
max_call_usd: float = 0.40
|
||||
max_steps: int = 40
|
||||
http_start_seconds: int = 90
|
||||
cli_start_seconds: int = 30
|
||||
reason_rounds: int = 4
|
||||
intents_per_round: int = 3
|
||||
demonstrations: int = 3
|
||||
@@ -28,6 +32,9 @@ class SearchBudget:
|
||||
if value < 0 or (value == 0 and name not in ("retries", "spend_usd")):
|
||||
raise ValueError(f"invalid {name}")
|
||||
if name in (
|
||||
"max_steps",
|
||||
"http_start_seconds",
|
||||
"cli_start_seconds",
|
||||
"reason_rounds",
|
||||
"intents_per_round",
|
||||
"demonstrations",
|
||||
@@ -37,3 +44,17 @@ class SearchBudget:
|
||||
"disk_bytes",
|
||||
) and not isinstance(value, int):
|
||||
raise ValueError(f"{name} must be an integer")
|
||||
|
||||
|
||||
def verification_timeout(schema: dict, limits: dict | None = None) -> int:
|
||||
"""Resolve the mode's start/command allowance from the search task budget."""
|
||||
key = "http_start_seconds" if schema["start"]["mode"] == "http" else "cli_start_seconds"
|
||||
value = (limits or {}).get(key, getattr(SearchBudget(), key))
|
||||
if type(value) is not int or not 1 <= value <= 300:
|
||||
raise ValueError("invalid verification timeout")
|
||||
return value
|
||||
|
||||
|
||||
def verification_run_seconds(schema: dict, timeout: int) -> int:
|
||||
# One readiness operation, all declared steps, and driver shutdown/handshake.
|
||||
return timeout * (1 + len(schema["steps"])) + 5
|
||||
|
||||
Reference in New Issue
Block a user