Repository navigation
fix(export): a composite usage states isReference = false in the element form - #2166
Open
devin-ai-integration[bot] wants to merge 8 commits into
Open
devin-ai-integration[bot] wants to merge 8 commits into
devin-ai-integration[bot] wants to merge 8 commits into
Conversation
…osite one Usage::isReference is a required Boolean derived as not isComposite (SysML v2.1 Beta 2 8.3.6.4 deriveUsageIsReference). The shared element-form completion table did not list it, so GetElementProperties and api-json stated it only where the graph did and a composite usage answered nothing. It is now completed from the evaluator on every usage. A graph element that states isComposite answers it ahead of its metaclass rule, and the symbol-backed structure states the effective isComposite, so both element readers agree with the element form. Re-records the api-json differential, the derived census and the structure differential, whose movement is isReference and isComposite and the collections that read them. Refs #1986 Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…sus and the structure differential on the develop merge The api-json fragments move only in isReference rows: 11659 values leave ours-missing (11639 present-equal, 20 present-different) and seven pilot-missing rows appear (1280 values). The census and the structure differential move in isComposite, isReference and the collections that read them. Refs #1986 Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ence-false Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/translate/export/testdata/structure_differential_expected.txt
… reflective flags The reflective feature flags now answer the always-referential usages themselves, so the symbol structure's own override is superseded; the structure differential is re-recorded. Refs #1986 Co-Authored-By: jason.han <hanhuijun@gmail.com>
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)".
|
This branch has not been deployed
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
Refs #1986.
A composite usage answered nothing for
isReferenceon the element form:GetElementPropertiesreturned an empty value list forM::Car::engineandsysml -convert api-jsonwrote noisReferencekey, while arefusage answeredtrueand the query leg answeredfalsecorrectly.Usage::isReferenceis a required Boolean derived asnot isComposite(SysML v2.1 Beta 2 §8.3.6.4deriveUsageIsReference), so a composite usage must answerfalse.Root cause. No
falsewas dropped in serialisation (derivedJSONValuewrites a Booleanfalse,derivedValueEmptytreats only null and empty sequences as absent).Usage::isReferencewas simply absent from the completion table of the shared element form (apiJSONCompletedPropertiesininternal/translate/export/api_json_derived.go), so it appeared only where the graph stated it, which the RDF writer does for referential usages only.isCompositeis an authored attribute the graph always states, which is whyisComposite = falsewas never lost.Fix, in the shared layer.
api_json_derived.go:Usage::isReferencejoins the completion table, so the one element form behindGetElementProperties, api-json and the clients completes it through the evaluator's existingderiveUsageIsReference.structure_rules.go(structureUsageComposite): for a graph-backed element, theisCompositethe graph states answers the derivation, so the completedisReferenceis always the negation of theisCompositeon the same element form. A symbol-backed element keeps the semantic model's answer.Other required Booleans.
isDefault,isInitial,isAbstract,isVariable,isPortion,isEnd,isDerived,isOrdered,isUnique,isNonuniquewere checked on the same surfaces: none is omitted for this reason (a required derived Boolean missing from the completion table), so nothing else was changed;api_json_booleans_test.gopins the Booleans the element form writes,falseincluded.Specification basis
SysML v2.1 Beta 2 §8.3.6.4
deriveUsageIsReference(isReference = not isComposite, multiplicity[1]). The row for derived Booleans indocs/project/spec-compliance/06-model-persistence-and-rdf-interchange.mdis updated.Known limitation: residual
isCompositedisagreement between the symbol and graph structuresAfter this change the two structures still disagree on
Feature::isComposite(and soUsage::isReference) for 60 usages. The graph states what the RDF writer derives fromUsageIsComposite; the symbol structure readsreflectiveFeatureFlagsininternal/semantic/semantics/annotations.go, which does not yet apply these rules. They are left visible in the structure differential rather than overridden in the symbol structure, as a follow-up inreflectiveFeatureFlags:renderusage of a view (RenderingUsage), a framed concern (ConcernUsage), an asserted constraint (AssertConstraintUsage) and oneRequirementUsage. The two framed concerns of the training corpus are the 5 → 7 movement: the graph-backed side used to derive them referential, agreeing with the symbol side, and now answers the composite the graph states.performin a state'sentry/do/exit(PerformActionUsage) and two variantPortUsages.The element form served by
GetElementPropertiesand api-json is graph-backed, so it answers the graph's value for all of these.The 60 elements, by root
examples(26)disposal-robot-demo/robot.sysmlRobotViews__interfaces__asInterconnectionDiagramdisposal-robot-demo/robot.sysmlRobotViews__partsTable__asElementTablephase-c-behavioral-bodies.sysmlPhaseC__ConnectionStateMachine___4011__announcephase-c-behavioral-bodies.sysmlPhaseC__ConnectionStateMachine___4012__reportFailurephase-c-behavioral-bodies.sysmlPhaseC__ConnectionStateMachine___4013__drainphase-c-behavioral-bodies.sysmlPhaseC__VehicleOperating___4014__handbrakephase-c-behavioral-bodies.sysmlPhaseC__VehicleOperating___4015__emergencyResponsephase-c-behavioral-bodies.sysmlPhaseC__AutopilotMode___409__engagephase-c-behavioral-bodies.sysmlPhaseC__AutopilotMode___4011__reportFaultself-model/views.sysmlOpenSysMLViews__pipelineStructure__asInterconnectionDiagramself-model/views.sysmlOpenSysMLViews__toolchainStructure__asInterconnectionDiagramself-model/views.sysmlOpenSysMLViews__documentPipeline__asInterconnectionDiagramself-model/views.sysmlOpenSysMLViews__stageTable__asElementTableself-model/views.sysmlOpenSysMLViews__invariantTable__asElementTableself-model/views.sysmlOpenSysMLViews__instanceLayer__asInterconnectionDiagramself-model/views.sysmlOpenSysMLViews__analysisFramework__asInterconnectionDiagramself-model/views.sysmlOpenSysMLViews__engineTable__asElementTableself-model/views.sysmlOpenSysMLViews__editorPipeline__asInterconnectionDiagramself-model/views.sysmlOpenSysMLViews__renderingKinds__asElementTableself-model/views.sysmlOpenSysMLViews__surfaceTable__asElementTableself-model/views.sysmlOpenSysMLViews__markupParsers__asElementTableself-model/views.sysmlOpenSysMLViews__identityPath__asInterconnectionDiagramviews-demo.sysmlLanderViews__interfaces__asInterconnectionDiagramviews-demo.sysmlLanderViews__partsTable__asElementTableviews-demo.sysmlLanderViews__useCases__asCaseDiagramviews-demo.sysmlLanderViews__mixedOverview__asMixedDiagramexamples/sysml-v2-training(7)31. Constraints/Constraint Assertions-2.sysmlConstraint_20Assertions-2__Vehicle___40042. Views/Viewpoint Example.sysmlViewpoint_20Example__system_20structure_20perspective__system_20breakdown42. Views/Viewpoint Example.sysmlViewpoint_20Example__system_20structure_20perspective__modularity42. Views/Views Example.sysmlViews_20Example__vehicle_20structure_20view__asTreeDiagram42. Views/Views Example.sysmlViews_20Example__asTextualNotationTable__columnView__asTextualNotation42. Views/Views Example.sysmlViews_20Example__vehicle_20tabular_20views__safety_20features_20view__asTextualNotationTable42. Views/Views Example.sysmlViews_20Example__vehicle_20tabular_20views__non-safety_20features_20view__asTextualNotationTableexamples/pilot-corpora(19)sysml-examples/Arrowhead Framework Example/AHFNorwayTopics.sysmlAHFNorway__AHFNorway_5fLocalCloudDD__APISProducer__APISPbehavior___403___400sysml-examples/Mass Roll-up Example/MassConstraintExample.sysmlMassConstraintExample__Vehicle4___400sysml-examples/Simple Tests/ConstraintTest.sysmlConstraintTest__vehicle3___400sysml-examples/Simple Tests/RequirementTest.sysmlRequirementTest__R2__c3sysml-examples/Simple Tests/StateTest.sysmlStateTest__S___404__Dsysml-examples/Simple Tests/StateTest.sysmlStateTest__S___407__Dsysml-examples/Simple Tests/ViewTest.sysmlViewTest__VP__csysml-examples/Simple Tests/ViewTest.sysmlViewTest__V__v__rsysml-examples/Simple Tests/ViewTest.sysmlViewTest__v__rsysml-examples/Variability Examples/VehicleVariabilityModel.sysmlVehicleVariabilityModel__150_25_20Model__PartsTree__EngineChoices__6cylEngine__autoPort__autoPort1sysml-examples/Variability Examples/VehicleVariabilityModel.sysmlVehicleVariabilityModel__150_25_20Model__PartsTree__EngineChoices__6cylEngine__autoPort__autoPort2sysml-examples/Vehicle Example/Annex_A_VehicleViews.sysmlAnnex_5fA_5fVehicleViews__VehicleSafetyView_5fViewpoint__ViewDefinitions__TreeView__asTreeDiagramsysml-examples/Vehicle Example/SysML v2 Spec Annex A SimpleVehicleModel.sysmlSimpleVehicleModel__Views_5fViewpoints__ViewDefinitions__TreeView__asTreeDiagramsysml-validation/08-Requirements/8-Requirements.sysml8-Requirements__vehicle1_5fc1_20Specification_20Context__vehicle1-c1_20Specification___402sysml-validation/11-View and Viewpoint/11a-View-Viewpoint.sysml11a-View-Viewpoint__ViewModel__system_20structure_20perspective__system_20breakdownsysml-validation/11-View and Viewpoint/11a-View-Viewpoint.sysml11a-View-Viewpoint__ViewModel__system_20structure_20generation__asElementTablesysml-validation/11-View and Viewpoint/11a-View-Viewpoint.sysml11a-View-Viewpoint__ViewModel__system_20structure_20generation__asElementTable__columnView__asTextualNotationsysml-validation/11-View and Viewpoint/11b-Safety and Security Feature Views.sysml11b-Safety_20and_20Security_20Feaure_20Views__ViewDefinitions__SafetyFeatureView__asTreeDiagramsysml-validation/11-View and Viewpoint/11b-Safety and Security Feature Views.sysml11b-Safety_20and_20Security_20Feaure_20Views__Views__vehicleMandatorySafetyFeatureViewStandalone__asElementTableexamples/spec-examples(8)sysml/7.18.3/5.sysmlSysml_207_2e18_2e3_20example_205__OnOff5___407__powerUpsysml/7.20.3/2.sysmlSysml_207_2e20_2e3_20example_202__testObject___401sysml/7.20.3/2.sysmlSysml_207_2e20_2e3_20example_202__alienObject___401sysml/7.26.2/1.sysmlSysml_207_2e26_2e2_20example_201__Part_20Structure_20View__asTreeDiagramsysml/7.26.2/2.sysmlSysml_207_2e26_2e2_20example_202__vehicle_20parts_20view__asMyTreeDiagramsysml/7.26.2/3.sysmlSysml_207_2e26_2e2_20example_203__vehicle_20parts_20view__asMyTreeDiagramsysml/7.26.3/2.sysmlSysml_207_2e26_2e3_20example_202__System_20Structure_20Perspective__system_20breakdownsysml/7.26.3/2.sysmlSysml_207_2e26_2e3_20example_202__System_20Structure_20Perspective__modularityHow it was verified
Tests
internal/translate/export/api_json_is_reference_test.go: every usage of a SysML and a KerML model statesisReference, as the negation of itsisComposite; composite part / variant / action usagesfalse,ref, attribute and parameter usagestrue.tests/grpc/testdata/conformance/:element_properties_feature_composite_usage(isComposite = true,isReference = false),element_properties_feature_referential_usage(the inverse),element_properties_variant_usage, andquery_usage_is_referencefor the query leg.internal/semantic/metamodel/structure_usage_composite_test.go: the symbol structure'sFeature::isCompositeandUsage::isReferencefor composite,ref, attribute, action andperformusages.Generated baselines (re-recorded with the repository tools, each moved row adjudicated)
pilot-apijson-diff -update): 713 fragments; onlyisReferencerows move and no element match does. 11,659 values leave ours-missing: 11,639 become present-equal and 20 present-different (the elements whoseisCompositealready differs from the pilot's, negated). Adjudicated indocs/project/api-json-differential.md.derived-census -update): two rows,Feature::isCompositeandUsage::isReferenceunderexamples, whose 15 disagreeing values each become equal.-update-structure-differential):Feature::isComposite/Usage::isReferencerows only. Differences drop from 93/89 to 19 in the pilot corpora and from 50 to 8 in the specification examples; the last symbol-missing values (1 inexamples, 2 in the specification examples) and thetests/testdatadifference close; the training corpus goes from 5 to 7 (below).Gates on this head
go build ./...,go vet ./...,go vet -C tools ./...,gofmt -l .(empty),make lint,go test ./...with the training, pilot and specification-example corpora required,go test -C tools ./...,make docs-counts,scripts/check-doc-ids.py,scripts/changelog.py check,scripts/spec_compliance.py check, and the three baseline-checkruns reproduce on this head.Checklist
make lintandgo test ./...pass locally (the suite ran without-race;make testadds the race detector)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 changelog🟢 Devin Review found nothing to fix · View findings