fix(grader): handle forward after_step references

This commit is contained in:
Affaan Mustafa
2026-04-12 23:36:16 -07:00
parent 9da8e5f6ac
commit 0fcb43ea90
2 changed files with 64 additions and 2 deletions

View File

@@ -33,7 +33,9 @@ def _check_temporal_order(
) -> str | None:
"""Check before_step/after_step constraints. Returns failure reason or None."""
if step.detector.after_step is not None:
after_events = resolved.get(step.detector.after_step, [])
after_events = resolved.get(step.detector.after_step)
if after_events is None:
after_events = classified.get(step.detector.after_step, [])
if not after_events:
return f"after_step '{step.detector.after_step}' not yet detected"
latest_after = max(e.timestamp for e in after_events)