Skip to content

FIX: Share common scenario parameter names between launch form and preset editor - #4593

Merged
hannahwestra25 merged 2 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25-unify-common-scenario-param-names
Nov 30, 2026
Merged

hannahwestra25 merged 2 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25-unify-common-scenario-param-names

Conversation

@hannahwestra25

@hannahwestra25 hannahwestra25 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The preset editor and the launch form each had their own copy of COMMON_SCENARIO_PARAMETER_NAMES, and they had drifted apart. As a result, the preset editor showed scoring_target as a raw text field even though the launch form hides it. This PR removes the editor's private copy and its separate filter so both forms use one shared filter.

  • Removed the preset editor's dynamicScenarioParameters filter. Both forms now call scenarioDynamicParameters from scenarioLaunchRequest.ts, so a hiding rule added there applies to both. The name set is private to that module.
  • Added operation_id to the shared set so it matches the backend's common parameters. The launch form already has its own operation control for it.
  • incompatible_technique_policy is still shown as a field on purpose. It has no dedicated control, and the backend reads it from scenario_params, so this field is the only way to set it. The set's JSDoc now explains this.
  • Saved presets keep working. A stored scoring_target is carried through unchanged by uneditableScenarioParams when the preset is edited, and by carriedPresetScenarioParams when it is launched.

Correction to the original report: dataset_overrides, local_technique_factory, and operation_id are declared opaque. scenario_service.py only sends parameters where is_external_input is true, so these three never reach the UI and never showed up as fields in the preset editor. They stay in the set to mirror the backend. scoring_target was the only one that actually appeared.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 18:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the change unifying scenario parameters across the launch form and preset editor.

No open issues 🎉

What changed in this PR

Unifies the common scenario parameter names used by the launch form and preset editor, preventing drift and hiding the unintended scoring_target field in the editor.

Changes:

  • Reuses one shared, read-only parameter set and adds operation_id.
  • Clarifies why incompatible_technique_policy remains editable.
  • Adds regression coverage confirming that stored scoring targets are preserved while the technique policy stays editable.
File Description
frontend/​src/​components/​Scenarios/​scenarioLaunchRequest.ts Makes the shared set read-only, adds operation_id, and clarifies its documentation.
frontend/​src/​components/​Scenarios/​scenarioConfigForm.ts Imports the shared set instead of maintaining a separate copy.
frontend/​src/​components/​ScenarioPresets/​scenarioPresetForm.test.ts Tests scoring-target preservation and technique-policy editability.

Review effort: Balanced

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.

[P3] inline:4690662488: Finding C1 (posted by this run). Supported, not fixed at head: the preset editor's dynamicScenarioParameters (scenarioConfigForm.ts:91-95; call sites scenarioConfigForm.ts:112, scenarioPresetForm.ts:43/70/82/131, ScenarioPresetEditor.tsx:216) and the launch form's scenarioDynamicParameters (scenarioLaunchRequest.ts:88-93) remain two filters for one concept; #4132 previously added a hiding rule to only the launch filter. They return the same list today because supported_parameters is a subset of supported_parameter_names, so there is no wrong runtime behavior. The duplication predates the PR and the PR does not extend it (it removed the duplicated data that actually diverged), so P3 non-blocking hardening; fix is to use scenarioDynamicParameters from './scenarioLaunchRequest' and delete dynamicScenarioParameters. Verified in code_review\4593-20261124-2029\feedback\feedback.json and should_approve_pr\4593-20261124-2029\feedback.json.

[P3] inline:4690662495: Finding C2 (posted by this run). Supported, not fixed at head: scenarioConfigForm.ts:6 imports COMMON_SCENARIO_PARAMETER_NAMES from '@/components/Scenarios/scenarioLaunchRequest' inside components/Scenarios; the frontend style guide requires './' imports within a feature directory, and sibling files (scenarioLaunchForm.ts:13, ScenarioDetail.tsx:106) use './scenarioLaunchRequest'. Added by this PR; convention-only with no runtime effect, so P3. Subsumed if C1's fix is adopted. Verified in code_review\4593-20261124-2029\feedback\feedback.json and should_approve_pr\4593-20261124-2029\feedback.json.

hannahwestra25 and others added 2 commits November 30, 2026 14:22
…eset editor

The preset editor kept a stale private copy of COMMON_SCENARIO_PARAMETER_NAMES,
so scoring_target rendered as a raw text field there. Use the launch form's
exported set, add operation_id to mirror the backend, and document why
incompatible_technique_policy stays editable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…m and preset editor

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@hannahwestra25
hannahwestra25 force-pushed the hannahwestra25-unify-common-scenario-param-names branch from f138e6d to e0081ed Compare November 30, 2026 20:06
@hannahwestra25
hannahwestra25 added this pull request to the merge queue Nov 30, 2026
Merged via the queue into microsoft:main with commit 06bb97a Nov 30, 2026
66 checks passed
@hannahwestra25
hannahwestra25 deleted the hannahwestra25-unify-common-scenario-param-names branch November 30, 2026 21:01
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