Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: flush maintenance evidence through Windows-compatible handles (#13332)

Adam Eivy405df678d51d
diff --git a/scripts/recover-maintenance-transaction.mjs b/scripts/recover-maintenance-transaction.mjs
index ed18055e76..a2c99b15b9 100644
--- a/scripts/recover-maintenance-transaction.mjs
+++ b/scripts/recover-maintenance-transaction.mjs
@@ -75,7 +75,8 @@ export async function recoverMaintenanceTransaction(reason, { data = PATHS.data,
// Interrupted writes may never have flushed their data. A directory fsync
// preserves names, not those bytes; retain the original fence on flush failure.
for (const { name } of pending) {
- const fd = io.openSync(join(directory, name), 'r');
+ // Windows FlushFileBuffers requires write access; r+ never truncates evidence.
+ const fd = io.openSync(join(directory, name), 'r+');
try { io.fsyncSync(fd); } finally { io.closeSync(fd); }
io.renameSync(join(directory, name), join(archiveDir, name));
}