FE-1488: Experiments accept an ad-hoc scenario when none is selected - #9288
Draft
kube wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
3 tasks
kube
force-pushed
the
cf/fe-1488-experiments-accept-an-ad-hoc-scenario
branch
from
August 23, 2026 14:18
9c0be90 to
7bf4f5f
Compare
kube
force-pushed
the
cf/fe-1488-experiments-accept-an-ad-hoc-scenario
branch
from
August 23, 2026 14:40
7bf4f5f to
4ffa12e
Compare
kube
force-pushed
the
cf/fe-1488-experiments-accept-an-ad-hoc-scenario
branch
from
August 23, 2026 15:42
4ffa12e to
cae549d
Compare
kube
force-pushed
the
cf/fe-1488-experiments-accept-an-ad-hoc-scenario
branch
from
August 24, 2026 01:03
cae549d to
5490013
Compare
kube
force-pushed
the
cf/fe-1488-experiments-accept-an-ad-hoc-scenario
branch
from
August 24, 2026 01:11
5490013 to
22b3bd7
Compare
kube
force-pushed
the
cf/fe-1488-experiments-accept-an-ad-hoc-scenario
branch
from
August 24, 2026 01:45
22b3bd7 to
f492f53
Compare
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.
🌟 What is the purpose of this PR?
The second consumer of the ad-hoc scenario form (FE-778): the create-experiment drawer's "No scenario" branch embeds the form, and the experiments provider compiles the result into the experiment's initial marking and parameter values through a scenario generated at experiment start and never persisted. Sits above FE-1487 (#9287) in stack #9286.
Hold merging until the experiment-backend PRs #9178 and #9179 land — this PR touches the same experiments provider.
🔗 Related links
🔍 What does this change?
react/experiments/context.ts:CreateExperimentInputgains an optionaladHocScenario: AdHocScenarioState | null, ignored whenscenarioIdis set.react/experiments/provider.tsx: with no named scenario and an ad-hoc definition,createExperimentsynthesizes a scenario withsynthesizeAdHocScenarioand compiles it through the existingcompileScenariopath, fillingparameterValuesandinitialMarkingexactly as a named scenario does. Synthesis and compilation failures throw with the samesource:itemId messageformat as the named path, so the drawer's footer error shows them. The experiment record'sscenarioNamebecomes "Ad-hoc scenario", which is what the experiments table and the running-experiments popover display.create-experiment-drawer.tsx: the Scenario section's empty branch rendersAdHocScenarioForm(optimizable: false). Unlike the quick-simulation drawer, the form's own Parameters section is active here, because the experiment drawer has no parameter inputs of its own. Left untouched, the form passes nothing and the experiment runs exactly as before. The state resets when the drawer closes.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
patch).📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🛡 What tests cover this?
Two new provider tests: an ad-hoc definition with a variable compiles into the worker's init message (
initialMarking["place-queue"]is 6) and stampsscenarioName: "Ad-hoc scenario"; an invalid definition rejectscreateExperimentbefore any worker message is sent. The FE-1485 tests cover the synthesis rules themselves.❓ How to test this?
turbo run test:unit --filter @hashintel/petrinautturbo run dev --filter @apps/petrinaut→ Simulate → Experiments → Create → set Scenario to "No scenario", define token rows, add a metric, Run.🐾 Next steps
FE-1489 wires the optimization drawer with manifest emission (also held until #9178/#9179).
🤖 Generated with Claude Code