Versions in this module Expand all Collapse all v0 v0.6.1 Aug 14, 2026 v0.6.0 Aug 13, 2026 Changes in this version + const DefaultMaxBytesRead + const DefaultMaxCandidatePaths + const DefaultPruneGrace + const DefaultStaleActiveAge + const DefaultStaleWindowAge + const DeltaVersion + const ReasonAlternateGone + const ReasonByteLimit + const ReasonFileLimit + const ReasonHeadChanged + const ReasonLockTimeout + const ReasonMalformedStatus + const ReasonPostSnapshotLost + const ReasonStaleActiveWindow + const ReasonStoreUnavailable + const ReasonTimeout + const ReasonUnsupportedPath + var ErrNoPendingSnapshot = errors.New("toolsnap: no pending snapshot for key") + var ErrRegistryCorrupt = errors.New("toolsnap: registry state corrupt") + var ErrStoreIncompatible = errors.New("toolsnap: snapshot store incompatible with repository") + var ErrWindowSealed = errors.New("toolsnap: window group sealed") + var ErrWindowTombstoned = errors.New("toolsnap: window tombstoned") + func GroupPostRef(worktreeID, groupID string) string + func SnapshotRef(worktreeID, groupID, toolUseID string) string + type Actor struct + Provider string + SessionID string + TurnID string + type CaptureResult struct + BytesRead int64 + Files []FileDelta + Post Snapshot + Truncated bool + type CompletionInfo struct + At int64 + CommandSummary string + EventID string + type Delta struct + Actors []Actor + Files []FileDelta + Kind string + Limits Limits + Reason string + Scope string + Status string + ToolUses []ToolUse + Version int + Window Window + func ParseDelta(raw []byte) (*Delta, error) + func (d *Delta) CanonicalBytes() ([]byte, error) + func (d *Delta) Normalize() + func (d *Delta) Validate() error + type FileChange struct + AfterHash string + AfterMode string + BeforeHash string + BeforeMode string + Op byte + Path string + type FileDelta struct + AfterHash string + AfterMode string + BeforeHash string + BeforeMode string + Binary bool + Hunks []Hunk + NewNoEOFNewline bool + OldNoEOFNewline bool + Operation string + Path string + Truncated bool + type FinalizeResult struct + Done bool + Final GroupFinal + type GroupFinal struct + CapturedAt int64 + DeltaHash string + PartialReason string + PostTreeHash string + type GroupMeta struct + CreatedAt int64 + JoinUntil int64 + Sealed bool + type Hunk struct + NewCount int + NewLines []string + NewStart int + OldCount int + OldLines []string + OldStart int + type Limits struct + BytesRead int64 + FilesObserved int + Truncated bool + type MaintenanceReport struct + ActiveWindows int + Deferred bool + MarkersPruned int + PruneRan bool + RefsDeleted int + RefsKept int + StoreBytes int64 + type PartialError struct + Detail string + Reason string + func (e *PartialError) Error() string + type PendingFinalization struct + Final *GroupFinal + GroupID string + Members []PendingToolSnapshot + type PendingPartialRecord struct + CommandSummary string + EventID string + Key ToolKey + Reason string + Timestamp int64 + ToolName string + type PendingToolSnapshot struct + CommandSummary string + CompletedAt int64 + EventID string + GroupID string + HeadHash string + Key ToolKey + ObjectFormat string + Seq int64 + SnapshotRef string + StartedAt int64 + Status string + ToolName string + TreeHash string + type ReclaimedGroup struct + Completed int + GroupID string + Tombstoned int + type Registry struct + func OpenRegistry(semDir string) (*Registry, error) + func (r *Registry) Begin(ctx context.Context, entry PendingToolSnapshot) (string, error) + func (r *Registry) CaptureAndBegin(ctx context.Context, s *Store, key ToolKey, toolName string, startedAt int64) (PendingToolSnapshot, error) + func (r *Registry) Complete(ctx context.Context, key ToolKey, info CompletionInfo, ...) (bool, error) + func (r *Registry) HasTombstone(key ToolKey) (bool, error) + func (r *Registry) ListTombstones() (tombs []Tombstone, malformed []string, err error) + func (r *Registry) LoadOrRecordPendingPartial(rec PendingPartialRecord) (PendingPartialRecord, error) + func (r *Registry) PendingFinalizations(ctx context.Context) ([]PendingFinalization, error) + func (r *Registry) PendingPartialRecords() ([]PendingPartialRecord, error) + func (r *Registry) ReclaimSealedGroups(ctx context.Context, now int64) ([]ReclaimedGroup, error) + func (r *Registry) RemoveGroup(ctx context.Context, groupID string) error + func (r *Registry) RemovePendingPartial(eventID string) error + func (r *Registry) RemoveTombstone(key ToolKey) error + func (r *Registry) ResumeFinalization(ctx context.Context, groupID string, ...) (bool, error) + func (r *Registry) Stale(ctx context.Context, cutoff int64) ([]PendingToolSnapshot, error) + func (r *Registry) WriteTombstone(key ToolKey, at int64) error + type RegistrySnapshot struct + Exists bool + Finals map[string]GroupFinal + Groups map[string]GroupMeta + MalformedTombstones []string + Partials []PendingPartialRecord + Tombstones []Tombstone + Windows []PendingToolSnapshot + func InspectRegistry(semDir string) (RegistrySnapshot, error) + func (s RegistrySnapshot) CompleteGroups() []PendingFinalization + type RepoContext struct + CommonDir string + GitDir string + HeadCommit string + HeadTree string + ObjectFormat string + WorktreeID string + WorktreeRoot string + func ResolveRepoContext(ctx context.Context, dir string) (RepoContext, error) + type Snapshot struct + DirtyPath []string + HeadHash string + TreeHash string + type Store struct + Dir string + MaxBytesRead int64 + MaxCandidatePaths int + func OpenStore(ctx context.Context, rc RepoContext, semDir string) (*Store, error) + func (s *Store) CaptureAfter(ctx context.Context, before Snapshot) (CaptureResult, error) + func (s *Store) CaptureBefore(ctx context.Context) (Snapshot, error) + func (s *Store) CreateRef(ctx context.Context, ref, tree string) error + func (s *Store) DeleteRef(ctx context.Context, ref, expectedTree string) error + func (s *Store) DeltaBetweenTrees(ctx context.Context, beforeTree, afterTree string) ([]FileDelta, int64, bool, error) + func (s *Store) DiffTrees(ctx context.Context, beforeTree, afterTree string) ([]FileChange, error) + func (s *Store) EnsureRef(ctx context.Context, ref, tree string) error + func (s *Store) ListRefs(ctx context.Context) (map[string]string, error) + func (s *Store) Maintain(ctx context.Context, reg *Registry, grace time.Duration) (MaintenanceReport, error) + func (s *Store) ReadBlob(ctx context.Context, hash string) ([]byte, error) + func (s *Store) WorktreeID() string + type Tombstone struct + At int64 + Key ToolKey + type ToolKey struct + Provider string + RepositoryID string + SessionID string + ToolUseID string + TurnID string + type ToolUse struct + Actor int + CommandSummary string + EventID string + ToolName string + ToolUseID string + type Window struct + CompletedAt int64 + DurationMS int64 + StartedAt int64