fix(contracts): reject unfulfillable output capture budgets

This commit is contained in:
2026-10-09 08:25:39 +08:00
parent b7e9111254
commit 76b565cce8
4 changed files with 169 additions and 2 deletions
+7 -1
View File
@@ -109,7 +109,13 @@ class RunLimits(WireModel):
@model_validator(mode="after")
def consistent(self) -> Self:
if self.stack_bytes > self.memory_bytes or self.file_bytes > self.workdir_bytes:
if (
self.stack_bytes > self.memory_bytes
or self.file_bytes > self.workdir_bytes
or self.stdout_bytes > self.file_bytes
or self.stderr_bytes > self.file_bytes
or self.stdout_bytes + self.stderr_bytes > self.workdir_bytes
):
raise ValueError("inconsistent resource limits")
return self