Skip to content

FE-1668: Demonstrate AI experiment and optimization integration - #9654

Merged
kube merged 3 commits into
codex/fe-1667-ai-experiment-chatfrom
codex/fe-1484-ai-experiments
Sep 15, 2026
Merged

kube merged 3 commits into
codex/fe-1667-ai-experiment-chatfrom
codex/fe-1484-ai-experiments

Conversation

@kube

@kube kube commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Important

Experimental optimization
Optimization requires Parameter sweeps and In-browser optimization. Simulation is available without these flags.

Summary

Add an /ai-experiments demo with scripted AI replies and real browser computation. The conversation proposes an experiment, starts it on request, and reports the returned results.

The example uses a saved SIR model with distributions. The integration guide separates Petrinaut's execution and chat responsibilities from Brunch's tool selection, transport, and agent behavior.

Integration responsibilities

Experiment

experiment.mp4

Optimization

optimization.mp4

Links

Blocked by

Changes

  • Stream planning replies before accepting a command to run or optimize
  • Derive completion messages from actual metric values, selected parameters, and run counts
  • Demonstrate heatmaps and histograms for simulation and optimization
  • Document the steps for Brunch adoption and its separate production integration work

Known issues

The SIR example is illustrative and uncalibrated. Searching initial infection levels demonstrates parameter search. Brunch adoption requires its own catalog registration and transport test, tracked in FE-1484.

Test coverage

The stack includes a fix for the HASH Edge deployment: AI schemas no longer import the worker backend. A bundler regression covers the dependency boundary, and all 52 integrated validation tasks passed again after the fix.

After the 15 September restack onto main a898a13810, core, editor, website, and Brunch builds, unit tests, TypeScript, and lint passed on the integrated stack (52 tasks). Architecture validation, the documentation site build, and changed-file formatting passed.

  • Demo transport tests cover planning, explicit launch commands, streamed replies, cancellation, and returned results
  • The recordings show live progress, completed results, and metric distributions

Browser verification completed 256 simulation runs, opened the heatmap and a time-slice histogram, and confirmed the fixed title is read-only. No console errors were reported. Optimization and cancellation are covered by tests; browser optimization was not rerun at the user's request. Existing recordings predate this restack.

How to test

  • Run turbo run dev --filter @apps/petrinaut-website
  • Open http://localhost:5173/ai-experiments, using the printed port if it differs
  • Open the AI assistant and ask How can I see the variation in this outbreak model?
  • Send run after reading the proposal
  • Select View experiment, then click a heatmap time step to inspect its histogram
  • Open Settings and enable Parameter sweeps and In-browser optimization
  • Ask to compare starting infection levels, then send optimize
  • Inspect the running card and the best point's distribution after completion
  • Start another optimization and select Cancel

    The card stops updating and shows cancellation.

@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Sep 15, 2026 12:31pm UTC
petrinaut Ready Ready Preview Sep 15, 2026 12:31pm UTC
petrinaut-docs Error Error Sep 15, 2026 12:31pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Sep 15, 2026 12:31pm UTC

Request Review

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team area/apps labels Sep 11, 2026
@kube kube self-assigned this Sep 11, 2026
@kube kube changed the title Run experiments from Petrinaut AI chat FE-1484: Run experiments from Petrinaut AI chat Sep 11, 2026
@kube kube changed the title FE-1484: Run experiments from Petrinaut AI chat FE-1668: Demonstrate AI experiment and optimization integration Sep 11, 2026
@kube
kube removed this pull request from stack #9698 September 14, 2026 15:50
@kube
kube added this pull request to stack #9717 September 14, 2026 15:51
@kube
kube force-pushed the codex/fe-1484-ai-experiments branch from 6a55503 to 9328684 Compare September 14, 2026 16:00
@CiaranMn
CiaranMn force-pushed the codex/fe-1484-ai-experiments branch from 9328684 to a7ca66a Compare September 14, 2026 16:13
@kube
kube force-pushed the codex/fe-1484-ai-experiments branch from a7ca66a to 9ee4cf1 Compare September 14, 2026 16:18
@kube
kube force-pushed the codex/fe-1484-ai-experiments branch from 9ee4cf1 to 4334375 Compare September 14, 2026 19:25
lunelson
lunelson previously approved these changes Sep 14, 2026

@lunelson lunelson 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.

Approved by Lu Nelson following an agent-assisted review of this PR against its parent and FE-1668. No actionable introduced defects found in the scripted transport, explicit launch commands, cancellation, or result-derived replies. The distinction between this demo and production Brunch integration is clear.

Verification on the integrated four-PR stack: core package build passed; 231 targeted tests across 11 files passed, including all 26 demo transport tests. Live-browser simulation and optimization were not rerun during this review; the recordings predate the rebase, as noted in the PR.

CiaranMn
CiaranMn previously approved these changes Sep 15, 2026

This branch was successfully deployed

3 active deployments
Preview – hash — 40c2676b Deployed Sep 15, 2026 by vercel[bot]
Preview – petrinaut — 40c2676b Deployed Sep 15, 2026 by vercel[bot]
Preview – petrinaut-docs — 40c2676b Deployed Sep 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

4 participants