A port typed `~P` reports its type as `P`: the conjugation is lost in the Symbol, query and reflection APIs and in api-json's PortUsage.type
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 20/100
調査の方向性
Start with the attached repro.py and model, then trace how conjugated port typing is exposed through Symbol, query, reflection, and api-json. The issue cites docs/project/spec-compliance.md and the SysML and KerML requirements; use the reproduction checks to locate the affected paths and verify each reported type. Done when those routes preserve the conjugated definition and the script’s BUG checks pass; linked pull request #1980 is already open.
索引モデルが issue の本文から書いたものです。
説明
This issue was written with AI help. The model, the reproduction script and its output are
attached and were run against the version below.
Model and observed behaviour
package ConjugatedPorts {
port def CmdPort {
out attribute cmd : ScalarValues::Integer;
}
part def Sender {
port cmdOut : CmdPort; // ordinary typing
}
part def Receiver {
port cmdIn : ~CmdPort; // conjugated typing
}
}
The conjugated port is reported as typed by CmdPort, which makes it indistinguishable from the
ordinary port, in every route a client normally reads:
| Route | cmdIn : ~CmdPort reports |
Expected |
|---|---|---|
Python Symbol (metadata['type'], type_facts, specializations) |
exactly what cmdOut : CmdPort reports: type 'CmdPort', TypeFacts(declared='CmdPort', resolved_id='…::CmdPort'), Specialization(kind='typing', target_id='…::CmdPort'). The ~ is gone even from declared. |
typing by …::CmdPort::~CmdPort, or at least a conjugation marker; declared='~CmdPort' |
model.query type |
ConjugatedPorts::CmdPort |
ConjugatedPorts::CmdPort::~CmdPort |
Reflection PortUsage::type, ::portDefinition |
[ConjugatedPorts::CmdPort] |
[ConjugatedPorts::CmdPort::~CmdPort] |
Reflection ownedTyping.conjugatedPortDefinition, ownedTyping.type |
ExecutionError: reflective feature is not derived: SysML::Systems::ConjugatedPortTyping::conjugatedPortDefinition (same for type) |
[ConjugatedPorts::CmdPort::~CmdPort] |
api-json PortUsage.type |
[CmdPort] |
[CmdPort_conjugated], as its own ConjugatedPortTyping.type says |
Some parts are already right, which shows the model is built correctly underneath:
- The reflected
ConjugatedPortTypingexists, and itsportDefinitionisCmdPort. - api-json writes the typing as a
ConjugatedPortTypingwithtype=conjugatedPortDefinition=
CmdPort_conjugatedandportDefinition=CmdPort, and writes the PortUsage'sportDefinition
anddefinitionasCmdPort_conjugated. OnlyPortUsage.typedisagrees, and the PortUsage
carries a privatesysx:conjugatedTyping: trueflag instead. - The conjugated definition is a symbol (
model.get("ConjugatedPorts::CmdPort::~CmdPort")), but
nothing on the port points to it.
The practical effect: a client reading port types (to check interface compatibility, generate
code, or draw diagrams) cannot tell an input-facing ~CmdPort from an output-facing CmdPort.
$ python repro.py # loads the model with opensysml.loads() over sysml-grpc
[BUG ] cmdIn : ~CmdPort is reported differently from cmdOut : CmdPort
observed: {'metadata.type': 'CmdPort', 'type_facts': TypeFacts(declared='CmdPort', resolved_id='ConjugatedPorts::CmdPort', resolved_kind='portDef', primitive='', primitive_source='', quantity=False, unit=''), 'specializations': [Specialization(kind='typing', declared='CmdPort', target_id='ConjugatedPorts::CmdPort', target_kind='portDef')]}
[BUG ] query 'type' of cmdIn is the conjugated definition
observed: 'ConjugatedPorts::CmdPort'
[BUG ] PortUsage::type of cmdIn is the conjugated definition
observed: ['ConjugatedPorts::CmdPort']
[BUG ] PortUsage::portDefinition of cmdIn is the conjugated definition
observed: ['ConjugatedPorts::CmdPort']
[OK ] ConjugatedPortTyping::portDefinition is the original definition
observed: ['ConjugatedPorts::CmdPort']
[BUG ] ConjugatedPortTyping::conjugatedPortDefinition is the conjugated definition
observed: ExecutionError('evaluation failed: reflective feature is not derived: SysML::Systems::ConjugatedPortTyping::conjugatedPortDefinition for ')
[BUG ] ConjugatedPortTyping::type is the conjugated definition
observed: ExecutionError('evaluation failed: reflective feature is not derived: SysML::Systems::ConjugatedPortTyping::type for ')
[INFO] api-json: the port's typing relationship (correct)
observed: {'@type': 'ConjugatedPortTyping', 'type': {'@id': 'ConjugatedPorts__CmdPort_conjugated'}, 'conjugatedPortDefinition': {'@id': 'ConjugatedPorts__CmdPort_conjugated'}, 'portDefinition': {'@id': 'ConjugatedPorts__CmdPort'}}
[BUG ] api-json: PortUsage.type agrees with its ConjugatedPortTyping.type
observed: [{'@id': 'ConjugatedPorts__CmdPort'}]
expected: [{'@id': 'ConjugatedPorts__CmdPort_conjugated'}]
Reproduction files (attached)
| File | Contents |
|---|---|
model.sysml.txt |
the model above (GitHub does not accept .sysml uploads): rename it to model.sysml next to repro.py |
repro.py |
loads model.sysml with opensysml.loads() and checks the Symbol, query, reflection and api-json routes. Each check prints OK, BUG or INFO, and the script exits 1 while any BUG reproduces. |
_common.py |
shared helper repro.py imports: starts the sysml-grpc named by $OPENSYSML_BINARY, prints the server and client versions, and formats the checks |
output.txt |
the full output of the run reported here |
To run it, put _common.py in the parent directory of the folder holding repro.py and
model.sysml, install the client (pip install -e client/python), and point
OPENSYSML_BINARY at a sysml-grpc build:
$ OPENSYSML_BINARY=/path/to/OpenSysML/bin/sysml-grpc python repro.py
Without OPENSYSML_BINARY, _common.py assumes the layout used here: an OpenSysML checkout
next to the directory that holds _common.py, with bin/sysml-grpc built by make build-grpc.
What the specification requires
SysML v2.1 Beta 2, §8.3.12.3 ConjugatedPortTyping:
A ConjugatedPortTyping is a FeatureTyping whose type is a ConjugatedPortDefinition.
conjugatedPortDefinition : ConjugatedPortDefinition {redefines type}— The type of this
ConjugatedPortTyping considered as a FeatureTyping, which must be a ConjugatedPortDefinition.
/portDefinition : PortDefinition— The originalPortDefinition of the conjugatedPortDefinition
of this ConjugatedPortTyping.
So for port cmdIn : ~CmdPort, the typing's type (= conjugatedPortDefinition) is
CmdPort::'~CmdPort', and only the derived portDefinition of the typing is CmdPort.
conjugatedPortDefinition is not a derived property, so "reflective feature is not derived" is
the wrong answer for it in any case.
KerML v1.1 Beta 2, deriveFeatureType: "The types of a Feature are the union of the types of
its typings and the types of the Features it subsets", so cmdIn.type is CmdPort::'~CmdPort'.
PortUsage::portDefinition (the port's definitions) is then that ConjugatedPortDefinition too,
which is what api-json already writes for portDefinition and definition.
The project's compliance record states the same (docs/project/spec-compliance.md,
conjugated-port row, ✅ Faithful): "port p : ~P types a port by the conjugated port definition
P::'~P' (§7.12.3)". The direction reversal that row describes does work. The reported type
does not follow it.
For the Python Symbol facts, which the specification does not define, the natural equivalent
is type_facts.resolved_id / Specialization.target_id = …::CmdPort::~CmdPort (with
declared='~CmdPort'), or an explicit conjugation flag next to the original definition.
Kind of gap
Parsed or resolved into the wrong structure
Reference implementation
Not tried.
Version
sysml-grpc v0.12.0-262-gc86932321 (develop at c86932321), opensysml Python client 0.12.0, Python 3.13.15
- 主要言語
- Go
- スター
- 56
- フォーク
- 17
- 平均マージ
- 12時間 45分
- マージ済み PR(30日)
- 910
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Open-MBEE/OpenSysML のほかの issue
-
dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Open-MBEE/OpenSysML#1951 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Open-MBEE/OpenSysML#2029 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement spec compliance
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
Open-MBEE/OpenSysML#2028 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Java client: no member enumeration, no GetElementProperties, no instance paths対応中かも @devin-ai-integration が今日担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
Open-MBEE/OpenSysML#2022 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
Open-MBEE/OpenSysML の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
bug raised-by:verifier
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
medici-finance/assay#5697 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sonatype-nexus-community/terraform-provider-sonatypeiq#101 ·
メンテナーはふだん 1 日以内に返信
-
area: metrics area: tracing contribfest enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4188 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
blinklabs-io/dingo#6074 ·
メンテナーはふだん 1 日以内に返信