generated from coulomb/repo-seed
Coevolution extension
This commit is contained in:
@@ -54,6 +54,19 @@ class ReviewDecision:
|
||||
created_at: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ExpectationGap:
|
||||
id: int
|
||||
repository_id: int
|
||||
analysis_run_id: int | None
|
||||
expected_type: str
|
||||
expected_name: str
|
||||
source: str
|
||||
notes: str
|
||||
status: str
|
||||
created_at: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class AnalysisRunDiffItem:
|
||||
change_type: str
|
||||
|
||||
@@ -16,6 +16,7 @@ from repo_registry.core.models import (
|
||||
CandidateFeature,
|
||||
CandidateGraph,
|
||||
ContentChunk,
|
||||
ExpectationGap,
|
||||
ObservedFact,
|
||||
Repository,
|
||||
RepositoryAbilityMap,
|
||||
@@ -282,6 +283,39 @@ class RegistryService:
|
||||
) -> list[ReviewDecision]:
|
||||
return self.store.list_review_decisions(repository_id, analysis_run_id)
|
||||
|
||||
def record_expectation_gap(
|
||||
self,
|
||||
repository_id: int,
|
||||
*,
|
||||
analysis_run_id: int | None = None,
|
||||
expected_type: str,
|
||||
expected_name: str,
|
||||
source: str,
|
||||
notes: str = "",
|
||||
) -> ExpectationGap:
|
||||
gap = self.store.create_expectation_gap(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
expected_type=expected_type,
|
||||
expected_name=expected_name,
|
||||
source=source,
|
||||
notes=notes,
|
||||
)
|
||||
self.store.create_review_decision(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
action="record_expectation_gap",
|
||||
notes=f"{source} expected {expected_type}: {expected_name}",
|
||||
)
|
||||
return gap
|
||||
|
||||
def list_expectation_gaps(
|
||||
self,
|
||||
repository_id: int,
|
||||
analysis_run_id: int | None = None,
|
||||
) -> list[ExpectationGap]:
|
||||
return self.store.list_expectation_gaps(repository_id, analysis_run_id)
|
||||
|
||||
def list_observed_facts(
|
||||
self,
|
||||
repository_id: int,
|
||||
|
||||
Reference in New Issue
Block a user