fix(jobs): preserve lifecycle order and headless settlement

This commit is contained in:
fz committed 2026-10-08 12:47:48 +08:00
1 parent 12dee990e1
commit 2be7329142
100 files changed
+463 -342

No files matched your search

+2 -2
View File
@@ -773,11 +773,11 @@ def test_job_snapshot_normalization_preserves_pairing_and_uncertainty():
replacements = []
first = {"type": "job/registered", "data": {"executionId": "job-a", "startedAt": 10}}
last = {"type": "job/settled", "data": {"executionId": "job-a", "startedAt": 10,
"finishedAt": 20, "terminationConfirmed": False}}
"finishedAt": 20, "producerReported": False}}
other = {"type": "job/registered", "data": {"executionId": "job-b", "startedAt": 30}}
a, b, c = normalize([first, last, other], replacements)
assert a["data"] == {"executionId": "{{id:1}}", "startedAt": 0}
assert b["data"] == {"executionId": "{{id:1}}", "startedAt": 0, "finishedAt": 0, "terminationConfirmed": False}
assert b["data"] == {"executionId": "{{id:1}}", "startedAt": 0, "finishedAt": 0, "producerReported": False}
assert c["data"]["executionId"] == "{{id:2}}"
assert normalize([a, b, c], []) == [a, b, c]
assert normalize({"type": "tool/result", "data": {"startedAt": 100, "finishedAt": 200}}, []) == {