contracts

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquisitionResult

type AcquisitionResult struct {
	Repo           RepoRef            `json:"repo"`
	Remote         string             `json:"remote"`
	DefaultBranch  string             `json:"default_branch"`
	CommitSHA      string             `json:"commit_sha"`
	Files          int                `json:"files"`
	Bytes          int                `json:"bytes"`
	Indexed        bool               `json:"indexed"`
	Inserted       bool               `json:"inserted"`
	AcquiredAt     string             `json:"acquired_at"`
	Message        string             `json:"message"`
	IndexManifest  codeindex.Manifest `json:"index_manifest"`
	ArtifactDigest string             `json:"artifact_digest"`
	ManifestDigest string             `json:"manifest_digest"`
	SnapshotToken  string             `json:"snapshot_token"`
}

type AcquisitionService

type AcquisitionService interface {
	Acquire(ctx context.Context, repo RepoRef, remote string) (*AcquisitionResult, error)
}

AcquisitionService exposes explicit managed clone/fetch and indexing.

type ArchiveService

type ArchiveService interface {
	SyncPlanningService
	RepositoryContextSync(ctx context.Context, repo RepoRef, maxRequests int) (*RepositoryContextResult, error)
	ArchiveSync(ctx context.Context, repo RepoRef, opts ArchiveSyncOptions) (*SyncResult, error)
	Hydrate(ctx context.Context, repo RepoRef, number int, opts HydrateOptions) (*HydrateResult, error)
}

ArchiveService exposes explicit network-reading archive operations.

type ArchiveSyncOptions

type ArchiveSyncOptions struct {
	State       string
	Since       time.Duration
	Numbers     []int
	MaxPages    int
	MaxRequests int
}

ArchiveSyncOptions bounds and filters one explicit archive synchronization.

type ArchiveThreadService

type ArchiveThreadService interface {
	ArchiveThreads(ctx context.Context, repo RepoRef, kind, state string, limit int) (*ThreadListResult, error)
}

ArchiveThreadService exposes the bounded offline archive listing separately from the stable local-query interface.

type ClusterListResult

type ClusterListResult struct {
	Repo       RepoRef                    `json:"repo"`
	Projection *ClusterProjectionIdentity `json:"projection,omitempty"`
	Total      int                        `json:"total"`
	Truncated  bool                       `json:"truncated"`
	Clusters   []ClusterResult            `json:"clusters"`
}

ClusterListResult is the result of listing clusters for a repository.

type ClusterMember

type ClusterMember struct {
	Kind     string  `json:"kind"`
	Owner    string  `json:"owner"`
	Repo     string  `json:"repo"`
	Number   int     `json:"number"`
	Title    string  `json:"title,omitempty"`
	State    string  `json:"state,omitempty"`
	Score    float64 `json:"score"`
	Reason   string  `json:"reason"`
	Included bool    `json:"included"`
}

ClusterMember is one thread inside a cluster.

type ClusterProjectionIdentity

type ClusterProjectionIdentity struct {
	SourceRevision     string `json:"source_revision"`
	GovernanceRevision uint64 `json:"governance_revision"`
	RuleVersion        string `json:"rule_version"`
	RunID              int64  `json:"run_id"`
}

ClusterProjectionIdentity identifies the inputs and durable run behind a projection.

type ClusterRefreshResult

type ClusterRefreshResult struct {
	Repo        RepoRef                   `json:"repo"`
	Disposition string                    `json:"disposition"`
	Projection  ClusterProjectionIdentity `json:"projection"`
	Stats       ClusterRefreshStats       `json:"stats"`
}

ClusterRefreshResult attributes an explicit projection refresh.

type ClusterRefreshStats

type ClusterRefreshStats struct {
	CandidateCount  int    `json:"candidate_count"`
	PossiblePairs   uint64 `json:"possible_pairs"`
	ScoredPairs     uint64 `json:"scored_pairs"`
	ClusterCount    int    `json:"cluster_count"`
	SnapshotQueries int    `json:"snapshot_queries"`
	CommitQueries   int    `json:"commit_queries"`
}

ClusterRefreshStats describes current projection cardinalities and bounded work performed by an explicit refresh.

type ClusterResult

type ClusterResult struct {
	StableID    string          `json:"stable_id"`
	State       string          `json:"state"`
	Canonical   ClusterMember   `json:"canonical"`
	MemberCount int             `json:"member_count"`
	Members     []ClusterMember `json:"members,omitempty"`
}

ClusterResult is a single duplicate-candidate cluster.

type ClusteringService

type ClusteringService interface {
	ListClusters(ctx context.Context, repo RepoRef, limit int) (*ClusterListResult, error)
	RefreshClusters(ctx context.Context, repo RepoRef) (*ClusterRefreshResult, error)
	Cluster(ctx context.Context, id string, limit int) (*ClusterResult, error)
}

ClusteringService is the optional duplicate-candidate clustering capability used by the CLI.

type CollectionListResult

type CollectionListResult struct {
	Collections []CollectionResult `json:"collections"`
	Total       int                `json:"total"`
	Truncated   bool               `json:"truncated"`
}

CollectionListResult is a list of collections.

type CollectionMember

type CollectionMember struct {
	Kind string `json:"kind"`
	Ref  string `json:"ref"`
}

CollectionMember is one typed reference added to a collection.

type CollectionResult

