Skip to content

FE-1793: Keep experiment runs and results in their originating conversation - #9857

Merged
kostandinang merged 17 commits into
ka/fe-1793-conversation-permissionsfrom
ka/fe-1793-experiment-lifecycle
Oct 1, 2026
Merged

kostandinang merged 17 commits into
ka/fe-1793-conversation-permissionsfrom
ka/fe-1793-experiment-lifecycle

Conversation

@kostandinang

@kostandinang kostandinang commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Keep an experiment proposal, its execution state and its result follow-up in the originating conversation. This is a complete experiment feature extracted from #9829, not a change to the simulation engine.

🔗 Related links

🚫 Blocked by

Stack: main → #9829 → #9856 → this PR → #9836. Voice steering #9826 is independent; mediation follows as a separate comparison.

🔍 What does this change?

  • Keep the host draft widget, session draft state, shared execution card and lifecycle tests together.
  • Own shared experiment draft state without depending on the voice-steering module changes.
  • Replace a running proposal in place with validation/progress and final metrics. Retain dismissed/cancelled records and support retry after failure.
  • Retain the original blue simulation and purple optimization cards for both the built-in assistant and Brunch. Keep one shared appearance; the shared card only gains an optional Retry run action. Do not add candidate-progress plumbing or touch petrinaut-core.
  • Send a completed local result as a separate turn when its originating conversation is ready. Preserve unsent text, do not automatically resume a stopped response, and offer retry if result submission fails.
  • Register the follow-up control with the host and report host-owned experiment activity through the composer context.
  • Keep the user guide and library patch changeset with this behavior.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

  • Adds a patch changeset for @hashintel/petrinaut execution cards and host activity reporting.

📜 Does this require a change to the docs?

  • Lifecycle, retry and result-follow-up behavior are documented in the assistant guide. Screenshot replacements remain pending where needed.

🕸️ Does this require a change to the Turbo Graph?

  • No execution-graph changes.

⚠️ Known issues

  • See the current PR checks for CI on the main-based head. Earlier website and Playwright integration runs failed before tests because Docker could not pull the MinIO images (unauthorized: access to the requested resource is not authorized); this is not a result for the current head.
  • No provider or microphone testing was performed.
  • The permissions layer is a convenient linear review base, not a fundamental experiment-engine dependency.

🐾 Next steps

Review this feature independently from the mediation layer above it. Live voice/provider verification remains separate. This PR remains draft.

🛡 What tests cover this?

  • Main-based experiments tree: all 18 Turborepo build, type-check and lint tasks passed. Both complete unit suites passed separately.
  • Petrinaut: 173 files / 1,515 tests. Website: 63 files / 895 tests.
  • Draft/execution tests cover proposal persistence, run/cancel/retry, result delivery, originating-conversation checks, and preservation of unsent text.
  • Before the main-based separation, browser assertions passed for running simulation, running optimization and finished cards. Cancellation removes progress; the original title placement, 5px progress bars and unboxed metrics are retained. Desktop and 390px captures were inspected. The rendered component sources remain unchanged; these were not new browser runs on the current head.
  • Formatting and git diff --check passed.

❓ How to test this?

  1. Run turbo run build test:unit lint:tsc lint:eslint --filter @hashintel/petrinaut --filter @apps/petrinaut-website.
  2. Use the deterministic draft integration test and draft-widget tests to exercise Run, Cancel, completion, failure and result retry without a provider.
  3. Open Storybook's RunningSimulation, RunningExperiment and FinishedExperiment fixtures. Check the original blue/purple styling, progress, cancellation and unboxed finished metrics.
  4. Verify a local result follows up only in the matching ready conversation, preserves the composer draft and does not automatically resume a stopped response.

📹 Demo

Controlled Storybook recordings using deterministic data, not a real optimizer or provider.

Running

pr-9857-running-experiment.mp4

Finished

pr-9857-finished-experiment.mp4

@vercel

vercel Bot commented Sep 28, 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 Oct 1, 2026 6:29am UTC
petrinaut Ready Ready Preview Oct 1, 2026 6:29am UTC
petrinaut-docs Ready Ready Preview Oct 1, 2026 6:29am UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Oct 1, 2026 6:29am 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 area/apps labels Sep 28, 2026
@kostandinang
kostandinang force-pushed the ka/fe-1793-experiment-lifecycle branch from 27fe33b to a4fa526 Compare September 28, 2026 17:19
@kostandinang kostandinang self-assigned this Sep 28, 2026
@github-actions github-actions Bot added the area/apps > hash.design Affects the `hash.design` design site (app) label Sep 28, 2026
@kostandinang
kostandinang added this pull request to stack #9861 September 28, 2026 18:43
@kostandinang
kostandinang force-pushed the ka/fe-1793-experiment-lifecycle branch from 6083a1d to 4fe0bde Compare September 28, 2026 19:19
@kostandinang
kostandinang removed this pull request from stack #9861 September 28, 2026 19:19
@kostandinang
kostandinang added this pull request to stack #9863 September 28, 2026 19:19

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2abc566. Configure here.

kostandinang and others added 12 commits September 30, 2026 16:23
Restore the experiment feature from the published UI snapshot as a complete layer: draft lifecycle, neutral execution cards, completion delivery to the originating conversation, retry handling, composer activity reporting, tests and documentation.

Keep result submission distinct from the original draft-tool result, preserve unsent text, and leave stopped responses stopped. No candidate-progress or petrinaut-core changes.

Refs FE-1793
Clear the model review once its accepted model starts a run, so a later
failure shows the run error and Retry run instead of an empty model-change
notice. Send the next unsent completed result even when an earlier result
summary failed, and keep Retry result summary for the failed one.

Co-authored-by: Cursor <cursoragent@cursor.com>
The experiment host resolves failures with an error result instead of rejecting, so the draft treated them as finished and never offered Retry. An error result now becomes a failed run with its message and the existing Retry run action.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Run branch waited for the finished experiment with the default one-second timeout, but it runs a real 20-run Monte Carlo experiment, which a loaded CI runner can take longer to complete.
… run

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
Comment thread libs/@hashintel/petrinaut/src/ui/types/ai-assistant-composer-control.ts Outdated
lunelson
lunelson previously approved these changes Sep 30, 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.

Thanks — all threads addressed.

kube
kube previously approved these changes Sep 30, 2026

This branch was successfully deployed

4 active (1 outdated) deployments
Preview – petrinaut-docs — 73100687 Deployed Oct 1, 2026 by vercel[bot]
Preview – hash — 73100687 Deployed Oct 1, 2026 by vercel[bot]
Preview – petrinaut — 73100687 Deployed Oct 1, 2026 by vercel[bot]
Preview – hashdotdesign-tokens — e1bf1d7e Deployed Sep 30, 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 > hash.design Affects the `hash.design` design site (app) 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 > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

3 participants