FE-1688: Remove the Optimizations tab and run optimization inside Experiments - #9685
FE-1688: Remove the Optimizations tab and run optimization inside Experiments#9685kube wants to merge 15 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview Optimization now starts from a sweep’s Parameters card ( Website/dev cleanup: Core: adds metric sampling mode Reviewed by Cursor Bugbot for commit d06c633. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
State-constraint rates currently include errored runs, and the package changeset and new module boundaries need correction.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Moves optimization into parameter-sweep experiments, removes standalone optimization surfaces and navigation, adds constraints and study results to experiment drawers, and updates browser-runtime behavior and documentation.
Changes:
- Adds parameter/state constraints and sweep-driven optimization.
- Integrates study progress, results, and controls into experiment drawers.
- Removes standalone optimization UI, routing, pause handling, and service-demo wiring.
File summaries
| File | Description |
|---|---|
libs/@local/petrinaut-arch-docs/content/website/router-integration.mdx |
Documents retired URL normalization. |
libs/@local/petrinaut-arch-docs/content/ui/ad-hoc-form.mdx |
Updates experiment/sweep architecture. |
libs/@local/petrinaut-arch-docs/content/experiments/sweep-surface.mdx |
Documents optimizer-driven sweep surfaces. |
libs/@local/petrinaut-arch-docs/content/diagrams/browser-optimization-loop.d2 |
Revises optimization flow diagram. |
libs/@hashintel/petrinaut/src/ui/views/SDCPN/components/viewport-settings-dialog.tsx |
Removes optimization-surface setting. |
libs/@hashintel/petrinaut/src/ui/views/SDCPN/components/viewport-settings-dialog.test.tsx |
Updates default-setting test. |
libs/@hashintel/petrinaut/src/ui/views/Editor/simulation-creation-drawer.tsx |
Removes optimization drawer routing. |
libs/@hashintel/petrinaut/src/ui/views/Editor/simulation-creation-drawer.test.tsx |
Removes optimization drawer case. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/simulate-view.tsx |
Removes Optimizations tab. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/use-gpu-availability.ts |
Debounces GPU analysis. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/use-gpu-availability.test.tsx |
Tests debounced analysis. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/surface-sampling.ts |
Removes standalone surface sampling. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/surface-sampling.test.ts |
Removes obsolete sampling tests. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/surface-frame.tsx |
Narrows surface helpers to sweeps. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/results-view.tsx |
Specializes results rendering for experiments. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/results-model.ts |
Updates experiment study model. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/objective-history-chart.tsx |
Updates chart documentation. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/format-value.ts |
Makes scalar formatter private. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/drawer-frame/README.md |
Declares drawer-frame layer. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/drawer-frame/frame-header.tsx |
Removes full-view leading control. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/drawer-frame.test.tsx |
Updates frame imports. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/drawer-frame.stories.tsx |
Updates story imports. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/describe-study-progress.ts |
Simplifies statuses and adds step progress. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/shared/describe-study-progress.test.ts |
Tests study progress wording. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/view-optimization-drawer.tsx |
Deletes standalone study drawer. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/study-results/study-progress.ts |
Deletes connected-study progress helper. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/study-results/parameter-values.tsx |
Deletes standalone parameter display. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/study-results/objective-history-card.tsx |
Deletes standalone objective card. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/study-results/continue-control.tsx |
Deletes Continue control. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-surface/use-study-surface-walk.ts |
Deletes detached surface walk. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-surface/sample-study-cell.test.ts |
Deletes detached sampling tests. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-surface/navigation-slice.ts |
Deletes optimization surface navigation. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-status.ts |
Deletes standalone status mapping. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-status.test.ts |
Deletes status tests. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-seed.ts |
Deletes standalone seed helper. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-parameter-row.test.tsx |
Deletes optimization-form tests. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-full-view.tsx |
Deletes full study view. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/optimization-full-view.stories.tsx |
Deletes full-view stories. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/optimizations/create-optimization-drawer/constraint-lsp.ts |
Removes old constraint authoring helper. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/sweep-surface/visited-field.test.ts |
Updates visited-cell fixtures. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/sweep-objective-strip.tsx |
Updates fold import. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/study-steps/steps-table.tsx |
Relocates steps-table imports. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/study-steps.tsx |
Uses relocated steps table. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/study-header/convergence.ts |
Adds convergence assessment. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/study-header/convergence.test.ts |
Tests convergence assessment. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/study-header.tsx |
Integrates convergence status. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/study-header.test.tsx |
Tests study headline states. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/study-constraints-card.tsx |
Moves constraints card into experiments. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/study-constraints-card.test.ts |
Tests latest-step description. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/parameter-importance-panel/importance-view.ts |
Updates parameter-binding source. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/parameter-importance-panel/importance-view.test.ts |
Updates fixture import. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-results/parameter-importance-panel.tsx |
Uses relocated importance helper. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-metric-timeline/README.md |
Declares metric-timeline layer. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-metric-timeline.tsx |
Updates architecture documentation. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/create-experiment-drawer/constraints-section/use-constraint-lsp-session.ts |
Supports readonly scenario parameters. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/create-experiment-drawer/constraint-lsp.ts |
Adds mixed-list constraint diagnostics. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/create-experiment-drawer/constraint-lsp.test.ts |
Tests constraint diagnostics. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/create-experiment-drawer/constraint-drafts.ts |
Adds constraint draft state. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel/petrinaut-docs-content.ts |
Removes optimization guide registration. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/ai-assistant-panel.test.tsx |
Updates editor context fixture. |
libs/@hashintel/petrinaut/src/ui/petrinaut.stories.tsx |
Updates remote optimizer story guidance. |
libs/@hashintel/petrinaut/src/ui/index.ts |
Removes presentation type export. |
libs/@hashintel/petrinaut/src/ui/components/contour-surface/README.md |
Narrows contour surface ownership. |
libs/@hashintel/petrinaut/src/react/state/user-settings-provider.tsx |
Migrates removed surface setting. |
libs/@hashintel/petrinaut/src/react/state/user-settings-context.ts |
Removes surface setting contract. |
libs/@hashintel/petrinaut/src/react/state/editor-provider.tsx |
Removes simulation presentation state. |
libs/@hashintel/petrinaut/src/react/state/editor-provider.test.tsx |
Removes presentation navigation test. |
libs/@hashintel/petrinaut/src/react/state/editor-context.ts |
Removes optimization view/drawer types. |
libs/@hashintel/petrinaut/src/react/optimizations/use-optimization-source.ts |
Updates optimization-source semantics. |
libs/@hashintel/petrinaut/src/react/optimizations/provider/point-refinement/objective-estimate.ts |
Deletes point-refinement estimation. |
libs/@hashintel/petrinaut/src/react/optimizations/provider/create-sweep-trial-evaluator/pruned-trial-outcome.ts |
Adds shared prune outcome helper. |
libs/@hashintel/petrinaut/src/react/optimizations/provider/create-sweep-trial-evaluator/parameter-constraints.ts |
Adds pre-navigation constraint evaluation. |
libs/@hashintel/petrinaut/src/react/optimizations/provider/create-sweep-trial-evaluator/parameter-constraints.test.ts |
Retains parameter-constraint tests. |
libs/@hashintel/petrinaut/src/react/optimizations/parameter-bindings.ts |
Extracts binding partitioning. |
libs/@hashintel/petrinaut/src/react/optimizations/parameter-bindings.test.ts |
Tests binding partitioning. |
libs/@hashintel/petrinaut/src/react/optimizations/fake-detached-objective-runs.fixtures.ts |
Deletes detached-run fixtures. |
libs/@hashintel/petrinaut/src/react/optimizations/channel/create-optimization-channel/trial-outcome.ts |
Deletes detached trial outcome logic. |
libs/@hashintel/petrinaut/src/react/optimizations/channel/create-optimization-channel/trial-constraints.ts |
Deletes detached constraint evaluation. |
libs/@hashintel/petrinaut/src/react/navigation/index.tsx |
Removes optimization navigation contract. |
libs/@hashintel/petrinaut/src/react/navigation/index.test.tsx |
Updates navigation tests. |
libs/@hashintel/petrinaut/src/react/index.ts |
Removes retired public exports. |
libs/@hashintel/petrinaut/src/react/hooks/use-petrinaut-mutations.test.tsx |
Updates editor fixture. |
libs/@hashintel/petrinaut/src/react/hooks/use-petrinaut-commands.test.tsx |
Updates editor fixture. |
libs/@hashintel/petrinaut/src/react/experiments/sweep-session/README.md |
Updates sweep-session architecture. |
libs/@hashintel/petrinaut/src/react/experiments/sweep-session.ts |
Records metric sample counts. |
libs/@hashintel/petrinaut/src/react/experiments/sweep-session.test.ts |
Tests sample-count publication. |
libs/@hashintel/petrinaut/src/react/experiments/sweep-cell-objective.ts |
Returns values with sampled runs. |
libs/@hashintel/petrinaut/src/react/experiments/sweep-cell-objective.test.ts |
Tests sampled-run counts. |
libs/@hashintel/petrinaut/src/react/experiments/provider.tsx |
Stores fixed scenario values and removes detached sampling. |
libs/@hashintel/petrinaut/src/react/experiments/context.test.ts |
Updates experiment fixtures. |
libs/@hashintel/petrinaut/src/react/experiments/constraint-indicators.ts |
Adds state-constraint metrics and verdict counts. |
libs/@hashintel/petrinaut/src/main.ts |
Removes presentation type export. |
libs/@hashintel/petrinaut/README.md |
Updates optimization story instructions. |
libs/@hashintel/petrinaut/docs/visual-settings.md |
Documents new optimization controls. |
libs/@hashintel/petrinaut/docs/simulation.md |
Redirects search guidance to experiments. |
libs/@hashintel/petrinaut/docs/README.md |
Folds optimization into experiments. |
libs/@hashintel/petrinaut/docs/preview.md |
Removes standalone optimization wording. |
libs/@hashintel/petrinaut/docs/petri-net-extensions.md |
Updates metric documentation link. |
libs/@hashintel/petrinaut/docs/examples.md |
Updates optimization walkthrough. |
libs/@hashintel/petrinaut/docs/drawing-a-net.md |
Updates Simulate workspace documentation. |
libs/@hashintel/petrinaut-core/src/simulation/monte-carlo/metrics/user-defined.test.ts |
Tests terminal indicator aggregation. |
libs/@hashintel/petrinaut-core/src/optimization/optimization.test.ts |
Removes paused-event fixture. |
libs/@hashintel/petrinaut-core/src/optimization/index.ts |
Removes pause event and capability API. |
libs/@hashintel/petrinaut-core/src/optimization/browser/worker/study-runner.ts |
Removes pause callback handling. |
libs/@hashintel/petrinaut-core/src/optimization/browser/worker/study-runner.pyodide.test.ts |
Updates runner callbacks. |
libs/@hashintel/petrinaut-core/src/optimization/browser/worker/attach-optimizer-worker.ts |
Removes pause worker protocol. |
libs/@hashintel/petrinaut-core/src/optimization/browser/worker/attach-optimizer-worker.test.ts |
Removes pause protocol test. |
libs/@hashintel/petrinaut-core/src/optimization/browser/run-log.ts |
Removes paused terminal state. |
libs/@hashintel/petrinaut-core/src/optimization/browser/run-log.test.ts |
Removes paused log test. |
libs/@hashintel/petrinaut-core/src/optimization/browser/README.md |
Updates browser-runtime lifecycle. |
libs/@hashintel/petrinaut-core/src/optimization/browser/messages.ts |
Removes pause messages. |
libs/@hashintel/petrinaut-core/src/optimization/browser/browser-optimization.ts |
Removes pause capability implementation. |
libs/@hashintel/petrinaut-core/src/optimization/browser/browser-optimization.test.ts |
Removes browser pause tests. |
libs/@hashintel/petrinaut-core/src/ai.ts |
Folds optimization guidance into experiments. |
apps/petrinaut-website/vite.config.ts |
Removes optimizer-service proxy. |
apps/petrinaut-website/turbo.json |
Removes optimizer environment input. |
apps/petrinaut-website/src/vite-env.d.ts |
Removes optimizer environment type. |
apps/petrinaut-website/src/routes/optimization.tsx |
Deletes optimization route. |
apps/petrinaut-website/src/main/app/optimization-demo/README.md |
Documents browser-only host. |
apps/petrinaut-website/src/main/app/optimization-demo/petrinaut-opt-optimization.ts |
Deletes service client adapter. |
apps/petrinaut-website/src/main/app/optimization-demo/petrinaut-opt-optimization-provider.tsx |
Deletes service provider. |
apps/petrinaut-website/src/examples/use-shared-search-navigation.ts |
Removes presentation search state. |
apps/petrinaut-website/src/examples/navigation-search.ts |
Removes presentation projection. |
apps/petrinaut-website/src/examples/navigation-search.test.ts |
Tests remaining URL contract. |
apps/petrinaut-website/src/examples/example-search.ts |
Removes optimization URL values. |
apps/petrinaut-website/src/examples/example-search.test.ts |
Tests legacy URL normalization. |
apps/petrinaut-website/scripts/dev.sh |
Removes optimizer-service startup. |
apps/petrinaut-website/README.md |
Documents browser optimization only. |
apps/petrinaut-website/docs/task-dependencies.json |
Removes optimizer environment dependency. |
apps/petrinaut-website/.env.example |
Removes optimizer-service variable. |
.changeset/simulate-drawer-frame.md |
Updates drawer-frame release note. |
.changeset/optimization-dedicated-view.md |
Removes obsolete release note. |
.changeset/fold-optimization-into-experiments.md |
Adds fold-in release note. |
Review details
- Files reviewed: 129/204 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3558a0b to
2ce1e3f
Compare
… parameter-constraint helper out of the Optimizations folder
…r and carry them on the experiment
… columns, constraint and sensitivity cards and steps table
…ebsite's optimization params and route
…he architecture docs
…lit the core changeset and reopen the drawer-frame door
The merge-base changed after approval.
134703a to
d06c633
Compare
Important
Experimental
Behind the Parameter sweeps and In-browser optimization feature flags.
Summary
Before this PR, the Simulate panel had an Optimizations tab beside Experiments and Scenarios. A study was created there from its own drawer, with the objective, the parameter bindings and the constraints, and ran through a channel of its own with a detached objective, Pause and Resume, a full view and a website route. A sweep could also hand its Parameters card to the optimizer, so the same search existed twice, in two places, with two sets of results.
This PR keeps one path. The Optimizations tab, its drawers, the full view, the standalone study channel and the website's
/optimizationroute are deleted. Constraints become a property of the experiment: with both flags on, the first Sweep toggle on a saved scenario's parameter adds a Constraints section to the Create Experiment drawer, one list of parameter and state rows with a pass threshold, checked as you type, recorded with the experiment and listed behind a fold in the sweep's Parameters card. A study started from the card enforces them exactly: a parameter constraint prunes a step before anything simulates, a state constraint runs as a 0/1 indicator metric on every batch so a step's pass share is its run count. The experiment drawer shows the study's displays only once a study exists, and holds that shape through running, stopped, failed and later studies: a headline over the header, Steps and Steps clear columns, the Constraints and Sensitivity analysis cards after the metric charts and the steps table under them. Objective by step stays under the sliders.9685.mp4
Links
Changes
Constraints on the experiment
The study in the experiment drawer
Deletions
Review fixes
drawer-frame.tsxis the frame parts' one public door againscenario.*by each scenario parameter's type in its constraint checkKnown issues
parameters.*at the net's defaults@local/petrinaut-optimizer-clientis an unused dependency of the websiteTest coverage
create-experiment-drawer.test.tsx:lower-constraint-drafts.test.ts,constraint-lsp.test.ts,constraint-indicators.test.ts:create-experiment.test.ts,sweep-optimizer.test.ts,create-sweep-trial-evaluator.test.ts:user-defined.test.tsin petrinaut-core:compile-net-shader.test.ts:experiment-results.test.tsx,view-experiment-drawer.test.tsx,study-header.test.tsx,describe-study-progress.test.ts, the study card tests underexperiment-results/:use-gpu-availability.test.tsx:navigation/index.test.tsx,editor-provider.test.tsx,simulate-view.test.tsx,simulation-creation-drawer.test.tsx,provider.test.tsx:example-search.test.ts,navigation-search.test.ts:How to test
infected_ratioscenario.infected_ratio < 0.5return state.places.Infected.count <= 900;/?view=optimizations