fix: close addressed publication recovery blockers

This commit is contained in:
2026-08-11 17:41:09 +02:00
parent 56acb397be
commit 4a0ec61da3
5 changed files with 139 additions and 74 deletions
@@ -72,7 +72,15 @@ async function durableJson(path: string, value: unknown): Promise<void> {
}
export class PreprocessingStateStore {
constructor(private readonly rootLease: VerifiedWorkspaceLockRootLease) {}
private readonly rootLease: Pick<VerifiedWorkspaceLockRootLease, "assertLive" | "anchoredPath">;
constructor(rootLease: VerifiedWorkspaceLockRootLease | string) {
if (typeof rootLease === "string") {
let st: ReturnType<typeof lstatSync>;
try { st = lstatSync(rootLease); } catch { throw fail(); }
if (!st.isDirectory() || st.isSymbolicLink()) throw fail();
this.rootLease = { assertLive: () => { const current = lstatSync(rootLease); if (!current.isDirectory() || current.isSymbolicLink()) throw fail(); }, anchoredPath: () => rootLease };
} else this.rootLease = rootLease;
}
private root(): string { this.rootLease.assertLive(); return this.rootLease.anchoredPath(); }
private paths(input: { runId: string }) {
id(input.runId); const root = this.root(); const base = join(root, "preprocessing");