Repository navigation
fix(metamodel,export): derive a flow's sourceOutputFeature and targetInputFeature from its ends - #2516
Merged
Conversation
…InputFeature from its ends KerML 8.3.4.9.2 deriveFlowSourceOutputFeature and deriveFlowTargetInputFeature state the two properties as the first ownedFeature of the flow's first and second connectorEnd. The shared derivation answered the features those owned features redefine instead. It now reads the ends, so GetElementProperties, the Symbol API and the graph structure answer the end-owned features, and the API-JSON element form writes the two properties. Fixes #2199. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tput-target-input-feature
The structure differential, agreement ratchet, derived census, api-json differential and hideo-suite baseline move with Flow::sourceOutputFeature and Flow::targetInputFeature now read from the flow's ends. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tput-target-input-feature Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential/index.json # docs/project/api-json-differential/kerml-examples/Behavior Examples/TakePicture.kerml.json # docs/project/api-json-differential/spec-examples/kerml/7.4.10.3/1.kerml.json
…tput-target-input-feature Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential/index.json
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 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 #2199.
What and why
For
flow f from t.fuelOut to e.fuelIn;, a flow'ssourceOutputFeatureandtargetInputFeaturewere derived as the features its two ends attach to (Tank::fuelOut,Engine::fuelIn). They are now the features the two ends own, which redefine those:P::fpropertysourceOutputFeatureP::Tank::fuelOutP::f::source::fuelOuttargetInputFeatureP::Engine::fuelInP::f::target::fuelInModel (from the issue), read with
GetElementPropertiesthrough the Python client:The change is in the shared derivation,
internal/semantic/metamodel/structure_rules.go:structureFlowEndFeaturetakes the flow'sconnectorEndat index 0 or 1 and answers its firstownedFeature; the supersededstructureFlowAttachmentis removed. An end inherited from a library flow (a message, or a flow declaring no ends) is read through the semantic model and still answers no feature, so the message behaviour of #2042 is unchanged.Surfaces:
GetElementPropertiesread the shared derivation and now answer the end-owned features for a flow, a succession flow, a flow whose ends are feature chains (tank.inner.o), and the KerMLflow/succession flowforms.sysml -convert api-json) wrote neither property.apiJSONCompletedPropertiesgains the twoFlowrows, so the export writes the same elements.Flowproperty ("does not derive yet") before and after this change, so they give no wrong answer. That limitation is left as it is.Specification basis
KerML 8.3.4.9.2 (Flow):
The pilot implementation answers the same elements. No row of
docs/project/spec-compliance/moves.Generated baselines
Every file below was rewritten by its recorder;
training_examples_expected.txtis untouched and no size allowlist entry is added.structure_differential_expected.txt): the tenFlow::sourceOutputFeature/Flow::targetInputFeaturerows are gone (five roots, e.g.equal 2 … symbol-extra 66,equal 16 … symbol-extra 100). They recorded the Symbol API answering an element the graph did not; the two now agree on every flow, and the file lists only the properties they disagree on.answered-not-exported.txt):FlowUsage::sourceOutputFeature70,FlowUsage::targetInputFeature71,SuccessionFlowUsage::sourceOutputFeature2 andSuccessionFlowUsage::targetInputFeature2 are gone: the export now writes what the reader answers.clauses.txt, edited by hand: thesymbol-76line is removed. It is a hand-written adjudication, not recorder output; it stated the old rule ("the features the flow's two ends attach to … the export writes none for them"), which contradicts 8.3.4.9.2, and no ratchet row cites it any more.derived_census_records.tsv, recorded date inderived_census_baseline.json), agreement with the pilot for both properties: pilot-examples 67 → 68 of 94 equal (27 → 26 different); spec-examples 7 → 14 of 26 equal (11 → 7 different, 8 → 5 unanswered). No row gets worse.Flow/FlowUsage/SuccessionFlowUsagerows and the file's summary. In ten (TakePicture.kerml,AHFSequences,Flashlight Example,ServerSequenceOutsideRealization-3,ServerSequenceRealization-3,RoomModel,Annex_A_VehicleViews,Annex A SimpleVehicleModel,kerml/7.4.10.3/1.kerml,Interaction Realization-2) the rows move from ours-missing to present-equal, e.g.RoomModel[0,0,6,0,0,0,0]→[6,0,0,0,0,0,0]. Inspec-examples/kerml/7.4.10.3/3.kermlthey move from ours-missing to present-different ([0,0,1,…]→[0,1,0,…]): the example leavesVehicle,fuelTankandengineunresolved, and both tools name the first feature owned byfuelFlow::source, but this export classifies that end-owned feature as aReferenceUsagewhere the pilot has aFeature, so the two references do not match by metaclass. That classification predates this change and is not altered by it.index.jsontotals: present-equal 2,332,784 → 2,332,874, ours-missing 186,616 → 186,524, present-different 168,586 → 168,588.docs/project/hideo-suite-baseline.tsv,hideo-suite.md): group B20 goes from 51 pass / 24 fail to 75 / 0 in both transports (48 case results), all cases 1729 / 51 / 33 → 1753 / 27 / 33.How it was verified
New tests, each failing before the fix:
TestSymbolStructureDerivesAFlowsEndFeaturesFromItsEnds(internal/semantic/metamodel) — flow, succession flow, feature-chain ends, a message, KerML flow and succession flow.TestElementPropertiesReadAFlowsEndFeatures(internal/frontend/grpc) — the same overGetElementProperties, also checking that each answer is the feature itsFlowEndowns and that itsownedRedefinitionreaches the attached feature.TestAPIJSONWritesAFlowsEndFeatures(internal/translate/export).Gates on this head:
go test ./...with the training, pilot, specification-example, library-XMI and PSSM corpora required,go build ./...,go vet ./...(root andtools),gofmt -lempty,make lint, staticcheck (root andtools),go test -C tools ./referee/apijson,TestSymbolStructureMatchesGraphStructure,derived-census -check -recorded-pilot,pilot-apijson-diff -check,doc-counts -check,scripts/changelog.py check.pilot-diff -checkandhideo-suite -checkwere run before the last merge ofdevelop, which touched neither surface.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 changelog🟢 Devin Review found nothing to fix · View findings