Skip to content

FE-1504: Run the process-model elicitor from the Petrinaut panel on one owned document - #9345

Open
lunelson wants to merge 4 commits into
ln/fe-1431-plugin-authoring-cyclefrom
ln/fe-1504-panel
Open

FE-1504: Run the process-model elicitor from the Petrinaut panel on one owned document#9345
lunelson wants to merge 4 commits into
ln/fe-1431-plugin-authoring-cyclefrom
ln/fe-1504-panel

Conversation

@lunelson

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

🔗 Related links

  • ...

🚫 Blocked by

  • ...

🔍 What does this change?

  • ...

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing
  • modifies an npm-publishable library and I have added a changeset file(s)
  • modifies a Cargo-publishable library and I have amended the version
  • modifies a Cargo-publishable library, but it is not yet ready to publish
  • modifies a block that will need publishing via GitHub action once merged
  • I am unsure / need advice

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change
  • are in a state where docs changes are not yet required but will be
  • require changes to docs which are made as part of this PR
  • require changes to docs which are not made in this PR
    • Provide more detail here
  • I am unsure / need advice

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

The changes in this PR:

  • do not affect the execution graph
  • affected the execution graph, and the turbo.json's have been updated to reflect this
  • I am unsure / need advice

⚠️ Known issues

🐾 Next steps

🛡 What tests cover this?

❓ How to test this?

  1. Checkout the branch / view the deployment
  2. Try X
  3. Confirm that Y

📹 Demo

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 26, 2026 6:30pm
hashdotdesign-tokens Ready Ready Preview Aug 26, 2026 6:30pm
petrinaut Ready Ready Preview Aug 26, 2026 6:30pm
petrinaut-docs Ready Ready Preview Aug 26, 2026 6:30pm

Request Review

lunelson commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

@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/tests New or updated tests area/apps labels Aug 26, 2026
@lunelson lunelson changed the title Refuse cross-principal target-document access FE-1504: Run the process-model elicitor from the Petrinaut panel on one owned document Aug 26, 2026
@lunelson
lunelson force-pushed the ln/fe-1431-plugin-authoring-cycle branch from a92dca6 to 9543278 Compare August 26, 2026 17:16
@cursor

cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes session/document identity and makes the principal header mandatory on chat, affecting persistence isolation and any clients that omit the header; local capture format v2 adds ownership checks on stored elicitation data.

Overview
Wires the Petrinaut local panel to the SDCPN process-model elicitor (replacing the gherkin path for /api/chat) and introduces a stable UI principal so Brunch can scope conversations and elicitation storage per browser.

The AI SDK transport now requires x-brunch-principal on chat POSTs (CORS preflight allows it), rejects missing/invalid principals, and threads principalKey through initial turns and ask-reply resumes. The Petrinaut demo persists a principal in localStorage and sends it on every chat request via the new @hashintel/brunch-agent-transport-aisdk/headers export.

On the server, resolvePetrinautSessionIdentity derives a hashed Flue session id from principal + panel conversation id while keeping one target document id per principal; elicitation sessions pass optional ownerKey into the local capture store. Target-document JSON moves to format v2 with ownerKey and refuses read/write when the on-disk owner does not match the caller (legacy v1 migrates with ownerKey: null).

Local dev adds yarn dev:brunch (Brunch + real Petrinaut site), a brunch-agent README, and tests covering the dev scripts, session naming, principal header contract, and ownership enforcement.

Reviewed by Cursor Bugbot for commit 146d789. Bugbot is set up for automated code reviews on this repo. Configure here.

@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 98 untouched benchmarks


Comparing ln/fe-1504-panel (146d789) with main (a37f9ae)1

Open in CodSpeed

Footnotes

  1. No successful run was found on ln/fe-1431-plugin-authoring-cycle (807cb52) during the generation of this report, so main (a37f9ae) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

lunelson and others added 4 commits August 26, 2026 20:15
Stamp local target documents with an opaque owner key so multiple sessions can share one document without allowing another principal to read or mutate it.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse one UI-shell identity across reloads and require it at the HTTP boundary so Brunch can resolve every panel session to the same owner-scoped document.

Co-authored-by: Cursor <cursoragent@cursor.com>
Route panel turns and ask replies through the SDCPN elicitor and provide one documented root command that starts the Brunch server with the real Petrinaut panel.

Co-authored-by: Cursor <cursoragent@cursor.com>
Namespace Flue sessions by the panel principal so client conversation IDs cannot cross ownership boundaries, and keep repository layout knowledge in the root launcher.

Co-authored-by: Cursor <cursoragent@cursor.com>
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) area/tests New or updated tests type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

1 participant