Repository navigation
fix(view): route specialization edges from Cameo and keep the keyword line in a stated box - #1166
Merged
Merged
Conversation
The DOT writer fitted the head first and wrote the keyword line only while height remained, so a Cameo-sized box whose two-word name wrapped lost its «part def» line. The head and keyword are now fitted together, shrunk in proportion from the node's size down to the floor, and the keyword is dropped only when no size holds both; detail lines and compartments are fitted after them as before. The fit order is documented on dotFittedLabel. Co-Authored-By: jason.han <hanhuijun@gmail.com>
A specialization declares no element an `about` could name, so a Route about the specific element types DiagramLayout::Route::general with the element the line is drawn to (`ref :>> general : Sup;`). The semantic model reads it into LayoutSite.General and resolves it per general with SpecializationRouteOf, RouteOf passing such sites over; the positioned tree gives each specialization, typing and subsetting edge the Route naming its target, so a subtype with two generals and the same subtype in two views each follow their own waypoints while an unpositioned tree is unchanged. The layout check keys duplicates by general and reports a Route naming a general the view draws no edge to. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…efinition A v1 Generalization becomes a `:>` clause with no member of its own, so its route was reported as "no v2 member" and the rendered inheritance line was auto-routed. The migrator now writes it as a DiagramLayout::Route about the specific definition naming the general the clause is drawn to, when a block definition diagram shows both ends and the `:>` was written, one per general; the report counts it as written. 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)".
|
…nt's route A setRoute edit rewrote the first Route stated about the element, which could be the one steering its specialization edge; the edit now passes such Routes over and writes the element's own. Co-Authored-By: jason.han <hanhuijun@gmail.com>
DiagramLayout::Route gains `ref general : Base::Anything[0..1]`, the element a Route about a specific element steers its specialization edge to; the engine contract lists it, the library snapshot is regenerated and the pilot-differential baseline re-recorded for the library digest alone. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…-routes-keyword-fit
HuiJun
marked this pull request as ready for review
October 15, 2026 02:06
…-routes-keyword-fit Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/pilot-differential-baseline.json
…-routes-keyword-fit Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # tests/migrate/testdata/xmi/diagram_edges.layout.golden.report.txt
…-routes-keyword-fit Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/translate/migrate/diagrams.go
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
A migrated Cameo block definition diagram drew its inheritance lines and its boxes wrongly in two ways; the migrated model text keeps its meaning.
Generalization routes were dropped. A v1 Generalization becomes a
:>clause on the subtype, which declares no member ametadata DiagramLayout::Route about Xcould name, so the migrator reportedroutes of Generalization: N no v2 memberand the positioned tree auto-routed the hollow-triangle edge. The route is now written about the specific definition, naming the general the line is drawn to:The semantic model reads
generalintoLayoutSite.Generaland resolves a Route per general (Model.SpecializationRouteOf);RouteOfpasses such sites over, so aconnection def Sub :> Basekeeps its own Route for its own line. The positioned tree gives each specialization, typing and subsetting edge the Route naming its target: a subtype with two generals follows one Route per general, the same subtype drawn in two views follows each view's own, and an unpositioned tree is unchanged. The layout check keys duplicate Routes by general and reports a Route naming a general the view draws no edge to. The migration report counts these routes aswritten.Options for carrying the route, ranked by spec compliance (each probed with the pinned pilot
validate-sysml-batchandsysml -validate):Routeabout the specific element, typing ageneralreference (ref :>> general : Sup;). Valid SysML v2 textual notation (theref :>> x : T;idiomMigrationMetadata::DeferredEventalready uses), 0 pilot errors, unambiguous for several generals and for several views. Needs the extension-library change below.Routeabout the subtype naming nothing: valid text, but a subtype with two generals cannot be routed (the second Route is a duplicate) and it contradicts the documented rule that a Route steers the declaring element of an edge.specialization G subclassifier A :> B;member: KerML-only. The pilot rejects it in a.sysmlfile (no viable alternative at input 'G') and so does OpenSysML (expected a namespace member).Extension-library change, Open-MBEE/OpenSysML-Extensions-Library#7 (merged):
DiagramLayout::Routegainsref general : Base::Anything[0..1];;EXTENSIONS_COMMITis pinned at its merge commit, the vendored copy andengine-contract.jsonsynced withscripts/sync-extension-libraries.sh,stdlib.snapshotregenerated and the pilot-differential baseline re-recorded for the library digest alone.The keyword line was dropped from Cameo-sized boxes when the name wrapped.
dotFittedLabelfitted the head first and wrote the keyword line only while height remained, so in a 33px boxInstrumentkept its«part def»line andDisplay System, wrapping to two lines, lost it. The head and keyword are now fitted together, shrunk in proportion from the node's size to the floor (whole words before broken ones), and the keyword is dropped only when no size holds both; detail lines and compartments are fitted after them with their clipping unchanged. The order is documented ondotFittedLabel. Mermaid, PlantUML and D2 have no stated-box fitting of their own, so nothing there changes.Before and after, the
tree-generalization.sysmlfixture rendered in the Cameo style:Measured on a Cameo model with two block definition diagrams of the detector hierarchy, re-migrated on this head with the library change applied: the model text differs from a
developbuild by exactly the four Generalization Route lines (two subtypes × two BDDs, eachref :>> general : Detector); the report moves fromroutes of Generalization: 4 no v2 memberto4 written, routes 284 → 288 of 316, placements 410 unchanged;-validateclean, pilot 0 errors; the rendered BDD draws both inherits on Cameo's waypoints and keywords all 19 boxes (6 of 19 before).Specification basis
SysML v2 textual notation admits a metadata usage body feature redefined with a typing,
ref :>> general : Sup;(the same formMigrationMetadata::DeferredEventuses forsignal), and admits no standalone specialization member: KerML'sspecialization/subclassifierdeclarations are KerML-only, asinternal/syntax/parser/f86_relationship_member.godocuments and both validators confirm. No row ofdocs/project/spec-compliance.mdmoves;docs/project/diagram-layout-annotations.mdanddocs/reference/sysml-v1-migration.mddescribe the new Route form.How it was verified
internal/ir/view/testdata/tree-generalization.sysml: Detector, Sensor and two subtypes (one with two generals) in 33px boxes with Cameo-like Routes, a second view drawing one subtype with another Route, and an unpositioned copy.TestGoldenTreeGeneralization(dot, cameo dot, mermaid, plantuml, d2, text, plus the second and unpositioned views) andTestTreeSpecializationRoutes(each edge's waypoints per view; nothing routed unpositioned). Pilotvalidate-sysml-batch: 0 errors on the fixture and on the migrated golden.TestDOTFitsTheLabelToAStatedBoxnow encodes the joint fit (shrunk keyword kept beside a wrapped name, dropped only below the floor, absent whenElementKeywordsis off) andTestDOTHeadsAnEnclosingBoxAboveItsMembersthe keyword line on an enclosing box's title.tests/migrate/testdata/xmi/diagram_edges.layout.golden.sysmland.golden.report.txt: the one Generalization connector of the BDD is now written as a Route aboutEnginenamingComponent;routes of Generalization: 1 no v2 member→1 written, routes12 of 24→13 of 24, its points running fromEnginetoComponentas every migrated line now runs from its first end to its second;layout_test.gocounts follow.internal/ir/viewgolden moved: no fixture there has a stated box too short for its keyword line.gofmt -l .empty,go build ./...,go vet ./...;go test -count=1 ./internal/ir/view/... ./internal/translate/migrate/... ./tests/migrate/...and./internal/check/... ./internal/semantic/semantics/pass.go run -C tools ./cmd/transformation-census -check: census document and baseline agree.python3 scripts/check-doc-ids.pyandpython3 scripts/changelog.py checkclean.go test ./...with the training corpus and pilot corpora fetched: the one failure left isTestExecutionConformance/verification_chain_package_usage_value*, which fails identically ondevelop.Checklist
make testandmake lintpass locally (see above for the onedevelopfailure)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/850d56a6ed3e4b39b7a1dc2b4b9ec6d8
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/850d56a6ed3e4b39b7a1dc2b4b9ec6d8?variant=devin
Requested by: @HuiJun