Skip to content

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

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

H-6763: Preview generated Petrinaut scratch nets automatically#9538
kostandinang wants to merge 187 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

Important

Closed as an obsolete stacked draft. This branch is not being recut. #9564 is merged and #9588 owns the omitted Voice settlement work. Automatic scratch preview and #9523 current-net grounding were not accepted by this closure; pursue them only in fresh current-main work if still wanted. Do not merge this branch.

🌟 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

lunelson and others added 30 commits September 4, 2026 11:30
Signed-off-by: Lu Nelson <ln@hash.ai>
The built-app test still required the retired Brunch identity sentence, so its faux provider rejected the request before emitting any response and surfaced an empty-reasoning assertion instead.
The production-path test already proves skill activation, resource reads, server and client tools, and transcript behavior. Exact system-prompt sentences only coupled it to editorial changes and obscured failures behind empty downstream output.
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
Signed-off-by: Lu Nelson <ln@hash.ai>
Add a software-behavior/Gherkin paper plugin, extract the cross-plugin transformation and evidence invariant, and capture the prospective software-correctness/Dafny boundary for mission planning.

Amp-Thread-ID: https://ampcode.com/threads/T-01a05d1a-c858-722b-b53a-d0c448d14155
Co-authored-by: Amp <amp@ampcode.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>

@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 81ad66b. Configure here.

idempotencyKey,
...(messageId === undefined && options.initialData !== undefined
? { initialData: options.initialData }
: {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Initial data sent on every user turn

Medium Severity

Scratch-mode initialData is attached to every user send, not only the first admission that creates the conversation. Flue records initialData once at creation and treats it as immutable, so follow-up turns in an open scratch chat can be rejected or ignore a late mode seed. The transport only distinguishes user messages from tool results, not first admission from later user turns.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 81ad66b. Configure here.

@kostandinang
kostandinang force-pushed the kostandin/fe-1580-harden-voice-safety-and-ux-on-the-unified-flue-route branch from b53b100 to be56a18 Compare September 7, 2026 09:07
@kostandinang
kostandinang requested review from a team as code owners September 7, 2026 09:07
@kostandinang
kostandinang marked this pull request as draft September 8, 2026 12:14
@github-actions github-actions Bot added type/legal Owned by the @legal team area/apps > hash.design Affects the `hash.design` design site (app) labels Sep 8, 2026
@kostandinang

Copy link
Copy Markdown
Contributor Author

Closing this obsolete stacked draft instead of recutting it. The accepted Voice foundation is #9564 with settlement follow-up #9588. This closure does not claim that automatic scratch preview or #9523 current-net grounding landed; either behavior should return only as fresh current-main work if still desired.

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/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 type/legal Owned by the @legal team

Development

Successfully merging this pull request may close these issues.

2 participants