generated from coulomb/repo-seed
Implement scope-derived candidate review infrastructure
This commit is contained in:
@@ -84,7 +84,67 @@ def test_quality_gates_flag_circular_scope_evidence():
|
||||
outcomes = evaluate_candidate_capability_quality(capability)
|
||||
|
||||
assert outcomes[0].criterion_id == "RREG-QC-005"
|
||||
assert outcomes[0].outcome == "rejected"
|
||||
assert outcomes[0].outcome == "requires_review"
|
||||
|
||||
|
||||
def test_quality_gates_flag_scope_derived_candidates_for_review():
|
||||
capability = CandidateCapability(
|
||||
id=12,
|
||||
name="Application workload deployment",
|
||||
description="Extracted from SCOPE.md.",
|
||||
inputs=[],
|
||||
outputs=[],
|
||||
confidence=0.6,
|
||||
status="candidate",
|
||||
source_refs=[source_ref("SCOPE.md", "scope")],
|
||||
confidence_label="medium",
|
||||
primary_class="infrastructure",
|
||||
attributes=["scope-derived", "review-required-scope"],
|
||||
)
|
||||
|
||||
outcomes = evaluate_candidate_capability_quality(capability)
|
||||
|
||||
outcome_ids = {outcome.criterion_id for outcome in outcomes}
|
||||
assert {"RREG-QC-005"} <= outcome_ids
|
||||
assert all(outcome.outcome == "requires_review" for outcome in outcomes)
|
||||
|
||||
|
||||
def test_quality_gates_flag_template_contaminated_abilities():
|
||||
graph = CandidateGraph(
|
||||
repository=Repository(
|
||||
id=1,
|
||||
name="Ops Warden",
|
||||
url=".",
|
||||
description=None,
|
||||
branch="main",
|
||||
status="analyzed",
|
||||
),
|
||||
analysis_run=AnalysisRun(
|
||||
id=1,
|
||||
repository_id=1,
|
||||
snapshot_id=None,
|
||||
status="completed",
|
||||
started_at="2026-05-15T00:00:00Z",
|
||||
completed_at="2026-05-15T00:00:01Z",
|
||||
error_message=None,
|
||||
scanner_version="deterministic-v1",
|
||||
),
|
||||
abilities=[
|
||||
CandidateAbility(
|
||||
id=1,
|
||||
name="A Git Repository Template To Bootstrap Coulomb Projects",
|
||||
description="Derived from repo-seed README boilerplate.",
|
||||
confidence=0.7,
|
||||
status="candidate",
|
||||
source_refs=[source_ref("README.md", "documentation")],
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
outcomes = evaluate_candidate_graph_quality(graph)
|
||||
|
||||
assert outcomes[0].criterion_id == "RREG-QC-007"
|
||||
assert outcomes[0].outcome == "downgraded"
|
||||
|
||||
|
||||
def test_quality_gate_outcomes_are_serializable_for_assessment_artifacts():
|
||||
|
||||
Reference in New Issue
Block a user