Documentation
¶
Overview ¶
Package app owns GitContribute use cases and capability composition.
Service methods are the shared application boundary for the CLI, MCP server, and terminal UI. Methods that read the corpus remain offline; methods that access GitHub, write local state, invoke git, or execute validation commands expose those effects explicitly. Product rules belong here rather than in a presentation adapter.
Index ¶
- Constants
- Variables
- func NewRuntimeContract(version string) (*contracts.RuntimeContractResult, error)
- type DuplicateCandidatesResult
- type ExplainMatchResult
- type HydrateOptions
- type HydrateRepositoryOptions
- type HydrateResult
- type HydratedFacet
- type JobExecutor
- func (e *JobExecutor) Cancel(ctx context.Context, id string) error
- func (e *JobExecutor) Close() error
- func (e *JobExecutor) Get(ctx context.Context, id string) (*corpus.Job, error)
- func (e *JobExecutor) List(ctx context.Context, status string, limit int) ([]corpus.Job, error)
- func (e *JobExecutor) Submit(ctx context.Context, kind string, request any, fn JobFunc) (string, error)
- type JobFunc
- type MCPReader
- func (r *MCPReader) AdoptWorkspace(ctx context.Context, in mcpcontract.AdoptWorkspaceInput) (mcpcontract.AdoptWorkspaceOutput, error)
- func (r *MCPReader) AttachValidationReceipt(ctx context.Context, in mcpcontract.AttachValidationReceiptInput) (mcpcontract.ExternalValidationReceiptOutput, error)
- func (r *MCPReader) BuildRepositoryDossier(ctx context.Context, in mcpcontract.BuildRepositoryDossierInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) CIFailureResource(ctx context.Context, owner, repo string, number int) (map[string]any, error)
- func (r *MCPReader) CIJobLogResource(ctx context.Context, owner, repo string, number int, jobID int64) (map[string]any, error)
- func (r *MCPReader) CancelJobs(ctx context.Context, in mcpcontract.CancelJobInput) (mcpcontract.GetJobsOutput, error)
- func (r *MCPReader) CheckCollisions(ctx context.Context, in mcpcontract.CheckCollisionsInput) (mcpcontract.CheckOutput, error)
- func (r *MCPReader) CheckDuplicates(ctx context.Context, in mcpcontract.CheckDuplicatesInput) (mcpcontract.CheckOutput, error)
- func (r *MCPReader) CheckMergeConflicts(ctx context.Context, in mcpcontract.CheckMergeConflictsInput) (mcpcontract.CheckMergeConflictsOutput, error)
- func (r *MCPReader) Concern(ctx context.Context, in mcpcontract.ConcernInput) (mcpcontract.ConcernOutput, error)
- func (r *MCPReader) CreateConcern(ctx context.Context, in mcpcontract.CreateConcernInput) (mcpcontract.ConcernOutput, error)
- func (r *MCPReader) CreateWorkspace(ctx context.Context, in mcpcontract.CreateWorkspaceInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) DeepWiki(ctx context.Context, in mcpcontract.DeepWikiInput) (mcpcontract.DeepWikiOutput, error)
- func (r *MCPReader) DefineValidation(ctx context.Context, in mcpcontract.DefineValidationInput) (mcpcontract.ValidationOutput, error)
- func (r *MCPReader) Dossier(ctx context.Context, in mcpcontract.RepoInput) (mcpcontract.DossierOutput, error)
- func (r *MCPReader) Draft(ctx context.Context, in mcpcontract.DraftInput) (mcpcontract.DraftOutput, error)
- func (r *MCPReader) Evidence(ctx context.Context, in mcpcontract.EvidenceInput) (mcpcontract.EvidenceOutput, error)
- func (r *MCPReader) ExplainMatch(ctx context.Context, in mcpcontract.ExplainMatchInput) (mcpcontract.ExplainMatchOutput, error)
- func (r *MCPReader) ExportManifest(ctx context.Context, in mcpcontract.ExportManifestInput) (mcpcontract.ManifestOutput, error)
- func (r *MCPReader) FindClusters(ctx context.Context, in mcpcontract.FindClustersInput) (mcpcontract.FindClustersOutput, error)
- func (r *MCPReader) FindNeighbors(ctx context.Context, in mcpcontract.FindNeighborsInput) (mcpcontract.FindNeighborsOutput, error)
- func (r *MCPReader) FindPortfolioOverlaps(ctx context.Context, in mcpcontract.FindPortfolioOverlapsInput) (mcpcontract.FindPortfolioOverlapsOutput, error)
- func (r *MCPReader) FindPrecedents(ctx context.Context, in mcpcontract.FindPrecedentsInput) (mcpcontract.FindPrecedentsOutput, error)
- func (r *MCPReader) GetCoverage(ctx context.Context, in mcpcontract.GetCoverageInput) (mcpcontract.GetCoverageOutput, error)
- func (r *MCPReader) GetFixPatternReport(ctx context.Context, id string) (mcpcontract.FixPatternReport, error)
- func (r *MCPReader) GetJob(ctx context.Context, in mcpcontract.GetJobInput) (mcpcontract.GetJobOutput, error)
- func (r *MCPReader) GetJobs(ctx context.Context, in mcpcontract.GetJobsInput) (mcpcontract.GetJobsOutput, error)
- func (r *MCPReader) GetRepositories(ctx context.Context, in mcpcontract.GetRepositoriesInput) (mcpcontract.GetRepositoriesOutput, error)
- func (r *MCPReader) GetThreads(ctx context.Context, in mcpcontract.GetThreadsInput) (mcpcontract.GetThreadsOutput, error)
- func (r *MCPReader) HydrateThreads(ctx context.Context, in mcpcontract.HydrateThreadsInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) IndexRepositories(ctx context.Context, in mcpcontract.IndexRepositoriesInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) InspectCommitChanges(ctx context.Context, in mcpcontract.InspectCommitChangesInput) (mcpcontract.CommitInventoryOutput, error)
- func (r *MCPReader) Investigation(ctx context.Context, in mcpcontract.InvestigationInput) (mcpcontract.InvestigationOutput, error)
- func (r *MCPReader) Lens(ctx context.Context, in mcpcontract.LensInput) (mcpcontract.LensOutput, error)
- func (r *MCPReader) LinkConcern(ctx context.Context, in mcpcontract.LinkConcernInput) (mcpcontract.ConcernOutput, error)
- func (r *MCPReader) LinkPullRequest(ctx context.Context, in mcpcontract.LinkPullRequestInput) (mcpcontract.LinkPullRequestOutput, error)
- func (r *MCPReader) ListConcerns(ctx context.Context, in mcpcontract.ListConcernsInput) (mcpcontract.ConcernListOutput, error)
- func (r *MCPReader) ListOpportunities(ctx context.Context, in mcpcontract.ListOpportunitiesInput) (mcpcontract.ListOpportunitiesOutput, error)
- func (r *MCPReader) ListPullRequestPortfolio(ctx context.Context, in mcpcontract.ListPullRequestPortfolioInput) (mcpcontract.ListPullRequestPortfolioOutput, error)
- func (r *MCPReader) Manifest(ctx context.Context, in mcpcontract.ManifestInput) (mcpcontract.ManifestOutput, error)
- func (r *MCPReader) MineRepositoryFixPatterns(ctx context.Context, in mcpcontract.MineRepositoryFixPatternsInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) Opportunity(ctx context.Context, in mcpcontract.OpportunityInput) (mcpcontract.OpportunityOutput, error)
- func (r *MCPReader) PlanSemanticCommits(ctx context.Context, in mcpcontract.PlanSemanticCommitsInput) (mcpcontract.SemanticCommitPlanOutput, error)
- func (r *MCPReader) PrepareContribution(ctx context.Context, in mcpcontract.PrepareContributionInput) (mcpcontract.DraftOutput, error)
- func (r *MCPReader) PrepareIssueSet(ctx context.Context, in mcpcontract.PrepareIssueSetInput) (mcpcontract.PrepareIssueSetOutput, error)
- func (r *MCPReader) PromoteConcern(ctx context.Context, in mcpcontract.PromoteConcernInput) (mcpcontract.ConcernOutput, error)
- func (r *MCPReader) PromoteOpportunity(ctx context.Context, in mcpcontract.PromoteOpportunityInput) (mcpcontract.OpportunityOutput, error)
- func (r *MCPReader) PullRequestFeedbackResource(ctx context.Context, owner, repo string, number int) (map[string]any, error)
- func (r *MCPReader) RankOpportunities(ctx context.Context, in mcpcontract.RankOpportunitiesInput) (mcpcontract.RankOpportunitiesOutput, error)
- func (r *MCPReader) Readiness(ctx context.Context, in mcpcontract.ReadinessInput) (mcpcontract.ReadinessOutput, error)
- func (r *MCPReader) RecordHypothesis(ctx context.Context, in mcpcontract.RecordHypothesisInput) (mcpcontract.HypothesisOutput, error)
- func (r *MCPReader) Repository(ctx context.Context, in mcpcontract.RepoInput) (mcpcontract.RepositoryOutput, error)
- func (r *MCPReader) RunValidation(ctx context.Context, in mcpcontract.RunValidationInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) Search(ctx context.Context, in mcpcontract.SearchInput) (mcpcontract.SearchOutput, error)
- func (r *MCPReader) SearchCode(ctx context.Context, in mcpcontract.SearchCodeInput) (mcpcontract.SearchCodeOutput, error)
- func (r *MCPReader) SearchGitHubRepositories(ctx context.Context, in mcpcontract.SearchGitHubRepositoriesInput) (mcpcontract.SearchGitHubRepositoriesOutput, error)
- func (r *MCPReader) SearchRepositories(ctx context.Context, in mcpcontract.SearchRepositoriesInput) (mcpcontract.SearchRepositoriesOutput, error)
- func (r *MCPReader) SetConcernStatus(ctx context.Context, in mcpcontract.SetConcernStatusInput) (mcpcontract.ConcernOutput, error)
- func (r *MCPReader) StartInvestigation(ctx context.Context, in mcpcontract.StartInvestigationInput) (mcpcontract.InvestigationOutput, error)
- func (r *MCPReader) SyncCIFailures(ctx context.Context, in mcpcontract.SyncCIFailuresInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) SyncPortfolio(ctx context.Context, in mcpcontract.SyncPortfolioInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) SyncPullRequestFeedback(ctx context.Context, in mcpcontract.SyncPullRequestFeedbackInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) SyncRepositoryContext(ctx context.Context, in mcpcontract.SyncRepositoryContextInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) SyncThreads(ctx context.Context, in mcpcontract.SyncThreadsInput) (mcpcontract.JobReference, error)
- func (r *MCPReader) Thread(ctx context.Context, in mcpcontract.ThreadInput) (mcpcontract.ThreadOutput, error)
- func (r *MCPReader) ThreadByNumber(ctx context.Context, in mcpcontract.ThreadByNumberInput) (mcpcontract.ThreadOutput, error)
- func (r *MCPReader) UpdateConcern(ctx context.Context, in mcpcontract.UpdateConcernInput) (mcpcontract.ConcernOutput, error)
- func (r *MCPReader) VerifyPublishedDraft(ctx context.Context, in mcpcontract.VerifyPublishedDraftInput) (mcpcontract.PublishedDraftVerificationOutput, error)
- func (r *MCPReader) Workspace(ctx context.Context, id string) (mcpcontract.WorkspaceResource, error)
- type ManifestOptions
- type ManifestPullRequest
- type Neighbor
- type NeighborsResult
- type PullRequestCollision
- type PullRequestCollisionResult
- type Service
- func (s *Service) Acquire(ctx context.Context, repo contracts.RepoRef, remote string) (result *contracts.AcquisitionResult, returnErr error)
- func (s *Service) Actions(_ context.Context, item tuicontract.Item) ([]tuicontract.Action, error)
- func (s *Service) AddCollectionMembers(ctx context.Context, name string, members []contracts.CollectionMember) (*contracts.CollectionResult, error)
- func (s *Service) AddGHArchiveSource(ctx context.Context, name string, events []string) (*contracts.SourceResult, error)
- func (s *Service) AddHypothesis(ctx context.Context, investigationID, title, description, category string) (*contracts.HypothesisResult, error)
- func (s *Service) AddLens(ctx context.Context, name string, def lens.Definition) (*contracts.LensResult, error)
- func (s *Service) AddRepoSource(ctx context.Context, name string, refs []contracts.RepoRef) (*contracts.SourceResult, error)
- func (s *Service) AddSearchSource(ctx context.Context, name, query string) (*contracts.SourceResult, error)
- func (s *Service) AdoptWorkspace(ctx context.Context, investigationID string, ...) (*contracts.WorkspaceResult, error)
- func (s *Service) ApplyCodePrune(ctx context.Context, repo string, keepLatest int, expectedDelete []string) (*contracts.CorpusPruneResult, error)
- func (s *Service) ApplyRepositoryRemoval(ctx context.Context, repo, expectedRevision string) (*contracts.CorpusRepositoryRemovalResult, error)
- func (s *Service) ArchiveSync(ctx context.Context, repo contracts.RepoRef, opts contracts.ArchiveSyncOptions) (*contracts.SyncResult, error)
- func (s *Service) ArchiveThreads(ctx context.Context, repo contracts.RepoRef, kind, state string, limit int) (*contracts.ThreadListResult, error)
- func (s *Service) AttachValidationReceipt(ctx context.Context, receipt contracts.ExternalValidationReceipt) (*contracts.ValidationRunResult, error)
- func (s *Service) BackupCorpus(ctx context.Context, destination string) (*contracts.CorpusBackupResult, error)
- func (s *Service) BuildRepositoryDossier(ctx context.Context, repo contracts.RepoRef) (*domain.Dossier, error)
- func (s *Service) CancelJob(ctx context.Context, id string) (*contracts.JobResult, error)
- func (s *Service) CheckHypothesisCollisions(ctx context.Context, hypothesisID string, limit int) (*contracts.CollisionCheckResult, error)
- func (s *Service) CheckHypothesisDuplicates(ctx context.Context, hypothesisID string, limit int) (*contracts.DuplicateCheckResult, error)
- func (s *Service) CheckOpportunityCollisions(ctx context.Context, opportunityID string, limit int) (*contracts.CollisionCheckResult, error)
- func (s *Service) CheckOpportunityDuplicates(ctx context.Context, opportunityID string, limit int) (*contracts.DuplicateCheckResult, error)
- func (s *Service) Close() error
- func (s *Service) Cluster(ctx context.Context, id string, limit int) (*contracts.ClusterResult, error)
- func (s *Service) CompareValidation(ctx context.Context, baseRunID, candidateRunID string) (*contracts.ValidationComparisonResult, error)
- func (s *Service) Configure(ctx context.Context, opts contracts.ConfigureOptions) (*contracts.ConfigureResult, error)
- func (s *Service) ContributionManifest(ctx context.Context, opportunityID string, opts ManifestOptions) (*manifest.Statement, error)
- func (s *Service) ContributionRadar(ctx context.Context, opts contracts.RadarOptions) (*radar.Report, error)
- func (s *Service) ControlStatus(ctx context.Context) (*contracts.ControlStatusResult, error)
- func (s *Service) Coverage(ctx context.Context, repo contracts.RepoRef) (*contracts.CoverageResult, error)
- func (s *Service) Crawl(ctx context.Context, name string, opts contracts.CrawlOptions) (*contracts.CrawlResult, error)
- func (s *Service) CreateCollection(ctx context.Context, name string) (*contracts.CollectionResult, error)
- func (s *Service) CreateConcern(ctx context.Context, opts contracts.ConcernCreateOptions) (*contracts.ConcernResult, error)
- func (s *Service) CreateHypothesis(ctx context.Context, investigationID string, ...) (*investigation.Hypothesis, error)
- func (s *Service) CreateWorkspace(ctx context.Context, investigationID string, ...) (*contracts.WorkspaceResult, error)
- func (s *Service) DefineValidation(ctx context.Context, investigationID string, ...) (*contracts.ValidationResult, error)
- func (s *Service) DiscoverSetup(ctx context.Context) (*contracts.SetupDiscovery, error)
- func (s *Service) Doctor(ctx context.Context) (*contracts.DoctorResult, error)
- func (s *Service) Dossier(ctx context.Context, repo contracts.RepoRef) (*contracts.DossierResult, error)
- func (s *Service) DuplicateCandidates(ctx context.Context, repo contracts.RepoRef, kind string, number int, ...) (*DuplicateCandidatesResult, error)
- func (s *Service) ExecuteAction(ctx context.Context, request tuicontract.ActionRequest) (tuicontract.ActionResult, error)
- func (s *Service) ExplainLens(ctx context.Context, name, ref string, opts contracts.LensExplainOptions) (*contracts.LensExplainResult, error)
- func (s *Service) ExplainMatch(_ context.Context, query string, match contracts.SearchMatch) (*ExplainMatchResult, error)
- func (s *Service) ExplainReadiness(ctx context.Context, checkID string) (*contracts.ReadinessCheck, error)
- func (s *Service) ExportDossier(ctx context.Context, repo contracts.RepoRef, format string) (*contracts.ExportResult, error)
- func (s *Service) ExportEvidence(ctx context.Context, investigationID, format string) (*contracts.ExportResult, error)
- func (s *Service) ExportLocalMetadata(ctx context.Context, opts contracts.MetadataExportOptions) (*contracts.MetadataExportResult, error)
- func (s *Service) ExportManifest(ctx context.Context, opportunityID string, ...) (*contracts.ExportResult, error)
- func (s *Service) ExtractSeeds(ctx context.Context, repo contracts.RepoRef, opts domain.ExtractSeedsOptions) ([]domain.Seed, error)
- func (s *Service) GetContribution(ctx context.Context, id string) (*contracts.ContributionResult, error)
- func (s *Service) GetJob(ctx context.Context, id string) (*contracts.JobResult, error)
- func (s *Service) GetRepositoryDossier(ctx context.Context, repo contracts.RepoRef) (*domain.Dossier, error)
- func (s *Service) Hydrate(ctx context.Context, repo contracts.RepoRef, number int, ...) (*contracts.HydrateResult, error)
- func (s *Service) HydrateRepository(ctx context.Context, repo contracts.RepoRef, opts HydrateRepositoryOptions) (*HydrateResult, error)
- func (s *Service) HydrateThread(ctx context.Context, repo contracts.RepoRef, number int, opts HydrateOptions) (*HydrateResult, error)
- func (s *Service) ImportLocalMetadata(ctx context.Context, opts contracts.MetadataImportOptions) (*contracts.MetadataImportResult, error)
- func (s *Service) Index(ctx context.Context, repo contracts.RepoRef, path string) (*contracts.IndexResult, error)
- func (s *Service) Init(ctx context.Context) (*contracts.InitResult, error)
- func (s *Service) InspectCommitChanges(ctx context.Context, workspaceID string) (commitplan.Inventory, error)
- func (s *Service) InspectCorpus(ctx context.Context) (*contracts.CorpusInspectionResult, error)
- func (s *Service) InventoryCorpus(ctx context.Context, repo string) (*contracts.CorpusInventoryResult, error)
- func (s *Service) Jobs(ctx context.Context) (*JobExecutor, error)
- func (s *Service) LinkConcern(ctx context.Context, id string, opts contracts.ConcernLinkOptions) (*contracts.ConcernResult, error)
- func (s *Service) ListClusters(ctx context.Context, repo contracts.RepoRef, limit int) (*contracts.ClusterListResult, error)
- func (s *Service) ListCollections(ctx context.Context) (*contracts.CollectionListResult, error)
- func (s *Service) ListConcerns(ctx context.Context, opts contracts.ConcernListOptions) (*contracts.ConcernListResult, error)
- func (s *Service) ListContributionOutcomes(ctx context.Context, contributionID string) (*contracts.ContributionOutcomeListResult, error)
- func (s *Service) ListContributions(ctx context.Context, opts contracts.ListContributionsOptions) (*contracts.ContributionListResult, error)
- func (s *Service) ListCorpusInventory(ctx context.Context) (*contracts.CorpusInventoryListResult, error)
- func (s *Service) ListCorpusProjections(ctx context.Context) (*contracts.CorpusProjectionListResult, error)
- func (s *Service) ListHypotheses(ctx context.Context, investigationID string) (*contracts.HypothesisListResult, error)
- func (s *Service) ListInvestigations(ctx context.Context) (*contracts.InvestigationListResult, error)
- func (s *Service) ListJobs(ctx context.Context, status string, limit int) (*contracts.JobListResult, error)
- func (s *Service) ListLenses(ctx context.Context) (*contracts.LensListResult, error)
- func (s *Service) ListOpportunities(ctx context.Context, investigationID string) (*contracts.OpportunityListResult, error)
- func (s *Service) ListSources(ctx context.Context) (*contracts.SourceListResult, error)
- func (s *Service) ListTriageEvents(ctx context.Context, opts contracts.ListTriageEventsOptions) (*contracts.TriageEventListResult, error)
- func (s *Service) Load(ctx context.Context) (tuicontract.Data, error)
- func (s *Service) MCPReader() mcpcontract.Reader
- func (s *Service) Metadata(ctx context.Context) (*contracts.MetadataResult, error)
- func (s *Service) MigrateCorpus(ctx context.Context, opts contracts.CorpusMigrateOptions) (*contracts.CorpusMigrationResult, error)
- func (s *Service) NeighborQuery(ctx context.Context, repo contracts.RepoRef, kind string, number, limit int) (*contracts.NeighborListResult, error)
- func (s *Service) Neighbors(ctx context.Context, repo contracts.RepoRef, kind string, number int, ...) (*NeighborsResult, error)
- func (s *Service) OpportunityReadiness(ctx context.Context, opportunityID string) (*contracts.ReadinessResult, error)
- func (s *Service) PlanArchiveSync(_ context.Context, repo contracts.RepoRef, opts contracts.ArchiveSyncOptions) (*contracts.SyncPlanResult, error)
- func (s *Service) PlanCodePrune(ctx context.Context, repo string, keepLatest int) (*contracts.CorpusPruneResult, error)
- func (s *Service) PlanRepositoryContextSync(_ context.Context, repo contracts.RepoRef, maxRequests int) (*contracts.SyncPlanResult, error)
- func (s *Service) PlanRepositoryRemoval(ctx context.Context, repo string) (*contracts.CorpusRepositoryRemovalResult, error)
- func (s *Service) PlanSemanticCommits(ctx context.Context, workspaceID, expectedInventorySHA256 string, ...) (commitplan.Plan, error)
- func (s *Service) PrepareIssue(ctx context.Context, opportunityID string, opts contracts.PrepareIssueOptions) (*contracts.DraftResult, error)
- func (s *Service) PreparePullRequest(ctx context.Context, opportunityID string, opts contracts.PreparePROptions) (*contracts.DraftResult, error)
- func (s *Service) PrepareReviewReport(ctx context.Context, input contracts.PrepareReviewReportInput) (*contracts.ReviewReport, error)
- func (s *Service) PromoteConcern(ctx context.Context, id string, opts contracts.ConcernPromoteOptions) (*contracts.ConcernResult, error)
- func (s *Service) PromoteOpportunity(ctx context.Context, hypothesisID, problem, scope, impact, effort string, ...) (*contracts.OpportunityResult, error)
- func (s *Service) PromoteOpportunityWithInput(ctx context.Context, hypothesisID string, ...) (*investigation.Opportunity, error)
- func (s *Service) PullRequestCollisions(ctx context.Context, repo contracts.RepoRef, number int, limit int) (*PullRequestCollisionResult, error)
- func (s *Service) RebuildCorpusProjection(ctx context.Context, name string) (*contracts.CorpusProjectionResult, error)
- func (s *Service) RecordContribution(ctx context.Context, opts contracts.RecordContributionOptions) (*contracts.ContributionResult, error)
- func (s *Service) RecordContributionOutcome(ctx context.Context, opts contracts.RecordContributionOutcomeOptions) (*contracts.ContributionOutcomeResult, error)
- func (s *Service) RecordEvidence(ctx context.Context, input contracts.RecordEvidenceInput) (*evidence.Evidence, error)
- func (s *Service) RecordTriageEvent(ctx context.Context, opts contracts.RecordTriageEventOptions) (*contracts.TriageEventResult, error)
- func (s *Service) RefreshClusters(ctx context.Context, repo contracts.RepoRef) (*contracts.ClusterRefreshResult, error)
- func (s *Service) RepositoryContextSync(ctx context.Context, repo contracts.RepoRef, maxRequests int) (_ *contracts.RepositoryContextResult, resultErr error)
- func (s *Service) RepositoryHealth(ctx context.Context, repo contracts.RepoRef) (*health.Report, error)
- func (s *Service) RepositoryHealthWithOptions(ctx context.Context, repo contracts.RepoRef, opts health.Options) (*health.Report, error)
- func (s *Service) ResearchBrief(ctx context.Context, item tuicontract.Item) (tuicontract.ResearchBrief, error)
- func (s *Service) RestoreCorpus(ctx context.Context, source, safetyBackup string) (*contracts.CorpusRestoreResult, error)
- func (s *Service) RunHistory(ctx context.Context, limit int) (*contracts.RunListResult, error)
- func (s *Service) RunValidation(ctx context.Context, id string, opts contracts.RunValidationOptions) (*contracts.ValidationRunResult, error)
- func (s *Service) RunValidationGroup(ctx context.Context, id string, opts contracts.RepeatValidationOptions) (*contracts.ValidationRunGroupResult, error)
- func (s *Service) RuntimeContract(ctx context.Context) (*contracts.RuntimeContractResult, error)
- func (s *Service) Search(ctx context.Context, query string, opts contracts.SearchOptions) (*contracts.SearchResult, error)
- func (s *Service) SetArchiveFetcher(f discovery.ArchiveFetcher)
- func (s *Service) SetClock(clock func() time.Time)
- func (s *Service) SetConcernStatus(ctx context.Context, id, status, rationale string) (*contracts.ConcernResult, error)
- func (s *Service) SetDeepWikiReader(r deepwiki.Reader)
- func (s *Service) SetGitHubReader(r github.Reader)
- func (s *Service) SetOpportunityStatus(ctx context.Context, id, status, rationale string) (*contracts.OpportunityResult, error)
- func (s *Service) Setup(ctx context.Context, opts contracts.SetupOptions) (*contracts.SetupReport, error)
- func (s *Service) SetupWithProgress(ctx context.Context, opts contracts.SetupOptions, ...) (*contracts.SetupReport, error)
- func (s *Service) ShowConcern(ctx context.Context, id string) (*contracts.ConcernResult, error)
- func (s *Service) ShowEvidence(ctx context.Context, investigationID string) (*contracts.EvidenceResult, error)
- func (s *Service) ShowInvestigation(ctx context.Context, id string) (*contracts.InvestigationResult, error)
- func (s *Service) ShowLens(ctx context.Context, name string) (*contracts.LensResult, error)
- func (s *Service) ShowOpportunity(ctx context.Context, id string) (*contracts.OpportunityResult, error)
- func (s *Service) ShowSource(ctx context.Context, name string) (*contracts.SourceResult, error)
- func (s *Service) ShowValidation(ctx context.Context, id string) (*contracts.ValidationResult, error)
- func (s *Service) ShowWorkspace(ctx context.Context, id string) (*contracts.WorkspaceResult, error)
- func (s *Service) StartInvestigation(ctx context.Context, repo contracts.RepoRef, commitSHA, lens string) (*contracts.InvestigationResult, error)
- func (s *Service) StartInvestigationFromThread(ctx context.Context, requested research.ThreadRef) (*contracts.ThreadInvestigationResult, error)
- func (s *Service) Status(ctx context.Context) (*contracts.StatusResult, error)
- func (s *Service) TailSource(ctx context.Context, name string, opts contracts.TailOptions) (*contracts.TailResult, error)
- func (s *Service) ThreadResearchBrief(ctx context.Context, ref research.ThreadRef) (*research.Brief, error)
- func (s *Service) TransitionHypothesis(ctx context.Context, hypothesisID, status, rationale string) (*investigation.Hypothesis, error)
- func (s *Service) UpdateConcern(ctx context.Context, id string, opts contracts.ConcernUpdateOptions) (*contracts.ConcernResult, error)
- func (s *Service) UpdateHypothesis(ctx context.Context, hypothesisID string, ...) (*investigation.Hypothesis, error)
- func (s *Service) UpdateHypothesisFields(ctx context.Context, hypothesisID string, ...) (*investigation.Hypothesis, error)
- func (s *Service) UpdateOpportunityCollisionStatus(ctx context.Context, opportunityID, status, rationale string) (*investigation.Opportunity, error)
- func (s *Service) Upgrade(ctx context.Context, opts contracts.UpgradeOptions) (*contracts.UpgradeReport, error)
- func (s *Service) VerifyPublishedDraft(ctx context.Context, in contracts.VerifyPublishedDraftInput) (*contracts.PublishedDraftVerification, error)
- func (s *Service) WorkspaceDiff(ctx context.Context, id string) (*contracts.WorkspaceDiffResult, error)
- type SyncOptions
- type ThreadRef
Constants ¶
const ( FacetIssueComments = facets.IssueComments FacetPRDetails = facets.PRDetails FacetPRReviews = facets.PRReviews FacetPRReviewComments = facets.PRReviewComments FacetPRChecks = facets.PRChecks FacetPRReviewThreads = facets.PRReviewThreads FacetPRMergeState = facets.PRMergeState FacetPRMergeQueue = facets.PRMergeQueue FacetPRClosingIssues = facets.PRClosingIssues FacetPRFiles = facets.PRFiles FacetIssueTimeline = facets.IssueTimeline )
Thread facets that selective hydration can retrieve.
const (
// FacetContributionGuidance stores bounded repository contribution and AI policy documents.
FacetContributionGuidance = "contribution_guidance"
)
Variables ¶
var ErrJobQueueFull = errors.New("job executor queue is full")
Functions ¶
func NewRuntimeContract ¶ added in v0.9.0
func NewRuntimeContract(version string) (*contracts.RuntimeContractResult, error)
NewRuntimeContract constructs immutable executable compatibility metadata. It does not resolve configuration, inspect a corpus, access the network, or write local state.
Types ¶
type DuplicateCandidatesResult ¶
type DuplicateCandidatesResult struct {
Repo string `json:"repo"`
Kind string `json:"kind"`
Number int `json:"number"`
ClusterID int64 `json:"cluster_id,omitempty"`
StableID string `json:"stable_id,omitempty"`
Canonical ThreadRef `json:"canonical,omitempty"`
SourceRevision string `json:"source_revision"`
Limit int `json:"limit"`
Total int `json:"total"`
Candidates []Neighbor `json:"candidates"`
}
DuplicateCandidatesResult is the response for a duplicate-candidate query.
type ExplainMatchResult ¶
ExplainMatchResult exposes the factual signals that contribute to a match score. It performs no network access.
type HydrateOptions ¶
type HydrateOptions struct {
// Facets lists the facets to retrieve. An empty list hydrates all facets
// applicable to the thread kind.
Facets []string
// MaxPages bounds pagination per facet. Zero defaults to 50.
MaxPages int
}
HydrateOptions controls selective thread hydration.
type HydrateRepositoryOptions ¶
HydrateRepositoryOptions controls repository-wide thread hydration.
type HydrateResult ¶
type HydrateResult struct {
Repo contracts.RepoRef
Number int
Kind string
Facets []HydratedFacet
Pages int
Requests int
Capped bool
Message string
}
HydrateResult reports the outcome of hydrating a thread.
type HydratedFacet ¶
HydratedFacet reports coverage and counts for one hydrated facet.
type JobExecutor ¶
type JobExecutor struct {
// contains filtered or unexported fields
}
JobExecutor persists job records, runs work asynchronously in this process, and supports cancellation, progress recording, and safe shutdown. It does not replay interrupted host or network operations after restart.
Each executor registers a unique owner in the corpus and heartbeats while it is open. Startup only reconciles jobs whose owner is missing or has a stale heartbeat; live owners from other processes are never failed. One executor watcher polls admitted IDs together so cross-process cancellation stays prompt without one SQLite query loop per job.
func (*JobExecutor) Cancel ¶
func (e *JobExecutor) Cancel(ctx context.Context, id string) error
Cancel requests cancellation for a job. Queued jobs are marked cancelled immediately; running jobs have their context cancelled and finish as cancelled.
func (*JobExecutor) Close ¶
func (e *JobExecutor) Close() error
Close stops running and waiting jobs and waits for their goroutines.
type JobFunc ¶
JobFunc performs asynchronous work for a job. It receives a context that is cancelled when the job is cancelled or the executor closes, and a report callback that records progress and statistics in the corpus.
type MCPReader ¶
type MCPReader struct{ *Service }
MCPReader adapts Service to the mcpcontract.Reader interface. It is a thin wrapper because Go does not allow two methods named Search on one type.
func (*MCPReader) AdoptWorkspace ¶ added in v0.10.0
func (r *MCPReader) AdoptWorkspace(ctx context.Context, in mcpcontract.AdoptWorkspaceInput) (mcpcontract.AdoptWorkspaceOutput, error)
AdoptWorkspace records an existing worktree synchronously without exposing its host path or remote URL in the protocol result.
func (*MCPReader) AttachValidationReceipt ¶ added in v0.14.0
func (r *MCPReader) AttachValidationReceipt(ctx context.Context, in mcpcontract.AttachValidationReceiptInput) (mcpcontract.ExternalValidationReceiptOutput, error)
func (*MCPReader) BuildRepositoryDossier ¶
func (r *MCPReader) BuildRepositoryDossier(ctx context.Context, in mcpcontract.BuildRepositoryDossierInput) (mcpcontract.JobReference, error)
BuildRepositoryDossier submits a durable job that builds a repository dossier.
func (*MCPReader) CIFailureResource ¶ added in v0.16.0
func (*MCPReader) CIJobLogResource ¶ added in v0.16.0
func (*MCPReader) CancelJobs ¶ added in v0.6.0
func (r *MCPReader) CancelJobs(ctx context.Context, in mcpcontract.CancelJobInput) (mcpcontract.GetJobsOutput, error)
CancelJobs requests bounded cancellation in input order. Missing and terminal jobs remain item-level outcomes so one bad ID does not hide successful writes.
func (*MCPReader) CheckCollisions ¶
func (r *MCPReader) CheckCollisions(ctx context.Context, in mcpcontract.CheckCollisionsInput) (mcpcontract.CheckOutput, error)
CheckCollisions finds open pull request collisions for a hypothesis or opportunity.
func (*MCPReader) CheckDuplicates ¶
func (r *MCPReader) CheckDuplicates(ctx context.Context, in mcpcontract.CheckDuplicatesInput) (mcpcontract.CheckOutput, error)
CheckDuplicates finds duplicate-candidate threads for a hypothesis or opportunity.
func (*MCPReader) CheckMergeConflicts ¶ added in v0.5.0
func (r *MCPReader) CheckMergeConflicts(ctx context.Context, in mcpcontract.CheckMergeConflictsInput) (mcpcontract.CheckMergeConflictsOutput, error)
CheckMergeConflicts compares already-fetched OIDs in managed workspaces without fetching or modifying refs, indexes, or worktrees.
func (*MCPReader) Concern ¶ added in v0.15.0
func (r *MCPReader) Concern(ctx context.Context, in mcpcontract.ConcernInput) (mcpcontract.ConcernOutput, error)
Concern reads one persisted concern without external access.
func (*MCPReader) CreateConcern ¶ added in v0.10.0
func (r *MCPReader) CreateConcern(ctx context.Context, in mcpcontract.CreateConcernInput) (mcpcontract.ConcernOutput, error)
CreateConcern implements the MCP local concern-write capability.
func (*MCPReader) CreateWorkspace ¶
func (r *MCPReader) CreateWorkspace(ctx context.Context, in mcpcontract.CreateWorkspaceInput) (mcpcontract.JobReference, error)
CreateWorkspace submits a durable job that clones a remote and creates a worktree.
func (*MCPReader) DeepWiki ¶ added in v0.5.0
func (r *MCPReader) DeepWiki(ctx context.Context, in mcpcontract.DeepWikiInput) (mcpcontract.DeepWikiOutput, error)
DeepWiki performs one external derived-knowledge read and does not persist its response.
func (*MCPReader) DefineValidation ¶
func (r *MCPReader) DefineValidation(ctx context.Context, in mcpcontract.DefineValidationInput) (mcpcontract.ValidationOutput, error)
DefineValidation stores a validation definition.
func (*MCPReader) Dossier ¶
func (r *MCPReader) Dossier(ctx context.Context, in mcpcontract.RepoInput) (mcpcontract.DossierOutput, error)
Dossier returns the latest persisted source-backed repository dossier.
func (*MCPReader) Draft ¶ added in v0.15.0
func (r *MCPReader) Draft(ctx context.Context, in mcpcontract.DraftInput) (mcpcontract.DraftOutput, error)
Draft reads one immutable persisted contribution-draft revision.
func (*MCPReader) Evidence ¶
func (r *MCPReader) Evidence(ctx context.Context, in mcpcontract.EvidenceInput) (mcpcontract.EvidenceOutput, error)
Evidence reads evidence for a local investigation or opportunity.
func (*MCPReader) ExplainMatch ¶
func (r *MCPReader) ExplainMatch(ctx context.Context, in mcpcontract.ExplainMatchInput) (mcpcontract.ExplainMatchOutput, error)
ExplainMatch explains why a search result matched.
func (*MCPReader) ExportManifest ¶ added in v0.10.0
func (r *MCPReader) ExportManifest(ctx context.Context, in mcpcontract.ExportManifestInput) (mcpcontract.ManifestOutput, error)
ExportManifest assembles a bounded local contribution evidence statement.
func (*MCPReader) FindClusters ¶
func (r *MCPReader) FindClusters(ctx context.Context, in mcpcontract.FindClustersInput) (mcpcontract.FindClustersOutput, error)
FindClusters lists duplicate-candidate clusters for bounded repository targets from the local corpus without recomputing them.
func (*MCPReader) FindNeighbors ¶
func (r *MCPReader) FindNeighbors(ctx context.Context, in mcpcontract.FindNeighborsInput) (mcpcontract.FindNeighborsOutput, error)
FindNeighbors ranks similar local threads in input order without network access.
func (*MCPReader) FindPortfolioOverlaps ¶ added in v0.6.0
func (r *MCPReader) FindPortfolioOverlaps(ctx context.Context, in mcpcontract.FindPortfolioOverlapsInput) (mcpcontract.FindPortfolioOverlapsOutput, error)
FindPortfolioOverlaps is a pure corpus read over complete normalized signal snapshots. It preserves candidate order and never treats absent coverage as proof that no overlap exists.
func (*MCPReader) FindPrecedents ¶ added in v0.5.0
func (r *MCPReader) FindPrecedents(ctx context.Context, in mcpcontract.FindPrecedentsInput) (mcpcontract.FindPrecedentsOutput, error)
FindPrecedents performs an offline similarity search over stored resolved threads. Each source thread is resolved and ranked independently while preserving input order and item-level recovery guidance in the bounded batch response.
func (*MCPReader) GetCoverage ¶
func (r *MCPReader) GetCoverage(ctx context.Context, in mcpcontract.GetCoverageInput) (mcpcontract.GetCoverageOutput, error)
GetCoverage returns bounded, input-ordered facet coverage without network access.
func (*MCPReader) GetFixPatternReport ¶ added in v0.14.0
func (r *MCPReader) GetFixPatternReport(ctx context.Context, id string) (mcpcontract.FixPatternReport, error)
GetFixPatternReport reads the typed terminal result of a pattern-mining job.
func (*MCPReader) GetJob ¶
func (r *MCPReader) GetJob(ctx context.Context, in mcpcontract.GetJobInput) (mcpcontract.GetJobOutput, error)
GetJob reads a durable job by ID.
func (*MCPReader) GetJobs ¶ added in v0.5.0
func (r *MCPReader) GetJobs(ctx context.Context, in mcpcontract.GetJobsInput) (mcpcontract.GetJobsOutput, error)
GetJobs reads up to 100 durable job records without waiting for completion.
func (*MCPReader) GetRepositories ¶ added in v0.5.0
func (r *MCPReader) GetRepositories(ctx context.Context, in mcpcontract.GetRepositoriesInput) (mcpcontract.GetRepositoriesOutput, error)
GetRepositories performs an offline, input-ordered corpus read and clears repository facts when metadata coverage has not been observed.
func (*MCPReader) GetThreads ¶ added in v0.5.0
func (r *MCPReader) GetThreads(ctx context.Context, in mcpcontract.GetThreadsInput) (mcpcontract.GetThreadsOutput, error)
GetThreads performs an offline, input-ordered exact-thread read. Compact mode omits bodies to keep broad triage responses bounded.
func (*MCPReader) HydrateThreads ¶ added in v0.5.0
func (r *MCPReader) HydrateThreads(ctx context.Context, in mcpcontract.HydrateThreadsInput) (mcpcontract.JobReference, error)
HydrateThreads submits a durable GitHub read for explicit child facets on selected threads; an empty facet set is rejected.
func (*MCPReader) IndexRepositories ¶ added in v0.5.0
func (r *MCPReader) IndexRepositories(ctx context.Context, in mcpcontract.IndexRepositoriesInput) (mcpcontract.JobReference, error)
IndexRepositories submits a durable Git acquisition and safe indexing job with at most two repositories processed concurrently.
func (*MCPReader) InspectCommitChanges ¶ added in v0.10.0
func (r *MCPReader) InspectCommitChanges(ctx context.Context, in mcpcontract.InspectCommitChangesInput) (mcpcontract.CommitInventoryOutput, error)
InspectCommitChanges implements the MCP commit-inventory capability.
func (*MCPReader) Investigation ¶
func (r *MCPReader) Investigation(ctx context.Context, in mcpcontract.InvestigationInput) (mcpcontract.InvestigationOutput, error)
Investigation reads a local investigation workspace from the corpus.
func (*MCPReader) Lens ¶
func (r *MCPReader) Lens(ctx context.Context, in mcpcontract.LensInput) (mcpcontract.LensOutput, error)
Lens reads a saved lens definition from the local corpus.
func (*MCPReader) LinkConcern ¶ added in v0.10.0
func (r *MCPReader) LinkConcern(ctx context.Context, in mcpcontract.LinkConcernInput) (mcpcontract.ConcernOutput, error)
LinkConcern implements MCP concern relationship writes.
func (*MCPReader) LinkPullRequest ¶ added in v0.6.0
func (r *MCPReader) LinkPullRequest(ctx context.Context, in mcpcontract.LinkPullRequestInput) (mcpcontract.LinkPullRequestOutput, error)
LinkPullRequest records an explicit local relationship without mutating GitHub.
func (*MCPReader) ListConcerns ¶ added in v0.10.0
func (r *MCPReader) ListConcerns(ctx context.Context, in mcpcontract.ListConcernsInput) (mcpcontract.ConcernListOutput, error)
ListConcerns implements the MCP offline concern-read capability.
func (*MCPReader) ListOpportunities ¶
func (r *MCPReader) ListOpportunities(ctx context.Context, in mcpcontract.ListOpportunitiesInput) (mcpcontract.ListOpportunitiesOutput, error)
ListOpportunities lists opportunities for a local investigation.
func (*MCPReader) ListPullRequestPortfolio ¶ added in v0.5.0
func (r *MCPReader) ListPullRequestPortfolio(ctx context.Context, in mcpcontract.ListPullRequestPortfolioInput) (mcpcontract.ListPullRequestPortfolioOutput, error)
ListPullRequestPortfolio performs an offline projection over stored authored PRs and status facets; unsupported health facets remain explicitly unknown.
func (*MCPReader) Manifest ¶ added in v0.15.0
func (r *MCPReader) Manifest(ctx context.Context, in mcpcontract.ManifestInput) (mcpcontract.ManifestOutput, error)
Manifest reads one persisted contribution evidence manifest.
func (*MCPReader) MineRepositoryFixPatterns ¶ added in v0.14.0
func (r *MCPReader) MineRepositoryFixPatterns(ctx context.Context, in mcpcontract.MineRepositoryFixPatternsInput) (mcpcontract.JobReference, error)
MineRepositoryFixPatterns submits one bounded GitHub-read/local-write workflow. It searches stored candidates first and hydrates only finalists whose merge outcome is unknown.
func (*MCPReader) Opportunity ¶
func (r *MCPReader) Opportunity(ctx context.Context, in mcpcontract.OpportunityInput) (mcpcontract.OpportunityOutput, error)
Opportunity reads a local contribution opportunity.
func (*MCPReader) PlanSemanticCommits ¶ added in v0.10.0
func (r *MCPReader) PlanSemanticCommits(ctx context.Context, in mcpcontract.PlanSemanticCommitsInput) (mcpcontract.SemanticCommitPlanOutput, error)
PlanSemanticCommits implements the MCP read-only semantic planning capability.
func (*MCPReader) PrepareContribution ¶
func (r *MCPReader) PrepareContribution(ctx context.Context, in mcpcontract.PrepareContributionInput) (mcpcontract.DraftOutput, error)
PrepareContribution renders a contribution draft for an opportunity.
func (*MCPReader) PrepareIssueSet ¶ added in v0.12.0
func (r *MCPReader) PrepareIssueSet(ctx context.Context, in mcpcontract.PrepareIssueSetInput) (mcpcontract.PrepareIssueSetOutput, error)
PrepareIssueSet composes contribution-facing evidence for exact stored issues. It opens only the read-only corpus and never creates workflow state.
func (*MCPReader) PromoteConcern ¶ added in v0.10.0
func (r *MCPReader) PromoteConcern(ctx context.Context, in mcpcontract.PromoteConcernInput) (mcpcontract.ConcernOutput, error)
PromoteConcern implements atomic MCP concern promotion.
func (*MCPReader) PromoteOpportunity ¶
func (r *MCPReader) PromoteOpportunity(ctx context.Context, in mcpcontract.PromoteOpportunityInput) (mcpcontract.OpportunityOutput, error)
PromoteOpportunity promotes a hypothesis to an opportunity.
func (*MCPReader) PullRequestFeedbackResource ¶ added in v0.16.0
func (*MCPReader) RankOpportunities ¶ added in v0.5.0
func (r *MCPReader) RankOpportunities(ctx context.Context, in mcpcontract.RankOpportunitiesInput) (mcpcontract.RankOpportunitiesOutput, error)
RankOpportunities performs deterministic offline Radar ranking across stored repositories.
func (*MCPReader) Readiness ¶
func (r *MCPReader) Readiness(ctx context.Context, in mcpcontract.ReadinessInput) (mcpcontract.ReadinessOutput, error)
Readiness reads a local contribution readiness report through MCP.
func (*MCPReader) RecordHypothesis ¶
func (r *MCPReader) RecordHypothesis(ctx context.Context, in mcpcontract.RecordHypothesisInput) (mcpcontract.HypothesisOutput, error)
RecordHypothesis records a fully structured hypothesis.
func (*MCPReader) Repository ¶
func (r *MCPReader) Repository(ctx context.Context, in mcpcontract.RepoInput) (mcpcontract.RepositoryOutput, error)
Repository reads a repository projection from the local corpus.
func (*MCPReader) RunValidation ¶
func (r *MCPReader) RunValidation(ctx context.Context, in mcpcontract.RunValidationInput) (mcpcontract.JobReference, error)
RunValidation submits one bounded validation execution group.
func (*MCPReader) Search ¶
func (r *MCPReader) Search(ctx context.Context, in mcpcontract.SearchInput) (mcpcontract.SearchOutput, error)
Search performs a local-only corpus search through the MCP interface.
func (*MCPReader) SearchCode ¶
func (r *MCPReader) SearchCode(ctx context.Context, in mcpcontract.SearchCodeInput) (mcpcontract.SearchCodeOutput, error)
SearchCode searches indexed code snapshots in the local corpus.
func (*MCPReader) SearchGitHubRepositories ¶ added in v0.5.0
func (r *MCPReader) SearchGitHubRepositories(ctx context.Context, in mcpcontract.SearchGitHubRepositoriesInput) (mcpcontract.SearchGitHubRepositoriesOutput, error)
SearchGitHubRepositories performs one bounded live repository search and persists the returned metadata observations without fetching thread data.
func (*MCPReader) SearchRepositories ¶
func (r *MCPReader) SearchRepositories(ctx context.Context, in mcpcontract.SearchRepositoriesInput) (mcpcontract.SearchRepositoriesOutput, error)
SearchRepositories performs a local-only repository search.
func (*MCPReader) SetConcernStatus ¶ added in v0.10.0
func (r *MCPReader) SetConcernStatus(ctx context.Context, in mcpcontract.SetConcernStatusInput) (mcpcontract.ConcernOutput, error)
SetConcernStatus implements MCP concern lifecycle transitions.
func (*MCPReader) StartInvestigation ¶
func (r *MCPReader) StartInvestigation(ctx context.Context, in mcpcontract.StartInvestigationInput) (mcpcontract.InvestigationOutput, error)
RunValidation submits a durable validation run. StartInvestigation creates a new investigation workspace.
func (*MCPReader) SyncCIFailures ¶ added in v0.16.0
func (r *MCPReader) SyncCIFailures(ctx context.Context, in mcpcontract.SyncCIFailuresInput) (mcpcontract.JobReference, error)
func (*MCPReader) SyncPortfolio ¶ added in v0.14.0
func (r *MCPReader) SyncPortfolio(ctx context.Context, in mcpcontract.SyncPortfolioInput) (mcpcontract.JobReference, error)
SyncPortfolio submits one bounded job that discovers pull requests authored by the active credential and refreshes health for the resulting stored set.
func (*MCPReader) SyncPullRequestFeedback ¶ added in v0.16.0
func (r *MCPReader) SyncPullRequestFeedback(ctx context.Context, in mcpcontract.SyncPullRequestFeedbackInput) (mcpcontract.JobReference, error)
func (*MCPReader) SyncRepositoryContext ¶ added in v0.13.0
func (r *MCPReader) SyncRepositoryContext(ctx context.Context, in mcpcontract.SyncRepositoryContextInput) (mcpcontract.JobReference, error)
SyncRepositoryContext submits a durable metadata and contribution-guidance GitHub read. It does not fetch threads, comments, reviews, or code.
func (*MCPReader) SyncThreads ¶ added in v0.5.0
func (r *MCPReader) SyncThreads(ctx context.Context, in mcpcontract.SyncThreadsInput) (mcpcontract.JobReference, error)
SyncThreads submits a durable bounded GitHub read for thread headers in repositories that already have local identities.
func (*MCPReader) Thread ¶
func (r *MCPReader) Thread(ctx context.Context, in mcpcontract.ThreadInput) (mcpcontract.ThreadOutput, error)
Thread reads one issue or pull request from the local corpus.
func (*MCPReader) ThreadByNumber ¶
func (r *MCPReader) ThreadByNumber(ctx context.Context, in mcpcontract.ThreadByNumberInput) (mcpcontract.ThreadOutput, error)
ThreadByNumber reads an issue or pull request by repository and number only.
func (*MCPReader) UpdateConcern ¶ added in v0.10.0
func (r *MCPReader) UpdateConcern(ctx context.Context, in mcpcontract.UpdateConcernInput) (mcpcontract.ConcernOutput, error)
UpdateConcern implements MCP concern content updates.
func (*MCPReader) VerifyPublishedDraft ¶ added in v0.14.0
func (r *MCPReader) VerifyPublishedDraft(ctx context.Context, in mcpcontract.VerifyPublishedDraftInput) (mcpcontract.PublishedDraftVerificationOutput, error)
func (*MCPReader) Workspace ¶ added in v0.16.0
func (r *MCPReader) Workspace(ctx context.Context, id string) (mcpcontract.WorkspaceResource, error)
Workspace returns a host-path-free workspace projection for offline resource reads.
type ManifestOptions ¶ added in v0.10.0
type ManifestOptions struct {
WorkspaceID string
PullRequest *ManifestPullRequest
}
ManifestOptions selects optional local workspace and exact stored PR inputs.
type ManifestPullRequest ¶ added in v0.10.0
ManifestPullRequest identifies one exact stored pull request.
type Neighbor ¶
type Neighbor struct {
Kind string `json:"kind"`
Owner string `json:"owner"`
Repo string `json:"repo"`
Number int `json:"number"`
Title string `json:"title"`
State string `json:"state"`
Score float64 `json:"score"`
Reason string `json:"reason"`
}
Neighbor is one ranked thread near a query.
type NeighborsResult ¶
type NeighborsResult struct {
Repo string `json:"repo"`
Kind string `json:"kind"`
Number int `json:"number"`
Limit int `json:"limit"`
Total int `json:"total"`
SourceRevision string `json:"source_revision"`
RuleVersion similarity.RuleVersion `json:"rule_version"`
Neighbors []Neighbor `json:"neighbors"`
}
NeighborsResult is the response for a local nearest-thread query.
type PullRequestCollision ¶
type PullRequestCollision struct {
Number int `json:"number"`
Title string `json:"title"`
Author string `json:"author"`
BaseRef string `json:"base_ref"`
Score float64 `json:"score"`
Reason string `json:"reason"`
}
PullRequestCollision is a competing open pull request with a score and reason.
type PullRequestCollisionResult ¶
type PullRequestCollisionResult struct {
Repo string `json:"repo"`
Number int `json:"number"`
Limit int `json:"limit"`
Total int `json:"total"`
Truncated bool `json:"truncated"`
Population int `json:"population"`
PopulationCapped bool `json:"population_capped"`
SourceRevision string `json:"source_revision"`
Collisions []PullRequestCollision `json:"collisions"`
}
PullRequestCollisionResult is the response for a focused open-PR collision query.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
New creates a Service and resolves local configuration. GitHub credentials are resolved lazily only when a network-reading operation is requested.
func NewWithContext ¶ added in v0.8.0
func NewWithContext(ctx context.Context, paths *config.Paths, version string, logger *slog.Logger) (*Service, error)
NewWithContext creates a Service bounded by ctx and Close.
func (*Service) Acquire ¶
func (s *Service) Acquire(ctx context.Context, repo contracts.RepoRef, remote string) (result *contracts.AcquisitionResult, returnErr error)
Acquire clones or fetches a repository into the managed cache, records the resolved remote URL/default branch/commit SHA/acquired time, and indexes the clean checkout into the corpus. It does not execute repository code.
func (*Service) Actions ¶ added in v0.14.0
func (s *Service) Actions(_ context.Context, item tuicontract.Item) ([]tuicontract.Action, error)
Actions returns only parameter-free operations that the application can execute for the selected item today.
func (*Service) AddCollectionMembers ¶
func (s *Service) AddCollectionMembers(ctx context.Context, name string, members []contracts.CollectionMember) (*contracts.CollectionResult, error)
AddCollectionMembers idempotently adds typed references to a collection.
func (*Service) AddGHArchiveSource ¶
func (s *Service) AddGHArchiveSource(ctx context.Context, name string, events []string) (*contracts.SourceResult, error)
AddGHArchiveSource stores a named GH Archive event filter without fetching data.
func (*Service) AddHypothesis ¶
func (s *Service) AddHypothesis(ctx context.Context, investigationID, title, description, category string) (*contracts.HypothesisResult, error)
AddHypothesis records a hypothesis under an investigation.
func (*Service) AddLens ¶
func (s *Service) AddLens(ctx context.Context, name string, def lens.Definition) (*contracts.LensResult, error)
AddLens validates and stores a lens definition.
func (*Service) AddRepoSource ¶
func (s *Service) AddRepoSource(ctx context.Context, name string, refs []contracts.RepoRef) (*contracts.SourceResult, error)
AddRepoSource stores a named, explicit set of repositories without fetching them.
func (*Service) AddSearchSource ¶
func (s *Service) AddSearchSource(ctx context.Context, name, query string) (*contracts.SourceResult, error)
AddSearchSource stores a named GitHub repository-search source without executing it.
func (*Service) AdoptWorkspace ¶ added in v0.10.0
func (s *Service) AdoptWorkspace(ctx context.Context, investigationID string, opts contracts.WorkspaceAdoptOptions) (*contracts.WorkspaceResult, error)
AdoptWorkspace records an existing local worktree without fetching, changing its refs, or taking ownership of its files.
func (*Service) ApplyCodePrune ¶ added in v0.9.0
func (s *Service) ApplyCodePrune(ctx context.Context, repo string, keepLatest int, expectedDelete []string) (*contracts.CorpusPruneResult, error)
ApplyCodePrune deletes the exact confirmed derived code-snapshot plan.
func (*Service) ApplyRepositoryRemoval ¶ added in v0.9.0
func (s *Service) ApplyRepositoryRemoval(ctx context.Context, repo, expectedRevision string) (*contracts.CorpusRepositoryRemovalResult, error)
ApplyRepositoryRemoval applies an unchanged, confirmed repository-removal plan.
func (*Service) ArchiveSync ¶
func (s *Service) ArchiveSync(ctx context.Context, repo contracts.RepoRef, opts contracts.ArchiveSyncOptions) (*contracts.SyncResult, error)
ArchiveSync adapts CLI archive options to the application sync contract.
func (*Service) ArchiveThreads ¶
func (s *Service) ArchiveThreads(ctx context.Context, repo contracts.RepoRef, kind, state string, limit int) (*contracts.ThreadListResult, error)
ArchiveThreads returns bounded current thread projections without network access.
func (*Service) AttachValidationReceipt ¶ added in v0.14.0
func (s *Service) AttachValidationReceipt(ctx context.Context, receipt contracts.ExternalValidationReceipt) (*contracts.ValidationRunResult, error)
AttachValidationReceipt imports a structured external receipt without executing its declared command.
func (*Service) BackupCorpus ¶ added in v0.9.0
func (s *Service) BackupCorpus(ctx context.Context, destination string) (*contracts.CorpusBackupResult, error)
BackupCorpus creates a verified online backup at destination.
func (*Service) BuildRepositoryDossier ¶
func (s *Service) BuildRepositoryDossier(ctx context.Context, repo contracts.RepoRef) (*domain.Dossier, error)
BuildRepositoryDossier builds a deterministic dossier from local corpus data, persists it safely, and returns the result.
func (*Service) CancelJob ¶
CancelJob records and applies a cancellation request, then returns current state.
func (*Service) CheckHypothesisCollisions ¶
func (s *Service) CheckHypothesisCollisions(ctx context.Context, hypothesisID string, limit int) (*contracts.CollisionCheckResult, error)
CheckHypothesisCollisions searches the local corpus for open pull requests that may collide with a hypothesis.
func (*Service) CheckHypothesisDuplicates ¶
func (s *Service) CheckHypothesisDuplicates(ctx context.Context, hypothesisID string, limit int) (*contracts.DuplicateCheckResult, error)
CheckHypothesisDuplicates searches the local corpus for threads similar to a hypothesis, returning each finding as evidence.
func (*Service) CheckOpportunityCollisions ¶
func (s *Service) CheckOpportunityCollisions(ctx context.Context, opportunityID string, limit int) (*contracts.CollisionCheckResult, error)
CheckOpportunityCollisions searches the local corpus for open pull requests that may collide with an opportunity.
func (*Service) CheckOpportunityDuplicates ¶
func (s *Service) CheckOpportunityDuplicates(ctx context.Context, opportunityID string, limit int) (*contracts.DuplicateCheckResult, error)
CheckOpportunityDuplicates searches the local corpus for threads similar to an opportunity.
func (*Service) Close ¶
Close cancels and waits for active jobs, then closes the corpus database connection.
func (*Service) Cluster ¶
func (s *Service) Cluster(ctx context.Context, id string, limit int) (*contracts.ClusterResult, error)
Cluster returns a single cluster by stable id.
func (*Service) CompareValidation ¶
func (s *Service) CompareValidation(ctx context.Context, baseRunID, candidateRunID string) (*contracts.ValidationComparisonResult, error)
CompareValidation compares a base validation run with a candidate validation run.
func (*Service) Configure ¶
func (s *Service) Configure(ctx context.Context, opts contracts.ConfigureOptions) (*contracts.ConfigureResult, error)
Configure validates and atomically saves supported typed settings. Runtime environment overrides are deliberately not persisted.
func (*Service) ContributionManifest ¶ added in v0.10.0
func (s *Service) ContributionManifest(ctx context.Context, opportunityID string, opts ManifestOptions) (*manifest.Statement, error)
ContributionManifest assembles and persists one bounded local evidence statement.
func (*Service) ContributionRadar ¶
func (s *Service) ContributionRadar(ctx context.Context, opts contracts.RadarOptions) (*radar.Report, error)
ContributionRadar ranks a bounded set of locally stored open issues. It is a strict corpus read: it neither resolves a GitHub reader nor writes state.
func (*Service) ControlStatus ¶
ControlStatus returns local corpus counts and freshness without network access or implicit hydration.
func (*Service) Coverage ¶
func (s *Service) Coverage(ctx context.Context, repo contracts.RepoRef) (*contracts.CoverageResult, error)
Coverage returns repository-level facet coverage without network access.
func (*Service) Crawl ¶
func (s *Service) Crawl(ctx context.Context, name string, opts contracts.CrawlOptions) (*contracts.CrawlResult, error)
Crawl performs one explicit, bounded read for a saved discovery source and persists its checkpoint only after the bounded operation succeeds.
func (*Service) CreateCollection ¶
func (s *Service) CreateCollection(ctx context.Context, name string) (*contracts.CollectionResult, error)
CreateCollection creates a named collection.
func (*Service) CreateConcern ¶ added in v0.10.0
func (s *Service) CreateConcern(ctx context.Context, opts contracts.ConcernCreateOptions) (*contracts.ConcernResult, error)
CreateConcern records one local concern without external access.
func (*Service) CreateHypothesis ¶
func (s *Service) CreateHypothesis(ctx context.Context, investigationID string, input investigation.CreateHypothesisInput) (*investigation.Hypothesis, error)
CreateHypothesis records a fully structured hypothesis under an investigation.
func (*Service) CreateWorkspace ¶
func (s *Service) CreateWorkspace(ctx context.Context, investigationID string, opts contracts.WorkspaceCreateOptions) (*contracts.WorkspaceResult, error)
CreateWorkspace creates a managed worktree for an investigation.
func (*Service) DefineValidation ¶
func (s *Service) DefineValidation(ctx context.Context, investigationID string, opts contracts.DefineValidationOptions) (*contracts.ValidationResult, error)
DefineValidation stores a validation definition for an investigation.
func (*Service) DiscoverSetup ¶ added in v0.3.0
DiscoverSetup inspects local onboarding state without writes, network access, credential resolution, or process execution.
func (*Service) Doctor ¶
Doctor performs bounded local diagnostics. It reports authentication source availability but never returns credential values or command output.
func (*Service) Dossier ¶
func (s *Service) Dossier(ctx context.Context, repo contracts.RepoRef) (*contracts.DossierResult, error)
Dossier builds a deterministic, local-corpus-backed repository dossier.
func (*Service) DuplicateCandidates ¶
func (s *Service) DuplicateCandidates(ctx context.Context, repo contracts.RepoRef, kind string, number int, limit int) (*DuplicateCandidatesResult, error)
DuplicateCandidates returns the included members of the duplicate-candidate cluster containing the query thread, excluding the query itself. It returns a deterministic order, transparent scores, the cluster stable id, canonical member, and source revision. If the thread is not in a cluster, the result is empty.
func (*Service) ExecuteAction ¶ added in v0.14.0
func (s *Service) ExecuteAction(ctx context.Context, request tuicontract.ActionRequest) (tuicontract.ActionResult, error)
ExecuteAction dispatches a previously offered operation. Every case uses local application services; none performs network access or GitHub mutation.
func (*Service) ExplainLens ¶
func (s *Service) ExplainLens(ctx context.Context, name, ref string, opts contracts.LensExplainOptions) (*contracts.LensExplainResult, error)
ExplainLens returns the saved definition, candidate facts, normalized signals, weighted contributions, final score, population context, and missing signals for a candidate under a saved lens. It performs no network access.
func (*Service) ExplainMatch ¶
func (s *Service) ExplainMatch(_ context.Context, query string, match contracts.SearchMatch) (*ExplainMatchResult, error)
ExplainMatch returns factual score reasons for a search match without network access. The returned reasons describe stored text matches, source freshness, and coverage signals.
func (*Service) ExplainReadiness ¶
func (s *Service) ExplainReadiness(ctx context.Context, checkID string) (*contracts.ReadinessCheck, error)
ExplainReadiness re-evaluates readiness and returns the requested check.
func (*Service) ExportDossier ¶
func (s *Service) ExportDossier(ctx context.Context, repo contracts.RepoRef, format string) (*contracts.ExportResult, error)
ExportDossier builds and renders a deterministic redacted dossier bundle.
func (*Service) ExportEvidence ¶
func (s *Service) ExportEvidence(ctx context.Context, investigationID, format string) (*contracts.ExportResult, error)
ExportEvidence renders a deterministic redacted investigation evidence bundle.
func (*Service) ExportLocalMetadata ¶
func (s *Service) ExportLocalMetadata(ctx context.Context, opts contracts.MetadataExportOptions) (*contracts.MetadataExportResult, error)
ExportLocalMetadata returns a bounded, redacted, deterministic JSON export of local tracking metadata. It does not include tokens, credentials, or absolute local paths.
func (*Service) ExportManifest ¶ added in v0.10.0
func (s *Service) ExportManifest(ctx context.Context, opportunityID string, opts contracts.ManifestExportOptions) (*contracts.ExportResult, error)
ExportManifest generates, persists, and renders one local JSON statement.
func (*Service) ExtractSeeds ¶
func (s *Service) ExtractSeeds(ctx context.Context, repo contracts.RepoRef, opts domain.ExtractSeedsOptions) ([]domain.Seed, error)
ExtractSeeds derives evidence-backed contribution seeds from locally stored merged PRs, closed-unmerged PRs, and issues. By default it returns only positive and negative outcome evidence; issue-only context is opt-in. It performs no network access.
func (*Service) GetContribution ¶
func (s *Service) GetContribution(ctx context.Context, id string) (*contracts.ContributionResult, error)
GetContribution returns contribution metadata by durable id.
func (*Service) GetRepositoryDossier ¶
func (s *Service) GetRepositoryDossier(ctx context.Context, repo contracts.RepoRef) (*domain.Dossier, error)
GetRepositoryDossier returns the most recently persisted dossier for a repository.
func (*Service) Hydrate ¶
func (s *Service) Hydrate(ctx context.Context, repo contracts.RepoRef, number int, opts contracts.HydrateOptions) (*contracts.HydrateResult, error)
Hydrate adapts the explicit CLI hydration contract to selective hydration.
func (*Service) HydrateRepository ¶
func (s *Service) HydrateRepository(ctx context.Context, repo contracts.RepoRef, opts HydrateRepositoryOptions) (*HydrateResult, error)
HydrateRepository hydrates selected facets for threads in a repository. It is explicit, bounded, cancellation-aware, and aggregates per-thread results.
func (*Service) HydrateThread ¶
func (s *Service) HydrateThread(ctx context.Context, repo contracts.RepoRef, number int, opts HydrateOptions) (*HydrateResult, error)
HydrateThread fetches the requested facets for an issue or pull request and stores immutable facet observations. It is explicit, bounded, paginated, cancellation-aware, and records independent facet coverage plus run completion/failure statistics.
func (*Service) ImportLocalMetadata ¶
func (s *Service) ImportLocalMetadata(ctx context.Context, opts contracts.MetadataImportOptions) (*contracts.MetadataImportResult, error)
ImportLocalMetadata imports a bounded JSON bundle of local tracking metadata idempotently.
func (*Service) Index ¶
func (s *Service) Index(ctx context.Context, repo contracts.RepoRef, path string) (*contracts.IndexResult, error)
Index records a bounded immutable code snapshot from a clean local checkout.
func (*Service) Init ¶
Init opens or creates the configured corpus and persists a default configuration if one does not already exist.
func (*Service) InspectCommitChanges ¶ added in v0.10.0
func (s *Service) InspectCommitChanges(ctx context.Context, workspaceID string) (commitplan.Inventory, error)
InspectCommitChanges returns stable assignable units for a managed workspace. It reads only the local worktree and Git object database.
func (*Service) InspectCorpus ¶ added in v0.9.0
InspectCorpus reports corpus compatibility without mutation.
func (*Service) InventoryCorpus ¶ added in v0.9.0
func (s *Service) InventoryCorpus(ctx context.Context, repo string) (*contracts.CorpusInventoryResult, error)
InventoryCorpus reports bounded storage details for one repository.
func (*Service) Jobs ¶
func (s *Service) Jobs(ctx context.Context) (*JobExecutor, error)
Jobs returns the durable job executor, opening the corpus if needed.
func (*Service) LinkConcern ¶ added in v0.10.0
func (s *Service) LinkConcern(ctx context.Context, id string, opts contracts.ConcernLinkOptions) (*contracts.ConcernResult, error)
LinkConcern attaches one explicit typed relationship.
func (*Service) ListClusters ¶ added in v0.8.0
func (s *Service) ListClusters(ctx context.Context, repo contracts.RepoRef, limit int) (*contracts.ClusterListResult, error)
ListClusters reads the current stored duplicate-candidate projection. It does not compute or write cluster state.
func (*Service) ListCollections ¶
ListCollections returns all named collections.
func (*Service) ListConcerns ¶ added in v0.10.0
func (s *Service) ListConcerns(ctx context.Context, opts contracts.ConcernListOptions) (*contracts.ConcernListResult, error)
ListConcerns performs a bounded offline concern list or search.
func (*Service) ListContributionOutcomes ¶
func (s *Service) ListContributionOutcomes(ctx context.Context, contributionID string) (*contracts.ContributionOutcomeListResult, error)
ListContributionOutcomes returns lifecycle outcomes for a contribution.
func (*Service) ListContributions ¶
func (s *Service) ListContributions(ctx context.Context, opts contracts.ListContributionsOptions) (*contracts.ContributionListResult, error)
ListContributions returns contribution metadata in prepared-at order.
func (*Service) ListCorpusInventory ¶ added in v0.9.0
func (s *Service) ListCorpusInventory(ctx context.Context) (*contracts.CorpusInventoryListResult, error)
ListCorpusInventory reports bounded storage details for every repository scope.
func (*Service) ListCorpusProjections ¶ added in v0.9.0
func (s *Service) ListCorpusProjections(ctx context.Context) (*contracts.CorpusProjectionListResult, error)
ListCorpusProjections reports derived projection identities and freshness.
func (*Service) ListHypotheses ¶
func (s *Service) ListHypotheses(ctx context.Context, investigationID string) (*contracts.HypothesisListResult, error)
ListHypotheses returns hypotheses for an investigation.
func (*Service) ListInvestigations ¶
func (s *Service) ListInvestigations(ctx context.Context) (*contracts.InvestigationListResult, error)
ListInvestigations returns all investigations.
func (*Service) ListJobs ¶
func (s *Service) ListJobs(ctx context.Context, status string, limit int) (*contracts.JobListResult, error)
ListJobs returns bounded durable jobs for CLI and MCP adapters.
func (*Service) ListLenses ¶
ListLenses returns all saved lenses in stable order.
func (*Service) ListOpportunities ¶
func (s *Service) ListOpportunities(ctx context.Context, investigationID string) (*contracts.OpportunityListResult, error)
ListOpportunities returns opportunities, optionally filtered to one investigation.
func (*Service) ListSources ¶
ListSources returns all saved discovery sources from the local corpus.
func (*Service) ListTriageEvents ¶
func (s *Service) ListTriageEvents(ctx context.Context, opts contracts.ListTriageEventsOptions) (*contracts.TriageEventListResult, error)
ListTriageEvents returns local triage outcomes in source-event order.
func (*Service) MCPReader ¶
func (s *Service) MCPReader() mcpcontract.Reader
MCPReader returns an MCP adapter backed by this service. Read methods remain offline; methods named sync or hydrate are explicit network-read operations.
func (*Service) Metadata ¶
Metadata reports deterministic application and local capability metadata. It performs no network access and never creates or migrates the corpus.
func (*Service) MigrateCorpus ¶ added in v0.9.0
func (s *Service) MigrateCorpus(ctx context.Context, opts contracts.CorpusMigrateOptions) (*contracts.CorpusMigrationResult, error)
MigrateCorpus explicitly applies pending schema migrations with backup policy.
func (*Service) NeighborQuery ¶
func (s *Service) NeighborQuery(ctx context.Context, repo contracts.RepoRef, kind string, number, limit int) (*contracts.NeighborListResult, error)
NeighborQuery returns transparent local nearest-thread results.
func (*Service) Neighbors ¶
func (s *Service) Neighbors(ctx context.Context, repo contracts.RepoRef, kind string, number int, limit int) (*NeighborsResult, error)
Neighbors returns a bounded, ranked list of threads most similar to the query thread. Results include transparent scores, reasons, and the source revision of the candidate population. No network access occurs.
func (*Service) OpportunityReadiness ¶
func (s *Service) OpportunityReadiness(ctx context.Context, opportunityID string) (*contracts.ReadinessResult, error)
OpportunityReadiness evaluates local, source-backed readiness checks for one opportunity.
func (*Service) PlanArchiveSync ¶ added in v0.8.0
func (s *Service) PlanArchiveSync(_ context.Context, repo contracts.RepoRef, opts contracts.ArchiveSyncOptions) (*contracts.SyncPlanResult, error)
PlanArchiveSync computes the conservative request ceiling before resolving a GitHub reader or opening the corpus.
func (*Service) PlanCodePrune ¶ added in v0.9.0
func (s *Service) PlanCodePrune(ctx context.Context, repo string, keepLatest int) (*contracts.CorpusPruneResult, error)
PlanCodePrune previews derived code snapshots eligible for deletion.
func (*Service) PlanRepositoryContextSync ¶ added in v0.13.0
func (*Service) PlanRepositoryRemoval ¶ added in v0.9.0
func (s *Service) PlanRepositoryRemoval(ctx context.Context, repo string) (*contracts.CorpusRepositoryRemovalResult, error)
PlanRepositoryRemoval previews the exact repository-owned removal scope.
func (*Service) PlanSemanticCommits ¶ added in v0.10.0
func (s *Service) PlanSemanticCommits(ctx context.Context, workspaceID, expectedInventorySHA256 string, input commitplan.PlanInput) (commitplan.Plan, error)
PlanSemanticCommits validates agent-authored semantic groups against the current workspace snapshot. It never stages changes or rewrites history.
func (*Service) PrepareIssue ¶
func (s *Service) PrepareIssue(ctx context.Context, opportunityID string, opts contracts.PrepareIssueOptions) (*contracts.DraftResult, error)
PrepareIssue renders and stores an issue draft for an opportunity.
func (*Service) PreparePullRequest ¶
func (s *Service) PreparePullRequest(ctx context.Context, opportunityID string, opts contracts.PreparePROptions) (*contracts.DraftResult, error)
PreparePullRequest renders and stores a pull request draft for an opportunity.
func (*Service) PrepareReviewReport ¶
func (s *Service) PrepareReviewReport(ctx context.Context, input contracts.PrepareReviewReportInput) (*contracts.ReviewReport, error)
PrepareReviewReport assembles a review report for an opportunity and/or workspace.
func (*Service) PromoteConcern ¶ added in v0.10.0
func (s *Service) PromoteConcern(ctx context.Context, id string, opts contracts.ConcernPromoteOptions) (*contracts.ConcernResult, error)
PromoteConcern atomically creates downstream investigation workflow records.
func (*Service) PromoteOpportunity ¶
func (s *Service) PromoteOpportunity(ctx context.Context, hypothesisID, problem, scope, impact, effort string, confidence float64) (*contracts.OpportunityResult, error)
PromoteOpportunity converts a proposed hypothesis into an opportunity.
func (*Service) PromoteOpportunityWithInput ¶
func (s *Service) PromoteOpportunityWithInput(ctx context.Context, hypothesisID string, input investigation.PromoteOpportunityInput) (*investigation.Opportunity, error)
PromoteOpportunityWithInput promotes a hypothesis with dependencies and maintainer-alignment evidence.
func (*Service) PullRequestCollisions ¶
func (s *Service) PullRequestCollisions(ctx context.Context, repo contracts.RepoRef, number int, limit int) (*PullRequestCollisionResult, error)
PullRequestCollisions returns a bounded, ranked list of open pull requests that may collide with the query PR. It uses only existing local data: base branch from the stored PR payload, explicit cross-references in the title/body, and shared author. No network access occurs and no semantic file overlap is invented.
func (*Service) RebuildCorpusProjection ¶ added in v0.9.0
func (s *Service) RebuildCorpusProjection(ctx context.Context, name string) (*contracts.CorpusProjectionResult, error)
RebuildCorpusProjection explicitly replaces one derived search projection.
func (*Service) RecordContribution ¶
func (s *Service) RecordContribution(ctx context.Context, opts contracts.RecordContributionOptions) (*contracts.ContributionResult, error)
RecordContribution stores prepared or submitted contribution metadata for an opportunity, keeping it separate from live GitHub state.
func (*Service) RecordContributionOutcome ¶
func (s *Service) RecordContributionOutcome(ctx context.Context, opts contracts.RecordContributionOutcomeOptions) (*contracts.ContributionOutcomeResult, error)
RecordContributionOutcome stores a lifecycle outcome for a contribution.
func (*Service) RecordEvidence ¶
func (s *Service) RecordEvidence(ctx context.Context, input contracts.RecordEvidenceInput) (*evidence.Evidence, error)
RecordEvidence stores an evidence item scoped to its parent workflow.
func (*Service) RecordTriageEvent ¶
func (s *Service) RecordTriageEvent(ctx context.Context, opts contracts.RecordTriageEventOptions) (*contracts.TriageEventResult, error)
RecordTriageEvent records a local triage or feedback outcome for a typed target.
func (*Service) RefreshClusters ¶ added in v0.8.0
func (s *Service) RefreshClusters(ctx context.Context, repo contracts.RepoRef) (*contracts.ClusterRefreshResult, error)
RefreshClusters explicitly computes and persists the duplicate-candidate projection for a repository.
func (*Service) RepositoryContextSync ¶ added in v0.13.0
func (*Service) RepositoryHealth ¶
func (s *Service) RepositoryHealth(ctx context.Context, repo contracts.RepoRef) (*health.Report, error)
RepositoryHealth returns a deterministic repository health report derived from already stored corpus facts. It performs no network access.
func (*Service) RepositoryHealthWithOptions ¶
func (s *Service) RepositoryHealthWithOptions(ctx context.Context, repo contracts.RepoRef, opts health.Options) (*health.Report, error)
RepositoryHealthWithOptions returns a deterministic repository health report using the provided analysis window and stale threshold.
func (*Service) ResearchBrief ¶ added in v0.14.0
func (s *Service) ResearchBrief(ctx context.Context, item tuicontract.Item) (tuicontract.ResearchBrief, error)
ResearchBrief projects the existing source-backed local research package into the terminal contract. It performs no network access or mutation.
func (*Service) RestoreCorpus ¶ added in v0.9.0
func (s *Service) RestoreCorpus(ctx context.Context, source, safetyBackup string) (*contracts.CorpusRestoreResult, error)
RestoreCorpus replaces the corpus from a verified backup after safety backup.
func (*Service) RunHistory ¶
RunHistory returns bounded durable run metadata.
func (*Service) RunValidation ¶
func (s *Service) RunValidation(ctx context.Context, id string, opts contracts.RunValidationOptions) (*contracts.ValidationRunResult, error)
RunValidation executes a stored validation definition against the base or candidate workspace.
func (*Service) RunValidationGroup ¶ added in v0.10.0
func (s *Service) RunValidationGroup(ctx context.Context, id string, opts contracts.RepeatValidationOptions) (*contracts.ValidationRunGroupResult, error)
RunValidationGroup executes a bounded repeat/stress validation group.
func (*Service) RuntimeContract ¶ added in v0.9.0
RuntimeContract reports immutable executable compatibility metadata.
func (*Service) Search ¶
func (s *Service) Search(ctx context.Context, query string, opts contracts.SearchOptions) (*contracts.SearchResult, error)
Search performs a local-only corpus search and supports repo and kind filters.
func (*Service) SetArchiveFetcher ¶
func (s *Service) SetArchiveFetcher(f discovery.ArchiveFetcher)
SetArchiveFetcher overrides the GH Archive fetcher. It is intended for tests.
func (*Service) SetConcernStatus ¶ added in v0.10.0
func (s *Service) SetConcernStatus(ctx context.Context, id, status, rationale string) (*contracts.ConcernResult, error)
SetConcernStatus applies one validated non-promotion transition.
func (*Service) SetDeepWikiReader ¶ added in v0.5.0
SetDeepWikiReader overrides the derived external knowledge reader. It is intended for tests and embedding.
func (*Service) SetGitHubReader ¶
SetGitHubReader overrides the GitHub reader. It is intended for tests.
func (*Service) SetOpportunityStatus ¶
func (s *Service) SetOpportunityStatus(ctx context.Context, id, status, rationale string) (*contracts.OpportunityResult, error)
SetOpportunityStatus transitions an opportunity with a recorded rationale.
func (*Service) Setup ¶
func (s *Service) Setup(ctx context.Context, opts contracts.SetupOptions) (*contracts.SetupReport, error)
Setup initializes local state for one of three access modes. MCP-only setup copies the running native executable into a private product-owned directory; CLI-only setup installs the published command globally through npm; Both registers that verified global executable with selected coding clients. Installation failures stop before later configuration writes.
Dry-run setup validates and reports the same access-mode plan without invoking npm or writing local state. Setup performs no GitHub access and never executes repository-controlled code.
func (*Service) SetupWithProgress ¶ added in v0.3.0
func (s *Service) SetupWithProgress(ctx context.Context, opts contracts.SetupOptions, observer contracts.SetupObserver) (*contracts.SetupReport, error)
SetupWithProgress applies setup while reporting phase changes to an optional observer owned by the interactive CLI adapter.
func (*Service) ShowConcern ¶ added in v0.10.0
ShowConcern returns one local concern with derived freshness.
func (*Service) ShowEvidence ¶
func (s *Service) ShowEvidence(ctx context.Context, investigationID string) (*contracts.EvidenceResult, error)
ShowEvidence returns the evidence packet for an investigation.
func (*Service) ShowInvestigation ¶
func (s *Service) ShowInvestigation(ctx context.Context, id string) (*contracts.InvestigationResult, error)
ShowInvestigation returns an investigation by ID.
func (*Service) ShowOpportunity ¶
func (s *Service) ShowOpportunity(ctx context.Context, id string) (*contracts.OpportunityResult, error)
ShowOpportunity returns an opportunity by ID.
func (*Service) ShowSource ¶
ShowSource returns one saved discovery source from the local corpus.
func (*Service) ShowValidation ¶
func (s *Service) ShowValidation(ctx context.Context, id string) (*contracts.ValidationResult, error)
ShowValidation returns a stored validation definition without executing it.
func (*Service) ShowWorkspace ¶
ShowWorkspace returns a workspace by ID with its current dirty state.
func (*Service) StartInvestigation ¶
func (s *Service) StartInvestigation(ctx context.Context, repo contracts.RepoRef, commitSHA, lens string) (*contracts.InvestigationResult, error)
StartInvestigation creates a new investigation scoped to a repository.
func (*Service) StartInvestigationFromThread ¶
func (s *Service) StartInvestigationFromThread(ctx context.Context, requested research.ThreadRef) (*contracts.ThreadInvestigationResult, error)
StartInvestigationFromThread atomically creates an investigation and seed hypothesis from one exact local observation. It performs no network access or process execution.
func (*Service) TailSource ¶
func (s *Service) TailSource(ctx context.Context, name string, opts contracts.TailOptions) (*contracts.TailResult, error)
TailSource repeatedly advances a named source until cancellation. Each iteration is an ordinary idempotent crawl and therefore retains its own run record, checkpoint, request budget, and failure state.
func (*Service) ThreadResearchBrief ¶
func (s *Service) ThreadResearchBrief(ctx context.Context, ref research.ThreadRef) (*research.Brief, error)
ThreadResearchBrief builds a deterministic brief from the local corpus. It performs no network access, local mutation, or process execution.
func (*Service) TransitionHypothesis ¶
func (s *Service) TransitionHypothesis(ctx context.Context, hypothesisID, status, rationale string) (*investigation.Hypothesis, error)
TransitionHypothesis advances a hypothesis through its lifecycle with rationale.
func (*Service) UpdateConcern ¶ added in v0.10.0
func (s *Service) UpdateConcern(ctx context.Context, id string, opts contracts.ConcernUpdateOptions) (*contracts.ConcernResult, error)
UpdateConcern changes editable concern content without changing status.
func (*Service) UpdateHypothesis ¶
func (s *Service) UpdateHypothesis(ctx context.Context, hypothesisID string, input investigation.UpdateHypothesisInput) (*investigation.Hypothesis, error)
UpdateHypothesis deliberately overwrites a hypothesis with rationale.
func (*Service) UpdateHypothesisFields ¶ added in v0.11.0
func (s *Service) UpdateHypothesisFields(ctx context.Context, hypothesisID string, opts contracts.HypothesisUpdateOptions) (*investigation.Hypothesis, error)
UpdateHypothesisFields applies a partial update without making callers reconstruct unchanged hypothesis state.
func (*Service) UpdateOpportunityCollisionStatus ¶
func (s *Service) UpdateOpportunityCollisionStatus(ctx context.Context, opportunityID, status, rationale string) (*investigation.Opportunity, error)
UpdateOpportunityCollisionStatus explicitly sets the collision status with rationale.
func (*Service) Upgrade ¶
func (s *Service) Upgrade(ctx context.Context, opts contracts.UpgradeOptions) (*contracts.UpgradeReport, error)
Upgrade checks npm for the latest release and updates persistent npm installations when explicitly authorized. It reports inspectable stages covering the npm launcher, private MCP runtime, configured client runtime, corpus schema compatibility, activation/restart action, and rollback limitations. It does not migrate the corpus or silently update an npx invocation.
func (*Service) VerifyPublishedDraft ¶ added in v0.14.0
func (s *Service) VerifyPublishedDraft(ctx context.Context, in contracts.VerifyPublishedDraftInput) (*contracts.PublishedDraftVerification, error)
VerifyPublishedDraft compares one immutable local revision with one explicitly synchronized GitHub thread and never performs a network read.
func (*Service) WorkspaceDiff ¶
func (s *Service) WorkspaceDiff(ctx context.Context, id string) (*contracts.WorkspaceDiffResult, error)
WorkspaceDiff returns the current diff of a workspace against its recorded base, including changed files and a suggested review order.
Source Files
¶
- acquisition.go
- app.go
- clustering.go
- collection.go
- commitplan.go
- concerns.go
- contribution.go
- control.go
- corpus_lifecycle.go
- discovery.go
- doc.go
- dossier.go
- draft_verification.go
- evidence.go
- evidence_freshness.go
- guidance.go
- health.go
- hydration.go
- hydration_refresh.go
- hydration_repo.go
- index.go
- investigation.go
- investigation_thread.go
- job_executor.go
- jobs.go
- lens.go
- manifest.go
- mcp.go
- mcp_advanced_reads.go
- mcp_authored_sync.go
- mcp_code_search.go
- mcp_commitplan.go
- mcp_concerns.go
- mcp_contribution_artifacts.go
- mcp_fix_patterns.go
- mcp_issue_set.go
- mcp_jobs.go
- mcp_portfolio_relationships.go
- mcp_portfolio_sync.go
- mcp_pr_health.go
- mcp_pr_workflows.go
- mcp_readiness.go
- mcp_repository_search.go
- mcp_resource_reads.go
- mcp_resources.go
- mcp_scalable_operations.go
- mcp_scalable_reads.go
- mcp_v1.go
- neighbor_models.go
- neighbors.go
- radar.go
- radar_related_work.go
- reader.go
- readiness.go
- repeated_validation_mcp.go
- research.go
- research_reader.go
- runtime_contract.go
- search.go
- search_explain.go
- search_helpers.go
- setup.go
- surfaces_extra.go
- sync_budget.go
- sync_headers.go
- sync_thread_operations.go
- tracking.go
- tui.go
- tui_actions.go
- tui_brief.go
- tui_sync_status.go
- upgrade.go
- upgrade_activation.go
- upgrade_stages.go
- workspace.go