Table of Contents

Class StashCheckpointStrategy

Namespace
JD.AI.Core.Agents.Checkpointing
Assembly
JD.AI.Core.dll

Checkpoint strategy using git stash. Lightweight, doesn't pollute branch history. Stashes are named "jdai-cp-{label}" and can be listed/restored.

public sealed class StashCheckpointStrategy : ICheckpointStrategy
Inheritance
StashCheckpointStrategy
Implements
Inherited Members

Constructors

StashCheckpointStrategy(string?)

public StashCheckpointStrategy(string? workingDir = null)

Parameters

workingDir string

Methods

ClearAsync(CancellationToken)

Remove all checkpoints.

public Task ClearAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task

CreateAsync(string, CancellationToken)

Create a checkpoint with the given label. Returns the checkpoint ID.

public Task<string?> CreateAsync(string label, CancellationToken ct = default)

Parameters

label string
ct CancellationToken

Returns

Task<string>

ListAsync(CancellationToken)

List all checkpoints for the current project.

public Task<IReadOnlyList<CheckpointInfo>> ListAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<IReadOnlyList<CheckpointInfo>>

RestoreAsync(string, CancellationToken)

Restore to a specific checkpoint.

public Task<bool> RestoreAsync(string checkpointId, CancellationToken ct = default)

Parameters

checkpointId string
ct CancellationToken

Returns

Task<bool>