fix(web): count only training events for discrimination and split user-stop from validated range
Three collected events with a reserved holdout were stalling because the discriminator door counted holdout. Public selection_allowed still had snapshot fallbacks, and health only proved the image SHA. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -77,8 +77,22 @@ def scoreable_event_stats(events: Sequence[dict[str, Any]] | None) -> tuple[int,
|
||||
return len(scoreable), len(domains), domains
|
||||
|
||||
|
||||
def training_scoreable_stats(events: Sequence[dict[str, Any]] | None) -> tuple[int, int, frozenset[str]]:
|
||||
from scripts.rectification.case_holdout import holdout_event_ids
|
||||
|
||||
holdout = holdout_event_ids(events)
|
||||
training = [
|
||||
event for event in (events or [])
|
||||
if isinstance(event, dict)
|
||||
and is_primary_scoreable_dict(event)
|
||||
and str(event.get("id") or "") not in holdout
|
||||
]
|
||||
domains = frozenset(str(event["domain"]) for event in training)
|
||||
return len(training), len(domains), domains
|
||||
|
||||
|
||||
def discriminator_gate_open(events: Sequence[dict[str, Any]] | None) -> bool:
|
||||
count, domain_count, _ = scoreable_event_stats(events)
|
||||
count, domain_count, _ = training_scoreable_stats(events)
|
||||
return count >= MIN_DISCRIMINATOR_EVENTS and domain_count >= MIN_DISCRIMINATOR_DOMAINS
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user