projectreliability

package
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRunNotFound = errors.New("context health run not found")

Functions

This section is empty.

Types

type ClaimCheckRequest

type ClaimCheckRequest struct {
	ProjectID       string          `json:"project_id,omitempty"`
	Documents       []ClaimDocument `json:"documents,omitempty"`
	SelectedPaths   []string        `json:"selected_paths,omitempty"`
	KnownTools      []string        `json:"known_tools,omitempty"`
	KnownRoutes     []string        `json:"known_routes,omitempty"`
	IncludeVerified bool            `json:"include_verified,omitempty"`
}

type ClaimCheckResult

type ClaimCheckResult struct {
	ProjectID       string            `json:"project_id,omitempty"`
	Summary         ClaimCheckSummary `json:"summary"`
	Claims          []ClaimFinding    `json:"claims"`
	VerifiedOmitted int               `json:"verified_omitted,omitempty"`
	AllVerified     bool              `json:"all_verified"`
}

type ClaimCheckSummary added in v0.1.10

type ClaimCheckSummary struct {
	Total      int            `json:"total"`
	Verified   int            `json:"verified"`
	Actionable int            `json:"actionable"`
	ByStatus   map[string]int `json:"by_status,omitempty"`
}

type ClaimChecker

type ClaimChecker struct {
	// contains filtered or unexported fields
}

func NewClaimChecker

func NewClaimChecker(workspace projectworkspace.API) *ClaimChecker

func (*ClaimChecker) Check

func (checker *ClaimChecker) Check(ctx context.Context, request ClaimCheckRequest) (ClaimCheckResult, error)

type ClaimDocument

type ClaimDocument struct {
	Path string `json:"path"`
	Text string `json:"text"`
}

type ClaimFinding

type ClaimFinding struct {
	Path        string `json:"path"`
	Line        int    `json:"line"`
	Kind        string `json:"kind"`
	Claim       string `json:"claim"`
	Status      string `json:"status"`
	Evidence    string `json:"evidence,omitempty"`
	SafeMessage string `json:"safe_message"`
}

type ContextHealth

type ContextHealth struct {
	ProjectID               string              `json:"project_id"`
	Status                  ContextHealthStatus `json:"status"`
	Enabled                 bool                `json:"enabled"`
	DigestMode              string              `json:"digest_mode"`
	UpdatePolicy            string              `json:"update_policy"`
	WorkspaceMode           string              `json:"workspace_mode"`
	GraphStorage            string              `json:"graph_storage"`
	ValidationStatus        string              `json:"validation_status"`
	StatusReason            string              `json:"status_reason,omitempty"`
	LatestRun               *RunSummary         `json:"latest_run,omitempty"`
	ActiveRunID             string              `json:"active_run_id,omitempty"`
	IndexedContentAvailable bool                `json:"indexed_content_available"`
	EligibleFileCount       int                 `json:"eligible_file_count"`
	IndexedSymbolCount      int                 `json:"indexed_symbol_count"`
	IndexedChunkCount       int                 `json:"indexed_chunk_count"`
	SearchIndex             SearchIndexHealth   `json:"search_index"`
	WorkspaceGitAvailable   bool                `json:"workspace_git_available"`
	ReasonCounts            map[string]int      `json:"reason_counts,omitempty"`
	CheckedAt               time.Time           `json:"checked_at"`
}

type ContextHealthStatus

type ContextHealthStatus string
const (
	ContextHealthReady       ContextHealthStatus = "ready"
	ContextHealthWarmingUp   ContextHealthStatus = "warming_up"
	ContextHealthRunning     ContextHealthStatus = "running"
	ContextHealthSyncing     ContextHealthStatus = "syncing"
	ContextHealthDegraded    ContextHealthStatus = "degraded"
	ContextHealthStale       ContextHealthStatus = "stale"
	ContextHealthEmpty       ContextHealthStatus = "empty"
	ContextHealthDisabled    ContextHealthStatus = "disabled"
	ContextHealthUnavailable ContextHealthStatus = "unavailable"
)

type ContextProvider

type ContextProvider interface {
	LatestRun(ctx context.Context, projectID string) (RunSummary, error)
	ActiveRuns(ctx context.Context, projectID string) ([]RunSummary, error)
	EligibleFileCount(ctx context.Context, projectID string) (int, error)
	IndexedSymbolCount(ctx context.Context, projectID string) (int, error)
	IndexedChunkCount(ctx context.Context, projectID string) (int, error)
	SearchIndexHealth(ctx context.Context, projectID string) (SearchIndexHealth, error)
}

