Fix/mooclet priors#3089
Closed
danoswaltCL wants to merge 11 commits intodevfrom
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR shifts Thompson-sampling priors from a single global setting to per-condition priors, updates the experiment design UI accordingly, and enhances the reward feedback table to display priors/posteriors plus an “estimated weight” metric computed via Thompson-sampling simulation.
Changes:
- Add per-condition prior editing via a new modal and wire it into the experiment conditions table/section.
- Revamp the TS reward feedback table to show counts, priors, posteriors, and an estimated weight with explanatory tooltips.
- Backend/types updates to support per-condition priors and to return additional reward-summary fields used by the UI.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/types/src/index.ts | Re-export Prior / CurrentPosteriors from the types package. |
| packages/types/src/Mooclet/index.ts | Extend rewards summary shape (add priors/posteriors/estimated weight fields; remove total). |
| packages/types/src/Mooclet/MoocletTSConfigurablePolicyParametersDTO.ts | Change prior to an optional per-key map (Record<string, Prior>). |
| packages/frontend/projects/upgrade/src/assets/i18n/en.json | Add new labels/tooltips for prior editing + estimated weight columns. |
| packages/frontend/projects/upgrade/src/app/shared/services/common-dialog.service.ts | Add dialog opener for the new “edit condition prior” modal. |
| packages/frontend/projects/upgrade/src/app/features/.../ts-configurable-reward-count-table.component.ts | Add estimated-weight tooltip logic + new displayed columns. |
| packages/frontend/projects/upgrade/src/app/features/.../ts-configurable-reward-count-table.component.html | Update reward table columns to show priors/posteriors and estimated weight tooltips. |
| packages/frontend/projects/upgrade/src/app/features/.../ts-configurable-reward-count-table.component.scss | Update reward table column sizing/styling for new columns. |
| packages/frontend/projects/upgrade/src/app/features/.../enrollment-condition-expandable-row.component.{html,scss} | Hide “weight” column content for Mooclet experiments in enrollment expandable row. |
| packages/frontend/projects/upgrade/src/app/features/.../experiment-conditions-table.component.ts | Add prior input + columns/events for prior display/edit. |
| packages/frontend/projects/upgrade/src/app/features/.../experiment-conditions-table.component.html | Render prior successes/failures columns and add an edit-prior button. |
| packages/frontend/projects/upgrade/src/app/features/.../experiment-conditions-table.component.scss | Add styling for prior/prior-edit columns. |
| packages/frontend/projects/upgrade/src/app/features/.../experiment-conditions-section-card.component.ts | Wire prior-edit event to dialog + store update. |
| packages/frontend/projects/upgrade/src/app/features/.../experiment-conditions-section-card.component.html | Pass priors into the conditions table and bind edit-prior output. |
| packages/frontend/projects/upgrade/src/app/features/.../ts-configurable-policy-parameters-form.component.{ts,html} | Remove global prior inputs from the experiment upsert modal form. |
| packages/frontend/projects/upgrade/src/app/features/.../edit-condition-prior-modal/* | New modal implementation for editing per-condition priors. |
| packages/frontend/projects/upgrade/src/app/core/experiments/store/experiments.model.ts | Remove prior labels from TS-configurable overview labels. |
| packages/frontend/projects/upgrade/src/app/core/experiments/mooclet-helper.service.ts | Remove global prior handling; add validators for per-condition prior inputs. |
| packages/frontend/projects/upgrade/src/app/core/experiments/mooclet-helper.service.spec.ts | Update tests to reflect removal of global prior fields in helper logic. |
| packages/frontend/projects/upgrade/src/app/core/experiments/experiments.service.ts | Add store update helper for per-condition priors. |
| packages/backend/src/api/services/estimate.ts | New Thompson-weight estimation helper (currently unused). |
| packages/backend/src/api/services/MoocletRewardsService.ts | Fetch policy params and include priors/posteriors/estimated weight in rewards summary response. |
| packages/backend/src/api/services/MoocletExperimentService.ts | Translate prior keys between condition codes and Mooclet version IDs on GET/PUT. |
| packages/backend/test/unit/services/MoocletRewardsService.test.ts | Update expected reward summary shape for the new fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
#3093 is the new one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apologies for giant PR, i got carried away
--
--
--

--