Skip to content

Detect and penalize ghost courses as missing in SPA solver#21

Draft
google-labs-jules[bot] wants to merge 1 commit intomainfrom
ghost-course-penalty-fix-5984943680112991797
Draft

Detect and penalize ghost courses as missing in SPA solver#21
google-labs-jules[bot] wants to merge 1 commit intomainfrom
ghost-course-penalty-fix-5984943680112991797

Conversation

@google-labs-jules
Copy link
Contributor

This change addresses an issue where courses with invalid time data (e.g., "Free Time" or unparsable time bitmaps) were silently ignored by the scheduler, leading to incomplete schedules without any warning or penalty.

Key changes in dist/static/js/solver.js:

  1. Strict Candidate Filtering: Introduced isValidCandidate to explicitly reject candidates that have "自由时间" (Free Time) in their location text or whose schedule bitmaps parse to zero (i.e., no valid time slots).
  2. Robust Missing Course Detection: Modified generateSchedules to capture the set of all course names the user intended to schedule (allRequiredNames) before any filtering occurs. The "missing course" check now compares the final schedule against this comprehensive list, ensuring that even if a group is completely filtered out (becoming empty/ghost), it is correctly identified as missing.
  3. Increased Penalty: Increased the score penalty for missing courses from 10.0 to 500.0. This ensures that schedules with missing courses (including these ghost courses) are ranked significantly lower than complete schedules, matching user expectations.

Verified with a Node.js unit test and a Playwright frontend test (mocking the API to return ghost courses).


PR created automatically by Jules for task 5984943680112991797 started by @OsakaLOOP

@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants