Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion skills/skill-comply/scripts/grader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment on lines 35 to 40
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing regression test for fixed scenario

No test covers the specific case this PR fixes: an after_step that references a step defined later in spec.steps. Without a test, the bug could silently regress. Consider adding a case to tests/test_grader.py where the classification mock returns events for a forward-referenced step (e.g., step B has after_step: step_C while step_C appears after B in the spec) and asserts that grading still succeeds with the correct temporal order.

latest_after = max(e.timestamp for e in after_events)
Expand Down