Refuse what a node cannot publish, and stop timing out work that is fine

Four things the python SDK turned up, each fixed where every client sees it.

A key no port declares is now an error rather than a silent drop, on the
return, the yield and the emit alike — the contract the docs already stated.
The SDK reads literal yields at sync time, so a typo fails before anything
runs, and an emission of one fails the call rather than being logged where
nobody looks.

NaN and infinity are refused at the port. JSON cannot spell either, so one
that travelled came back as a 500, a socket frame that stopped the canvas, or
a metric batch the database dropped whole.

An artifact input takes `@run:<id>.<output>` or a bare digest, resolved on the
engine — so the CLI, the run dialog and a python caller mean the same thing,
and a sweep can pass one at all.

Node timeouts are off by default. The clock measured silence, which a training
node is full of, and remote workers had already stopped enforcing it — their
heartbeat reset it. Now a heartbeat proves the agent rather than the node,
ninety seconds of nothing fails the call either way, and the engine touches
work it is still running so a long node is not redelivered at sixty seconds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019V5bsYGNxcgPs4xXmTPx69
This commit is contained in:
2026-08-25 07:30:14 +02:00
co-authored by Claude Opus 5
parent c33fa404a4
commit 93374a310e
32 changed files with 968 additions and 67 deletions
+38
View File
@@ -114,3 +114,41 @@ def test_qualify_scopes_bare_names_only():
assert qualify("heating", "solar.power") == "solar.power"
assert qualify("heating", "") == ""
assert flow_of("heating.temp") == "heating"
# -----------------------------------------------------------------------------
# NaN and infinity
#
# JSON cannot spell either, so one travelling through a port would come back as
# a response nobody can parse, a socket frame that stops a canvas, or a row the
# database rejects — a long way from the node that produced it.
# -----------------------------------------------------------------------------
def test_a_float_port_refuses_nan_and_infinity():
spec = MessageSpec(name="score", dtype=DType.FLOAT)
spec.check(0.5)
for value in (float("nan"), float("inf"), float("-inf")):
with pytest.raises(TypeError, match="score"):
spec.check(value)
def test_a_json_port_refuses_a_nan_nested_in_it():
spec = MessageSpec(name="report", dtype=DType.JSON)
spec.check({"groups": [{"mean": 1.0}]})
with pytest.raises(TypeError, match="JSON"):
spec.check({"groups": [{"mean": float("nan")}]})
def test_a_series_refuses_a_nan_point():
spec = MessageSpec(name="curve", dtype=DType.SERIES)
lines = [{"label": "loss", "points": [[1.0, float("nan")]]}]
with pytest.raises(TypeError):
spec.check({"lines": lines})
def test_a_value_that_refers_to_itself_does_not_hang_the_check():
spec = MessageSpec(name="report", dtype=DType.JSON)
loop: dict = {}
loop["self"] = loop
spec.check(loop)