Write the on-disk recovery record (atomic). Best-effort; never fatal.
(taskId: string, _signal?: AbortSignal)
| 218 | |
| 219 | /** Write the on-disk recovery record (atomic). Best-effort; never fatal. */ |
| 220 | private async writeRecoveryRecord(taskId: string, _signal?: AbortSignal): Promise<void> { |
| 221 | if (!this.repoRoot || !this.state) return; |
| 222 | const rec: SandboxRecoveryRecord = { |
| 223 | version: 1, |
| 224 | taskId, |
| 225 | branch: this.state.branch, |
| 226 | originBranch: this.state.originBranch, |
| 227 | baseCommit: this.state.baseCommit, |
| 228 | stashed: this.state.stashed, |
| 229 | stashMessage: this.state.stashMessage, |
| 230 | pid: process.pid, |
| 231 | startedAt: new Date().toISOString(), |
| 232 | }; |
| 233 | await writeFileAtomic(recoveryRecordPath(this.repoRoot), JSON.stringify(rec, null, 2)); |
| 234 | } |
| 235 | |
| 236 | /** |
| 237 | * Restore a stash identified by its push MESSAGE (not a positional `stash pop`, |
no test coverage detected