fix: harden pi maintenance lifecycle

This commit is contained in:
2026-08-04 19:09:04 +02:00
parent 8fde1f81c7
commit 0b9ad7f53f
21 changed files with 432 additions and 171 deletions
+10
View File
@@ -0,0 +1,10 @@
import { existsSync } from "node:fs";
/**
* A host-side lifecycle transaction creates this marker before it checks for active sessions.
* The marker is intentionally only an admission gate: it must never terminate existing Pi
* processes or make their in-flight work unavailable.
*/
export function createMaintenanceGate(markerFile: string): () => boolean {
return () => existsSync(markerFile);
}