type CollectionResult struct {
	Name        string `json:"name"`
	MemberCount int    `json:"member_count"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

CollectionResult is a single named collection.

type CollectionService

type CollectionService interface {
	CreateCollection(ctx context.Context, name string) (*CollectionResult, error)
	AddCollectionMembers(ctx context.Context, name string, members []CollectionMember) (*CollectionResult, error)
	ListCollections(ctx context.Context) (*CollectionListResult, error)
}

CollectionService is the optional collection management capability used by the CLI.

type CollisionCheckResult

type CollisionCheckResult struct {
	HypothesisID   string              `json:"hypothesis_id,omitempty"`
	OpportunityID  string              `json:"opportunity_id,omitempty"`
	Repo           domain.RepoRef      `json:"repo"`
	Query          string              `json:"query"`
	Findings       []evidence.Evidence `json:"findings"`
	SourceRevision string              `json:"source_revision"`
	Limit          int                 `json:"limit"`
	Total          int                 `json:"total"`
}

type ConcernCreateOptions

type ConcernCreateOptions struct {
	Repo             RepoRef
	CommitSHA        string
	WorkspaceID      string
	Title            string
	ProblemStatement string
	SuspectedOwner   string
	Confidence       float64
	Unknowns         []string
	SuccessCriterion string
	Notes            string
	EvidenceIDs      []string
}

ConcernCreateOptions carries local concern intake fields.

type ConcernLinkOptions

type ConcernLinkOptions struct {
	Kind       string
	TargetType string
	TargetID   string
	Note       string
}

ConcernLinkOptions identifies one explicit relationship.

type ConcernLinkResult

type ConcernLinkResult struct {
	Kind       string `json:"kind"`
	TargetType string `json:"target_type"`
	TargetID   string `json:"target_id"`
	Note       string `json:"note,omitempty"`
}

ConcernLinkResult is a transport-safe relationship view.

type ConcernListOptions

type ConcernListOptions struct {
	Repo   RepoRef
	Status string
	Query  string
	Limit  int
	Offset int
}

ConcernListOptions bounds an offline concern list or search.

type ConcernListResult

type ConcernListResult struct {
	Concerns  []ConcernResult `json:"concerns"`
	Limit     int             `json:"limit"`
	Total     int             `json:"total"`
	Truncated bool            `json:"truncated"`
}

ConcernListResult contains one bounded result set.

type ConcernPromoteOptions

type ConcernPromoteOptions struct {
	Kind           string
	Category       string
	Scope          string
	Impact         string
	ExpectedEffort string
}

ConcernPromoteOptions configures atomic workflow promotion.

type ConcernPromotionResult

type ConcernPromotionResult struct {
	Kind            string `json:"kind"`
	InvestigationID string `json:"investigation_id"`
	HypothesisID    string `json:"hypothesis_id"`
	OpportunityID   string `json:"opportunity_id,omitempty"`
}

ConcernPromotionResult preserves downstream workflow IDs.

type ConcernResult

type ConcernResult struct {
	ID               string                  `json:"id"`
	Repo             RepoRef                 `json:"repo"`
	CommitSHA        string                  `json:"commit_sha,omitempty"`
	WorkspaceID      string                  `json:"workspace_id,omitempty"`
	Title            string                  `json:"title"`
	ProblemStatement string                  `json:"problem_statement"`
	SuspectedOwner   string                  `json:"suspected_owner,omitempty"`
	Confidence       float64                 `json:"confidence"`
	Unknowns         []string                `json:"unknowns,omitempty"`
	SuccessCriterion string                  `json:"success_criterion,omitempty"`
	Notes            string                  `json:"notes,omitempty"`
	EvidenceIDs      []string                `json:"evidence_ids,omitempty"`
	SourceRefCount   int                     `json:"source_ref_count"`
	Freshness        string                  `json:"freshness"`
	FreshnessReason  string                  `json:"freshness_reason"`
	Links            []ConcernLinkResult     `json:"links,omitempty"`
	Status           string                  `json:"status"`
	Promotion        *ConcernPromotionResult `json:"promotion,omitempty"`
	CreatedAt        string                  `json:"created_at"`
	UpdatedAt        string                  `json:"updated_at"`
}

ConcernResult omits source URLs and host paths. Source/evidence details stay available through their dedicated local records.

type ConcernService

ConcernService manages repo-local concern intake without GitHub access.

type ConcernUpdateOptions

type ConcernUpdateOptions struct {
	Title            *string
	ProblemStatement *string
	SuspectedOwner   *string
	Confidence       *float64
	Unknowns         []string
	SuccessCriterion *string
	Notes            *string
	EvidenceIDs      []string
}

ConcernUpdateOptions carries optional replacement fields.

type ConfigResult

type ConfigResult struct {
	Database         string `json:"database"`
	TokenSource      string `json:"token_source"`
	TokenSourceKey   string `json:"token_source_key,omitempty"`
	CrawlBudget      int    `json:"crawl_budget"`
	CrawlConcurrency int    `json:"crawl_concurrency"`
	CrawlRetryLimit  int    `json:"crawl_retry_limit"`
	CrawlTimeout     string `json:"crawl_timeout"`
}

type ConfigureOptions

type ConfigureOptions struct {
	Database         *string
	TokenSource      *string
	TokenSourceKey   *string
	CrawlBudget      *int
	CrawlConcurrency *int
	CrawlRetryLimit  *int
	CrawlTimeout     *string
	DryRun           bool
}

ConfigureOptions uses pointers so callers can distinguish an omitted value from a deliberate zero value. Tokens themselves are never accepted here.

type ConfigureResult

type ConfigureResult struct {
	Path    string       `json:"path"`
	DryRun  bool         `json:"dry_run"`
	Changed bool         `json:"changed"`
	Config  ConfigResult `json:"config"`
}

type ContributionListResult

type ContributionListResult struct {
	Contributions []ContributionResult `json:"contributions"`
	Limit         int                  `json:"limit"`
	Total         int                  `json:"total"`
}

ContributionListResult contains a bounded contribution history page.

type ContributionOutcomeListResult

type ContributionOutcomeListResult struct {
	ContributionID string                      `json:"contribution_id"`
	Outcomes       []ContributionOutcomeResult `json:"outcomes"`
}

ContributionOutcomeListResult contains all stored outcomes for one contribution.

type ContributionOutcomeResult

type ContributionOutcomeResult struct {
	ID             string `json:"id"`
	ContributionID string `json:"contribution_id"`
	Outcome        string `json:"outcome"`
	Reason         string `json:"reason,omitempty"`
	SourceEventAt  string `json:"source_event_at,omitempty"`
	CreatedAt      string `json:"created_at"`
}

ContributionOutcomeResult is a stored contribution outcome.

type ContributionResult

type ContributionResult struct {
	ID            string         `json:"id"`
	OpportunityID string         `json:"opportunity_id"`
	Kind          string         `json:"kind"`
	Title         string         `json:"title"`
	Body          string         `json:"body,omitempty"`
	Reference     string         `json:"reference,omitempty"`
	ReferenceURL  string         `json:"reference_url,omitempty"`
	PreparedAt    string         `json:"prepared_at"`
	SubmittedAt   string         `json:"submitted_at,omitempty"`
	CreatedAt     string         `json:"created_at"`
	UpdatedAt     string         `json:"updated_at"`
	Metadata      map[string]any `json:"metadata,omitempty"`
}

ContributionResult is the stored representation of a prepared contribution.

type ContributionService

type ContributionService interface {
	PrepareIssue(ctx context.Context, opportunityID string, opts PrepareIssueOptions) (*DraftResult, error)
	PreparePullRequest(ctx context.Context, opportunityID string, opts PreparePROptions) (*DraftResult, error)
}

ContributionService is the optional contribution drafting capability used by the CLI.

type ControlCounts

type ControlCounts struct {
	Repositories  int `json:"repositories"`
	Threads       int `json:"threads"`
	Sources       int `json:"sources"`
	FrontierReady int `json:"frontier_ready"`
	ActiveRuns    int `json:"active_runs"`
	ActiveJobs    int `json:"active_jobs"`
}

type ControlService

type ControlService interface {
	Metadata(ctx context.Context) (*MetadataResult, error)
	Configure(ctx context.Context, opts ConfigureOptions) (*ConfigureResult, error)
	ControlStatus(ctx context.Context) (*ControlStatusResult, error)
	Doctor(ctx context.Context) (*DoctorResult, error)
}

ControlService exposes local configuration and diagnostic capabilities. Implementations must not perform network access for Metadata or ControlStatus.

type ControlStatusResult

type ControlStatusResult struct {
	Healthy        bool             `json:"healthy"`
	Corpus         string           `json:"corpus"`
	Version        string           `json:"version"`
	SchemaVersion  int64            `json:"schema_version"`
	Counts         ControlCounts    `json:"counts"`
	FreshestSource string           `json:"freshest_source,omitempty"`
	RateLimits     []RateLimitState `json:"rate_limits,omitempty"`
	Warnings       []string         `json:"warnings"`
}

type CorpusBackupResult

type CorpusBackupResult struct {
	Path           string `json:"path"`
	ManifestPath   string `json:"manifest_path,omitempty"`
	SizeBytes      int64  `json:"size_bytes"`
	SHA256         string `json:"sha256"`
	CreatedAt      string `json:"created_at,omitempty"`
	SourceSchema   int64  `json:"source_schema,omitempty"`
	ExpectedSchema int64  `json:"expected_schema,omitempty"`
	Compatibility  string `json:"compatibility,omitempty"`
}

CorpusBackupResult identifies a verified SQLite backup and manifest.

type CorpusInspectionResult

type CorpusInspectionResult struct {
	Path                      string                `json:"path"`
	Exists                    bool                  `json:"exists"`
	SizeBytes                 int64                 `json:"size_bytes"`
	WALBytes                  int64                 `json:"wal_bytes"`
	State                     string                `json:"state"`
	Current                   int64                 `json:"current_schema"`
	Target                    int64                 `json:"target_schema"`
	Repositories              int                   `json:"repositories"`
	Threads                   int                   `json:"threads"`
	Pending                   []CorpusMigrationStep `json:"pending_migrations"`
	Problem                   string                `json:"problem,omitempty"`
	BackupRequired            bool                  `json:"backup_required"`
	RequiredDiskBytes         uint64                `json:"required_disk_bytes"`
	AvailableDiskBytes        uint64                `json:"available_disk_bytes"`
	ProjectionRebuildRequired bool                  `json:"projection_rebuild_required"`
}

CorpusInspectionResult reports side-effect-free corpus compatibility and scope.

type CorpusInventoryListResult

type CorpusInventoryListResult struct {
	Schema                  *CorpusInspectionResult           `json:"schema"`
	Repositories            []CorpusRepositoryInventoryResult `json:"repositories"`
	Projections             []CorpusProjectionResult          `json:"projections"`
	PendingWork             []CorpusPendingWorkResult         `json:"pending_work"`
	ObservationPayloadBytes int64                             `json:"observation_payload_bytes"`
	CodeBytes               int64                             `json:"code_bytes"`
	DatabaseBytes           int64                             `json:"database_bytes"`
	WALBytes                int64                             `json:"wal_bytes"`
	SizeAttribution         string                            `json:"size_attribution"`
}

CorpusInventoryListResult summarizes all bounded corpus scopes and storage.

type CorpusInventoryResult

type CorpusInventoryResult struct {
	Repo                   string `json:"repo"`
	Issues                 int    `json:"issues"`
	PullRequests           int    `json:"pull_requests"`
	Threads                int    `json:"threads"`
	RepositoryObservations int    `json:"repository_observations"`
	ThreadObservations     int    `json:"thread_observations"`
	FacetObservations      int    `json:"facet_observations"`
	FacetCoverage          int    `json:"facet_coverage"`
	CodeSnapshots          int    `json:"code_snapshots"`
	CodeDocuments          int    `json:"code_documents"`
	CodeBytes              int64  `json:"code_bytes"`
	DatabaseBytes          int64  `json:"database_bytes"`
	WALBytes               int64  `json:"wal_bytes"`
}

CorpusInventoryResult summarizes one repository's stored corpus data.

type CorpusLifecycleService

type CorpusLifecycleService interface {
	InspectCorpus(ctx context.Context) (*CorpusInspectionResult, error)
	MigrateCorpus(ctx context.Context, opts CorpusMigrateOptions) (*CorpusMigrationResult, error)
	BackupCorpus(ctx context.Context, destination string) (*CorpusBackupResult, error)
	RestoreCorpus(ctx context.Context, source, safetyBackup string) (*CorpusRestoreResult, error)
	InventoryCorpus(ctx context.Context, repo string) (*CorpusInventoryResult, error)
	ListCorpusInventory(ctx context.Context) (*CorpusInventoryListResult, error)
	PlanCodePrune(ctx context.Context, repo string, keepLatest int) (*CorpusPruneResult, error)
	ApplyCodePrune(ctx context.Context, repo string, keepLatest int, expectedDelete []string) (*CorpusPruneResult, error)
	PlanRepositoryRemoval(ctx context.Context, repo string) (*CorpusRepositoryRemovalResult, error)
	ApplyRepositoryRemoval(ctx context.Context, repo, expectedRevision string) (*CorpusRepositoryRemovalResult, error)
	ListCorpusProjections(ctx context.Context) (*CorpusProjectionListResult, error)
	RebuildCorpusProjection(ctx context.Context, name string) (*CorpusProjectionResult, error)
}

CorpusLifecycleService owns explicit inspection, backup, migration, and restore.

type CorpusMigrateOptions

type CorpusMigrateOptions struct {
	BackupPath string
	NoBackup   bool
}

CorpusMigrateOptions controls explicit migration backup behavior.

type CorpusMigrationResult

type CorpusMigrationResult struct {
	Before *CorpusInspectionResult `json:"before"`
	After  *CorpusInspectionResult `json:"after"`
	Backup *CorpusBackupResult     `json:"backup,omitempty"`
	Steps  []CorpusMigrationStep   `json:"steps"`
}

CorpusMigrationResult reports the before/after schema and optional backup.

type CorpusMigrationStep

type CorpusMigrationStep struct {
	Version           int64  `json:"version"`
	Name              string `json:"name"`
	Phase             string `json:"phase"`
	AffectedRows      int64  `json:"affected_rows_estimate,omitempty"`
	EstimateAvailable bool   `json:"affected_rows_estimate_available,omitempty"`
	Transactional     bool   `json:"transactional,omitempty"`
	Resumable         bool   `json:"resumable,omitempty"`
	ResumeStrategy    string `json:"resume_strategy,omitempty"`
	ProjectionRebuild bool   `json:"projection_rebuild,omitempty"`
}

CorpusMigrationStep reports one planned or completed migration step.

type CorpusPendingWorkResult

type CorpusPendingWorkResult struct {
	Kind   string `json:"kind"`
	Name   string `json:"name"`
	Status string `json:"status"`
	Detail string `json:"detail,omitempty"`
}

CorpusPendingWorkResult describes incomplete explicit corpus work.

type CorpusProjectionListResult

type CorpusProjectionListResult struct {
	Projections []CorpusProjectionResult `json:"projections"`
}

CorpusProjectionListResult contains bounded projection status records.

type CorpusProjectionResult

type CorpusProjectionResult struct {
	Name              string `json:"name"`
	Version           string `json:"version"`
	Status            string `json:"status"`
	RowCount          int64  `json:"row_count"`
	RefreshedAt       string `json:"refreshed_at,omitempty"`
	SourceRevision    string `json:"source_revision,omitempty"`
	ContentHash       string `json:"content_hash,omitempty"`
	AttemptStatus     string `json:"attempt_status,omitempty"`
	AttemptStartedAt  string `json:"attempt_started_at,omitempty"`
	AttemptFinishedAt string `json:"attempt_finished_at,omitempty"`
	AttemptError      string `json:"attempt_error,omitempty"`
}

CorpusProjectionResult describes one derived corpus projection.

type CorpusPruneResult

type CorpusPruneResult struct {
	Repo         string                `json:"repo"`
	DryRun       bool                  `json:"dry_run"`
	KeepLatest   int                   `json:"keep_latest"`
	Total        int                   `json:"total_snapshots"`
	Delete       []CorpusPruneSnapshot `json:"delete"`
	Deleted      int                   `json:"deleted"`
	ReclaimBytes int64                 `json:"reclaim_bytes"`
}

CorpusPruneResult describes a code-pruning preview or result.

type CorpusPruneSnapshot

type CorpusPruneSnapshot struct {
	CommitSHA string `json:"commit_sha"`
	Bytes     int64  `json:"bytes"`
}

CorpusPruneSnapshot identifies a derived code snapshot selected for deletion.

type CorpusRepositoryInventoryResult

type CorpusRepositoryInventoryResult struct {
	Repo                   string `json:"repo"`
	Issues                 int    `json:"issues"`
	PullRequests           int    `json:"pull_requests"`
	Threads                int    `json:"threads"`
	RepositoryObservations int    `json:"repository_observations"`
	ThreadObservations     int    `json:"thread_observations"`
	FacetObservations      int    `json:"facet_observations"`
	FacetCoverage          int    `json:"facet_coverage"`
	LatestObservationAt    string `json:"latest_observation_at,omitempty"`
	CodeSnapshots          int    `json:"code_snapshots"`
	CodeDocuments          int    `json:"code_documents"`
	CodeBytes              int64  `json:"code_bytes"`
}

CorpusRepositoryInventoryResult summarizes one repository in a corpus listing.

type CorpusRepositoryRemovalResult

type CorpusRepositoryRemovalResult struct {
	Repo                         string `json:"repo"`
	DryRun                       bool   `json:"dry_run"`
	Revision                     string `json:"revision"`
	RepositoryObservations       int    `json:"repository_observations"`
	Threads                      int    `json:"threads"`
	ThreadObservations           int    `json:"thread_observations"`
	FacetObservations            int    `json:"facet_observations"`
	FacetCoverage                int    `json:"facet_coverage"`
	CodeSnapshots                int    `json:"code_snapshots"`
	CodeDocuments                int    `json:"code_documents"`
	Dossiers                     int    `json:"dossiers"`
	ClusterRuns                  int    `json:"cluster_runs"`
	Clusters                     int    `json:"clusters"`
	FrontierItems                int    `json:"frontier_items"`
	DetachedTriageEvents         int    `json:"detached_triage_events"`
	RemovedPortfolioLinks        int    `json:"removed_portfolio_links"`
	RemovedResolutionRecords     int    `json:"removed_resolution_records"`
	RemovedSignalSnapshots       int    `json:"removed_signal_snapshots"`
	DetachedClusterMembers       int    `json:"detached_cluster_members"`
	PreservedInvestigations      int    `json:"preserved_investigations"`
	PreservedCrossRepoReferences int    `json:"preserved_cross_repo_references"`
}

CorpusRepositoryRemovalResult describes a repository-removal preview or result.

type CorpusRestoreResult

type CorpusRestoreResult struct {
	Source       string                  `json:"source"`
	Before       *CorpusInspectionResult `json:"before,omitempty"`
	After        *CorpusInspectionResult `json:"after"`
	SafetyBackup *CorpusBackupResult     `json:"safety_backup,omitempty"`
	Restored     *CorpusBackupResult     `json:"restored"`
}

CorpusRestoreResult reports a verified corpus replacement and its safety backup.

type CoverageFacet

type CoverageFacet struct {
	Facet     string `json:"facet"`
	Present   bool   `json:"present"`
	Complete  bool   `json:"complete"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

type CoverageResult

type CoverageResult struct {
	Repo   RepoRef         `json:"repo"`
	Facets []CoverageFacet `json:"facets"`
}

type CrawlOptions

type CrawlOptions struct {
	Since  time.Duration
	Budget int
}

type CrawlResult

type CrawlResult struct {
	Source       string `json:"source"`
	Windows      int    `json:"windows"`
	Repositories int    `json:"repositories"`
	Threads      int    `json:"threads,omitempty"`
	Events       int    `json:"events,omitempty"`
	Requests     int    `json:"requests"`
	Imported     int    `json:"imported,omitempty"`
	Skipped      int    `json:"skipped,omitempty"`
	Failures     int    `json:"failures,omitempty"`
	Checkpoint   string `json:"checkpoint"`
}

type DefineValidationOptions

type DefineValidationOptions struct {
	Kind                 string
	Command              string
	WorkingDir           string
	BaseWorkingDir       string
	CandidateDir         string
	WorkspaceID          string
	BaseWorkspaceID      string
	CandidateWorkspaceID string
	Env                  []string
	Timeout              time.Duration
	MaxOutputBytes       int64
	Observation          *ValidationObservationContract
	Protocol             string
	ReadinessTimeout     time.Duration
}

DefineValidationOptions carries an explicit validation definition.

type DiscoveryService

type DiscoveryService interface {
	AddSearchSource(ctx context.Context, name, query string) (*SourceResult, error)
	AddRepoSource(ctx context.Context, name string, refs []RepoRef) (*SourceResult, error)
	AddGHArchiveSource(ctx context.Context, name string, events []string) (*SourceResult, error)
	ShowSource(ctx context.Context, name string) (*SourceResult, error)
	ListSources(ctx context.Context) (*SourceListResult, error)
	Crawl(ctx context.Context, name string, opts CrawlOptions) (*CrawlResult, error)
}

DiscoveryService is the optional source and crawl capability used by the CLI without enlarging the core local archive contract.

type DoctorCheck

type DoctorCheck struct {
	Name     string `json:"name"`
	Status   string `json:"status"`
	Required bool   `json:"required"`
	Message  string `json:"message"`
}

type DoctorResult

type DoctorResult struct {
	Healthy bool          `json:"healthy"`
	Checks  []DoctorCheck `json:"checks"`
}

type DossierResult

type DossierResult struct {
	Repo       RepoRef  `json:"repo"`
	Summary    string   `json:"summary"`
	Language   string   `json:"language"`
	Stars      int      `json:"stars"`
	OpenIssues int      `json:"open_issues"`
	Coverage   []string `json:"coverage"`
	Freshness  string   `json:"freshness"`
}

DossierResult is a summary view of a repository.

type DossierService

type DossierService interface {
	BuildRepositoryDossier(ctx context.Context, repo RepoRef) (*domain.Dossier, error)
	GetRepositoryDossier(ctx context.Context, repo RepoRef) (*domain.Dossier, error)
	ExtractSeeds(ctx context.Context, repo RepoRef, opts domain.ExtractSeedsOptions) ([]domain.Seed, error)
}

DossierService exposes typed repository dossier operations.

type DraftDiagnosticResult added in v0.14.0

type DraftDiagnosticResult struct {
	Code       string `json:"code"`
	Severity   string `json:"severity"`
	Message    string `json:"message"`
	ByteOffset int    `json:"byte_offset,omitempty"`
}

type DraftResult

type DraftResult struct {
	ID            string                  `json:"id"`
	Revision      int                     `json:"revision"`
	OpportunityID string                  `json:"opportunity_id"`
	Kind          string                  `json:"kind"`
	Repository    string                  `json:"repository"`
	Title         string                  `json:"title"`
	Body          string                  `json:"body"`
	TitleBytes    int                     `json:"title_bytes"`
	BodyBytes     int                     `json:"body_bytes"`
	TitleSHA256   string                  `json:"title_sha256"`
	BodySHA256    string                  `json:"body_sha256"`
	EvidenceIDs   []string                `json:"evidence_ids,omitempty"`
	Warnings      []DraftDiagnosticResult `json:"warnings,omitempty"`
	RenderedAt    string                  `json:"rendered_at"`
	ManifestID    string                  `json:"manifest_id,omitempty"`
}

DraftResult is a rendered, locally-stored contribution draft.

type DuplicateCheckResult

type DuplicateCheckResult struct {
	HypothesisID   string              `json:"hypothesis_id,omitempty"`
	OpportunityID  string              `json:"opportunity_id,omitempty"`
	Repo           domain.RepoRef      `json:"repo"`
	Query          string              `json:"query"`
	Findings       []evidence.Evidence `json:"findings"`
	SourceRevision string              `json:"source_revision"`
	Limit          int                 `json:"limit"`
	Total          int                 `json:"total"`
}

type EvidenceItem

type EvidenceItem struct {
	ID               string                         `json:"id"`
	Type             string                         `json:"type"`
	Relation         string                         `json:"relation"`
	Description      string                         `json:"description"`
	ValidationRunID  string                         `json:"validation_run_id,omitempty"`
	OpportunityID    string                         `json:"opportunity_id,omitempty"`
	SourceRefs       []WorkflowSourceRefResult      `json:"source_refs,omitempty"`
	SourceProvenance []EvidenceSourceRevisionResult `json:"source_provenance,omitempty"`
	Freshness        string                         `json:"freshness"`
	FreshnessReason  string                         `json:"freshness_reason,omitempty"`
	CreatedAt        string                         `json:"created_at"`
}

EvidenceItem is a single piece of evidence with derived corpus freshness.

type EvidenceResult

type EvidenceResult struct {
	InvestigationID string         `json:"investigation_id"`
	Evidence        []EvidenceItem `json:"evidence"`
}

EvidenceResult is the evidence packet for an investigation.

type EvidenceService

type EvidenceService interface {
	ShowEvidence(ctx context.Context, investigationID string) (*EvidenceResult, error)
}

EvidenceService is the optional evidence reading capability used by the CLI.

type EvidenceSourceRevisionResult

type EvidenceSourceRevisionResult struct {
	Subject             EvidenceSourceSubjectResult `json:"subject"`
	SourceUpdatedAt     string                      `json:"source_updated_at,omitempty"`
	ObservationSequence int64                       `json:"observation_sequence"`
	ObservedAt          string                      `json:"observed_at"`
}

EvidenceSourceRevisionResult is the portable recorded source order.

type EvidenceSourceSubjectResult

type EvidenceSourceSubjectResult struct {
	Kind       string `json:"kind"`
	Owner      string `json:"owner"`
	Repo       string `json:"repo"`
	ThreadKind string `json:"thread_kind,omitempty"`
	Number     int    `json:"number,omitempty"`
	Facet      string `json:"facet,omitempty"`
}

EvidenceSourceSubjectResult identifies the independently refreshed corpus projection used by an evidence item.

type EvidenceSummary

type EvidenceSummary struct {
	Supporting    int `json:"supporting"`
	Contradicting int `json:"contradicting"`
	Inconclusive  int `json:"inconclusive"`
	Stale         int `json:"stale"`
	Invalid       int `json:"invalid"`
	Total         int `json:"total"`
}

type ExportResult

type ExportResult struct {
	Kind    string `json:"kind"`
	Format  string `json:"format"`
	Content string `json:"content"`
}

ExportResult contains one rendered local export.

type ExportService

type ExportService interface {
	ExportDossier(ctx context.Context, repo RepoRef, format string) (*ExportResult, error)
	ExportEvidence(ctx context.Context, investigationID, format string) (*ExportResult, error)
	ExportManifest(ctx context.Context, opportunityID string, opts ManifestExportOptions) (*ExportResult, error)
}

ExportService renders redacted, deterministic local bundles.

type ExternalValidationProvenance added in v0.14.0

type ExternalValidationProvenance struct {
	SchemaVersion  string            `json:"schema_version"`
	Producer       string            `json:"producer"`
	ValidationID   string            `json:"validation_id"`
	ReceiptSHA256  string            `json:"receipt_sha256"`
	Repository     string            `json:"repository,omitempty"`
	Revision       string            `json:"revision,omitempty"`
	ArtifactSHA256 string            `json:"artifact_sha256,omitempty"`
	Provider       string            `json:"provider,omitempty"`
	ExternalRunID  string            `json:"external_run_id,omitempty"`
	Command        []string          `json:"argv,omitempty"`
	WorkingDir     string            `json:"working_dir,omitempty"`
	Environment    map[string]string `json:"environment,omitempty"`
	Artifacts      map[string]string `json:"artifacts,omitempty"`
	Limitations    []string          `json:"limitations,omitempty"`
	Incomplete     bool              `json:"incomplete,omitempty"`
}

type ExternalValidationReceipt added in v0.14.0

type ExternalValidationReceipt struct {
	SchemaVersion   string            `json:"schema_version"`
	Producer        string            `json:"producer"`
	ReceiptSHA256   string            `json:"receipt_sha256"`
	ValidationID    string            `json:"validation_id"`
	InvestigationID string            `json:"investigation_id"`
	OpportunityID   string            `json:"opportunity_id,omitempty"`
	Kind            string            `json:"kind"`
	Repository      string            `json:"repository,omitempty"`
	Revision        string            `json:"revision,omitempty"`
	ArtifactSHA256  string            `json:"artifact_sha256,omitempty"`
	Provider        string            `json:"provider,omitempty"`
	ExternalRunID   string            `json:"external_run_id,omitempty"`
	Command         []string          `json:"argv,omitempty"`
	WorkingDir      string            `json:"working_dir,omitempty"`
	Environment     map[string]string `json:"environment,omitempty"`
	Artifacts       map[string]string `json:"artifacts,omitempty"`
	StartedAt       time.Time         `json:"started_at"`
	CompletedAt     time.Time         `json:"completed_at"`
	ExitCode        int               `json:"exit_code"`
	Classification  string            `json:"classification"`
	Stdout          string            `json:"stdout,omitempty"`
	Stderr          string            `json:"stderr,omitempty"`
	Truncated       bool              `json:"truncated,omitempty"`
	Limitations     []string          `json:"limitations,omitempty"`
	Incomplete      bool              `json:"incomplete,omitempty"`
}

ExternalValidationReceipt is an untrusted producer receipt imported without executing its command.

type HealthService

type HealthService interface {
	RepositoryHealthWithOptions(ctx context.Context, repo RepoRef, opts health.Options) (*health.Report, error)
}

HealthService exposes deterministic offline repository health metrics.

type HydrateOptions

type HydrateOptions struct {
	Kind     string
	Facets   []string
	MaxPages int
}

HydrateOptions selects bounded child facets for one stored thread.

type HydrateResult

type HydrateResult struct {
	Repo     RepoRef         `json:"repo"`
	Number   int             `json:"number"`
	Kind     string          `json:"kind"`
	Facets   []HydratedFacet `json:"facets"`
	Pages    int             `json:"pages"`
	Requests int             `json:"requests"`
	Message  string          `json:"message"`
}

HydrateResult reports the facets retrieved for one issue or pull request.

type HydratedFacet

type HydratedFacet struct {
	Facet    string `json:"facet"`
	Count    int    `json:"count"`
	Pages    int    `json:"pages"`
	Complete bool   `json:"complete"`
}

HydratedFacet reports one retrieved facet's item and coverage counts.

type HypothesisListResult

type HypothesisListResult struct {
	Hypotheses []HypothesisResult `json:"hypotheses"`
}

HypothesisListResult is a collection of hypotheses.

type HypothesisResult

type HypothesisResult struct {
	ID              string                    `json:"id"`
	InvestigationID string                    `json:"investigation_id"`
	Title           string                    `json:"title"`
	Description     string                    `json:"description"`
	Category        string                    `json:"category"`
	Status          string                    `json:"status"`
	SourceRefs      []WorkflowSourceRefResult `json:"source_refs,omitempty"`
	Links           []WorkflowLinkResult      `json:"links,omitempty"`
	AuditTrail      []WorkflowAuditResult     `json:"audit_trail,omitempty"`
	CreatedAt       string                    `json:"created_at"`
	UpdatedAt       string                    `json:"updated_at"`
}

HypothesisResult is a single hypothesis view.

type HypothesisUpdateOptions

type HypothesisUpdateOptions struct {
	Title              *string
	Description        *string
	Category           *string
	ExpectedBehavior   *string
	ObservedBehavior   *string
	PotentialImpact    *string
	OpenQuestions      []string
	AffectedComponents []string
	Rationale          string
}

type IndexResult

type IndexResult struct {
	Repo     RepoRef `json:"repo"`
	Path     string  `json:"path"`
	Commit   string  `json:"commit"`
	Files    int     `json:"files"`
	Bytes    int     `json:"bytes"`
	Inserted bool    `json:"inserted"`
	Message  string  `json:"message"`
}

IndexResult reports one immutable local code snapshot.

type InitResult

type InitResult struct {
	Path    string `json:"path"`
	Message string `json:"message"`
}

InitResult is the result of initializing a local corpus.

type InvestigationListResult

type InvestigationListResult struct {
	Investigations []InvestigationResult `json:"investigations"`
}

InvestigationListResult is a collection of investigations.

type InvestigationResult

type InvestigationResult struct {
	ID               string                `json:"id"`
	Repo             RepoRef               `json:"repo"`
	CommitSHA        string                `json:"commit_sha,omitempty"`
	Lens             string                `json:"lens,omitempty"`
	Status           string                `json:"status"`
	ThreadBaseline   *ThreadBaselineResult `json:"thread_baseline,omitempty"`
	SeedHypothesisID string                `json:"seed_hypothesis_id,omitempty"`
	AuditTrail       []WorkflowAuditResult `json:"audit_trail,omitempty"`
	CreatedAt        string                `json:"created_at"`
	UpdatedAt        string                `json:"updated_at"`
}

InvestigationResult is a single investigation view.

type InvestigationService

type InvestigationService interface {
	StartInvestigation(ctx context.Context, repo RepoRef, commit, lens string) (*InvestigationResult, error)
	ShowInvestigation(ctx context.Context, id string) (*InvestigationResult, error)
	ListInvestigations(ctx context.Context) (*InvestigationListResult, error)
	AddHypothesis(ctx context.Context, investigationID, title, description, category string) (*HypothesisResult, error)
	ListHypotheses(ctx context.Context, investigationID string) (*HypothesisListResult, error)
	PromoteOpportunity(ctx context.Context, hypothesisID, problem, scope, impact, effort string, confidence float64) (*OpportunityResult, error)
	ShowOpportunity(ctx context.Context, id string) (*OpportunityResult, error)
	ListOpportunities(ctx context.Context, investigationID string) (*OpportunityListResult, error)
	SetOpportunityStatus(ctx context.Context, id, status, rationale string) (*OpportunityResult, error)
}

InvestigationService is the optional investigation and opportunity management capability used by the CLI.

type JobListResult

type JobListResult struct {
	Jobs []JobResult `json:"jobs"`
}

type JobResult

type JobResult struct {
	ID           string `json:"id"`
	Kind         string `json:"kind"`
	Status       string `json:"status"`
	Request      string `json:"request,omitempty"`
	Result       string `json:"result,omitempty"`
	Error        string `json:"error,omitempty"`
	Progress     string `json:"progress,omitempty"`
	Statistics   string `json:"statistics,omitempty"`
	CreatedAt    string `json:"created_at"`
	StartedAt    string `json:"started_at,omitempty"`
	CompletedAt  string `json:"completed_at,omitempty"`
	CancelledAt  string `json:"cancelled_at,omitempty"`
	Cancellation bool   `json:"cancellation_requested"`
}

type JobService

type JobService interface {
	ListJobs(ctx context.Context, status string, limit int) (*JobListResult, error)
	GetJob(ctx context.Context, id string) (*JobResult, error)
	CancelJob(ctx context.Context, id string) (*JobResult, error)
}

JobService exposes durable background job state and cancellation.

type LensExplainCandidate

type LensExplainCandidate struct {
	Kind      string  `json:"kind"`
	Repo      RepoRef `json:"repo"`
	Number    int     `json:"number,omitempty"`
	Title     string  `json:"title"`
	State     string  `json:"state,omitempty"`
	URL       string  `json:"url,omitempty"`
	UpdatedAt string  `json:"updated_at,omitempty"`
}

LensExplainCandidate identifies the explained result.

type LensExplainOptions

type LensExplainOptions struct {
	Query        string
	Repo         string
	Kind         string
	State        string
	Author       string
	Association  string
	Assignee     string
	Labels       []string
	UpdatedAfter time.Time
}

type LensExplainResult

type LensExplainResult struct {
	Lens            LensResult           `json:"lens"`
	Candidate       LensExplainCandidate `json:"candidate"`
	Query           string               `json:"query,omitempty"`
	PopulationSize  int                  `json:"population_size"`
	PopulationScope string               `json:"population_scope"`
	EvaluatedAt     string               `json:"evaluated_at"`
	Score           float64              `json:"score"`
	Signals         []LensExplainSignal  `json:"signals"`
	MissingSignals  []string             `json:"missing_signals,omitempty"`
}

LensExplainResult explains a saved lens score for one candidate.

type LensExplainSignal

type LensExplainSignal struct {
	Name         string  `json:"name"`
	Value        float64 `json:"value,omitempty"`
	Normalized   float64 `json:"normalized,omitempty"`
	Weight       float64 `json:"weight"`
	Contribution float64 `json:"contribution"`
	Missing      bool    `json:"missing"`
}

LensExplainSignal exposes one signal value, normalization, and contribution.

type LensListResult

type LensListResult struct {
	Lenses    []LensResult `json:"lenses"`
	Total     int          `json:"total"`
	Truncated bool         `json:"truncated"`
}

LensListResult is a list of saved lenses.

type LensResult

type LensResult struct {
	Name       string          `json:"name"`
	Definition lens.Definition `json:"definition"`
	CreatedAt  string          `json:"created_at"`
	UpdatedAt  string          `json:"updated_at"`
}

LensResult is a saved lens definition.

type LensService

type LensService interface {
	AddLens(ctx context.Context, name string, def lens.Definition) (*LensResult, error)
	ListLenses(ctx context.Context) (*LensListResult, error)
	ShowLens(ctx context.Context, name string) (*LensResult, error)
	ExplainLens(ctx context.Context, name, ref string, opts LensExplainOptions) (*LensExplainResult, error)
}

LensService is the optional saved-lens management capability used by the CLI.

type ListContributionsOptions

type ListContributionsOptions struct {
	OpportunityID string
	Kind          string
	Limit         int
}

ListContributionsOptions filters and bounds contribution history.

type ListTriageEventsOptions

type ListTriageEventsOptions struct {
	TargetKind string
	TargetRef  string
	Outcome    string
	Lens       string
	Limit      int
}

type LocalQueryService

type LocalQueryService interface {
	Coverage(ctx context.Context, repo RepoRef) (*CoverageResult, error)
	RunHistory(ctx context.Context, limit int) (*RunListResult, error)
	NeighborQuery(ctx context.Context, repo RepoRef, kind string, number, limit int) (*NeighborListResult, error)
}

LocalQueryService exposes bounded offline corpus queries.

type MCPOptions

type MCPOptions struct {
	Transport string
	ReadOnly  bool
}

MCPOptions carries MCP server startup options.

type MCPRunner

type MCPRunner interface {
	Run(ctx context.Context, opts MCPOptions) error
}

MCPRunner is the product-owned boundary for running an MCP server. The CLI adapter dispatches to it and does not own MCP protocol details.

type ManifestExportOptions

type ManifestExportOptions struct {
	WorkspaceID string
	PullRequest *ManifestPullRequestRef
}

ManifestExportOptions selects optional local identities for a manifest export.

type ManifestPullRequestRef

type ManifestPullRequestRef struct {
	Owner  string
	Repo   string
	Number int
}

ManifestPullRequestRef identifies one exact stored pull request.

type MetadataExportOptions

type MetadataExportOptions struct {
	Limit int
}

MetadataExportOptions bounds a local tracking metadata export.

type MetadataExportResult

type MetadataExportResult struct {
	SchemaVersion        int             `json:"schema_version"`
	Data                 json.RawMessage `json:"data"`
	TriageEvents         int             `json:"triage_events"`
	Contributions        int             `json:"contributions"`
	ContributionOutcomes int             `json:"contribution_outcomes"`
	Evidence             int             `json:"evidence"`
}

MetadataExportResult contains the exported tracking bundle and record counts.

type MetadataImportOptions

type MetadataImportOptions struct {
	Data []byte
}

MetadataImportOptions carries a serialized local tracking bundle.

type MetadataImportResult

type MetadataImportResult struct {
	SchemaVersion        int `json:"schema_version"`
	TriageEvents         int `json:"triage_events"`
	Contributions        int `json:"contributions"`
	ContributionOutcomes int `json:"contribution_outcomes"`
	Evidence             int `json:"evidence"`
}

MetadataImportResult reports the imported bundle version and record counts.

type MetadataResult

type MetadataResult struct {
	Name                   string          `json:"name"`
	Version                string          `json:"version"`
	GoVersion              string          `json:"go_version"`
	OS                     string          `json:"os"`
	Architecture           string          `json:"architecture"`
	SchemaVersion          int64           `json:"schema_version"`
	SupportedSchemaVersion int64           `json:"supported_schema_version"`
	ConfigPath             string          `json:"config_path"`
	CorpusPath             string          `json:"corpus_path"`
	Capabilities           []string        `json:"capabilities"`
	Features               map[string]bool `json:"features"`
}

type NeighborListResult

type NeighborListResult struct {
	Repo           RepoRef          `json:"repo"`
	Kind           string           `json:"kind"`
	Number         int              `json:"number"`
	SourceRevision string           `json:"source_revision"`
	Neighbors      []NeighborResult `json:"neighbors"`
}

type NeighborResult

type NeighborResult struct {
	Kind   string  `json:"kind"`
	Repo   RepoRef `json:"repo"`
	Number int     `json:"number"`
	Title  string  `json:"title"`
	State  string  `json:"state"`
	Score  float64 `json:"score"`
	Reason string  `json:"reason"`
}

type OpportunityListResult

type OpportunityListResult struct {
	Opportunities []OpportunityResult `json:"opportunities"`
	Filter        string              `json:"filter,omitempty"`
}

OpportunityListResult is a collection of opportunities.

type OpportunityResult

type OpportunityResult struct {
	ID               string  `json:"id"`
	InvestigationID  string  `json:"investigation_id"`
	HypothesisID     string  `json:"hypothesis_id"`
	Title            string  `json:"title"`
	ProblemStatement string  `json:"problem_statement"`
	Category         string  `json:"category"`
	Scope            string  `json:"scope"`
	Impact           string  `json:"impact"`
	ExpectedEffort   string  `json:"expected_effort"`
	Confidence       float64 `json:"confidence"`
	CollisionStatus  string  `json:"collision_status"`
	Status           string  `json:"status"`
	CreatedAt        string  `json:"created_at"`
	UpdatedAt        string  `json:"updated_at"`
}

OpportunityResult is a single opportunity view.

type PrepareIssueOptions

type PrepareIssueOptions struct {
	Guidance   string
	Success    string
	ManifestID string
}

PrepareIssueOptions carries optional fields for issue preparation.

type PreparePROptions

type PreparePROptions struct {
	WorkspaceID   string
	Approach      string
	Changes       string
	Compatibility string
	Limitations   string
	LinkedIssue   string
	Guidance      string
	ManifestID    string
}

PreparePROptions carries explicit and optional fields for PR preparation.

type PrepareReviewReportInput

type PrepareReviewReportInput struct {
	OpportunityID string
	WorkspaceID   string
}

type PublishedDraftDifference added in v0.14.0

type PublishedDraftDifference struct {
	FirstDifferingLine int `json:"first_differing_line,omitempty"`
	DraftBytes         int `json:"draft_bytes"`
	PublishedBytes     int `json:"published_bytes"`
}

type PublishedDraftVerification added in v0.14.0

type PublishedDraftVerification struct {
	Status               string                    `json:"status"`
	DraftID              string                    `json:"draft_id"`
	Revision             int                       `json:"revision"`
	PublishedRef         string                    `json:"published_ref"`
	TitleComparison      string                    `json:"title_comparison,omitempty"`
	BodyComparison       string                    `json:"body_comparison,omitempty"`
	DraftTitleSHA256     string                    `json:"draft_title_sha256"`
	DraftBodySHA256      string                    `json:"draft_body_sha256"`
	PublishedTitleSHA256 string                    `json:"published_title_sha256,omitempty"`
	PublishedBodySHA256  string                    `json:"published_body_sha256,omitempty"`
	ObservedAt           string                    `json:"observed_at,omitempty"`
	SourceUpdatedAt      string                    `json:"source_updated_at,omitempty"`
	CoverageStatus       string                    `json:"coverage_status"`
	Difference           *PublishedDraftDifference `json:"difference,omitempty"`
	Reason               string                    `json:"reason,omitempty"`
}

type RadarOptions

type RadarOptions struct {
	Repo  RepoRef
	Limit int
}

RadarOptions scopes one bounded, offline contribution ranking.

type RadarService

type RadarService interface {
	ContributionRadar(ctx context.Context, opts RadarOptions) (*radar.Report, error)
}

RadarService exposes explainable contribution ranking as a separate, optional offline-read capability.

type RateLimitState

type RateLimitState struct {
	Resource   string `json:"resource"`
	Limit      int    `json:"limit"`
	Remaining  int    `json:"remaining"`
	Used       int    `json:"used"`
	ResetAt    string `json:"reset_at,omitempty"`
	StatusCode int    `json:"status_code"`
	ObservedAt string `json:"observed_at"`
}

type ReadinessCheck

type ReadinessCheck struct {
	CheckID      string   `json:"check_id"`
	RuleID       string   `json:"rule_id"`
	RuleVersion  string   `json:"rule_version"`
	Status       string   `json:"status"`
	Summary      string   `json:"summary"`
	EvidenceRefs []string `json:"evidence_refs,omitempty"`
	Remediation  string   `json:"remediation,omitempty"`
	EvaluatedAt  string   `json:"evaluated_at"`
}

ReadinessCheck is one explainable readiness rule result.

type ReadinessResult

type ReadinessResult struct {
	OpportunityID  string           `json:"opportunity_id"`
	RuleSetVersion string           `json:"rule_set_version"`
	Status         string           `json:"status"`
	EvaluatedAt    string           `json:"evaluated_at"`
	Checks         []ReadinessCheck `json:"checks"`
}

ReadinessResult is the deterministic readiness report for one opportunity.

type ReadinessService

type ReadinessService interface {
	OpportunityReadiness(ctx context.Context, opportunityID string) (*ReadinessResult, error)
	ExplainReadiness(ctx context.Context, checkID string) (*ReadinessCheck, error)
}

ReadinessService is the optional contribution readiness capability used by the CLI.

type RecordContributionOptions

type RecordContributionOptions struct {
	OpportunityID string
	Kind          string
	Title         string
	Body          string
	Reference     string
	ReferenceURL  string
}

RecordContributionOptions describes a prepared contribution to persist.

type RecordContributionOutcomeOptions

type RecordContributionOutcomeOptions struct {
	ContributionID string
	Outcome        string
	Reason         string
}

RecordContributionOutcomeOptions describes an outcome to attach to a contribution.

type RecordEvidenceInput

type RecordEvidenceInput struct {
	InvestigationID  string
	HypothesisID     string
	OpportunityID    string
	Type             string
	Relation         string
	Description      string
	SourceRefs       []domain.SourceRef
	SourceProvenance []evidence.SourceRevision
}

type RecordTriageEventOptions

type RecordTriageEventOptions struct {
	Target  string
	Outcome string
	Reason  string
	Lens    string
}

type RepeatValidationOptions

type RepeatValidationOptions struct {
	Kinds          []string
	RunCount       int
	Concurrency    int
	PerRunTimeout  time.Duration
	OverallTimeout time.Duration
	SampleInterval time.Duration
	Execute        bool
}

RepeatValidationOptions bounds an explicitly authorized run group.

type RepoRef

type RepoRef struct {
	Owner string `json:"owner"`
	Repo  string `json:"repo"`
}

RepoRef identifies a GitHub repository.

func (RepoRef) String

func (r RepoRef) String() string

type RepositoryContextResult added in v0.13.0

type RepositoryContextResult struct {
	Repo            RepoRef `json:"repo"`
	Requests        int     `json:"requests"`
	PlannedRequests int     `json:"planned_requests"`
	RequestBudget   int     `json:"request_budget"`
	Message         string  `json:"message"`
}

RepositoryContextResult reports one repository metadata and guidance refresh.

type ResearchService

type ResearchService interface {
	ThreadResearchBrief(ctx context.Context, ref research.ThreadRef) (*research.Brief, error)
}

ResearchService exposes deterministic local thread briefs as an optional offline-read capability.

type ReviewReport

type ReviewReport struct {
	OpportunityID        string               `json:"opportunity_id,omitempty"`
	WorkspaceID          string               `json:"workspace_id,omitempty"`
	Repo                 RepoRef              `json:"repo"`
	OpportunityStatus    string               `json:"opportunity_status,omitempty"`
	CollisionStatus      string               `json:"collision_status,omitempty"`
	CollisionFindings    []evidence.Evidence  `json:"collision_findings"`
	DiffMetadata         *WorkspaceDiffResult `json:"diff_metadata,omitempty"`
	EvidenceSummary      EvidenceSummary      `json:"evidence_summary"`
	SuggestedReviewOrder []ReviewStep         `json:"suggested_review_order"`
	RenderedAt           time.Time            `json:"rendered_at"`
}

type ReviewStep

type ReviewStep struct {
	Path      string `json:"path"`
	Priority  int    `json:"priority"`
	Rationale string `json:"rationale"`
}

type RunListResult

type RunListResult struct {
	Runs []RunResult `json:"runs"`
}

type RunResult

type RunResult struct {
	ID          int64  `json:"id"`
	Kind        string `json:"kind"`
	Status      string `json:"status"`
	StartedAt   string `json:"started_at"`
	CompletedAt string `json:"completed_at,omitempty"`
	Stats       string `json:"stats,omitempty"`
	Error       string `json:"error,omitempty"`
}

type RunValidationOptions

type RunValidationOptions struct {
	Kind    string
	Execute bool
}

RunValidationOptions carries the run target and explicit host-execution authorization.

type RuntimeContractResult

type RuntimeContractResult struct {
	Name                   string `json:"name"`
	Version                string `json:"version"`
	SupportedSchemaLineage string `json:"supported_schema_lineage"`
	SupportedSchemaVersion int64  `json:"supported_schema_version"`
}

RuntimeContractResult is immutable executable compatibility metadata.

type RuntimeContractService

type RuntimeContractService interface {
	RuntimeContract(ctx context.Context) (*RuntimeContractResult, error)
}

RuntimeContractService reports only immutable executable compatibility metadata. Implementations must not inspect configuration or the corpus.

type SearchMatch

type SearchMatch struct {
	Kind           string   `json:"kind"`
	Repo           RepoRef  `json:"repo"`
	Title          string   `json:"title"`
	Number         int      `json:"number,omitempty"`
	State          string   `json:"state,omitempty"`
	Author         string   `json:"author,omitempty"`
	Labels         []string `json:"labels,omitempty"`
	URL            string   `json:"url,omitempty"`
	Score          float64  `json:"score"`
	Body           string   `json:"-"`
	Freshness      string   `json:"freshness,omitempty"`
	Coverage       []string `json:"coverage,omitempty"`
	MatchSource    string   `json:"match_source,omitempty"`
	MatchExcerpt   string   `json:"match_excerpt,omitempty"`
	MatchTruncated bool     `json:"match_truncated,omitempty"`
}

SearchMatch is one local search result.

type SearchOptions

type SearchOptions struct {
	Kind          string
	Repo          string
	State         string
	StateReason   string
	Merged        *bool
	Author        string
	Association   string
	Assignee      string
	Labels        []string
	UpdatedAfter  time.Time
	UpdatedBefore time.Time
	Limit         int
	Cursor        string
	Lens          string
	Sort          string
	MatchMode     string
	// SnapshotToken pins this read to one product-owned corpus state.
	SnapshotToken string
}

SearchOptions carries parameters for a local corpus search.

type SearchResult

type SearchResult struct {
	Query                string        `json:"query"`
	Kind                 string        `json:"kind"`
	Repo                 string        `json:"repo,omitempty"`
	Limit                int           `json:"limit"`
	Total                int           `json:"total"`
	Matches              []SearchMatch `json:"matches"`
	NextCursor           string        `json:"next_cursor,omitempty"`
	UnknownMergeCount    int           `json:"unknown_merge_count,omitempty"`
	SnapshotToken        string        `json:"snapshot_token"`
	ObservationWatermark int64         `json:"observation_watermark"`
}

SearchResult is the result of a local corpus search.

type Service

type Service interface {
	Init(ctx context.Context) (*InitResult, error)
	Status(ctx context.Context) (*StatusResult, error)
	Search(ctx context.Context, query string, opts SearchOptions) (*SearchResult, error)
	Dossier(ctx context.Context, repo RepoRef) (*DossierResult, error)
	Index(ctx context.Context, repo RepoRef, path string) (*IndexResult, error)
}

Service is the product-owned application interface used by the CLI and MCP adapters. Implementations live outside the CLI package and must not leak CLI or transport concerns.

type SetupAuthentication

type SetupAuthentication struct {
	Method string `json:"method"`
	Key    string `json:"key,omitempty"`
}

SetupAuthentication describes the credential source recorded by setup. It never contains a credential value and does not imply that credentials were read or validated.

type SetupClientDiscovery

type SetupClientDiscovery struct {
	Name       string
	Path       string
	Detected   bool
	Registered bool
	Error      string
}

SetupClientDiscovery describes one supported coding client and the exact configuration file GitContribute would update.

type SetupDiscovery

type SetupDiscovery struct {
	Version               string
	Clients               []SetupClientDiscovery
	ConfiguredTokenSource string
	ConfiguredTokenKey    string
	GitHubCLIAvailable    bool
	EnvironmentKeyPresent bool
}

SetupDiscovery is a read-only snapshot used to choose sensible onboarding defaults. Discovery never authenticates, performs network access, or writes configuration.

type SetupMCPCommand

type SetupMCPCommand struct {
	Command string   `json:"command"`
	Args    []string `json:"args"`
}

SetupMCPCommand preserves the executable and argument boundaries registered with coding clients.

type SetupMode

type SetupMode string

SetupMode selects one complete onboarding strategy.

const (
	// SetupModeMCP installs private MCP access without a global CLI command.
	SetupModeMCP SetupMode = "mcp"
	// SetupModeCLI installs the global CLI without coding-agent configuration.
	SetupModeCLI SetupMode = "cli"
	// SetupModeBoth installs the global CLI and configures coding-agent MCP access.
	SetupModeBoth SetupMode = "both"
)

func (SetupMode) ConfiguresMCP

func (m SetupMode) ConfiguresMCP() bool

ConfiguresMCP reports whether setup should register coding-agent access.

func (SetupMode) InstallsCLI

func (m SetupMode) InstallsCLI() bool

InstallsCLI reports whether setup should install the global command.

type SetupObserver

type SetupObserver interface {
	SetupStarted(phase SetupPhase)
	SetupCompleted(step SetupStep)
}

SetupObserver receives repository-owned progress events. Implementations must return promptly and must not alter setup behavior.

type SetupOptions

type SetupOptions struct {
	Remove     bool
	Mode       SetupMode
	Clients    []string
	AllClients bool

	TokenSource    string
	TokenSourceKey string
	Repository     string
	DryRun         bool
	// Version is the release used for persistent CLI or private MCP runtime
	// installation. Empty values inherit the running service version.
	Version string
	// Executable is the packaged native program copied for MCP-only setup. It is
	// injectable so installation behavior can be tested without copying the test
	// process itself.
	Executable string
}

SetupOptions selects one access mode and its explicit targets. DryRun plans the selected mode without invoking npm or writing local state.

type SetupPhase

type SetupPhase string

SetupPhase identifies a long-running application operation.

const (
	// SetupPhaseCLI installs and verifies the persistent terminal command.
	SetupPhaseCLI SetupPhase = "cli"
	// SetupPhaseMCPRuntime installs the private native runtime used by MCP-only setup.
	SetupPhaseMCPRuntime SetupPhase = "mcp-runtime"
	// SetupPhaseConfiguration writes shared local configuration.
	SetupPhaseConfiguration SetupPhase = "configuration"
	// SetupPhaseCorpus initializes the local corpus.
	SetupPhaseCorpus SetupPhase = "corpus"
	// SetupPhaseClients registers the MCP server with selected clients.
	SetupPhaseClients SetupPhase = "clients"
	// SetupPhaseRepository adds the optional initial repository source.
	SetupPhaseRepository SetupPhase = "repository"
	// SetupPhaseVerification checks the completed local installation.
	SetupPhaseVerification SetupPhase = "verification"
)

type SetupReport

type SetupReport struct {
	Operation         string                  `json:"operation"`
	DryRun            bool                    `json:"dry_run"`
	MCPCommand        *SetupMCPCommand        `json:"mcp_command,omitempty"`
	MCPCommandPending bool                    `json:"mcp_command_pending,omitempty"`
	RestartClients    []string                `json:"restart_clients,omitempty"`
	Authentication    *SetupAuthentication    `json:"authentication,omitempty"`
	Corpus            *CorpusInspectionResult `json:"corpus,omitempty"`
	Steps             []SetupStep             `json:"steps"`
}

SetupReport records the effects attempted by setup. MCPCommand is populated only when MCP was selected. A report may contain both successful and failed independent steps.

func (*SetupReport) HasFailures

func (r *SetupReport) HasFailures() bool

HasFailures reports whether setup could not produce a usable result. A nil report is a failure because callers cannot verify any planned or applied step.

type SetupService

type SetupService interface {
	DiscoverSetup(ctx context.Context) (*SetupDiscovery, error)
	Setup(ctx context.Context, opts SetupOptions) (*SetupReport, error)
	SetupWithProgress(ctx context.Context, opts SetupOptions, observer SetupObserver) (*SetupReport, error)
}

SetupService exposes local onboarding and client-registration operations. Setup may install a private MCP runtime, invoke npm for the global CLI, write local configuration, and initialize the corpus. It must not perform GitHub network access or execute repository-controlled code.

type SetupStep

type SetupStep struct {
	Name    string `json:"name"`
	Path    string `json:"path,omitempty"`
	Status  string `json:"status"`
	Message string `json:"message,omitempty"`
}

SetupStep describes one independently observable setup effect. Status is a stable human-readable state such as "would install", "installed", "configured", "not installed", or "failed".

type SourceListResult

type SourceListResult struct {
	Sources   []SourceResult `json:"sources"`
	Total     int            `json:"total"`
	Truncated bool           `json:"truncated"`
}

type SourceResult

type SourceResult struct {
	Name       string `json:"name"`
	Kind       string `json:"kind"`
	Definition string `json:"definition"`
	Enabled    bool   `json:"enabled"`
}

type StatusResult

type StatusResult struct {
	Healthy bool   `json:"healthy"`
	Corpus  string `json:"corpus"`
	Version string `json:"version"`
	Message string `json:"message"`
}

StatusResult reports the health and identity of the local corpus.

type SyncPlanResult

type SyncPlanResult struct {
	Repo                 RepoRef `json:"repo"`
	FixedRequests        int     `json:"fixed_requests"`
	ThreadRequestCeiling int     `json:"thread_request_ceiling"`
	PlannedRequests      int     `json:"planned_requests"`
	RequestBudget        int     `json:"request_budget"`
	MaxPages             int     `json:"max_pages"`
	ExactThreads         int     `json:"exact_threads"`
}

SyncPlanResult is the conservative request ceiling computed before a sync obtains a GitHub reader or writes the corpus.

type SyncPlanningService

type SyncPlanningService interface {
	PlanRepositoryContextSync(ctx context.Context, repo RepoRef, maxRequests int) (*SyncPlanResult, error)
	PlanArchiveSync(ctx context.Context, repo RepoRef, opts ArchiveSyncOptions) (*SyncPlanResult, error)
}

SyncPlanningService computes a bounded request plan without network or corpus access.

type SyncResult

type SyncResult struct {
	Repo            RepoRef         `json:"repo"`
	Threads         []SyncThreadRef `json:"threads,omitempty"`
	Updated         int             `json:"updated"`
	Requests        int             `json:"requests"`
	PlannedRequests int             `json:"planned_requests"`
	RequestBudget   int             `json:"request_budget"`
	Capped          bool            `json:"request_capped"`
	Message         string          `json:"message"`
}

type SyncThreadRef added in v0.17.0

type SyncThreadRef struct {
	Owner  string `json:"owner"`
	Repo   string `json:"repo"`
	Kind   string `json:"kind"`
	Number int    `json:"number"`
}

SyncResult reports the outcome of syncing a repository.

type TUIOptions

type TUIOptions struct {
	Repo RepoRef
	JSON bool
}

type TUIRunner

type TUIRunner interface {
	Run(ctx context.Context, opts TUIOptions) error
}

TUIRunner is the terminal UI adapter boundary.

type TailOptions

type TailOptions struct {
	Since    time.Duration
	Budget   int
	Interval time.Duration
	Once     bool
}

type TailResult

type TailResult struct {
	Source     string       `json:"source"`
	Iterations int          `json:"iterations"`
	Last       *CrawlResult `json:"last,omitempty"`
}

type TailService

type TailService interface {
	TailSource(ctx context.Context, name string, opts TailOptions) (*TailResult, error)
}

TailService exposes continuous source execution separately from the stable discovery interface so lightweight clients can opt in explicitly.

type ThreadBaselineResult

type ThreadBaselineResult struct {
	Ref                  string                  `json:"ref"`
	Repository           string                  `json:"repository"`
	Kind                 string                  `json:"kind"`
	Number               int                     `json:"number"`
	ObservationID        int64                   `json:"observation_id"`
	SourceUpdatedAt      string                  `json:"source_updated_at,omitempty"`
	ObservationSequence  int64                   `json:"observation_sequence"`
	ObservedAt           string                  `json:"observed_at,omitempty"`
	Source               WorkflowSourceRefResult `json:"source"`
	DescriptionTruncated bool                    `json:"description_truncated"`
}

ThreadBaselineResult is the immutable observation revision saved at start.

type ThreadInvestigationResult

type ThreadInvestigationResult struct {
	Created       bool                 `json:"created"`
	Investigation *InvestigationResult `json:"investigation"`
	Hypothesis    *HypothesisResult    `json:"hypothesis"`
}

ThreadInvestigationResult contains the atomically created or reused pair.

type ThreadInvestigationService

type ThreadInvestigationService interface {
	StartInvestigationFromThread(ctx context.Context, ref research.ThreadRef) (*ThreadInvestigationResult, error)
}

ThreadInvestigationService starts an investigation and seed hypothesis from one stored thread.

type ThreadListItem

type ThreadListItem struct {
	Kind      string   `json:"kind"`
	Number    int      `json:"number"`
	State     string   `json:"state"`
	Title     string   `json:"title"`
	Author    string   `json:"author,omitempty"`
	Labels    []string `json:"labels,omitempty"`
	UpdatedAt string   `json:"updated_at"`
}

type ThreadListResult

type ThreadListResult struct {
	Repo      RepoRef          `json:"repo"`
	Threads   []ThreadListItem `json:"threads"`
	Freshness string           `json:"freshness,omitempty"`
	Coverage  []CoverageFacet  `json:"coverage,omitempty"`
}

type TrackingService

type TrackingService interface {
	RecordTriageEvent(ctx context.Context, opts RecordTriageEventOptions) (*TriageEventResult, error)
	ListTriageEvents(ctx context.Context, opts ListTriageEventsOptions) (*TriageEventListResult, error)
	RecordContribution(ctx context.Context, opts RecordContributionOptions) (*ContributionResult, error)
	GetContribution(ctx context.Context, id string) (*ContributionResult, error)
	ListContributions(ctx context.Context, opts ListContributionsOptions) (*ContributionListResult, error)
	RecordContributionOutcome(ctx context.Context, opts RecordContributionOutcomeOptions) (*ContributionOutcomeResult, error)
	ListContributionOutcomes(ctx context.Context, contributionID string) (*ContributionOutcomeListResult, error)
	ExportLocalMetadata(ctx context.Context, opts MetadataExportOptions) (*MetadataExportResult, error)
	ImportLocalMetadata(ctx context.Context, opts MetadataImportOptions) (*MetadataImportResult, error)
}

TrackingService exposes local triage, contribution, and metadata portability operations. Implementations must keep local state separate from GitHub state and must not perform network access.

type TriageEventListResult

type TriageEventListResult struct {
	Events []TriageEventResult `json:"events"`
	Limit  int                 `json:"limit"`
	Total  int                 `json:"total"`
}

type TriageEventResult

type TriageEventResult struct {
	ID            string `json:"id"`
	TargetKind    string `json:"target_kind"`
	TargetRef     string `json:"target_ref"`
	Outcome       string `json:"outcome"`
	Reason        string `json:"reason,omitempty"`
	Lens          string `json:"lens,omitempty"`
	SourceEventAt string `json:"source_event_at,omitempty"`
	CreatedAt     string `json:"created_at"`
	UpdatedAt     string `json:"updated_at"`
}

type UpgradeConfiguredClient

type UpgradeConfiguredClient struct {
	Name    string `json:"name"`
	Path    string `json:"path,omitempty"`
	Version string `json:"version,omitempty"`
	Status  string `json:"status"`
	Message string `json:"message,omitempty"`
}

UpgradeConfiguredClient reports one coding client's runtime registration.

type UpgradeOptions

type UpgradeOptions struct {
	Check bool
	Yes   bool
}

type UpgradeReport

type UpgradeReport struct {
	Context           string                    `json:"context"`
	Current           string                    `json:"current"`
	Latest            string                    `json:"latest,omitempty"`
	Status            string                    `json:"status"`
	Command           string                    `json:"command,omitempty"`
	Action            string                    `json:"action,omitempty"`
	Rollback          string                    `json:"rollback,omitempty"`
	RestartClients    []string                  `json:"restart_clients,omitempty"`
	Stages            []UpgradeStage            `json:"stages"`
	ConfiguredClients []UpgradeConfiguredClient `json:"configured_clients,omitempty"`
}

UpgradeReport describes installation, compatibility, activation, and rollback.

type UpgradeService

type UpgradeService interface {
	Upgrade(ctx context.Context, opts UpgradeOptions) (*UpgradeReport, error)
}

type UpgradeStage

type UpgradeStage struct {
	Name    string `json:"name"`
	Status  string `json:"status"`
	Path    string `json:"path,omitempty"`
	Version string `json:"version,omitempty"`
	Target  string `json:"target,omitempty"`
	Message string `json:"message,omitempty"`
}

UpgradeStage reports one inspectable upgrade stage.

type ValidationAggregateResult

type ValidationAggregateResult struct {
	Kind                   string `json:"kind"`
	Requested              int    `json:"requested"`
	Completed              int    `json:"completed"`
	Passing                int    `json:"passing"`
	Failing                int    `json:"failing"`
	Inconclusive           int    `json:"inconclusive"`
	Cancelled              int    `json:"cancelled"`
	Classification         string `json:"classification"`
	ResourceClassification string `json:"resource_classification"`
}

ValidationAggregateResult classifies comparable attempts for one run kind.

type ValidationAttemptResult

type ValidationAttemptResult struct {
	Index             int                         `json:"index"`
	Kind              string                      `json:"kind"`
	RunID             string                      `json:"run_id,omitempty"`
	StartedAt         string                      `json:"started_at"`
	CompletedAt       string                      `json:"completed_at"`
	ExitCode          int                         `json:"exit_code"`
	Classification    string                      `json:"classification"`
	ObservationStatus string                      `json:"observation_status"`
	TimeoutPhase      string                      `json:"timeout_phase,omitempty"`
	FailurePhase      string                      `json:"failure_phase,omitempty"`
	Error             string                      `json:"error,omitempty"`
	Process           ValidationProcessIdentity   `json:"process"`
	Phases            ValidationRunPhases         `json:"phases"`
	Resources         ValidationResourceTelemetry `json:"resources"`
	Cleanup           ValidationCleanupResult     `json:"cleanup"`
}

ValidationAttemptResult summarizes one independently timed attempt.

type ValidationCleanupResult

type ValidationCleanupResult struct {
	Status    string                      `json:"status"`
	Reason    string                      `json:"reason,omitempty"`
	Survivors []ValidationProcessIdentity `json:"survivors,omitempty"`
	CheckedAt string                      `json:"checked_at,omitempty"`
}

ValidationCleanupResult reports sampled descendants after shutdown.

type ValidationComparisonResult

type ValidationComparisonResult struct {
	Base           *ValidationRunResult `json:"base"`
	Candidate      *ValidationRunResult `json:"candidate"`
	Classification string               `json:"classification"`
	Explanation    string               `json:"explanation"`
}

ValidationComparisonResult classifies a base run against a candidate run.

type ValidationExpectedObservation

type ValidationExpectedObservation struct {
	Name       string `json:"name"`
	Source     string `json:"source"`
	Matcher    string `json:"matcher"`
	Pattern    string `json:"pattern"`
	Occurrence string `json:"occurrence"`
	Path       string `json:"path,omitempty"`
}

ValidationExpectedObservation is one assertion over captured output or a declared artifact.

type ValidationGroupComparisonResult

type ValidationGroupComparisonResult struct {
	Classification string `json:"classification"`
	Explanation    string `json:"explanation"`
}

ValidationGroupComparisonResult compares stable base and candidate aggregates.

type ValidationInt64Metric

type ValidationInt64Metric struct {
	Value             *int64 `json:"value,omitempty"`
	UnavailableReason string `json:"unavailable_reason,omitempty"`
}

ValidationInt64Metric distinguishes an observed zero from unavailable data.

type ValidationObservationContract

type ValidationObservationContract struct {
	Intent    string                          `json:"intent"`
	Base      []ValidationExpectedObservation `json:"base,omitempty"`
	Candidate []ValidationExpectedObservation `json:"candidate,omitempty"`
}

ValidationObservationContract ties output assertions to a proof intent.

type ValidationObservationResult

type ValidationObservationResult struct {
	ValidationExpectedObservation
	Status  string `json:"status"`
	Excerpt string `json:"excerpt,omitempty"`
	Error   string `json:"error,omitempty"`
}

ValidationObservationResult records one evaluated output assertion.

type ValidationProcessIdentity

type ValidationProcessIdentity struct {
	PID                 int32 `json:"pid,omitempty"`
	CreateTimeUnixMilli int64 `json:"create_time_unix_milli,omitempty"`
}

ValidationProcessIdentity identifies a sampled process without conflating PID reuse.

type ValidationReceiptService added in v0.14.0

type ValidationReceiptService interface {
	AttachValidationReceipt(ctx context.Context, receipt ExternalValidationReceipt) (*ValidationRunResult, error)
}

ValidationReceiptService is the optional no-execution receipt import capability used by CLI and MCP adapters.

type ValidationResourceTelemetry

type ValidationResourceTelemetry struct {
	Provider                   string                 `json:"provider"`
	Platform                   string                 `json:"platform"`
	SampleInterval             string                 `json:"sample_interval"`
	SampleCount                int                    `json:"sample_count"`
	CPUTimeMillis              ValidationInt64Metric  `json:"cpu_time_millis"`
	PeakRSSBytes               ValidationUint64Metric `json:"peak_rss_bytes"`
	PeakChildCount             ValidationInt64Metric  `json:"peak_child_count"`
	SamplerOverheadNanoseconds int64                  `json:"sampler_overhead_nanoseconds"`
}

ValidationResourceTelemetry reports bounded process-tree high-water marks.

type ValidationResult

type ValidationResult struct {
	ID                   string                         `json:"id"`
	InvestigationID      string                         `json:"investigation_id"`
	Kind                 string                         `json:"kind"`
	Command              []string                       `json:"command"`
	WorkingDir           string                         `json:"working_dir"`
	BaseWorkingDir       string                         `json:"base_working_dir,omitempty"`
	CandidateDir         string                         `json:"candidate_dir,omitempty"`
	WorkspaceID          string                         `json:"workspace_id,omitempty"`
	BaseWorkspaceID      string                         `json:"base_workspace_id,omitempty"`
	CandidateWorkspaceID string                         `json:"candidate_workspace_id,omitempty"`
	Env                  []string                       `json:"environment_allowlist,omitempty"`
	Timeout              string                         `json:"timeout,omitempty"`
	MaxOutputBytes       int64                          `json:"max_output_bytes,omitempty"`
	Observation          *ValidationObservationContract `json:"observation,omitempty"`
	Protocol             string                         `json:"protocol,omitempty"`
	ReadinessTimeout     string                         `json:"readiness_timeout,omitempty"`
	CreatedAt            string                         `json:"created_at"`
}

ValidationResult is a stored validation definition view.

type ValidationRunGroupResult

type ValidationRunGroupResult struct {
	ID                  string                           `json:"id"`
	DefinitionID        string                           `json:"definition_id"`
	InvestigationID     string                           `json:"investigation_id"`
	ConfigurationSHA256 string                           `json:"configuration_sha256"`
	RequestedRuns       int                              `json:"requested_runs"`
	CompletedRuns       int                              `json:"completed_runs"`
	Concurrency         int                              `json:"concurrency"`
	PerRunTimeout       string                           `json:"per_run_timeout"`
	OverallTimeout      string                           `json:"overall_timeout"`
	SampleInterval      string                           `json:"sample_interval"`
	Attempts            []ValidationAttemptResult        `json:"attempts"`
	Aggregates          []ValidationAggregateResult      `json:"aggregates"`
	Classification      string                           `json:"classification"`
	Comparison          *ValidationGroupComparisonResult `json:"comparison,omitempty"`
	StartedAt           string                           `json:"started_at"`
	CompletedAt         string                           `json:"completed_at"`
}

ValidationRunGroupResult is the bounded repeat/stress result returned to clients.

type ValidationRunPhases

type ValidationRunPhases struct {
	SpawnStartedAt    string `json:"spawn_started_at,omitempty"`
	ProcessStartedAt  string `json:"process_started_at,omitempty"`
	InitializedAt     string `json:"initialized_at,omitempty"`
	ToolsListedAt     string `json:"tools_listed_at,omitempty"`
	FirstResponseAt   string `json:"first_response_at,omitempty"`
	ExecutionEndedAt  string `json:"execution_ended_at,omitempty"`
	ShutdownStartedAt string `json:"shutdown_started_at,omitempty"`
	ShutdownCheckedAt string `json:"shutdown_checked_at,omitempty"`
}

ValidationRunPhases exposes process and declared protocol milestones.

type ValidationRunResult

type ValidationRunResult struct {
	ID                      string                        `json:"id"`
	DefinitionID            string                        `json:"definition_id"`
	InvestigationID         string                        `json:"investigation_id"`
	Kind                    string                        `json:"kind"`
	ExitCode                int                           `json:"exit_code"`
	Stdout                  string                        `json:"stdout"`
	Stderr                  string                        `json:"stderr"`
	Truncated               bool                          `json:"truncated"`
	Error                   string                        `json:"error,omitempty"`
	Classification          string                        `json:"classification"`
	ObservationStatus       string                        `json:"observation_status"`
	Observations            []ValidationObservationResult `json:"observations,omitempty"`
	StartedAt               string                        `json:"started_at"`
	CompletedAt             string                        `json:"completed_at"`
	WorkspaceSnapshotBefore string                        `json:"workspace_snapshot_before,omitempty"`
	WorkspaceSnapshotAfter  string                        `json:"workspace_snapshot_after,omitempty"`
	WorkspaceBindingStatus  string                        `json:"workspace_binding_status,omitempty"`
	WorkspaceBindingReason  string                        `json:"workspace_binding_reason,omitempty"`
	Process                 ValidationProcessIdentity     `json:"process"`
	Phases                  ValidationRunPhases           `json:"phases"`
	TimeoutPhase            string                        `json:"timeout_phase,omitempty"`
	FailurePhase            string                        `json:"failure_phase,omitempty"`
	Resources               ValidationResourceTelemetry   `json:"resources"`
	Cleanup                 ValidationCleanupResult       `json:"cleanup"`
	ExecutionOrigin         string                        `json:"execution_origin,omitempty"`
	External                *ExternalValidationProvenance `json:"external,omitempty"`
}

ValidationRunResult is the captured outcome of one validation run.

type ValidationService

type ValidationService interface {
	DefineValidation(ctx context.Context, investigationID string, opts DefineValidationOptions) (*ValidationResult, error)
	ShowValidation(ctx context.Context, id string) (*ValidationResult, error)
	RunValidation(ctx context.Context, id string, opts RunValidationOptions) (*ValidationRunResult, error)
	RunValidationGroup(ctx context.Context, id string, opts RepeatValidationOptions) (*ValidationRunGroupResult, error)
	CompareValidation(ctx context.Context, baseRunID, candidateRunID string) (*ValidationComparisonResult, error)
}

ValidationService is the optional validation management capability used by the CLI.

type ValidationUint64Metric

type ValidationUint64Metric struct {
	Value             *uint64 `json:"value,omitempty"`
	UnavailableReason string  `json:"unavailable_reason,omitempty"`
}

ValidationUint64Metric distinguishes an observed zero from unavailable data.

type VerifyPublishedDraftInput added in v0.14.0

type VerifyPublishedDraftInput struct {
	DraftID  string `json:"draft_id"`
	Revision int    `json:"revision"`
	Owner    string `json:"owner"`
	Repo     string `json:"repo"`
	Kind     string `json:"kind"`
	Number   int    `json:"number"`
}

type WorkflowAuditResult

type WorkflowAuditResult struct {
	From      string `json:"from,omitempty"`
	To        string `json:"to"`
	Rationale string `json:"rationale"`
	At        string `json:"at"`
}

WorkflowAuditResult records why a local workflow object changed state.

type WorkflowLinkResult

type WorkflowLinkResult struct {
	Kind   string                  `json:"kind"`
	Ref    string                  `json:"ref"`
	Source WorkflowSourceRefResult `json:"source"`
}

WorkflowLinkResult is an explicit hypothesis source link.

type WorkflowService

type WorkflowService interface {
	UpdateHypothesisFields(ctx context.Context, id string, opts HypothesisUpdateOptions) (*investigation.Hypothesis, error)
	TransitionHypothesis(ctx context.Context, id, status, rationale string) (*investigation.Hypothesis, error)
	CheckHypothesisDuplicates(ctx context.Context, id string, limit int) (*DuplicateCheckResult, error)
	CheckOpportunityDuplicates(ctx context.Context, id string, limit int) (*DuplicateCheckResult, error)
	CheckHypothesisCollisions(ctx context.Context, id string, limit int) (*CollisionCheckResult, error)
	CheckOpportunityCollisions(ctx context.Context, id string, limit int) (*CollisionCheckResult, error)
	UpdateOpportunityCollisionStatus(ctx context.Context, id, status, rationale string) (*investigation.Opportunity, error)
	RecordEvidence(ctx context.Context, input RecordEvidenceInput) (*evidence.Evidence, error)
	WorkspaceDiff(ctx context.Context, id string) (*WorkspaceDiffResult, error)
	PrepareReviewReport(ctx context.Context, input PrepareReviewReportInput) (*ReviewReport, error)
}

WorkflowService exposes typed investigation workflow operations.

type WorkflowSourceRefResult

type WorkflowSourceRefResult struct {
	Source     string `json:"source"`
	URL        string `json:"url,omitempty"`
	CommitSHA  string `json:"commit_sha,omitempty"`
	ObservedAt string `json:"observed_at,omitempty"`
	AsOf       string `json:"as_of,omitempty"`
}

WorkflowSourceRefResult is a transport-stable workflow provenance record.

type WorkspaceAdoptOptions

type WorkspaceAdoptOptions struct {
	Path    string
	BaseRef string
	Name    string
}

WorkspaceAdoptOptions identifies an existing local Git worktree.

type WorkspaceCreateOptions

type WorkspaceCreateOptions struct {
	Remote       string
	BaseRef      string
	CandidateRef string
	Name         string
}

WorkspaceCreateOptions carries explicit local-write intent for workspace creation.

type WorkspaceDiffResult

type WorkspaceDiffResult struct {
	ID               string       `json:"id"`
	Repo             RepoRef      `json:"repo"`
	BaseSHA          string       `json:"base_sha"`
	CandidateSHA     string       `json:"candidate_sha"`
	MergeBase        string       `json:"merge_base"`
	Dirty            bool         `json:"dirty"`
	HasUntracked     bool         `json:"has_untracked"`
	Diff             string       `json:"diff"`
	ChangedFiles     []string     `json:"changed_files"`
	ChangedFileCount int          `json:"changed_file_count"`
	DiffBytes        int          `json:"diff_bytes"`
	ReviewOrder      []ReviewStep `json:"review_order"`
}

type WorkspaceResult

type WorkspaceResult struct {
	ID              string  `json:"id"`
	InvestigationID string  `json:"investigation_id"`
	Repo            RepoRef `json:"repo"`
	Path            string  `json:"path"`
	Remote          string  `json:"remote"`
	BaseSHA         string  `json:"base_sha"`
	CandidateSHA    string  `json:"candidate_sha"`
	MergeBase       string  `json:"merge_base"`
	Dirty           bool    `json:"dirty"`
	HasUntracked    bool    `json:"has_untracked"`
	Ownership       string  `json:"ownership"`
	CreatedAt       string  `json:"created_at"`
}

WorkspaceResult is a durable view of a managed Git worktree.

type WorkspaceService

type WorkspaceService interface {
	CreateWorkspace(ctx context.Context, investigationID string, opts WorkspaceCreateOptions) (*WorkspaceResult, error)
	AdoptWorkspace(ctx context.Context, investigationID string, opts WorkspaceAdoptOptions) (*WorkspaceResult, error)
	ShowWorkspace(ctx context.Context, id string) (*WorkspaceResult, error)
}

WorkspaceService is the optional workspace management capability used by the CLI.

Jump to

Keyboard shortcuts

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