MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / writeRecoveryRecord

Method writeRecoveryRecord

src/agent/git-sandbox.ts:220–234  ·  view source on GitHub ↗

Write the on-disk recovery record (atomic). Best-effort; never fatal.

(taskId: string, _signal?: AbortSignal)

Source from the content-addressed store, hash-verified

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`,

Callers 1

beginMethod · 0.95

Calls 2

writeFileAtomicFunction · 0.85
recoveryRecordPathFunction · 0.85

Tested by

no test coverage detected