Documentation
¶
Overview ¶
Package joblist provides supported, read-only c2j job listing without loading project configuration or initializing an executor. See README.md for the compatibility, pagination, and lifecycle contracts.
Index ¶
- Variables
- func BuildRequest(tenantID string, query Query) (jobdb.ListJobsRequest, error)
- func CloneBlockingWaitSummary(wait *jobdb.DependencyWaitSummary) *jobdb.DependencyWaitSummary
- func CompactSummary(job jobdb.JobSummary) jobdb.JobSummary
- func DefaultVisibleStatuses() []jobdb.JobStatus
- func ExecutionView(job jobdb.JobSummary) execution.View
- func ExecutionViewFromInfo(metadata json.RawMessage, job jobdb.JobInfo) execution.View
- func ListExecutionJobs(ctx context.Context, lister Lister, req jobdb.ListJobsRequest, ...) (jobdb.ListJobsResponse, error)
- func StoreForJob(job jobdb.JobSummary) jobdb.JobStore
- func StoresForStatuses(statuses []jobdb.JobStatus) []jobdb.JobStore
- type Client
- type Config
- type ExecutionDemandError
- type Job
- type Lister
- type Page
- type Query
Constants ¶
This section is empty.
Variables ¶
var ErrExecutionDetailsRequired = errors.New("execution compatibility requires job details; inspect selected jobs or use the acquired lease payload")
ErrExecutionDetailsRequired rejects compatibility filtering until its pagination contract can preserve one backend page per list page.
var ErrInvalidInput = errors.New("invalid listing input")
ErrInvalidInput identifies invalid connection or query configuration.
Functions ¶
func BuildRequest ¶
func BuildRequest(tenantID string, query Query) (jobdb.ListJobsRequest, error)
BuildRequest owns repository filtering, validation, and CLI-compatible query defaults. Most callers should use Client.List instead of assembling a backend.
func CloneBlockingWaitSummary ¶ added in v0.0.108
func CloneBlockingWaitSummary(wait *jobdb.DependencyWaitSummary) *jobdb.DependencyWaitSummary
CloneBlockingWaitSummary copies the compact wait and its optional deadline.
func CompactSummary ¶ added in v0.0.108
func CompactSummary(job jobdb.JobSummary) jobdb.JobSummary
CompactSummary excludes evaluated waits and additional goal memberships. Stored fields are preserved, including the full client payload.
func DefaultVisibleStatuses ¶
DefaultVisibleStatuses returns a fresh slice of the CLI's nonterminal statuses.
func ExecutionView ¶
func ExecutionView(job jobdb.JobSummary) execution.View
ExecutionView interprets the restored list projection. An absent payload uses the same submission/absence semantics as an explicit job read.
func ExecutionViewFromInfo ¶ added in v0.0.108
ExecutionViewFromInfo interprets explicitly loaded job details. A lease holder should use execution.Inspect with the lease payload instead.
func ListExecutionJobs ¶
func ListExecutionJobs(ctx context.Context, lister Lister, req jobdb.ListJobsRequest, filter *execution.Filter) (jobdb.ListJobsResponse, error)
ListExecutionJobs returns exactly one backend page without enrichment. Compatibility filters remain rejected: restoring stored payloads does not define filtered pagination without extra backend scans.
func StoreForJob ¶
func StoreForJob(job jobdb.JobSummary) jobdb.JobStore
StoreForJob reports the store indicated by the job's archive timestamp.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is immutable and safe for concurrent listing calls. It starts no workers or background tasks and requires no Close. Callers own any supplied HTTP client's transport and its idle-connection lifecycle.
func New ¶
New validates explicit connection inputs without making a network request. Only remote HTTP(S) targets are supported; embedded runtimes are not opened.
type Config ¶
type Config struct {
// JobDBURI uses the CLI format: https://host[:port]/<tenant-id>.
JobDBURI string
// HTTPClient configures authentication, TLS, proxies, and timeouts. Nil uses
// a client with a 30-second request timeout and the default HTTP transport.
// A supplied client remains caller-owned and must be safe for concurrent use.
HTTPClient *http.Client
}
Config is explicit and never supplemented with environment or project config.
type ExecutionDemandError ¶
ExecutionDemandError identifies a job with unusable demand. Deprecated: compact list filtering returns ErrExecutionDetailsRequired.
func (*ExecutionDemandError) Error ¶
func (e *ExecutionDemandError) Error() string
func (*ExecutionDemandError) Unwrap ¶
func (e *ExecutionDemandError) Unwrap() error
type Job ¶
type Job struct {
BlockingWaitSummary *jobdb.DependencyWaitSummary `json:"blocking_wait_summary,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
SchemaHash string `json:"schema_hash,omitempty"`
ParentJobID string `json:"parent_job_id,omitempty"`
// Deprecated: not loaded in lists. Use explicit job inspection.
BlockingWait *jobdb.DependencyWaitInfo `json:"blocking_wait,omitempty"`
GoalID string `json:"goal_id"`
// Deprecated: not loaded in lists. Use explicit job inspection.
OtherGoalIDs []string `json:"other_goal_ids"`
// Completion fields are persisted terminal results, separate from scheduler Status.
// Empty status means unavailable. Unknown statuses are preserved verbatim.
CompletionStatus string `json:"completion_status,omitempty"`
// Preserved from the list response without additional reads.
CompletionDetail string `json:"completion_detail,omitempty"`
Execution execution.View `json:"execution"`
// Preserved from the list response without additional reads.
ClientPayload json.RawMessage `json:"client_payload,omitempty"`
ClientPayloadRevision int64 `json:"client_payload_revision"`
TenantID string `json:"tenant_id"`
JobID string `json:"job_id"`
RepositorySource string `json:"repo,omitempty"`
Prompt string `json:"prompt,omitempty"`
Title string `json:"title,omitempty"`
Status jobdb.JobStatus `json:"status"`
Store jobdb.JobStore `json:"store"`
JobType string `json:"job_type"`
CreatedAt time.Time `json:"created_at"`
AvailableAt time.Time `json:"available_at"`
ArchivedAt *time.Time `json:"archived_at,omitempty"`
LeaseExpiresAt *time.Time `json:"lease_expires_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
NextRoute *jobdb.Route `json:"next_route,omitempty"`
// Preserved from the list response without additional reads.
TaskWait *jobdb.TaskWait `json:"task_wait,omitempty"`
// Preserved from the list response without additional reads.
WaitFor []string `json:"wait_for,omitempty"`
CancelRequested bool `json:"cancel_requested,omitempty"`
}
Job is the CLI-compatible typed projection, with repository identity added. Stored row fields pass through; evaluated waits and extra memberships are not loaded.
func JobFromSummary ¶
func JobFromSummary(job jobdb.JobSummary) Job
JobFromSummary applies c2j's execution interpretation without resolving a recipe or reading history. Malformed execution data stays an item diagnostic.
type Lister ¶
type Lister interface {
ListJobs(context.Context, jobdb.ListJobsRequest) (jobdb.ListJobsResponse, error)
}
Lister is the read-only backend used by the shared pagination helper.
type Page ¶
type Page struct {
Jobs []Job `json:"jobs"`
NextPageToken string `json:"next_page_token,omitempty"`
}
Page contains one logical result page. Jobs is non-nil on a successful List.
type Query ¶
type Query struct {
GoalIDs []string
// Repository is an explicit remote repository URL, SCP-style Git remote,
// or host/owner/repository identity. Configured short names and local paths
// are not resolved by this library. An absolute file URL can identify jobs
// previously submitted from a local repository, without accessing that path.
Repository string
// Empty JobTypes includes every job type in the selected repository.
JobTypes []string
// Empty Statuses selects DefaultVisibleStatuses, matching c2j list.
Statuses []jobdb.JobStatus
JobIDs []string
JobTasks []jobdb.JobTaskFilter
CreatedAfter *time.Time
CreatedBefore *time.Time
PageSize int
PageToken string
// Deprecated: compact lists cannot filter current execution demand.
// A non-nil filter returns ErrExecutionDetailsRequired.
ExecutionFilter *execution.Filter
}
Query selects jobs within the client's tenant and one repository.