fix: preserve postprocessing run ownership across stops

Bind main, deferred, and hybrid postprocessing controllers to the run context that owns their package generation. Abort only the stopped run and unowned work so a later run cannot cancel deferred completion for an earlier run.

Treat stop and shutdown aborts as lifecycle cancellation instead of cleanup failure and cover the real deferred handoff through package, run, history, and cleanup results.
This commit is contained in:
Sucukdeluxe
2026-08-22 12:22:21 +02:00
parent ae2691319d
commit c634b70396
2 changed files with 53 additions and 17 deletions
+1
View File
@@ -755,6 +755,7 @@ describe("authoritative run completion", () => {
await Promise.allSettled(deferredTasks);
await flushNotifications();
expect(packageA.cleanupErrorCategory || "").toBe("");
expect(events.filter((event) => event.type === "package_completed")).toHaveLength(1);
expect(events.filter((event) => event.type === "run_completed")).toHaveLength(1);
expect(history.map((entry) => entry.name)).toEqual([packageA.name]);