Repository navigation
fix(migrate): find item flow ends through the parts and blocks a tool names; let state usages inherit past views - #1025
Merged
Conversation
An «ItemFlow» whose source and target are the parts on the realizing connector's ends, the blocks typing them, or the connector's owner at its own port — as Cameo writes a flow drawn between parts — now flows between the ports those ends name instead of being left as a comment. lower: a view, viewpoint, rendering or metadata member of a state def is not state content, so a usage typed by it inherits past it instead of failing to lower, which left migrated state diagrams empty. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
Author
Runtime verificationSEM migration and restored state renderingTested the freshly built CLI against the supplied Cameo SEM archive.
Caveats: the pre-existing Adversarial and regression checks
|
HuiJun
marked this pull request as ready for review
October 9, 2026 11:41
Merged
3 of 6 tasks
… given a direction Two same-typed parts at same-typed ports let a flow from the block to the port type stand for either end; only the ends' roles may then tell them apart, and when they cannot the flow is left as a comment instead of taking the connector's end order. lower: a parallel state def's views, viewpoints, renderings and metadata are no regions, so a usage typed by it lowers as an ordinary one does. Co-Authored-By: jason.han <hanhuijun@gmail.com>
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Migrating a Cameo SysML v1 model (a Scanning Electron Microscope, 41 diagrams) left 16 of its 19 unmapped elements as «ItemFlow»s and rendered its state machine diagram empty. Both come from how Cameo writes a model, not from the model being malformed.
internal/translate/migrate/migrate.go—itemFlowonly accepted an InformationFlow whoseinformationSource/informationTargetwere the realizing connector ends'roles (the ports). Cameo writes a flow drawn between parts with the parts or the blocks typing them as source and target, and a flow at the owner's own port with the owner block.endStandsFornow matches the source/target against each end's resolved path (segs): its role, any part on the path, the type of either, or the connector's owner when the end is the owner's own port. Direction still follows source → target regardless of end order, and the flow properties are still looked up on the end's actual role. The unmapped note for a flow naming neither end now says what was tried. On the SEM model: 19 → 7 unmapped (the remaining 4 flows name parts whose ports carry no flow property, 2 are Interactions, 1 a DependencyMatrix).internal/ir/lower/state_inheritance.go— a migrated state machine diagram becomes aviewinside thestate def.loweredElsewheredid not list views, viewpoints, renderings or metadata, so astate s : ThatDeffailed with "the view usage … cannot be inherited by the state", the whole state graph was dropped, and every layout annotation for the view warned "does not draw … as a node". Those members are not state content and are now passed over like a comment or a nested definition. On the SEM model this also took strict-validation warnings from 46 to 23.docs/reference/sysml-v1-migration.mdrow for ItemFlow updated; twochanges/unreleased/*.fixed.mdfragments.Specification basis
SysML v1.6 §9.3.2.6 ItemFlow (an ItemFlow is realized by a connector; its item properties/flow properties are those of the connector ends' types) — the change only widens which v1 encodings of the source/target are recognised, the v2 output (
flow of X from a.p to b.q, KerML/SysML v2 §7.13) is unchanged. No row indocs/project/spec-compliance.mdmoves.How it was verified
TestItemFlowEndsMayBeThePartsOrBlocksOnTheConnector(tests/migrate/relations_test.go): block-typed ends, owner-port end, and a flow naming neither end stays unmapped with the new note.TestToStateGraphTypedStateUsageSkipsInheritedViewsAndMetadata(internal/ir/lower/state_inherited_test.go): a state def withview,viewpoint,rendering,@Noteandmetadata … aboutstill lowers through a typed usage with its substates.go test ./internal/ir/... ./internal/exec/runtime ./internal/translate/... ./internal/check/...andmake lintpass;scripts/changelog.py checkpasses..mdzip; output validates with-validate -strict, 0 errors; the state view now renders its states and transitions.Checklist
make testandmake lintpass locally (focusedgo teston the touched trees +make lint; fullmake testruns in CI)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (none moved)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/dbff7ccc1454416fb497412e51cf5513
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/dbff7ccc1454416fb497412e51cf5513?variant=devin
Requested by: @HuiJun