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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user