Skip to content

fix(science): read a requirement line that carries no == pin - #928

Closed
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 3 commits into
synthetic-sciences:mainfrom
aniruddhaadak80:fix/science-requirements-without-pin
Closed

ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 3 commits into
synthetic-sciences:mainfrom
aniruddhaadak80:fix/science-requirements-without-pin

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

What does this PR do, and why?

requirementArtifacts assumes every non-comment line carries an == pin. When it does not, indexOf("==") returns -1 and name/version are carved out of the wrong offsets - so pip_requirements: "requests>=2.31\n" yields name requests>=2.3, version equests>=2.31.

Linked issue

small fix, no issue

How did you verify it?

cd backend/cli && bun test test/science/kernel/requirement-artifacts.test.ts

Regression proof: Reverting the source reproduces 4 pass 2 fail; restoring gives 6 pass 0 fail.

cd backend/cli && bun test test/science/kernel/requirement-artifacts.test.ts -> 6 pass 0 fail. The 4 pre-existing tests still pass, including the merged #813 comment/blank-line case, so this complements rather than duplicates it.

Environment markers after a real pin (numpy==1.26.4 ; python_version >= "3.10") are still read correctly, pinned by a test. A spec whose entries are all valid == pins still fails closed through verifiedWheels with the exact coverage error unchanged.

Not verified: end-to-end wheel verification needs conda plus network, unavailable here. environment-manager.test.ts has 10 pre-existing failures on this box (R/micromamba absent), verified identical at base.

Two pre-existing conditions in this checkout, reproduced on the untouched base commit and therefore not caused by this change: �un run typecheck (turbo) fails with sgo: command not found, and �un run format:check reports roughly 30 files. I ran sc --noEmit for �ackend/cli and prettier on the files I touched instead; neither appears in the base warning list.

Checklist

  • �un run check is green (format, typecheck, backend + frontend/ui + SDK tests)
  • �un run --cwd frontend/workspace build succeeds if I touched rontend/workspace or rontend/ui (not applicable - no frontend/workspace or frontend/ui file changed)
  • ./tooling/repo/generate.ts was run and the ooling/sdk output committed if I changed �ackend/cli/src/server (not applicable - no �ackend/cli/src/server file changed)
  • [[x]] CHANGELOG.md has an Unreleased entry if the change is user-visible
  • The matching docs page under rontend/docs/src/content/openscience/ is updated if behavior changed (not applicable - no documented behavior changed)
  • Screenshots or a short video are attached for UI changes (not applicable - no UI change)
  • No version bumps (package.json versions and tags are written by the release workflow)
  • install and rontend/landing/public/install are still byte-identical if I touched either (not applicable - neither was touched)

I left the first box unticked rather than claiming it: �un run check cannot pass in this checkout because turbo cannot find sgo, and that failure reproduces on the base commit.

requirementArtifacts assumed every non-comment line carries an == pin.
TaskSpec validates pip_requirements only as a non-empty string, so a range
("requests>=2.31"), a bare name, or a direct URL reached the parser.
indexOf("==") returned -1 for those and name and version were sliced at
the wrong offsets, yielding artifacts such as name "requests>=2.3" and
version "equests>=2.31".

verifiedWheels compares the parsed entries against the pinned packages and
the downloaded wheel filenames, so a corrupted entry mis-counted the pins
and either accepted a wrong wheel or failed with "Downloaded wheels do not
exactly cover the hashed task requirements".

Drop an entry that carries no == pin rather than fabricate a name and a
version from it. This complements the existing skip for comments and blank
lines; an environment marker after a real pin is still read as that pin.
Copilot AI balanced review requested due to automatic review settings October 3, 2026 07:27
@vercel

vercel Bot commented Oct 3, 2026

Copy link
Copy Markdown

ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@aayambansal

Copy link
Copy Markdown
Member

Incorporated, reviewed, and validated in #953, now merged into main. Closing this original PR as superseded by the consolidated change.

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.

3 participants