Skip to content

H-6763: Preview generated Petrinaut scratch nets automatically - #9538

Draft
kostandinang wants to merge 10 commits into
kostandin/fe-1580-harden-voice-safety-and-ux-on-the-unified-flue-routefrom
kostandin/h-6763-automatic-petrinaut-draft-preview
Draft

H-6763: Preview generated Petrinaut scratch nets automatically#9538
kostandinang wants to merge 10 commits into
kostandin/fe-1580-harden-voice-safety-and-ux-on-the-unified-flue-routefrom
kostandin/h-6763-automatic-petrinaut-draft-preview

Conversation

@kostandinang

@kostandinang kostandinang commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Close the bounded Brunch interview-to-canvas loop in the Petrinaut local demo. Brunch now reads the live document before answering a request about the current net in every conversation. When a typed or Voice conversation begins against an empty scratch document, Brunch can also construct the elicited net through Petrinaut's canonical client tools and each accepted mutation appears on the canvas immediately. There is no separate Preview, Publish, or Generate action.

This is a temporary stacked implementation intended to prove the complete interaction. Its generic client-tool catalog and input-mapping seams are reconciled with Mission 6 without adopting Mission 6 fixture state or durability claims.

🔗 Related links

  • H-6763 (internal)
  • FE-1580 reconciliation
  • Behavior donor #9523: current-net grounding and browser client-tool handling
  • Reconciliation source #9537 at ec85958981: generic host-supplied client-tool projection seams

🚫 Blocked by

🔍 What does this change?

  • Mounts the read-only live-net tool for every Brunch conversation and requires it before answers about the current net.
  • Adds an explicitly gated scratch-project construction mode to the SDCPN Brunch plugin.
  • Carries conversation creation data through the shared AI SDK-to-Flue transport.
  • Admits the existing Petrinaut construction calls as browser tools in the local demo.
  • Reuses Petrinaut's canonical mutation dispatcher, active document handle, canvas renderer, and localStorage persistence.
  • Adds typed, Voice-route, transport, mode-gating, current-net grounding, and complete connected-net tracers.
  • Applies host-supplied client-tool catalogs and input mapping consistently across live stream and hydrated-history projection.

Donor behavior

#9523 is a behavior donor. This PR adopts live-net reading before answering a request about the current net in every conversation, including conversations attached to existing non-empty documents, and preserves that browser client tool through transport and history hydration. It reimplements those behaviors against the shared Flue route and SDCPN plugin rather than importing #9523's older agent topology. Mutation tools remain gated to explicit scratch or validated construction modes. This PR does not supersede or authorize retirement of #9523.

From #9537, this PR adopts only the generic host-supplied client-tool catalog and input-mapping seams. It preserves FE-1580 hidden-tool filtering, admission and response tracking, complete errors, Voice provenance, and the exclusion of brunch_ask; it does not import prepared fixtures, identities, coherent bundles, settled manifests, or evidence architecture.

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

📜 Does this require a change to the docs?

The changes in this PR:

  • are in a state where docs changes are not yet required but will be
    • this is tracked in: H-6763 (internal)

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

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

  • Automatic construction is intentionally limited to documents that started empty; existing non-empty documents are read-only from this mission's construction path.
  • The tracer covers a connected place-transition-place net; arbitrary SDCPN projection, provenance, atomic publication, scenarios, and metrics remain out of scope.
  • This branch deliberately does not copy Mission 6's prepared fixture identity or coherent-bundle architecture.

🐾 Next steps

  • Move general workpiece-to-net projection, provenance, and repeat/change semantics into the later traceable-projection mission.

🛡 What tests cover this?

  • Ordinary no-mode ChatAgent model request proving the live-net reader and grounding instructions are mounted while mutation tools remain absent.
  • Hermetic Flue-to-headless-Petrinaut tracer constructing two places, one transition, and both arcs.
  • SDCPN plugin mode/schema tests.
  • AI SDK transport creation-data plus live and hydrated client-tool input-mapping tests.
  • Petrinaut website panel transport, local demo, and Voice route tests.
  • Existing FE-1580 Petrinaut chat and validated runbook tracers.
  • Package type checks, lint, and production builds.

❓ How to test this?

  1. Run the Brunch agent and Petrinaut website from this stacked branch.
  2. Open an existing non-empty net, ask What is this net about?, and confirm the answer uses the live definition instead of asking for an attachment.
  3. Open a new empty New Process document.
  4. Describe a small process via text or Voice and provide enough detail, or ask Brunch to use sensible defaults.
  5. Confirm places, transitions, and arcs appear without another preview/generate action.
  6. Reload and confirm the local net remains visible without duplicated elements.

📹 Demo

Not recorded yet.

Made with Cursor

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
petrinaut Ready Ready Preview Sep 4, 2026 10:11pm UTC
3 Skipped Deployments
Project Deployment Actions Updated
hash Ignored Ignored Preview Sep 4, 2026 10:11pm UTC
hashdotdesign-tokens Ignored Ignored Preview Sep 4, 2026 10:11pm UTC
petrinaut-docs Ignored Ignored Preview Sep 4, 2026 10:11pm UTC

Request Review

kostandinang and others added 4 commits September 4, 2026 23:04
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
kostandinang and others added 2 commits September 4, 2026 23:35
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
kostandinang and others added 2 commits September 5, 2026 00:03
Co-authored-by: Cursor <cursoragent@cursor.com>
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/deps Relates to third-party dependencies (area) 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