Add detection operator profiles
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-07-09 20:19:10 +02:00
parent 60a7e822db
commit 90048ffb4a
12 changed files with 275 additions and 13 deletions
@@ -20,10 +20,9 @@ def test_detection_lab_explains_explicit_model_asset_and_threshold_selection() -
assert "Explicit model asset" in lab
assert "No model file is selected automatically" in lab
assert "Current benchmark candidate" in lab
assert "geointel-building-yolov8s-hardneg160r4e50-pt" in lab
assert "Recommended starting threshold" in lab
assert "0.25" in lab
assert "Operator profiles" in lab
assert "DETECTION_OPERATOR_PROFILES" in lab
assert "Candidate only - not default-approved" in lab
assert "will_download_models" in lab
@@ -0,0 +1,46 @@
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def test_detection_operator_profiles_define_explicit_non_default_yolo_candidates() -> None:
profiles = ROOT / "frontend" / "src" / "components" / "detection" / "detectionProfiles.ts"
source = profiles.read_text(encoding="utf-8")
assert "DETECTION_OPERATOR_PROFILES" in source
assert "geointel-building-yolov8s-aoi1024bg512r3e50-pt" in source
assert "balanced-review" in source
assert "conservative-review" in source
assert "confidenceThreshold: 0.15" in source
assert "confidenceThreshold: 0.35" in source
assert "defaultApproved: false" in source
assert "promotionRecommendation: 'none'" in source
assert "false-positive pressure" in source
def test_detection_lab_surfaces_profiles_as_deliberate_operator_actions() -> None:
lab = (ROOT / "frontend" / "src" / "components" / "detection" / "DetectionLab.tsx").read_text(
encoding="utf-8"
)
assert "DETECTION_OPERATOR_PROFILES" in lab
assert "Operator profiles" in lab
assert "profile.displayName" in lab
assert "profile.confidenceThreshold" in lab
assert "Candidate only - not default-approved" in lab
assert "Apply profile" in lab
assert "onApplyOperatorProfile(profile)" in lab
assert "Recommended starting threshold: 0.25" not in lab
def test_detection_workflow_applies_profiles_without_auto_selecting_assets() -> None:
hook = (ROOT / "frontend" / "src" / "hooks" / "useDetectionWorkflow.ts").read_text(encoding="utf-8")
app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8")
assert "applyDetectionOperatorProfile" in hook
assert "setSelectedDetectionModelId('yolo-configured')" in hook
assert "setSelectedModelAssetId(profile.modelAssetId)" in hook
assert "setDetectionConfidenceThreshold(profile.confidenceThreshold)" in hook
assert "setSelectedModelAssetId(assetResponse.items[0]" not in hook
assert "onApplyOperatorProfile={applyDetectionOperatorProfile}" in app