FE-1567: Add optional description and metadata fields to SDCPN nodes - #9484
FE-1567: Add optional description and metadata fields to SDCPN nodes#9484claude[bot] wants to merge 18 commits into
description and metadata fields to SDCPN nodes#9484Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview
The Petrinaut website drops Reviewed by Cursor Bugbot for commit 6a4c5d8. Bugbot is set up for automated code reviews on this repo. Configure here. |
…description-metadata
…ngeset conventions
… 64px default height
|
The Generated by Claude Code |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9484 +/- ##
=======================================
Coverage 60.89% 60.89%
=======================================
Files 1461 1461
Lines 146725 146725
Branches 6744 6744
=======================================
+ Hits 89343 89345 +2
+ Misses 56264 56262 -2
Partials 1118 1118
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Size the box between 64px and 100px to fit the existing description when the field mounts or the edited element changes, leaving manual resizing and typing untouched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PF5otFQYGu8yGEZ6WTyt9j
Give the net root, every place, every transition, and the Drone type a description grounded in each example's lambda, kernel, and dynamics code, matching the other built-in examples. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PF5otFQYGu8yGEZ6WTyt9j
Give the net root, every place, every transition, and every type in the seven website example models a description grounded in each node's lambda, kernel, and dynamics code, matching the built-in examples. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PF5otFQYGu8yGEZ6WTyt9j
The truck-fleet model's scenario initial states built the fleet with a `for` loop and object spread, which the HIR compiler rejects ("Loops are not supported"). A load-time step rewrote that code into a `range(scenario.trucks).map(...)` body before compiling; the model file now carries that body directly, so the rewrite step, its test, and its turbo input are gone.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PF5otFQYGu8yGEZ6WTyt9j
Requested by Ciaran Morinan · Slack thread
Before: SDCPN elements carry no human-readable summary apart from
Scenario.descriptionandMetric.description, and a host embedding Petrinaut (such as the Flows→Petrinaut migration, H-6769) has nowhere to store its own data on a net.After:
Place,Transition,Subnet,ComponentInstance,Color, and the net root carry an optionaldescription;Transition,Subnet,ComponentInstance, and the net root also carry an optionalmetadatarecord of JSON values, opaque to Petrinaut and never rendered. Arcs carry neither. Descriptions are editable in the place, transition, component-instance, and type properties panels. Files written before this change still validate, and files carrying the new fields round-trip through export and import.How: The fields are added to the SDCPN types and the strict zod entity schemas (the update-action schemas derive from those, so AI actions and the properties panels accept them without further changes). The file-format schemas gain the fields on their standalone subnet and net-root objects, the export key order includes them,
SDCPNInput/normalizeSDCPNpass them through for hosts, and a shared draft-field textarea renders the description editors.🔗 Related links
Definitionsview with Petrinaut view of a net (internal)🔍 What does this change?
libs/@hashintel/petrinaut-core:description/metadataon the SDCPN types, entity schemas, file-format schemas, export key order, andSDCPNInput/normalizeSDCPNlibs/@hashintel/petrinaut: aDescriptionField/DescriptionTextAreacomponent, wired into the place, transition, component-instance, and type properties panels; user-guide note indocs/drawing-a-net.mdPre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🐾 Next steps
descriptionis schema-only for now; editing UI can follow if wanted.🛡 What tests cover this?
parse-sdcpn-file.test.ts: parse tests for files with and without the new fields, versioned and legacy formatsserialize-sdcpn.test.ts: round-trip and key-order tests now exercise the fields on the net root, transitions, and subnets❓ How to test this?
yarn devinlibs/@hashintel/petrinaut)