{"record":{"id":"acc430d25827deca","repo":"paperclipai/paperclip","slug":"durable-authority-commit-is-indeterminate-reload","errorCode":null,"errorMessage":"Durable authority commit is indeterminate; reload is required.","messagePattern":"Durable authority commit is indeterminate; reload is required\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/paperclip-runner/src/control-plane/durable-prp-control-plane.ts","lineNumber":1224,"sourceCode":"      this.#state = parsed;\n    } else {\n      this.#state = initialCoreState(identity);\n      this.save();\n    }\n  }\n\n  get state(): StoredCoreState {\n    return this.#state;\n  }\n\n  save(): void {\n    this.assertWritable();\n    atomicPrivateWrite(this.path, `${JSON.stringify(this.#state, null, 2)}\\n`);\n  }\n\n  assertWritable(): void {\n    if (this.#writeIndeterminate)\n      throw new Error(\n        \"Durable authority commit is indeterminate; reload is required.\",\n      );\n  }\n\n  /** Persist a complete candidate before publishing any new authority in memory. */\n  commit(candidate: StoredCoreState): void {\n    this.assertWritable();\n    try {\n      atomicPrivateWrite(this.path, `${JSON.stringify(candidate, null, 2)}\\n`);\n      this.#state = candidate;\n    } catch (error) {\n      // Rename may already have succeeded before directory fsync failed.\n      // Never overwrite that possibly durable receipt using stale memory.\n      this.#writeIndeterminate = true;\n      throw error;\n    }\n  }\n}","sourceCodeStart":1206,"sourceCodeEnd":1242,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/control-plane/durable-prp-control-plane.ts#L1206-L1242","documentation":"The durable store persists state with an atomic write that can leave the commit outcome unknown (write may or may not have landed). When that happens the store sets an indeterminate flag; assertWritable then refuses every subsequent commit with this error, forcing the caller to reload state from disk rather than risk divergent authority.","triggerScenarios":"Any commit after a previous atomic write failed ambiguously (EIO/ENOSPC mid-rename, process crash during fsync/rename), which set #writeIndeterminate; the next commit()/assertWritable call throws.","commonSituations":"Disk-full during a state write; container killed mid-write then restarted on the same state file; filesystem errors (EIO) on the volume hosting the state path.","solutions":["Reload the durable state from disk (reconstruct the store from the persisted file) to resolve the indeterminacy, then retry.","Check disk space and filesystem health for the volume holding the state file.","If the on-disk state is corrupt, restore from the last known-good backup of the state file.","Restart the runner/control-plane process with state reconstruction so the indeterminate flag is cleared safely."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (store.isIndeterminate?.()) throw new Error('reload durable state before further commits');","typeGuard":null,"tryCatchPattern":"try {\n  store.commit(candidate);\n} catch (e) {\n  if (e.message.includes('indeterminate')) {\n    checkDiskSpace(store.path);\n    store = reloadStoreFromDisk(store.path);\n    store.commit(candidate);\n  } else throw e;\n}","preventionTips":["Monitor disk space on the volume hosting the durable state file.","Back up the state file before deployments so recovery is possible after an ambiguous write.","Treat any mid-write crash as requiring a full state reload, never in-memory continuation."],"tags":["durability","filesystem","state"],"backgroundTag":"file-write-failed","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}