Skip to content

conflict issues#6

Merged
Siddharthakhandelwal merged 5 commits into
Rudrakshfrom
main
Mar 18, 2026
Merged

conflict issues#6
Siddharthakhandelwal merged 5 commits into
Rudrakshfrom
main

Conversation

@Siddharthakhandelwal

Copy link
Copy Markdown
Collaborator

No description provided.

Siddharthakhandelwal and others added 5 commits March 8, 2026 14:32
…e validation (#5)

* Remove issue markdown file and provide issue text inline

* Modularize stability computation with isolated service logic

* Add detailed backend feature and architecture docs

* Fix stability request length validation after cleaning
@Siddharthakhandelwal Siddharthakhandelwal merged commit 88e78c6 into Rudraksh Mar 18, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 405956141c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/main.py
Comment on lines +135 to +144
def validate_amino_acids(cls, v: str) -> str:
"""Strip whitespace/digits, uppercase, then reject invalid amino-acid letters."""
cleaned = re.sub(r"[\s\d]", "", v).upper()
invalid = set(cleaned) - VALID_AMINO_ACIDS
if invalid:
raise ValueError(
f"Sequence contains invalid characters: {', '.join(sorted(invalid))}. "
f"Only standard amino-acid letters are allowed: {''.join(sorted(VALID_AMINO_ACIDS))}"
)
return cleaned

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate solubility sequence length after cleanup

SolubilityRequest strips whitespace and digits in the validator, but it never re-checks the cleaned length. That means /api/solubility will happily accept inputs like "1 2 3 4 5 6 7 8 9 0" and return a 0-residue score, and it will also reject numbered/wrapped sequences based on the raw string length before cleanup. PredictRequest and StabilityRequest both enforce the post-clean 10-2000 residue constraint, so this endpoint now returns meaningless results for malformed payloads that the other sequence endpoints correctly reject.

Useful? React with 👍 / 👎.

Comment thread backend/main.py Outdated
Comment on lines +377 to +381
if min_score < 0 or min_score > 100 or max_score < 0 or max_score > 100:
raise HTTPException(status_code=400, detail="Scores must be between 0 and 100")

if min_score > max_score:
raise HTTPException(status_code=400, detail="min_score must be less than or equal to max_score")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject NaN score filters before returning search results

If a client sends min_score=NaN or max_score=NaN, all of these range checks evaluate false, so the handler falls through and returns a payload containing nan. FastAPI/Starlette's default JSON response does not serialize NaN values, so this turns an invalid query into a 500 instead of a 4xx. Guarding with math.isfinite() (or constrained query params) would keep the endpoint from crashing on that input.

Useful? React with 👍 / 👎.

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