A `subject` is reported as an ordinary part with no direction (and no type in a requirement def), and inherited `result`/`verdict` parameters are not listed
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start with internal/semantic/symbols/builder.go, especially the *ast.SubjectMember case, and trace how parameter direction, subject typing, and inherited return parameters reach attributes(). Reproduce with the supplied Python example or the C01 cases C01-055..064 in sysmlv2-tests; inspect the Go API path too, since the issue reports the same behavior there. Done means the listed parameters and metadata match the expected table for definitions and specializations.
索引モデルが issue の本文から書いたものです。
説明
This issue was written with AI help. The model and the reproduction were run against the version below.
What happened
package P {
private import ScalarValues::*;
part def Thing;
constraint def Cons { in x : Real; x > 0 }
requirement def Req { subject s : Thing; in x : Real; }
use case def UC { subject s : Thing; }
analysis def An { subject s : Thing; return r : Real; }
verification def Ver { subject s : Thing; }
}
import opensysml
m = opensysml.loads(SRC) # m.ok is True, no diagnostics
for qn in ["P::Cons", "P::Req", "P::UC", "P::An", "P::Ver"]:
d = m.get(qn)
for c in d.children():
print(qn, c.name, c.kind, dict(c.metadata),
c.type_facts.resolved_id if c.type_facts else None)
print(qn, "attributes:", [(a.name, a.metadata.get("direction")) for a in d.attributes()],
"withheld:", d.withheld_library_attributes)
P::Cons x referenceUsage {'type': 'Real', 'visibility': 'default', 'direction': 'in'} ScalarValues::Real
P::Cons attributes: [('x', 'in')] withheld: 58
P::Req s partUsage {'visibility': 'default'} None
P::Req x referenceUsage {'type': 'Real', 'visibility': 'default', 'direction': 'in'} ScalarValues::Real
P::Req attributes: [('x', 'in')] withheld: 58
P::UC s partUsage {'type': 'Thing', 'visibility': 'default'} P::Thing
P::UC attributes: [] withheld: 55
P::An s partUsage {'type': 'Thing', 'visibility': 'default'} P::Thing
P::An r referenceUsage {'type': 'Real', 'visibility': 'default', 'direction': 'out'} ScalarValues::Real
P::An attributes: [('r', 'out')] withheld: 55
P::Ver s partUsage {'type': 'Thing', 'visibility': 'default'} P::Thing
P::Ver attributes: [] withheld: 56
Three things are wrong with the subject, and one with the result parameters:
- The subject is a
partUsage. The symbol builder makes it one on purpose (internal/semantic/symbols/builder.go,case *ast.SubjectMember: "Create a part usage symbol (subject is structural usage like part)"). In SysML a subject is aReferenceUsage(SubjectUsage : ReferenceUsage). It is owned through aSubjectMembership, which is aParameterMembership, so it is a parameter of the case or requirement. - The subject has no direction. Every other parameter carries
directionin its metadata. A parameter with no written direction isin: KerMLParameterMembership::parameterDirection()givesin, andFeature::directiontakes it from there. Nothing in the Symbol markssas the subject either, so a client cannot tellsubject s : Thing;frompart s : Thing;. - In a requirement def the subject has no type.
subject s : Thing;inReqreports notypemetadata and an emptytype_facts.resolved_id. The same declaration inUC,AnandVerreportsP::Thing. This happens whether or not the subject is the first member. - Inherited
resultandverdictparameters are not listed. A constraint def and a requirement def inherit theresult : Booleanreturn parameter, a use case def itsresult, and a verification def itsverdict(which redefinesresult). They come from the standard library, soattributes()withholds them along with the rest of the library members (withheld_library_attributes). A declaredreturn ris listed, asAnshows. Leaving out library noise such asselforsubpartsis reasonable. The return parameter is part of the definition's signature, though, and should be listed liker.
Expected
The parameters, with their directions:
| definition | parameters |
|---|---|
Cons |
in x, out result |
Req |
in s (subject, typed Thing), in x, out result |
UC |
in s (subject), out result |
An |
in s (subject), out r |
Ver |
in s (subject), out verdict |
The subject is a referenceUsage with direction: in and something that marks it as the subject. A metadata key such as subject: true would do. The same applies to the specializing definitions (requirement def SubReq :> Req; and so on), which inherit these parameters.
For comparison, the SysML v2 Pilot Implementation (0.64.0-SNAPSHOT, commit 378a8700c) and sysml-toolkit (v0.11.3, ResolvedModel compatibility reader) list exactly these parameters, in both the definitions and their specializations.
Version
OpenSysML develop at 1a8e4927dc (2026-11-05), built locally: sysml-grpc nightly-153-g1a8e4927dc, Python client from client/python. The Go API (client/opensysml) fails the same cases.
Related
#1961 is about members not being listed through a typing usage or a specialization. Here the definitions are read directly.
Found by
The test suite at https://github.com/hideo67/sysmlv2-tests, matrix C01 (behavioral definitions), model test-suite/data/models/C01.sysml. Failing cases C01-055..064: the parameters of Cons, Req, UC, An and Ver and of their specializations SubCons ... SubVer.
- 主要言語
- Go
- スター
- 56
- フォーク
- 17
- 平均マージ
- 12時間 31分
- マージ済み PR(30日)
- 909
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Open-MBEE/OpenSysML のほかの issue
-
dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Open-MBEE/OpenSysML#1951 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
bug spec compliance
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
Open-MBEE/OpenSysML#2008 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Open-MBEE/OpenSysML#2007 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
Open-MBEE/OpenSysML#2006 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
Open-MBEE/OpenSysML の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoft/TypeScript#65370 ·
メンテナーはふだん 1 日以内に返信
-
bug tech debt testing
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aws/amazon-vpc-cni-k8s#3976 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
txn2/mcp-data-platform#2522 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-telemetry/opentelemetry-go-contrib#10234 ·
メンテナーはふだん 1 日以内に返信
-
discovery/backoff: default FindPeers limit yields no fresh peers対応中かも @zakazaka95 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100