Skip to content

fix: interaction-screening and bulk-prediction - #186

Merged
vtnphan merged 1 commit into
devfrom
sbp-660
Sep 29, 2026
Merged

vtnphan merged 1 commit into
devfrom
sbp-660

Conversation

@vtnphan

@vtnphan vtnphan commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

SBP-660 interaction-screening and bulk-prediction (WISPS) launches never deducted credits — launch_credit_cost() only priced single-prediction/de-novo-design and returned None for the rest, so the deduction at launch was a silent no-op.

Changes

  • launch_credit_cost() (credits.py) now prices bulk-prediction (multiplier × entry count) and interaction-screening (multiplier × query count × target count).
  • Added _count_wisps_samplesheet_entries() (workflows.py) to derive that quantity server-side from the samplesheet already staged for the run (via its group column), instead of trusting the client-supplied fastaContent — keeps the charge non-spoofable.
  • Updated a stale docstring on SbpCreditField (admin.py).
  • No migrations or backwards-incompatible changes.

How to Test

  1. uv run pytest tests/test_routes_workflows.py — covers bulk/interaction-screening deduction and 402 rejection on insufficient credits.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added or updated documentation where necessary
  • I have run linting and unit tests locally
  • The code follows the project's style guidelines

credit deduction for WISPS workflows
@vtnphan
vtnphan marked this pull request as ready for review September 29, 2026 23:06

@amandazhuyilan amandazhuyilan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice fix - promise me you will do a test once this goes into dev?

@vtnphan

vtnphan commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator Author

Nice fix - promise me you will do a test once this goes into dev?

Yes, sure thing!

@vtnphan
vtnphan merged commit b023416 into dev Sep 29, 2026
2 checks passed
@vtnphan
vtnphan deleted the sbp-660 branch September 29, 2026 23:10
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.

2 participants