Skip to content

Predictor fix#280

Open
Mokshith08 wants to merge 4 commits into
ionfwsrijan:mainfrom
Mokshith08:Predictor-Fix
Open

Predictor fix#280
Mokshith08 wants to merge 4 commits into
ionfwsrijan:mainfrom
Mokshith08:Predictor-Fix

Conversation

@Mokshith08

Copy link
Copy Markdown

Before opening: make sure there is an issue tracking this work, and link it below. PRs without a linked issue may be closed without review.

Linked issue

Closes #278

What this PR does

Fixes a silent data-integrity bug where zip(findings, adjusted_scores) could silently skip updating trailing findings if the score list length mismatched. Adds length validation, defensive assertions, and an index-based update loop to ensure all-or-nothing updates.

Type of change

  • Bug fix
  • New feature
  • ML model / training pipeline
  • Refactor (no behaviour change)
  • Documentation
  • Tests only

ML tier (if applicable)

  • Tier 2 — Predictive
  • Tier 1 — Triage
  • Tier 3 — Autonomous
  • Not ML-related

Stack affected

  • Backend
  • Frontend
  • Both

Changes

Backend

  • Added length-invariant assertions in fp_predictor.py.
  • Added mismatch validation and error logging in main.py.
  • Replaced zip() with an index-based update loop.

Frontend

  • No frontend changes.

New dependencies

  • None.

Database / schema changes

  • None.

Testing

How did you test this?

  • Ran pytest tests/test_fp_predictor.py -v.
  • Added tests for length mismatch, exception handling, empty inputs, and successful updates.

Checklist

  • Tested locally end-to-end
  • New ML model falls back gracefully when model file is absent
  • No new console.error or unhandled Python exceptions introduced
  • Added or updated tests where applicable
  • requirements.txt / package.json updated if new dependencies added
  • New model files (.pkl, .pt, etc.) are gitignored, not committed

Anything reviewers should focus on

  • Length validation and assertions.
  • All-or-nothing update behavior on score mismatches.

Screenshots (if UI changed)

N/A (Backend-only changes)

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🎉 Thank you @Mokshith08 for submitting a Pull Request!

We're excited to review your contribution.

Before Review

✅ Ensure all CI checks pass
✅ Complete the PR template
✅ Link the related issue

Want faster reviews and contributor support?

Join our Discord community:

🔗 https://discord.gg/FcXuyw2Rs

Maintainers and mentors are active there and can help resolve blockers quickly.

Happy Contributing! 🚀

@github-actions github-actions Bot added backend Backend issues bug Something isn't working frontend Frontend issues ml ML related issues SSoC26 labels Jul 6, 2026
@github-actions github-actions Bot requested a review from arpit2006 July 6, 2026 08:34
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

PR template check passed!

@arpit2006 this PR is ready for your review. 🚀

@arpit2006

Copy link
Copy Markdown
Collaborator

@Mokshith08 , Resolve CI issues!

@github-actions github-actions Bot removed the needs-work Work needed label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR template check passed!

@arpit2006 this PR is ready for your review. 🚀

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR template check passed!

@arpit2006 this PR is ready for your review. 🚀

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

PR template check passed!

@arpit2006 this PR is ready for your review. 🚀

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

Labels

backend Backend issues bug Something isn't working changes-required checks-failing CI-Fail frontend Frontend issues help wanted Extra attention is needed Medium Medium difficulty ml ML related issues PR-review quality-issue SSoC26 Template-passed tier-2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] False Positive Predictor Silently Drops Findings on Length Mismatch and Cross-Thread Mutation

2 participants