Skip to content

FE-524: Add Inhibitor Arc support#8618

Merged
alex-e-leon merged 18 commits intomainfrom
FE-524-inhibitor-arcs
Apr 13, 2026
Merged

FE-524: Add Inhibitor Arc support#8618
alex-e-leon merged 18 commits intomainfrom
FE-524-inhibitor-arcs

Conversation

@alex-e-leon
Copy link
Copy Markdown
Contributor

@alex-e-leon alex-e-leon commented Apr 10, 2026

🌟 What is the purpose of this PR?

Adds inhibitor arcs to petrinaut. Specifically this:

  • adds a new "type: 'inhibitor' | 'standard' field to input arcs
  • updates the logic for executing a net with inhibitor arc logic
  • styles inhibitor arcs with a dot-dash line + circle endpoint
  • adds a new "deployment pipeline" example net to the examples folder with an inhibitor arc added.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

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

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

The new circle markers for inhibitor arcs don't play super nice with the existing arrows for other arcs. Currently if there is an inhibitor arc, any standard arc arrows are hidden by the new circle marker. We will likely need to rethink how we show markers/connections down the line.

The new dashed stroke style is also possibly confusing. Based on some quick research, it looks like "conditional arcs" also use a dashed line style. I've adjusted the stroke to be a dot-dash pattern to make it less confusing, but it may still not be a great style.

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 10, 2026

PR Summary

Medium Risk
Updates core SDCPN data structures and simulation enablement/execution logic to support inhibitor arcs, which could change net behavior and rendering if any assumptions about input arcs were implicit. Backward compatibility is mostly handled via schema defaults, but existing serialized nets/clipboard payloads rely on that defaulting behaving correctly.

Overview
Adds inhibitor arcs support end-to-end. Input arcs now carry a type (standard/inhibitor) in core SDCPN types plus clipboard and file-format schemas (defaulting to standard for backward compatibility).

Simulation behavior changes: transition structural enablement and firing now treat inhibitor arcs as guards (tokens < weight) and they no longer contribute tokens to transition inputs or token consumption; LSP virtual input types also ignore inhibitor arcs.

Editor + examples updates: the arc properties panel can toggle input-arc type, inhibitor arcs render as dashed edges with a circle marker, and a new “Deployment Pipeline” example net demonstrates inhibitor usage; existing tests/examples were updated to include type: "standard" on input arcs.

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

@github-actions github-actions bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps > hash.design Affects the `hash.design` design site (app) labels Apr 10, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Apr 13, 2026 1:03pm
petrinaut Ready Ready Preview, Comment Apr 13, 2026 1:03pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview Apr 13, 2026 1:03pm
hashdotdesign-tokens Ignored Ignored Preview Apr 13, 2026 1:03pm

@github-actions github-actions bot added the area/infra Relates to version control, CI, CD or IaC (area) label Apr 10, 2026
Comment thread libs/@hashintel/petrinaut/src/views/SDCPN/sdcpn-view.tsx
Comment thread libs/@hashintel/petrinaut/src/simulation/simulator/compute-possible-transition.ts Outdated
Comment thread libs/@hashintel/petrinaut/src/simulation/simulator/compute-possible-transition.ts Outdated
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 10, 2026

🤖 Augment PR Summary

Summary: This PR adds inhibitor-arc support to Petrinaut SDCPN nets, including persistence, simulation semantics, and UI rendering.

Changes:

  • Introduces an explicit type field on input arcs (standard | inhibitor) and updates core SDCPN typings accordingly.
  • Updates clipboard and file-format Zod schemas to accept the new field and default missing arc types to standard for backwards compatibility.
  • Extends simulator enablement logic so inhibitor arcs enable when tokenCount < weight, and updates firing logic so inhibitor arcs are not consumed.
  • Adds unit tests for inhibitor-arc enablement and firing behavior.
  • Updates the editor properties panel to allow changing an arc’s type, and adds visual styling for inhibitor arcs (dot-dash stroke + circle end marker).
  • Adds a new “Deployment Pipeline” example net demonstrating inhibitor arcs, and tweaks SDCPN view zoom padding.

