Prefix metadata (`#FailureMode state s;`) is missing from both the Symbol API and the query API, although api-json exports it as an owned MetadataUsage
Maintainer thường phản hồi trong vòng 1 ngày
@devin-ai-integration đang làm issue này rồi.
Từ ngày 5/11/2026.
- #1978 của @devin-ai-integration — đang mở
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with the attached repro.py and model.sysml.txt, then trace how prefix metadata is represented in the Symbol API and query API; the issue identifies SymbolInfo.child_ids, Symbol.children(), and model.query(scope=[…]) as the failing routes. Compare those results with the api-json owned MetadataUsage and reflection output in the reproduction. Done means prefix metadata appears through both APIs like body-form metadata; the linked pull request #1978 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This issue was written with AI help. The model, the reproduction script and its output are
attached and were run against the version below.
What happened, and what you expected instead
A state and an action input are annotated with prefix metadata:
#FailureMode state overheated;
action pumpFluid {
in #FailureMode pressure : ScalarValues::Real;
}
Neither the Symbol API nor the query API reports the annotation:
| Route | PumpStates::overheated / pumpFluid::pressure |
|---|---|
SymbolInfo.child_ids |
[]: the annotation is not listed at all |
Symbol.children() |
[] |
model.query(scope=[…]) |
nothing besides the element itself |
| api-json export | an owned MetadataUsage (…overheated___400, owner = the state, annotatedElement = the state) ✔ |
reflection, model.eval("X meta FailureMode") |
the annotation ✔ |
The prefix form is an owned member like the body form. SysML v2.1 Beta 2, §8.2
(UsageExtensionKeyword, DefinitionExtensionKeyword):
UsageExtensionKeyword : Usage =
ownedRelationship += PrefixMetadataMember
PrefixMetadataMember : OwningMembership =
'#' ownedRelatedElement = PrefixMetadataUsage
So #FailureMode state overheated; and state overheated { @FailureMode; } should give the same
structure: a MetadataUsage owned by the state that annotates it. OpenSysML's api-json export
already writes it that way.
Expected: the prefix MetadataUsage is listed in child_ids / children() and by
model.query(scope=[…]), exactly as the body form is. The body form is listed by the query
API today, but children() drops it because it is unnamed (#1960). A client that collects the
elements carrying a given annotation (for example, every state marked as a failure mode) cannot
find prefix-annotated ones through either API.
Related: #643 (fixed by #662) made model.query() return MetadataUsage elements, and it does
so for the body form. The prefix form appears to be a case that fix did not reach.
Reproduction
$ python repro.py # loads model.sysml with opensysml.loads() over sysml-grpc
## PumpStates::overheated (stateUsage, # prefix metadata)
[BUG ] PumpStates::overheated: Symbol.children() lists the MetadataUsage
observed: []
[INFO] PumpStates::overheated: SymbolInfo.child_ids
observed: []
[BUG ] PumpStates::overheated: model.query lists the MetadataUsage
observed: []
[INFO] PumpStates::overheated: api-json exports an owned MetadataUsage
observed: ['MetadataAnnotations__Pump__PumpStates__overheated___400']
[INFO] PumpStates::overheated: reflection finds it: X meta FailureMode
observed: [InstanceRef(id=1)]
## pumpFluid::pressure (referenceUsage, # prefix metadata)
[BUG ] pumpFluid::pressure: Symbol.children() lists the MetadataUsage
observed: []
[INFO] pumpFluid::pressure: SymbolInfo.child_ids
observed: []
[BUG ] pumpFluid::pressure: model.query lists the MetadataUsage
observed: []
[INFO] pumpFluid::pressure: api-json exports an owned MetadataUsage
observed: ['MetadataAnnotations__Pump__pumpFluid__pressure___400']
## PumpStates::stalled (stateUsage, named metadata)
[OK ] PumpStates::stalled: Symbol.children() lists the MetadataUsage
observed: [('metadataUsage', 'MetadataAnnotations::Pump::PumpStates::stalled::fm')]
[OK ] PumpStates::stalled: model.query lists the MetadataUsage
observed: [('MetadataUsage', 'MetadataAnnotations::Pump::PumpStates::stalled::fm')]
model.sysml:
package MetadataAnnotations {
metadata def FailureMode {
attribute severity : ScalarValues::Integer;
}
part def Pump {
state def PumpStates {
entry; then idle;
state idle;
state jammed { @FailureMode { severity = 3; } } // body form, unnamed
#FailureMode state overheated; // prefix form
state stalled { metadata fm : FailureMode; } // body form, named (for contrast)
}
action pumpFluid {
in flowRate : ScalarValues::Real { @FailureMode { severity = 2; } } // body form, unnamed
in #FailureMode pressure : ScalarValues::Real; // prefix form
}
}
}
The same script also shows the body-form annotations (jammed, flowRate) missing from
children(), which is #1960.
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, for each annotated element, checks children(), child_ids, model.query, the api-json export and reflection. Each check prints OK, BUG or INFO, and the script exits 1 while any BUG reproduces. |
_common.py |
shared helper the script 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 the model,
install the client (pip install -e client/python from an OpenSysML checkout), 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 an OpenSysML checkout next to the directory
that holds _common.py, with bin/sysml-grpc built by make build-grpc.
Version
sysml-grpc v0.12.0-262-gc86932321 (develop at c86932321), opensysml Python client 0.12.0, Python 3.13.15
Surface
Python client (opensysml)
- Ngôn ngữ chính
- Go
- Star
- 56
- Fork
- 17
- Merge trung bình
- 12 giờ 21 phút
- Pull request đã merge (30 ngày)
- 900
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Open-MBEE/OpenSysML
-
dependencies
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Open-MBEE/OpenSysML#1951 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Definition of requirementsĐang mởquestion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Open-MBEE/OpenSysML#1359 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug enhancement spec compliance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Open-MBEE/OpenSysML#1965 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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.typeCó thể đã có người làm @devin-ai-integration đã nhận hôm nay. Đang mởbug spec compliance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
Open-MBEE/OpenSysML#1962 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Enhancement: Python client Symbol cannot list a usage's inherited members (parts, ports, bindings), unlike attributes()Có thể đã có người làm @devin-ai-integration đã nhận hôm nay. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Open-MBEE/OpenSysML#1961 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Open-MBEE/OpenSysML
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[FEATURE]: Set fieldPath and reason on the CEL validation rulesCó thể đã có người làm @bjosv đã nhận hôm nay. Đang mởenhancement needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
valkey-io/valkey-operator#618 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
agent-butler-finding bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jordansmall/spindrift#6414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Icinga/icinga-kubernetes#294 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Cluster details: the Control Plane version field has a different border color than its icon boxĐang mởkind/design sig/ui
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
kubermatic/dashboard#8449 ·
Maintainer thường phản hồi trong vòng 1 ngày