Documentation
¶
Index ¶
- type GitMode
- type GitPolicy
- type Index
- func (i *Index) Close() error
- func (i *Index) Get(ctx context.Context, taskName string) (Record, bool, error)
- func (i *Index) ListAll(ctx context.Context) ([]ListItem, error)
- func (i *Index) ListClosed(ctx context.Context) ([]ListItem, error)
- func (i *Index) ListOpen(ctx context.Context) ([]ListItem, error)
- func (i *Index) Refresh(ctx context.Context, policy RefreshPolicy) error
- func (i *Index) UpdateChangesCache(ctx context.Context, name string, baseCommit string, branchHead string, ...) error
- func (i *Index) UpdateCommitCountCache(ctx context.Context, name string, baseCommit string, branchHead string, ...) error
- func (i *Index) UpdateCommitLogLastHead(ctx context.Context, name string, branchHead string) error
- func (i *Index) UpdateIntegrationCache(ctx context.Context, name string, branchHead string, targetHead string, ...) error
- func (i *Index) UpdateRefHeads(ctx context.Context, name string, branchHead string, baseHead string) error
- type ListItem
- type Record
- type RefreshPolicy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a SQLite-backed cache of task metadata for fast queries.
The task files on disk remain the source of truth; the index can be rebuilt at any time.
func OpenDefault ¶
OpenDefault opens (or creates) the index database at .subtask/index.db.
func (*Index) Refresh ¶
func (i *Index) Refresh(ctx context.Context, policy RefreshPolicy) error
Refresh updates the index from task files on disk.
It is safe to call frequently: when no files changed, Refresh performs no DB writes.
func (*Index) UpdateChangesCache ¶ added in v0.2.0
func (*Index) UpdateCommitCountCache ¶ added in v0.2.0
func (*Index) UpdateCommitLogLastHead ¶ added in v0.2.0
func (*Index) UpdateIntegrationCache ¶ added in v0.2.0
type ListItem ¶
type ListItem struct {
Name string
Title string
FollowUp string
BaseBranch string
BaseCommit string
TaskStatus task.TaskStatus
WorkerStatus task.WorkerStatus
Stage string
Workspace string
StartedAt time.Time
LastError string
LastHistory time.Time
LastActive time.Time
ToolCalls int
LastRunDurationMS int
ProgressDone int
ProgressTotal int
LinesAdded int
LinesRemoved int
}
ListItem is a task summary record suitable for list output.
type Record ¶
type Record struct {
Task *task.Task
BaseCommit string
TaskStatus task.TaskStatus
WorkerStatus task.WorkerStatus
Stage string
State *task.State
ProgressMeta *task.Progress
LastHistory time.Time
ProgressDone int
ProgressTotal int
LastRunDurationMS int
LinesAdded int
LinesRemoved int
ConflictFilesJSON string
// Integration (content detection) cache keyed by (base_head, branch_head).
IntegratedReason string
IntegratedBranchHead string
IntegratedTargetHead string
IntegratedCheckedAtNS int64
// Git redesign cache fields (input-based invalidation).
BranchHead string
BaseHead string
ChangesAdded int
ChangesRemoved int
ChangesBaseCommit string
ChangesBranchHead string
CommitCount int
CommitCountBaseCommit string
CommitCountBranchHead string
CommitLogLastHead string
}
Record is the cached file-backed data for a single task.
type RefreshPolicy ¶
type RefreshPolicy struct {
Git GitPolicy
}
RefreshPolicy controls what work Refresh performs. File-backed fields are always refreshed; git refresh is optional.
Click to show internal directories.
Click to hide internal directories.