Skip to content

Comments

feat: Broaden Score Calibration Permissions Create/Update#666

Open
bencap wants to merge 5 commits intochore/bencap/agent-md-improvementsfrom
feature/bencap/539/broaden-calibration-upload-permissions
Open

feat: Broaden Score Calibration Permissions Create/Update#666
bencap wants to merge 5 commits intochore/bencap/agent-md-improvementsfrom
feature/bencap/539/broaden-calibration-upload-permissions

Conversation

@bencap
Copy link
Collaborator

@bencap bencap commented Feb 23, 2026

This pull request introduces new permissions and API endpoints for handling score calibrations in the MaveDB codebase. The main changes include adding a new ADD_CALIBRATION action, updating permission logic to allow broader access to calibration uploads, and requiring users to have email addresses for calibration operations.

Permissions and Access Control

  • Introduced the ADD_CALIBRATION action in the Action enum and updated permission checks so any authenticated user can add calibrations to published score sets, while private score sets require owner/contributor/admin access. [1] [2] [3] [4]
  • Updated score calibration creation and modification routes to check for ADD_CALIBRATION permission instead of UPDATE, and clarified requirements to include having an email address. [1] [2] [3] [4] [5] [6]
  • Changed all score calibration routes to require require_current_user_with_email, ensuring users have verified email addresses for these actions. [1] [2] [3] [4] [5] [6] [7]

Permission Logic Adjustments

  • Updated rank-changing logic for calibrations: contributors can always change rank for calibrations on their score set, while owners can only change rank for investigator-provided calibrations.

Minor Fixes and Refactoring

  • Fixed import and typing issues in view models and router files, and updated field access in collection update logic for consistency with Pydantic v2. [1] [2] [3]

…nt endpoints

Score set API responses were slow (5+ seconds) because functional
classifications eagerly serialized thousands of variants. This moves
variant data to dedicated endpoints while keeping a lightweight
variant_count summary in the default response.

Changes:
- Remove `variants` field from functional classification view models
- Add `id` and `variant_count` fields to SavedFunctionalClassification
- Add `variant_count` column_property on the ORM model using a
  correlated COUNT subquery against the association table
- Add `FunctionalClassificationVariants` response model
- Add GET /{urn}/functional-classifications/{id}/variants endpoint
- Add GET /{urn}/variants endpoint (all classifications)
- Update test constants and assertions for new response shape

Breaking change: clients relying on `variants` in calibration responses
must migrate to the new dedicated endpoints.
@bencap bencap requested review from jstone-dev and sallybg February 23, 2026 21:51
@bencap bencap linked an issue Feb 23, 2026 that may be closed by this pull request
@bencap bencap force-pushed the feature/bencap/539/broaden-calibration-upload-permissions branch from 691d2ba to 7d60adc Compare February 24, 2026 00:13
@bencap bencap force-pushed the feature/bencap/539/broaden-calibration-upload-permissions branch from 7d60adc to a96cab7 Compare February 24, 2026 02:45
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.

Broaden Score Calibration Create/Update Permissions

1 participant