Technical Notes: Inhibitor arcs currently affect marker rendering interactions with existing arrow markers (noted in PR description), and the new arc type is passed through ReactFlow edge data for rendering.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread libs/@hashintel/petrinaut/src/simulation/simulator/compute-possible-transition.ts Outdated
Comment thread libs/@hashintel/petrinaut/src/state/mutation-provider.tsx Outdated
@graphite-app graphite-app bot requested review from a team April 10, 2026 15:30
Comment thread .changeset/funky-deserts-grin.md Outdated
Comment thread libs/@hashintel/petrinaut/src/views/SDCPN/reactflow-types.ts Outdated
@alex-e-leon alex-e-leon changed the title Fe 524 inhibitor arcs FE-524 inhibitor arcs Apr 10, 2026
Copy link
Copy Markdown
Collaborator

@kube kube left a comment

Choose a reason for hiding this comment

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

Looks good! Good job!

Only minor thing on making type required on ArcData to force the mapper.

Will check a bit more on Monday after you fixed the AI reviews, but should be good.

Comment thread libs/@hashintel/petrinaut/src/core/types/sdcpn.ts
Copy link
Copy Markdown

@cursor cursor bot left a comment

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.

There are 2 total unresolved issues (including 1 from previous review).

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Output arcs receive unintended type property from addArc
    • Updated addArc to add type only for input arcs and removed the invalid type field from the output-arc test fixture.

Create PR

Or push these changes by commenting:

@cursor push ba1e8904d4
Preview (ba1e8904d4)
diff --git a/libs/@hashintel/petrinaut/src/lsp/lib/create-sdcpn-language-service.test.ts b/libs/@hashintel/petrinaut/src/lsp/lib/create-sdcpn-language-service.test.ts
--- a/libs/@hashintel/petrinaut/src/lsp/lib/create-sdcpn-language-service.test.ts
+++ b/libs/@hashintel/petrinaut/src/lsp/lib/create-sdcpn-language-service.test.ts
@@ -113,9 +113,7 @@
         inputArcs: [
           { placeId: "place1", weight: 1, type: "standard" as const },
         ],
-        outputArcs: [
-          { placeId: "place2", weight: 1, type: "standard" as const },
-        ],
+        outputArcs: [{ placeId: "place2", weight: 1 }],
         lambdaCode: "",
         transitionKernelCode: "",
       },

diff --git a/libs/@hashintel/petrinaut/src/state/mutation-provider.tsx b/libs/@hashintel/petrinaut/src/state/mutation-provider.tsx
--- a/libs/@hashintel/petrinaut/src/state/mutation-provider.tsx
+++ b/libs/@hashintel/petrinaut/src/state/mutation-provider.tsx
@@ -126,13 +126,18 @@
       guardedMutate((sdcpn) => {
         for (const transition of sdcpn.transitions) {
           if (transition.id === transitionId) {
-            transition[
-              arcDirection === "input" ? "inputArcs" : "outputArcs"
-            ].push({
-              type: "standard",
-              placeId,
-              weight,
-            });
+            if (arcDirection === "input") {
+              transition.inputArcs.push({
+                type: "standard",
+                placeId,
+                weight,
+              });
+            } else {
+              transition.outputArcs.push({
+                placeId,
+                weight,
+              });
+            }
             break;
           }
         }

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread libs/@hashintel/petrinaut/src/state/mutation-provider.tsx
Comment thread libs/@hashintel/petrinaut/src/lsp/lib/create-sdcpn-language-service.test.ts Outdated
Comment thread libs/@hashintel/petrinaut/src/views/SDCPN/components/arc.tsx
Copy link
Copy Markdown

@cursor cursor bot left a comment

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.

There are 2 total unresolved issues (including 1 from previous review).

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 7692cc7. Configure here.

@vilkinsons vilkinsons changed the title FE-524 inhibitor arcs FE-524: Add Inhibitor Arc support Apr 13, 2026
Copy link
Copy Markdown
Collaborator

@kube kube left a comment

Choose a reason for hiding this comment

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

👍

@alex-e-leon alex-e-leon added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit dae70b5 Apr 13, 2026
48 checks passed
@alex-e-leon alex-e-leon deleted the FE-524-inhibitor-arcs branch April 13, 2026 16:58
@hashdotai hashdotai mentioned this pull request Apr 13, 2026
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/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.

2 participants