generated from coulomb/repo-seed
Record quality gate audit decisions
This commit is contained in:
@@ -235,6 +235,16 @@ class RegistryService:
|
||||
candidate_source = "deterministic"
|
||||
candidates = normalize_candidate_drafts(candidates)
|
||||
self.store.replace_candidate_graph(repository_id, completed_run.id, candidates)
|
||||
gate_outcomes = evaluate_candidate_graph_quality(
|
||||
self.store.get_candidate_graph(repository_id, completed_run.id)
|
||||
)
|
||||
if gate_outcomes:
|
||||
self.store.create_review_decision(
|
||||
repository_id,
|
||||
completed_run.id,
|
||||
action="quality_gate_evaluation",
|
||||
notes=self._quality_gate_review_notes(gate_outcomes),
|
||||
)
|
||||
if "llm" in candidate_source:
|
||||
log_operation(
|
||||
"llm_extraction_used",
|
||||
@@ -282,6 +292,27 @@ class RegistryService:
|
||||
facts=facts,
|
||||
)
|
||||
|
||||
def _quality_gate_review_notes(
|
||||
self,
|
||||
gate_outcomes,
|
||||
) -> str:
|
||||
criteria = ", ".join(
|
||||
sorted({outcome.criterion_id for outcome in gate_outcomes})
|
||||
)
|
||||
outcome_counts: dict[str, int] = {}
|
||||
for outcome in gate_outcomes:
|
||||
outcome_counts[outcome.outcome] = outcome_counts.get(outcome.outcome, 0) + 1
|
||||
outcomes = ", ".join(
|
||||
f"{name}:{count}" for name, count in sorted(outcome_counts.items())
|
||||
)
|
||||
return (
|
||||
f"criteria_version={active_quality_criteria_version()}; "
|
||||
f"criteria={criteria}; outcomes={outcomes}; "
|
||||
f"quality_gate_outcomes={len(gate_outcomes)}; "
|
||||
"rationale=Deterministic quality gates flagged candidates for "
|
||||
"review without approving registry truth."
|
||||
)
|
||||
|
||||
def _generate_candidates(
|
||||
self,
|
||||
repository: Repository,
|
||||
|
||||
Reference in New Issue
Block a user