tarlatan
    Preparing search index...

    Interface SnapshotKeeper

    The keeper's work in one recorded worktree.

    interface SnapshotKeeper {
        keep: (
            tree: string & Brand<"Revision">,
            request: KeepRequest,
        ) => Effect<SnapshotKept, KeepFailure>;
        removeSessionRefs: (
            sessionId: string & Brand<"SessionId">,
        ) => Effect<readonly string[]>;
        takeAndKeep: (
            request: KeepRequest,
        ) => Effect<SnapshotKept, TakeAndKeepFailure>;
    }
    Index
    keep: (
        tree: string & Brand<"Revision">,
        request: KeepRequest,
    ) => Effect<SnapshotKept, KeepFailure>

    Keeps tree, already taken, on the request's ref.

    removeSessionRefs: (
        sessionId: string & Brand<"SessionId">,
    ) => Effect<readonly string[]>

    Deletes every ref under refs/tarlatan/<sessionId>/ that the listing finds, each with update-ref --no-deref -d <ref> <oid>, a ref git listed whose object is missing with its listed id (dogfood-8a4 F1), or with no old value for an unresolved ref such as a dangling symbolic ref (review 2 F2) and for any symbolic ref, so an alias left dangling by the deletion of the ref it names is still deleted (review 3 F3 re-review), and returns the refs still there: those whose deletion failed, or the session's prefix when the listing failed. Never fails. A listing that is only incomplete is no failure (review 3 F3): in a repository whose ref storage is not files, such as reftable, a dangling symbolic ref may remain, unreported here, and status reports the listing as incomplete with the reason. No ref is deleted unless the ref root git uses is the recorded common directory; every listed ref, or the prefix when none is listed, is then returned (review F4A). On the files backend no ref is deleted when a directory from refs down to a listed ref, or from logs down to its reflog, is a symbolic link; every listed ref is then returned (review F3A, F4A, F5D).

    takeAndKeep: (request: KeepRequest) => Effect<SnapshotKept, TakeAndKeepFailure>

    Takes a snapshot from request.base the way the handoff does (the attribute check of the base, the snapshot, the attribute check of the staged tree) and keeps it. A snapshot the raw checks refuse fails with its SnapshotRefused; nothing is kept then.