FE-1489: Optimizations accept an ad-hoc scenario defined inline - #9289
Draft
kube wants to merge 2 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
kube
force-pushed
the
cf/fe-1489-optimizations-accept-an-ad-hoc-scenario
branch
from
August 23, 2026 14:18
6d697ae to
df1b754
Compare
kube
force-pushed
the
cf/fe-1489-optimizations-accept-an-ad-hoc-scenario
branch
from
August 23, 2026 14:40
df1b754 to
fbd39af
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 third consumer of the ad-hoc scenario form (FE-778), and the one Optimize was built for: the create-optimization drawer offers "Ad-hoc (define inline)" in its scenario picker. Every Optimize selection in the form becomes a generated scenario parameter with a deterministic
adhoc.*name, and the optimization manifest binds those parameters to their optimize domains — submitted exactly like a named scenario's manifest. The generated scenario is never persisted into the net file. Top of stack #9286, above FE-1488 (#9288).Hold merging until the experiment-backend PRs #9178 and #9179 land (same hold as FE-1488).
🔗 Related links
🔍 What does this change?
All in
create-optimization-drawer.tsx:AdHocScenarioFormwithoptimizable: truein place of the scenario-parameters section; the Optimization and Objective sections are unchanged. An optimization no longer requires a saved scenario.synthesizeAdHocOptimizationproduces the generated scenario plus one optimized field per selection (name, attribution label, target, domain);adHocOptimizationBindingstransforms the fields into manifestparameterBindings, and a newbuildAdHocPetrinautOptimizationInputparses the result through the samepetrinautOptimizationInputSchemaas the named path — the manifest schema itself is untouched. Generated parameter names (adhoc.<place>.r<row>.<field>,adhoc.count.<place>,adhoc.var.net.<name>, ...) are the wire contract for result attribution.getConfigurationErroraccepts the ad-hoc state and requires at least one Optimize selection ("Enable Optimize on at least one value"); bounds and domain rules are enforced by the FE-1485 synthesis and surface in the drawer footer.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 drawer tests: selecting the ad-hoc option renders the inline form and blocks Run with "Enable Optimize on at least one value"; a real
synthesizeAdHocOptimizationoutcome round-trips throughbuildAdHocPetrinautOptimizationInputand the manifest schema, bindingadhoc.count.Queueto its integer domain with the generated scenario embedded. The FE-1485 tests cover the synthesis and naming rules.❓ How to test this?
turbo run test:unit --filter @hashintel/petrinautturbo run dev --filter @apps/petrinaut→ Simulate → Optimizations → Create → pick "Ad-hoc (define inline)", enable Optimize on a value with a domain, choose an objective, Run.adhoc.*parameters; the net file gains no scenario.🐾 Next steps
The user-guide pages for the ad-hoc feature (all three consumers) follow as the next stack layer.
🤖 Generated with Claude Code