Repository navigation
fix(metamodel): answer send-action input, constructor function and arguments, and sourceless transition ends - #2549
Merged
Conversation
Type::input is every feature related to the type by a FeatureMembership whose direction is in or inout (KerML 8.3.3.1.10), and a send action's payload, sender and receiver are input parameters (SysML 8.3.17.15). The reader answered a send action through a branch of its own that kept only owned Expressions, so the list was empty while parameter named them. The send action now takes the general derivation, and the element form writes the derived list rather than the graph's owned parameters. Refs #2495 Co-Authored-By: jason.han <hanhuijun@gmail.com>
… typing it Expression::function redefines Step::behavior and is the Function that types the Expression (KerML 8.3.4.7.3). A ConstructorExpression is typed by Performances::Evaluation, which behavior and type already answered, while function was refused as not defined. It is answered now, as the pinned OMG pilot answers it. The instantiated type the reader answered before is not restored: for an attribute definition it is no Function. Refs #2495 Co-Authored-By: jason.han <hanhuijun@gmail.com>
… before it A transition written in a state body without the transition keyword and a source takes the closest lexically previous state usage as its source (SysML 7.18.3), and its succession's ends are that source and the target (checkTransitionUsageSuccessionSourceSpecialization, deriveTransitionUsageTarget). The declared succession of such a transition had no source end, so its target was read as the source, and a state usage with a body was not taken as the one left. The shared derivation and the export now name the same previous state usage. Refs #2495 Co-Authored-By: jason.han <hanhuijun@gmail.com>
…amed ones The arguments of a ConstructorExpression are the values of its result's owned features in the order of the instantiated type's features they redefine (KerML 8.3.4.8.3). Binding matched a formal by structure key alone, which a library type's catalogued features never share with the symbols naming them, so a constructor of ShapeItems::Cuboid was refused. Formals now match by the declared element. A named argument's result feature owns the Redefinition of the feature it names (checkConstructorExpressionResultFeatureRedefinition) in the shared relationships, the feature's types follow it, and the export writes it. Refs #2495 Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ties-2495-regressions
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ties-2495-regressions Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential/index.json # internal/semantic/metamodel/derived_census_records.tsv # internal/translate/export/testdata/structure_differential_expected.txt
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)".
|
…e part
A named constructor argument looked its feature up by the last `::`-separated
segment of the name's text, so an unrestricted name holding `::`
(`new Box('left::width' = 1)`) redefined the feature `width` instead.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ties-2495-regressions Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential/examples/disposal-team-demo/team.sysml.json # docs/project/api-json-differential/examples/relay-probe-demo/mission.sysml.json # docs/project/api-json-differential/index.json # docs/project/api-json-differential/kerml-examples/Simple Tests/Expressions.kerml.json # docs/project/api-json-differential/pilot-examples/Geometry Examples/VehicleGeometryAndCoordinateFrames.sysml.json # docs/project/api-json-differential/pilot-examples/Simple Tests/ParameterTest.sysml.json # docs/project/api-json-differential/pilot-examples/Simple Tests/StateTest.sysml.json # docs/project/api-json-differential/pilot-validation/09-Verification/9-Verification-simplified.sysml.json # docs/project/api-json-differential/spec-examples/kerml/7.4.9.4/4.kerml.json
…velop Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ties-2495-regressions Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/semantic/semantics/annotations.go
…ties-2495-regressions Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/semantic/metamodel/derived_census_records.tsv # internal/translate/export/testdata/structure_differential_expected.txt
…ties-2495-regressions Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential/index.json # internal/semantic/metamodel/derived_census_baseline.json # tests/corpus/testdata/element_properties_agreement/answered-not-exported.txt # tests/corpus/testdata/element_properties_agreement/value.txt
…nes over develop, and the normative-schema gap Co-Authored-By: jason.han <hanhuijun@gmail.com>
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.
Fixes #2495.
What and why
Four
GetElementPropertiesanswers regressed with #2042 (reported in #2495). Each is fixed in the shared derivation, so the gRPC reader, theapi-jsonelement form, the query surface and the Symbol API give the same answer. None of the four was fixed by #2496: all four still reproduced on its merge commitf17bc5d10e.One commit per item:
Type::inputof a send action (action sendRef send new Sig(gain) via sp;) was empty.structureDirectedFeatureshad aSendActionUsagebranch that only collected ownedExpressionmembers; it is removed, so the generic directed-feature derivation supplies theinparameters.Expression::functionof aConstructorExpressionwas refused. The refusal branch is removed; the typed-feature derivation answersPerformances::Evaluation.state a; accept Sig then b;) answeredsourceFeature = band no target. The succession derivation now takes the closest preceding state usage as the source (ast.LeavableByTransition, shared by the semantic model, the reflective transitions and the RDF export), and the succession ends are resolved against the enclosing body's members.InstantiationExpression::argumentof a constructor of a library type (new Cuboid(4800 [mm], 1840 [mm], 1350 [mm])) was refused as unbindable. Positional binding compared structure elements only by identity, which never matches a library feature the structure names by id;sameDeclaredElementalso matches through the catalogued symbol that declares it. In the same derivation, a named constructor argument (new Box(l = …, w = …, h = …)) now gives its result feature theRedefinitionof the instantiated type's feature it names, in the shared representation the reader and both exports use. A genuinely unbindable argument list is still refused.Before / after (the issue's four models)
P::T::sendRefinputinReferenceUsagesparameterlistsnew Sig(gain)functionPerformances::Evaluationbehavior,typePerformances::Evaluationsource/ successionsourceFeatureQ::SD/Q::SD::bQ::SD::a/Q::SD::atarget/ successiontargetFeatureQ::SD::b/ emptyQ::SD::b/Q::SD::bc1(new Cuboid(…))argumentc2(new Box(…))argumentinstantiatedTypeShapeItems::Cuboid,R::BoxRedefinitionRedefinitionof the feature it namesSpecification basis
Re-derived from the specification text rendered by
./scripts/download-spec-examples.sh(build/spec-docs/*.txt), and checked against the pinned OMG pilot only where the specification backs it.deriveTypeInput: the features related to the Type by FeatureMemberships whose direction isinorinout. SysMLSendActionUsage's payload, sender and receiver are input parameters.Expression::functionredefinesbehaviorand is the Function that types the Expression, so the answer isPerformances::Evaluation. This matches the pinned pilot, whose exporter was run on the model to confirm. TheP::Sigin the issue's earlier column was OpenSysML's own previous answer and was wrong:P::Sigis the instantiated type, an AttributeDefinition, not a Function.transitionkeyword and source omitted, the source is the closest lexically previous state usage.TransitionUsage:succession.sourceFeature = source, andtargetis the feature target ofsuccession.targetFeature.deriveConstructorExpressionArgumentandcheckConstructorExpressionResultFeatureRedefinition: the arguments are the value Expressions of the result's owned features, in the order of the instantiated type's features they redefine; positional arguments bind to those features in order (KerML 7.4.9.4).Baseline movement (recorders only, each adjudicated)
All generated files were moved by their recorders on top of the merged
develop; nothing was edited by hand, andtests/corpus/testdata/training_examples_expected.txtis untouched.Derived census (
derived_census_baseline.json,derived_census_records.tsv): elements/implied +4 in the spec examples, +1 in the pilot corpora, +1 in the training corpus. These are the new named-argumentRedefinitions.SendActionUsageinput,ConstructorExpressionfunctionandargument, and the transition/succession ends fill as intended.api-json differential (
docs/project/api-json-differential/**, 34 files):ConstructorExpression.argument(equal / different)ConstructorExpression.function(equal / different)ConstructorExpression.instantiatedType(equal / ours missing)SendActionUsage.input(equal / different)Totals:
presentEqual2,333,106 → 2,333,139,presentDifferent168,600 → 168,496,oursMissing186,528 → 186,357. The remainingSendActionUsage.inputdifferences are ordering.One movement is against the grain and is adjudicated, not fixed here: matched elements 114,698 → 114,693 and our unkeyable elements 21,456 → 21,477, in
Simple Tests/StateTest.sysml. The referee (tools/referee/apijson/ours.go,isRelationship) treats any element that states asourceortargetas a relationship, so the 13 transitions that now state their source become unkeyable and their matches drop out. The new values equal the pilot's; the referee is deliberately not changed in this PR.Structure differential (
structure_differential_expected.txt): the constructor rows close (InstantiationExpression::argumentandFeature::ownedRedefinitiondisagreements disappear in the pilot corpora, spec examples andexamples/). Two existing classes grow:Connector::relatedFeature/sourceFeature/targetFeatureand the matchingRelationship::relatedElement/source/targetrows (trainingdifferent56 → 81, pilot corpora 195–199 → 209–217, spec examples 37 → 41). The symbol side now derives the correct source of a sourceless transition's succession, while the graph-backed evaluator still reads an empty source end there, so successions that agreed on a wrong answer now differ. The symbol answer is the specified one.Type::input(pilot corporadifferent28 → 29, spec examples 16 → 18): body-form send actions now answer their inputs on both sides, in a different order; an ordering difference of the kind already recorded.Agreement ratchet (
tests/corpus/testdata/element_properties_agreement/*.txt):SendActionUsage::input30 → 2; theConstructorExpressionrows are removed;SuccessionAsUsageandTransitionUsagesource/target rows fall by about half (for examplesourceFeature75 → 49,TransitionUsage::source39 → 13). Two existing classes gain members:Feature::feature/featureMembership/inheritedFeature/inheritedMembership(export-57) 17 → 21: the four named-argument result features of KerML spec example 7.4.9.4/4 now carry theirRedefinitionand inherit the reader/export gap the redefined feature already has there.SuccessionAsUsage::target4 → 5 andtargetFeature2 → 3 (symbol-81): one SysML spec example'sthen donetransition now has its source and joins the recorded "no exported target for a librarydoneend" rows.Normative-schema gap (
tests/export/testdata/api_json_normative_schema_baseline.json, recorded with-update-normative-schema):Redefinitionowned by the result feature ofnew Telemetry(frames = 3)intests/export/testdata/convert/send_new.sysml, redefiningSendNew::Telemetry::frames— the named constructor-argumentRedefinitionof item 4. It accounts for every+1row (its@id, owner, related-element, source/target and specialization references, and the properties any element still lacks), and for its owner'sownedRedefinition,ownedSpecialization,ownedSubsettingandownedMemberNameleavingmissingRequired.nonSchemaKeys/sysx:mappingValues95 → 101: fourConstructorExpressions and twoSendActionUsages insend_new.sysmlandaction_nodes.sysmlnow state the completedfunction(Performances::Evaluation) andinput(the fullType::input) at top level and keep the mapping's own value undersysx:mappingValues. That is the same change that movesinvalidValues/function42 → 38 toward the schema.invalidValues/instantiatedType format0 → 4 withmissingRequired/instantiatedType118 → 114: four constructors now stateinstantiatedTypeas an{"@id": …}reference, which counts under the existing non-UUID id gap every reference property has.Convert golden:
tests/export/testdata/convert/send_new.golden.ttlgains the constructor's argument ownership.How it was verified
New tests, each failing before its commit:
internal/frontend/grpc/element_properties_{send_input,constructor_function,transition_source,library_constructor}_test.goandtests/export/api_json_{send_input,constructor_function,constructor_arguments,transition_source}_test.go(libraryCuboid, userBox, namedRectangularCuboidarguments with their redefinitions, and a refused unbindable list).Gate on head
c8654cb06d(mergeddevelop8d91bf8d68), withOPENSYSML_REQUIRE_TRAINING_CORPUS,_PILOT_CORPORA,_SPEC_EXAMPLES,_PILOT_LIBRARY_XMIand_OMG_JSON_SCHEMAset to 1 after their download scripts:The whole-module
-racerun was not repeated locally on this head; CI's race tiers cover it.Checklist
make testandmake lintpass locallychanges/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/c5ca2e36a22f4afea824815332b637dc
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/c5ca2e36a22f4afea824815332b637dc?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work