type ImpactAnalysis

type ImpactAnalysis struct {
	ProjectID          string         `json:"project_id"`
	DiffScope          string         `json:"diff_scope,omitempty"`
	ChangedPaths       []string       `json:"changed_paths,omitempty"`
	AffectedDomains    []ImpactDomain `json:"affected_domains,omitempty"`
	AffectedRoutes     []string       `json:"affected_routes,omitempty"`
	AffectedTools      []string       `json:"affected_tools,omitempty"`
	SecurityFlags      []string       `json:"security_flags,omitempty"`
	SourceAnchors      []SourceAnchor `json:"source_anchors,omitempty"`
	ResidualUnknowns   []string       `json:"residual_unknowns,omitempty"`
	Partial            bool           `json:"partial,omitempty"`
	PartialReason      string         `json:"partial_reason,omitempty"`
	WorkspaceDiffUsed  bool           `json:"workspace_diff_used"`
	WorkspaceTruncated bool           `json:"workspace_truncated,omitempty"`
}

type ImpactAnalysisRequest

type ImpactAnalysisRequest struct {
	ProjectID    string   `json:"project_id,omitempty"`
	ChangedPaths []string `json:"changed_paths,omitempty"`
	DiffScope    string   `json:"diff_scope,omitempty"`
	MaxDiffBytes int      `json:"max_diff_bytes,omitempty"`
}

type ImpactAnalyzer

type ImpactAnalyzer struct {
	// contains filtered or unexported fields
}

func NewImpactAnalyzer

func NewImpactAnalyzer(workspace projectworkspace.API) *ImpactAnalyzer

func NewImpactAnalyzerWithGraph added in v0.1.1

func NewImpactAnalyzerWithGraph(workspace projectworkspace.API, ingestion impactGraphAPI) *ImpactAnalyzer

func (*ImpactAnalyzer) Analyze

func (analyzer *ImpactAnalyzer) Analyze(ctx context.Context, request ImpactAnalysisRequest) (ImpactAnalysis, error)

type ImpactDomain

type ImpactDomain struct {
	Name       string   `json:"name"`
	Reason     string   `json:"reason"`
	Confidence string   `json:"confidence"`
	Paths      []string `json:"paths,omitempty"`
}

type Options

type Options struct {
	StaleAfter   time.Duration
	ProbeTimeout time.Duration
	Now          func() time.Time
}

type ProjectProvider

type ProjectProvider interface {
	GetProject(ctx context.Context, projectID string) (projectregistry.Project, error)
}

type RunSummary

type RunSummary struct {
	ID             string         `json:"id"`
	Status         string         `json:"status"`
	Trigger        string         `json:"trigger,omitempty"`
	RunKind        string         `json:"run_kind,omitempty"`
	Mode           string         `json:"mode,omitempty"`
	FilesSeen      int            `json:"files_seen"`
	FilesIngested  int            `json:"files_ingested"`
	FilesSkipped   int            `json:"files_skipped"`
	FilesUnchanged int            `json:"files_unchanged"`
	ChunksStored   int            `json:"chunks_stored"`
	SymbolsStored  int            `json:"symbols_stored"`
	ErrorCategory  string         `json:"error_category,omitempty"`
	ReasonCounts   map[string]int `json:"reason_counts,omitempty"`
	CurrentPhase   string         `json:"current_phase,omitempty"`
	StartedAt      time.Time      `json:"started_at,omitempty"`
	FinishedAt     time.Time      `json:"finished_at,omitempty"`
	HeartbeatAt    time.Time      `json:"heartbeat_at,omitempty"`
	LastProgressAt time.Time      `json:"last_progress_at,omitempty"`
}

type SearchIndexHealth

type SearchIndexHealth struct {
	Status   string `json:"status"`
	Degraded bool   `json:"degraded"`
	Reason   string `json:"reason,omitempty"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(projects ProjectProvider, contextProvider ContextProvider, workspace WorkspaceGitProvider, options Options) *Service

func NewServiceFromAPIs

func NewServiceFromAPIs(registry *projectregistry.Registry, ingestion projectingestion.API, workspace projectworkspace.API, options Options) *Service

func (*Service) ContextHealth

func (svc *Service) ContextHealth(ctx context.Context, projectID string) (ContextHealth, error)

type SourceAnchor

type SourceAnchor struct {
	Path string `json:"path"`
	Kind string `json:"kind,omitempty"`
}

type WorkspaceGitProvider

type WorkspaceGitProvider interface {
	GitAvailable(ctx context.Context, projectID string) (bool, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL