CHANGELOG¶
0.106.1 (2026-11-14)¶
Packaging and presentation only — no library behaviour changed.
- PyPI metadata was blank and is now filled.
pyproject.tomlhaddescription = "", so the PyPI project page showed no summary at all, and it carried nokeywordsand noproject.urls. It now has a real summary line, 11 keywords (sysml, sysml-v2, sysml-v2.1, kerml, mbse, systems-engineering, model-based-systems-engineering, antlr4, parser, plantuml, simulation), and Homepage / Repository / Documentation / Changelog / Issues URLs all pointing at https://github.com/mycr0ft/sysmlpy. - The
boxesextra is now markedpython = ">=3.10".diagramboxesrequires Python >=3.10 while this project declares>=3.9, so a fresh dependency resolve was unsatisfiable —poetry lockcould not complete at all. The marker keeps the 3.9 floor for the library itself and gates only the extra; the wheel now emitsdiagramboxes ; (python_version >= "3.10") and (extra == "boxes").poetry.lockrefreshed with the marker in place: additive only, no pinned version changed. - README states its target honestly. The description said "consistent with the
SysML v2.0 standard"; it now targets SysML v2.1 (Beta 2) / KerML 1.1 on OMG
release 2026-08, and the
## Conformancesection became## Standards status: the project aims at the specification and publishes test results (123/123 XPect, 31 in-house analyzer rules) instead of claiming conformance, because there is no accredited conformance-testing authority for SysML v2 tools — OMG's SysML v2 certification program examines practitioners (Model User exam), not implementations. - Repository presentation. Description and 12 topics set; on 2026-11-14 the
repository was extracted from the
Westfall-io/sysml2pyfork network and is now the root of its own network, with its four child forks carried along, and its 33 issues, 11 pull requests and 141 releases intact.
0.106.0 (2026-11-09)¶
Issues #43 and #44 closed: allocation endpoints resolve, and concrete interfaces need two related elements. Repro set and report from Jon Fox, 2026-11-09, against a deployed SysML v2 model set on sysmlpy 0.105.0 / OpenSysML kernel 0.63.1 / SysON v2026.9.0.
- Allocation endpoints are diagnosed (issue #43).
analyze()never looked atallocateendpoints — they lived as dump text ongrammar.connectorPart(issue #23) and no pass collected them, soallocate Nope to Target;was clean. Endpoints now resolve through the same machinery ordinary typings use; failure is anALLOCATION_ENDPOINT_UNRESOLVEDerror, and every form is covered: binary, n-ary (allocate (a, b, c);— every end checked), chained (a.p), sibling-package qualified (Architecture::Source), and star-imported. - Qualified and chained endpoints resolve through the public API.
_resolve_names_to_elementsused to skip any name containing::or.—allocation.source_elementswas[]for the qualified repro. Paths now resolve depth-wise from the root (with the depth-1 retry that mirrors how a bare name resolves from an inner scope), unique match kept, ambiguous still fails closed. - Allocation-definition ends are typed and resolvable. The
end :>> source : Architecture::Source;members of anallocation defare grammar-only (they do not load as children — only interface ends do, issue #29), so their typings never reached symbol collection: an unresolved end type now reportsALLOCATION_END_TYPE_UNRESOLVED, and a nestedallocate source to target;resolvessource/targetthrough the end's declared type. The TypedAllocation repro is fully resolvable. - Concrete interfaces need two related elements (issue #44). Mirrors
OpenSysML's w10b constraint pass (KerML 1.1 §8.3.3.5 / §8.3.4.7) with the
message verbatim (
Must have at least two related elements, codeRELATED_ELEMENTS) so cross-tool runs diff cleanly. Zero- and one-end interface definitions (the deployedEthernetInterfaceshape) are errors; abstract and variation declarations are exempt, ends inherited through:>count. One-end connect and one-feature bind are grammar errors upstream — noted in the test module. Model-only scope: bundled library interfaces are never subjects. - Cross-tool portability pins.
tests/portability_test.py+tests/fixtures/report_2026_11/carry the four repro files verbatim; measured against OpenSysML 0.12.1-998-gddc4a547fe (origin/develop): qualified allocation rejected (connector-end-referenton both ends — including the imported form, whose "fixes it" claim in the report does not hold on current develop), SingleItemInterface rejected (related-elements), TypedAllocation accepted. sysmlpy and OpenSysML now agree on all four files. - 15 pins in
tests/issue43_test.py, 14 intests/issue44_test.py, 12 intests/portability_test.py(4 skip without a built OpenSysML).
0.105.0 (2026-11-04)¶
Issue #42 closed: metadata bodies survive the dump, and their values are structured.
- Applications with a body no longer vanish from
dump().element.annotationsheld them (issue #24) but the dump is generated from the grammar tree, which had no member for them — so@M { w = z; }disappeared on a round trip while@M { w = 1; }survived._inject_annotationsputs each application back into the annotated element's body, de-duplicated against applications the parsed body already carries, and skips prefix applications (#M part def Y;renders once, in the prefix). - The notation the author used is the notation dumped back.
#Mkeeps its sigil,metadata app : M { … }keeps its keyword,@Mbinds to its type (@ Mwas the old spacing).declaredKeywordnow survivesMetadataFeature.get_definition(), which it previously dropped. - Values are structured. Each metadata body member is captured through the
same expression path attribute defaults use (
valuePart→FeatureValue→OwnedExpression→ operator tree), exposed asMetadata.value_expressions[name]alongside the author'svalues[name]text. In the interchange graph each body member is aReferenceUsagewithdeclaredName+valueand aFeatureValue/expression subtree (the OpenSysML shape), instead of an opaque"body": "{w=z;}"string — and import maps those nodes back, sovaluesandvalue_expressionssurvive a graph round trip. - Pins:
tests/issue42_test.py(22) — reference, literal, chain, arithmetic and empty bodies;#M,metadata app : M, nested usage bodies,aboutclauses; fixed-point round trips; graph structure and graph↔model equality. - Two pins updated because the old expectations encoded the defect:
issue24's@ m1 : M …andclass_test's canonical@ m1 : MDboth assumed the dump normalized ametadatadeclaration to the sigil form. - Advisory gate unchanged: 1116 errors / 1678 warnings, PASS, 0 parse failures.
0.104.2 (2026-11-04)¶
- Cold analyze: 190 s → 10.9 s (0.103.3 was 43.5 s). The snapshot was only
consulted when
lib_rootswas None, butanalyze(model, library=[...])— the ordinary path — always passes explicit roots, so a cold analyze rebuilt the whole facts index (276 s with no DFA cache). The snapshot is now tried for any roots and accepted only when its digest matches theirs: a custom library fails the check and builds; the bundled library answers instantly however the caller spelled it. Measured on a fresh venv with no DFA and no facts cache: 190.5 s → 10.9 s, warm <0.1 s.
0.104.1 (2026-11-04)¶
- Shipped facts snapshot: first run 276 s → 0.02 s. The library facts index
is now packaged as
src/sysmlpy/library_facts.json(564 KiB, generated byscripts/gen_library_facts.py), validated against build id + library content digest like any cache record — a stale snapshot is a miss, never wrong answers, and custom library roots never use it. The measured cold build from source is 276 s on a machine with no DFA cache (each parse pays DFA construction), which is why a snapshot is the difference between a usable first run and a four-minute wait. Same approach as OpenSysML'sstdlib.snapshot. tests/library_facts_test.pyfails when the snapshot does not match the current build id or library digest, so a version bump or a library edit cannot silently ship a stale one.- Pool workers no longer touch the persistent DFA cache
(
ProcessPoolExecutor(initializer=_worker_init)): eight workers each loading and re-saving a tens-of-MB pickle was serialising the parallel extract.
0.104.0 (2026-11-04)¶
Issue #34 closed: the library answers as a model, not as a scrape.
- Library facts index (
src/sysmlpy/library_facts.py,tests/library_facts_test.py). One library-wide index of namespaces, members, imports and short names, with public star-imports expanded to a fixpoint — the shape OpenSysML derives inExpandWildcardImports()and the OMG ships precomputed assysml.library.xmi.implied. Facade packages now expose what they re-export:ISQ::mass(declared inISQBase),ISQ::speed(ISQSpaceTime),ISQ::time(alias time for duration),SI::time(chained re-export), and short names such asSI::kg,ft,Btu_ITresolve instead of falling back to the scraped index. - Private imports stay private:
ISQ::RealandSI::Realare False even though both files importScalarValues::Real; onlypublic importre-exports. - KerML half indexed too: names come from the visitor dict with quoting
stripped (
VectorFunctions::+), and imports are read lexically because the KerML dict does not carry them. - Persisted facts cache, keyed on library content digest + set digest + build
id + format version (
SYSMLPY_LIBRARY_CACHE,offdisables). A stale or corrupt record is a miss, never a crash. Cold build 24.6 s on 8 cores (parallel per-file extract,SYSMLPY_LIBRARY_WORKERSoverrides); warm load 0.02 s. get_symbols()now reads the facts index: 29.6 s warm / 53.5 s cold → 0.02 s cached, and 11,225 symbols including re-exported members and short names. A file the parser rejects (a.kermlcarrying SysML notation) still contributes its names through the tolerant lexical harvester, so custom libraries keep resolving.exists_in_loaded_model()answers name-level truth from facts first; a lookup no longer loads a library model.library_namespace_table()stays model-backed (real elements, nested scopes) with facts as the fallback — that split is what keeps feature access likeisq.L(through a short-named attribute's type) resolving; making the tables facts-only cost 2041 extraUNRESOLVED_EXPRESSION_IDENTIFIERfindings before the ordering was fixed.- Advisory gate: 2794 findings (1116 errors / 1678 warnings) from 2853
(1146/1707) — every class improved and none moved up:
IMPLICIT_LIBRARY_IMPORT 1343 → 1314,UNRESOLVED_EXPRESSION_IDENTIFIER 967 → 946,UNRESOLVED_IMPORT 17 → 12,UNDEFINED_SYMBOL 46 → 42. 0 parse failures, PASS. - Benchmarks (
benchmarks/bench.py,docs/benchmarks.md, see 0.103.4):library.index29.62 s → 0.021 s;library.exists(8 lookups) 16 ms.
0.103.4 (2026-11-04)¶
- Benchmark suite (
benchmarks/bench.py,docs/benchmarks.md). The v0.84.0 harness measured only parse cold/cached/warm on a synthetic model; this one measures every phase a caller pays for, on real corpora: parse, element build,load_files,analyze,dump, interchange export/round-trip, the library symbol index, per-namespace tables, qualified-name lookups, and the full gate scan (opt-in). Results are written tobenchmarks/results/<version>-<mode>.jsonso releases diff against each other, and--coldruns each case in a fresh process with a throwaway DFA cache — the cost a first CLI invocation pays.
Baseline on 0.103.3 (Python 3.13.5, n=1): parse.library_all 17.8 s,
model.library_all 18.3 s, dump.library_all 7.2 s, analyze.fixtures 1.8 s,
interchange.export 0.54 s, and library.index 29.6 s warm / 53.5 s cold
— the analyzer's library index, not the parser, is the dominant cost. That is
the component #34 replaces, which is why its cache design matters more than the
parser's.
0.103.3 (2026-11-03)¶
- Issue #41: a succession vanished when its body had other members.
part p { first a then b; }kept it; add one sibling —part p { attribute x : Real; first a then b; }— and it disappeared from the element tree and the dump. The parse tree and the visitor dict both carried it, so the loss was in the loader: no child element was built for aSuccession, andUsage._ensure_bodyrebuilds a parsed body fromself.children. Alone, the body had no other member and the grammar body survived by accident.
A succession is now a first-class element, modelled the way Binding already
is (a non-occurrence usage kept in the tree, DefinitionBodyItem →
NonOccurrenceUsageMember → NonOccurrenceUsageElement on the way back), with
source / target / ends readable from the connector ends:
p.children # [Attribute('x'), Succession(None)]
p.children[1].source, .target # ('a', 'b') — chains too: ('a.b', 'c.d')
The succession keyword is preserved, multiple successions keep their order,
and any position in the body works (first, middle, last).
-
Library sweep stays clean: 58 files, 0 parse failures, 0 non-idempotent, 0 raw dicts, 0 stdout noise.
-
Pins:
tests/issue41_test.py(11).
0.103.2 (2026-11-03)¶
- Issue #40: the last four defects keeping library dumps from round-tripping.
With these fixed, all 58
.sysmlfiles insrc/sysmlpy/libraryload, dump, re-parse to identical text, contain no raw dicts, and print nothing. Measured on the 0.103.1 wheel against the 0.103.2 tree:
before after
parse failures 1 0 Actions.sysml (reparse returned None)
not idempotent 2 0 SampledFunctions, VerificationCases
raw dicts 0 0
stdout noise 2 0 AnalysisCases, Cases
then perform body;lost its target (Actions.sysml— the one file that failed to re-parse at all). The visitor's behavior-member dispatch had noperformActionUsagebranch, so the member vanished and the dump emitted a barethen ;, which the grammar rejects. The member now loads asBehaviorUsageMember → BehaviorUsageElement → PerformActionUsage.- Preserved text collapsed newlines (
SampledFunctions.sysml). A constraint body with a trailing//comment was flattened onto one line, so on the next parse the comment swallowed the rest of the expression and the body fell back to captured text._verbatim_textnow collapses whitespace within lines and keeps the line breaks. - Ternary re-spacing was not idempotent (
VerificationCases.sysml)._respace_ternary_gluere-spaced already-spaced text, adding a space per round trip (if passing ? …). It now strips each part before re-joining. -
case/analysisusages were dropped and printed to stdout (AnalysisCases.sysml,Cases.sysml).Package.load_from_grammarhad noCaseUsage/AnalysisCaseUsagebranch ("Unknown class … skipping"), and the case-family declaration (name + typing) lives in aconstraintUsageDeclarationthat the name helper never read —case c1 : CD;came out ascase;. Both now load with their names. -
Pins:
tests/issue40_test.py(9), including the whole-library sweep as the acceptance criterion.
0.103.1 (2026-11-03)¶
- Issue #36: metadata applications now state themselves in the
@graph. Two shape decisions, both taken against what the implementations actually emit — the OMG metamodel generated intoSysML-v2-API-Services(MetadataUsage extends ItemUsage, MetadataFeature;AnnotationcarriesannotatedElement/annotatingElement), OpenSysML'sdocs/reference/rdf-mapping.md, and sysml-toolkit'sINTEROP.md: - Metaclass (
D'): an annotation node is now typedMetadataUsage, the SysML metaclass, instead of the bare KerMLMetadataFeature. The two are related by inheritance, so a consumer keyed on either finds it. - Link (
B'): the annotation node carries"annotatedElement": [{"@id": <the element it annotates>}]— the metaclass property, on the annotation (not a convenience edge on the anchor, which is what I first proposed and then withdrew after checking the tools). For the body form the anchor is the element whose body holds the application; for the#Mprefix form, the element being prefixed; for nested elements, the nearest one. - Sigil:
"declaredKeyword": "@" | "#"records which form the author wrote (the visitor now captures it;metadata m : M;normalises to@, which is what its own dump already did). - An annotation with an
aboutclause keeps itsAnnotationnodes and gets no derived edge — that clause names its own targets, and the ownership edge would state something false.
Nothing enters the identity space: element ids are byte-identical to 0.103.0
(95/95 nodes on the probe model), stable_ids/doc_ids/reconcile_ids are
untouched, explicit_terms=True picks the new terms up automatically, and a
pre-0.103.1 document (typed MetadataFeature, no derived edge) still imports
unchanged.
- Pins:
tests/issue36_test.py(11).
0.103.0 (2026-11-03)¶
- Issue #39: binding connectors lost their
bindingkeyword and multiplicity — the last blocker for a clean library. Three causes: - the connector's usage-declaration multiplicity (
[1]) was never read by the visitor, sobinding [1] bind …dumped asbinding bind …; BindingConnector.dump()appended the anonymous declaration as its own token, which is where the double space (and the "the keyword only survives by accident" look) came from;- a bare
bind …was indistinguishable frombinding bind …, so the dumper could invent the keyword. It now travels with the dict (hasBindingKeyword), and a barebindstays bare.
The connector's usageBody was also hardcoded empty, so members inside
binding … { members } were dropped; they load now.
-
Successionhad the same two defects (dumped assuccession first …, and the optionalsuccessionkeyword was unconditional —first a then b;came back assuccession first a then b;). Same fix, same flag. This is what madesystems/Flows.sysmlnon-idempotent. -
Library sweep (58 files) after the fix: 0 raw dicts, and the four Quantities/Geometry files plus
systems/Flows.sysmlare clean fixed points. Residual stragglers, each its own defect, are filed as #40:Actions.sysml(a succession'sperformtarget is dropped → parse error),SampledFunctions.sysml(an indexed#(i)expression emits text the grammar rejects),VerificationCases.sysml(if cond ?whitespace not normalised), and theCaseUsage/AnalysisCaseUsageskips that print on dump. -
Pins:
tests/issue39_test.py(21).
0.102.9 (2026-11-03)¶
- Issue #38: multiple redefinitions lost their comma separator.
redefinesis a comma list, butRedefinitions.dump()joined the targets with a plain space:
attribute :>> ThermodynamicTemperatureUnit::quantityDimension TemperatureDifferenceUnit::quantityDimension {
which the grammar rejects. The whole attribute line then failed to load, so
SI.sysml, USCustomaryUnits.sysml and ShapeItems.sysml were never re-parseable —
even after the last of their raw-dict leaks was removed. Now
:>> A::x, B::x, matching the source.
-
References(::>) had the mirror-image bug, one step behind it: that operator repeats per target (::> A ::> B) and the grammar rejects a comma list there, so its dump now repeats the operator instead of joining with a space. -
Library round-trip: 3 of 4 files fixed. SI.sysml, SIPrefixes.sysml and USCustomaryUnits.sysml now dump → parse → dump with no change and no raw dicts. ShapeItems.sysml still is not a fixed point, and the remaining diff is entirely binding connectors — filed as #39 (
binding [1] bind …loses itsbindingkeyword and multiplicity, a captured-text artifact that only looked correct on the first dump). -
Pins:
tests/issue38_test.py(16).
0.102.8 (2026-11-02)¶
- Issue #33: grouped exponents were opaque text — calc bodies were
unevaluable, and unit-expression exponents dumped raw dicts. A
parenthesized group had no representation in the expression chain, so the
emitter fell back to preserving the whole expression as one name:
(x^(1/2)+0)reached the evaluator as the identifier(x^(1/2)+0). It is now represented structurally — aPrimaryExpressionwhose base is aSequenceExpressionrelationship, the shapeBaseExpression.dump()already renders in parentheses — so the group is one operand of whatever encloses it: (x^(1/2)+0)atx=9→ 3.0;(a+b)^2→ 25.0;(x*(1+y))^2→ 64.0; results stay pint-aware (x * 2 [m]→Quantity(6.0, 'meter')).- The
#31paren guards are gone: with a real paren node the emitter no longer needs a binding-power heuristic, andtp / (tm * v),-(2 - 5)and(a or b) and call dump as written and are now structured rather than text. - Two dumper defects behind the raw-dict leak:
ExponentiationExpression.dump()converted its right operand as anotherExponentiationExpression(the grammar saysunaryExpression), sox ^ 2printedx ^ {'name': 'UnaryExpression', ...}; andMultiplicativeExpression.dump()joined operands with""(tp/ (tm* v)). Both fixed. const_foldfolds through groups (nestedOwnedExpression,SequenceExpression), and the evaluator accepts^(SysML spelling) as well as**.- Library effect: the four files that leaked dicts are clean — SI.sysml 1085 → 0, USCustomaryUnits 325 → 0, SIPrefixes 35 → 0, ShapeItems 104 → 0 — and dump without any stdout output.
-
Pins:
tests/issue33_test.py(27). -
Issue #32: keyword-less variant members kept their body at grammar level.
variant 'six cyl' { attribute note : String; }built the variant element but loaded no children, becauseReference.load_from_grammarreturned before the shared body dispatch. The dispatch loop inUsage.load_from_grammaris nowUsage._load_body_members, and the VariantReference branch unpacks itsUsageBody → DefinitionBodymembers and loads them through it, sovariant.childrenreally holds the members. - Same gap in action bodies:
variation action g : A { variant g1; }parsed asActionBodyItem → VariantUsageMember, which neither the visitor norAction.load_from_grammardispatched — the variants existed only in the grammar. The visitor now visitsVariantUsageMemberContext, and the action loader routes those members through the shared dispatch with the variant chain marked (is_variantTrue). On the OMG corpus this restores all fourvariant generateTorque*/amplifyTorque*members. -
Pins:
tests/issue32_test.py(9), including the OMG VehicleVariabilityModel round-trip. -
New issue #38 filed (found here): multiple redefinitions are dumped space-joined without repeating
:>>, which is why SI.sysml / USCustomaryUnits / ShapeItems still do not re-parse even with no raw dicts left.
0.102.7 (2026-11-02)¶
- Issue #31:
assert constraintbodies dumped glued operators and never reached a fixed point. Three separate defects in the expression emitter — only the third was in the report: - Wrong operand class for the loose boolean layers.
_unwrap_to_layerhandedOrExpressionthe And-layer,XorExpressionthe Or-layer andImpliesExpressionthe tail of a ladder, but each layer's grammar class expects the layer immediately BELOW it (orExpression : xorExpression (OR xorExpression)*). Any expression usingor/xor/impliestherefore put a foreign chain dict into an operand slot and the dumper stringified it:a xor b→a xor {'name': 'OrExpression', 'operator': [], ...}. Corrected for OR (→ xor), XOR (→ and) and IMPLIES (→ or). - Parenthesized groups never entered the chain.
(A and B) xor (C and D)matched no emitter branch, so the whole expression collapsed to one FeatureReference name. Groups are now unwrapped (_paren_inner_context, which follows theownedExpression → primaryExpression → baseExpression → '(' sequenceExpressionList ')'wrappers). A group keeps its parens whenever its loosest operator binds no tighter than the enclosing operator — at equal precedence the parens still decide the grouping (tp / (tm * v)must not becometp / tm * v,-(2 - 5)must not become-2 - 5), and a unary prefix over a grouping stays text for the same reason. - The text fallback glued tokens.
ctx.getText()concatenates tokens, so any preserved expression became unparseable ((a or b) and c→(aorb)andc). The fallback now slices the original source (_verbatim_text, whitespace-normalised) using the context's character interval, so preserved text is the source text. - Dumps no longer print on stdout.
valid_definitionprinted the offending dict'snamebefore raising — on a normal control-flow miss (probing an operand against several layer classes). It floodedsysmlpy ciwith layer names; the raise stays, the print is gone. - Corpus:
VehicleVariabilityModel.sysml(the reporting file) now reaches a fixed point with nolanguage "English"capture and an operator sequence identical to the source (21 operators,==/and/xor). - Gate: 0 parse failures, 1180 errors (was 1183) / 1706 warnings, PASS —
the three former text-captured bodies now expose their identifiers to the
resolver, retiring 5
UNRESOLVED_EXPRESSION_IDENTIFIERfindings. - Pins:
tests/issue31_test.py(11). Known and unchanged: unit-expression exponents (s ^ -1,1024 ^ (1/1000)) still dump theirUnaryExpressiondict — a pre-existing leak tracked by issue #33, which the same machinery now makes tractable.
0.102.6 (2026-11-02)¶
- Issue #34 step 7: the
.kermlhalf of the library now answers on truth. KerML names were only ever scraped —exists_in_loaded_modelreturned False for them by design,library_namespace_tablefiltered its candidates to.sysml, and the regex index carried doc-comment words as names. - KerML has no public
Modelloader, but itsparse_to_dictoutput is already name-shaped (name= the declaration KIND,declaredName/declaredShortName= identifiers,children= nested members). A symbol table is now built directly from that dict (LibrarySymbolIndex._kerml_table_for_file, process-cached), soVectorFunctions,VectorValues,ScalarValues,Collections… answer with their real members; declarations are represented by a minimal_LibrarySymbol(name, kind, typed_by, shortname) because there is no model element to hand back. library_namespace_tableaccepts.kermlcandidates, soprivate import VectorFunctions::*imports real members; the scraped index stays only as the callers' last fallback.exists_in_loaded_modelconsults the KerML table for fingerprinted.kermlsources (nested members included), soexists_in_loaded_model( "VectorOf")is True instead of False-with-a-scraped-fallback.- The leaf fingerprint now harvests
.kermldeclarations lexically (_KERML_DECL_RE, leading modifiers included:abstract datatype VectorValue,in feature v), so the step-7 path works in a cold process that has not built the full symbol index. Before this the kerml leaves existed only as a side effect of the index walk, and a step-7 lookup in a fresh process silently found no candidates. - Gate unchanged by design: 0 parse failures, 1183 errors / 1706 warnings, PASS, identical per-code histogram to 0.102.5 — the scraped fallback was already resolving these names on the corpus, so step 7 changes how they resolve (truth, without doc-comment noise), not how many.
- Pins:
tests/issue34_step7_test.py(7 — member tables, kernel namespaces, the symbol stand-in,exists_in_loaded_model, nested members, absence of doc-comment words, and an import resolving through the table). Two older pins updated to the new truth (library_model_test,issue34_step5_test).
0.102.5 (2026-11-02)¶
- Issue #34 step 5: imports resolve against the loaded library model.
Phase 1+2 (0.102.0) made the existence question answer on truth; this
release does the same for import visibility — a
private import SI::*imports the members the loadedSImodel really declares, including declared short names (attribute <kg> kilogram), which no scraped name list carried. SymbolTable._walk_elementregisters declared short names for every element (not just library ones), soattribute <x> foo : Real;makesxa real name in its own namespace too.SymbolTable.lookup_member/table descent unchanged; the library table is built shallow (direct members, no recursive import walk) and cached per namespace. A table that resolved its own imports walked the whole library closure: 248 s cold on a two-import model, which is why the earlier attempt was deferred. Shallow costs ~1–2 s per namespace (DFA-warm) and leaves a facade's re-exported members toexists_in_loaded_model— they still resolve as references (the residual is the import-suggestion warning for a re-exported name, documented below).- Re-entrancy guard (
_namespace_table_building) so two library files that import each other cannot loop;.kerml-only namespaces (e.g.VectorFunctions) keep the scraped fallback unchanged (step 7 will model-load them). - Gate delta (bundled library + fixtures, 99 files): errors 3369 → 1183, warnings 2961 → 1706, PASS, 0 parse failures. Per-code: UNRESOLVED_EXPRESSION_IDENTIFIER 3180 → 1006, IMPLICIT_LIBRARY_IMPORT 2598 → 1343, UNDEFINED_SYMBOL 58 → 46; every other code unchanged (nothing increased, nothing suppressed).
- Cost: a cold
analyzeon a library-importing model 28.9 s → 39.5 s (the table builds for the imported namespaces); warm analysis unchanged (~0.0 s). Persisting tables across processes (step 6) is now a cost-optimisation, not a prerequisite. - Pins:
tests/issue34_step5_test.py(7 — unit short names, facade truth fallback, short names in the table, element-valued members, the.kermlfallback, user-model short names, and a namespace no library defines still warns). - Plan record updated:
docs/v0.102-library-model-resolution.md.
0.102.4 (2026-11-02)¶
- Issue #29: interface ends are first-class children and keep their
typing.
interface def I { end e1 : PD; end e2 : PD [1..*]; }built theInterfacewith zero children, kept the ends only inInterface.endsas(name, None, None), and dumpedend e1;— the declared type, multiplicity and flags were gone from the model and the text. - New public element
InterfaceEnd(also exported assysmlpy.InterfaceEnd):name,typed_by_name,multiplicity(as written, e.g.[1..*]/[0..1] ordered nonunique),reference(the::> a.bchain as written), plustyped_elements/reference_elementslazy resolution (the issue #23*_elementsrule: unambiguous names only). Ends appear iniface.children;iface.ends/iface.iface_connectionskeep their old shapes, now with the type filled in. Interface.load_from_grammarreads the: Ttyping (Typings → TypedBy) and the multiplicity part (bounds plusordered/nonunique) that it previously dropped.- The rebuild that serializes an interface body
(
Usage._ensure_body) emits each end through one shared builder (_interface_end_body_item) in the visitor's own shape (InterfaceBodyItem → InterfaceOccurrenceUsageMember → InterfaceOccurrenceUsageElement → DefaultInterfaceEnd → Usage), with the Typings and::>chain specializations and a rebuiltMultiplicityPart— so the body no longer degrades on every dump anddump → parse → dumpis a fixed point. Children take precedence; theself.endspath remains for programmaticadd_end(). - Dump glue:
InterfaceUsageDeclarationcarried a literal newline in itsconnectkeyword, sointerface ib connect a to b;came out asconnect\\n a to b;. - Fixed en route (pre-existing, proved on 0.102.3): a programmatically
built
InterfaceraisedAttributeError: 'NoneType' object has no attribute 'get_definition'fromModel.dump()becauseInterface.grammarstayedNone;Interface._get_definitionnow synthesizes a body-less grammar object. - Pins:
tests/issue29_test.py(7 — reporter model, typing in the dump, multiplicity/flags round trip,::>chain, usage-with-body, single-lineconnect, programmatic definitions and usages). - Gate unchanged: 0 parse failures, 3369 errors / 2961 warnings, PASS. Affected suites 713 passed; full suite 1822 passed / 79 skipped.
0.102.3 (2026-11-01)¶
- Issue #35: the KerML parser shares the persistent DFA cache.
dfa_cachecovered only the SysML parser, so every KerML corpus run and every library-index walk re-derived the prediction structures cold (Occurrences.kerml~14 s per parse, every process). - The cache is now per grammar family: each target has its own key and file,
derived from its own serialized ATNs (plus ANTLR runtime + version), so a
SysML grammar change can never invalidate or corrupt the KerML cache and
vice versa. SysML keeps its historical
dfa-<key>.pklname (caches written by earlier releases stay valid); KerML writesdfa-kerml-<key>.pkl. - A target is only loaded/saved when its parser actually ran in the process
(
used), so a SysML-only run never imports the KerML classes or touches its file. - Exit-time re-save: the once-per-process save landed after the FIRST
parse of a run, so a library-index walk persisted 558 of the 1,622 states
it warmed.
maybe_load/maybe_savenow register anatexithook that re-saves each used target when its in-process DFA is strictly warmer than the file — the multi-file walk converges instead of half-caching. - Measured (fresh processes, bundled library):
LibrarySymbolIndex.get_symbols51 s → 26 s; the analysis that follows a warm index 59 s → 1.7 s;Occurrences.kerml13.7 s → 3.3 s; full test suite 34m44s → 23m04s. dfa_cacheAPI:cache_key/cache_file/load_dfa_cache/save_dfa_cache/ maybe_load/maybe_save/statstake an optionaltarget("sysml"default, so every existing call and cache stays valid);targets()lists the families. Cache problems still never break a parse (maybe_*swallow).- Fixed en route: the generated parsers define
serializedATN()at MODULE level — keying on the class attribute raisesAttributeError, which the new_serialized_atn()resolves (module first, class fallback). - Docs: README's "Parse Performance and the DFA Cache" now covers both grammars and the measured numbers.
- Pins:
tests/issue35_test.py(7 — per-target keys/files, save→load, the SysML/KerML file isolation, the disable flag, the never-raise contract, and a subprocess pin that the exit hook persists the whole corpus walk). Thedfa_cache_testmonkeypatch ofcache_fileaccepts the newtargetkeyword. - Gate unchanged: 0 parse failures, 3369 errors / 2961 warnings, PASS. Full suite 1815 passed / 79 skipped.
0.102.2 (2026-11-01)¶
- Issue #30 (reported downstream by the CARTA team): allocation usages and
definitions keep their body members.
allocate p to q { attribute note : String; }built theAllocationelement with zero children — the body member was absent from the model, and the dump kept it only by re-serializing the parsed grammar — so a consumer reading allocations (theirrepro_01) saw nothing inside them. No exception, no visitor warning. - Visitor:
allocationUsagehardcoded an emptyDefinitionBody— the same defect the connection fix closed in 0.99.5. It now fills the body through the sharedusageBodyhelper (_connection_usage_body_items, whose docstring now records thatallocationUsagehas the same shape). - Loaders: all three sites assigned
element.grammardirectly instead of callingload_from_grammar, so nothing was ever flattened — the package-level definition and usage (definition.py), the nested usage in a definition body, and the behavior-body path (usage.py). All four now use the shared loader. - Dump:
AllocationUsage.dumpjoined unstripped parts, emittingallocate p to q {(double space); it now strips like its base class. - Serialization safety: a parsed allocation keeps its parsed body
authoritative (
Allocation._ensure_bodyreturns early), because rebuilding from children loses what no child models — redefinition-carrying ends (end :>> source : Wheel;, the 0.98.1/PR#18 pin) and innerallocate source.xs to target.y;statements. Programmatic elements still rebuild from children as before. - Pins:
tests/issue30_test.py(6 — usage body, definition body, nested usage, visitor-dict body, dump→parse→dump fixed point, empty bodies unchanged). - LSP subprocess test budget 120 s → 300 s, with the cost documented. The
end-to-end test spawns a cold server that pays the scraped library index
(.kerml parse, ~55 s; #35 caches it) plus the first
SI.sysmlload (~60 s when the DFA cache has no entry for that family — the cache file is keyed by the sysmlpy version, so the first run after every release is cold). It passed at 119.9 s against a 120 s timeout: a latent flake, not a measurement. No analysis-cost change. - Verified: affected suites 527 passed; gate unchanged (0 parse failures, 3369 errors / 2961 warnings, PASS); full suite 1808 passed / 79 skipped.
0.102.1 (2026-10-31)¶
- Issue #37 (reported by failys): qualified references into an IMPORTED
namespace resolve.
::> type = InterfaceType::required;— withInterfaceTypevisible only throughprivate import LIB::*— was reported asUNRESOLVED_EXPRESSION_IDENTIFIER, twice per use (the value-owningPortand the redefiningReference). - Root cause: the qualified-name descent resolved the head name, then
asked
_find_symbol_owner(head)— which answers where the name is visible (the importing scope) — and looked for the namespace in that scope's_children. An imported namespace's member table belongs to its DEFINING package (LIB::InterfaceType), so the descent never reachedrequired. - Fix:
SymbolTablerecords element → member-table at build time (_element_scopes, kept on the root table;_scope_for_memberconsults it after the existing child/owner lookups), and all three descents use it (_resolve_qualified_name,_find_namespace_table,_is_resolved). The final segment stays "the resolved element" — no child namespace is required for it. - Not leniency: a bogus member (
E::nope) is still reported, and the reporter's model validates clean under Open-MBEE's OpenSysML (-validate -strict), confirming the finding was ours. - Pins:
tests/issue37_test.py(5 — the reporter's model, named-import and same-package forms, the negative case, and a symbol-table pin that the resolver returns theEnumeratedValuemember). - Gate unchanged: 0 parse failures, 3369 errors / 2961 warnings, PASS (identical per-code histogram — the pattern does not occur in the bundled corpus). Affected suites 372 passed; full suite 1802 passed / 79 skipped.
0.102.0 (2026-10-31)¶
- Issue #34 (phase 1+2): the analyzer's library fallback resolves through loaded library MODELS, not the scraped name index.
LibrarySymbolIndex.exists_in_loaded_model(name)— a leaf → file fingerprint picks the smallest candidate set; each candidate loads once per process through the public pipeline and answers on truth: re-export facades (ISQ→ISQBase), star-imported members (import SI::*+ barekgSHORT names,<Gy> gray), and unit members classify correctly. Doc-scraped false leaves can no longer prove existence.- The fingerprint is lexical (packages, definitions, member usages,
<short>names — one line scan, 0.3 s over the bundled library) and is shared with the index walk via_leaves_on_line, so the two cannot drift. A cold resolver need therefore no longer pays the scraped index's .kerml parse: facade-modelanalyze56 s → 4 s cold, LSP diagnostics subprocess 120 s → 66 s (the residual is the .kerml index pass, #35),tests/library_model_test.py156 s → 68 s. - Wired into both resolver fallbacks and the
UNRESOLVED_IMPORTvalidators (leaf-level checks). - Gate deltas (baseline 7890 errors / 940 warnings → PASS; fresh run
this release: 0 parse failures, 3369 errors / 2961 warnings):
UNDEFINED_SYMBOL 2079 → 58, IMPLICIT_LIBRARY_IMPORT 577 → 2598 — the
2,021 moved findings are unimported library-type uses inside the
bundled sources, re-classified from error (undefined symbol) to
intentional-import warning (advisory); UNRESOLVED_EXPRESSION_
IDENTIFIER 5640 → 3180 (the last 102 are unit SHORT names —
ft,lb,lbf,Btu_IT… — that the shared harvester now fingerprints); UNRESOLVED_IMPORT 57 → 17. Every other code unchanged. Nothing suppressed; parse failures 0. - Only .sysml sources model-load this phase; the .kerml half stays
index-backed until its DFA cache (#35). Deferred follow-up
(documented): model-resolved import visibility (fresh SymbolTables
over library files) exploded warm analysis cost (~100 s/analysis
warm) when wired; deferred until the tables persist across
processes —
docs/v0.102-library-model-resolution.mdsteps 5–7. - Pins:
tests/library_model_test.py(6).
0.101.0 (2026-10-31)¶
- Issue #27 (decision shipped): deterministic object-model identity.
Anonymous members keep
name=None— the per-parseuuid4()name mint (17 sites:Usage/Packagedefaults, six class overrides, the visitor'sRequirement_/UseCase_/Interface_/Case_/AnalysisCase_/VerificationCase_prefixes) is gone; uuid churn in downstream identity maps is over. Durable identity is UUIDv5 in the ID slot: sysmlpy.stable_ids(model)→{element: "sysml:<uuid5>"},element.stable_idconvenience; declared elements join through the stable export's#qn_registryand agree exactly with their@idinto_interchange(model, stable_ids=True)— nested members and same-name sibling groups included (pinned).- Anonymous members derive from the nearest declared ancestor +
structural path (public-tree
children:<index>version of the exporter's dict-tree path — documented bound:docs/stable-identities.md§6, option D). - The
Modelroot keeps its documented per-parse uuid (not a member; never serialized as content). - Registry defect fixed en route: the
#qn_registryside table stored a literal...placeholder for same-name sibling groups' second+ occurrences, keyed by the raw dict-tree qn; it now keys"<deduped-qn>#<index>"with the actual node id (the object-model mirror relies on that join). - Pins:
tests/issue27_id_test.py(no uuid names, no churn across parses, export agreement incl. nested members,stable_idproperty, distinct ids in name-collision groups, anonymous determinism).
0.100.1 (2026-10-31)¶
- Issue #25 emission gaps, all fixed (downstream report):
- Keyword-less variant members (
variant automatic;,variant 'six cyl' { … }— grammarVariantUsageElement → VariantReference) dropped from the model. They now buildReferencechildren of the variation withis_variantset and the referenced chain onvariant_reference(naming follows the bare-reference convention: the chain makes the member addressable, exactly how the OpenSysML oracle resolves them), and re-emit thevariantkeyword. - Enumerated values (
enum def Color { a; enum b; }, §7.8.2) reached the grammar dict but never the model — values are nowEnumeratedValuechildren of the Enumeration (keywordpreserved); serialization unchanged. ref part r : X;had nois_reference— theBasicUsagePrefixREF token now setsUsage.is_reference; kind-less elements are referential by construction (§7.6.4).- Kind-less usages with a prefix chain (
private ref #M z1;,abstract #M z2;,private #M z3;) dropped. They build Reference elements carrying the#Mmetadata annotations, and re-emit visibility +ref/flags +#Min source order (REF-less forms keep REF-less dumps; no spuriousref). - refPrefix flag tokens (
abstract/variation/derived/constant) dropped from kind-less members on dump (abstract z2;→z2;). Alsoconstantre-emits asconstant— the textual keyword; theisReadOnlyfield name is a historical misnomer (readonlyis not in the grammar; the OpenSysML oracle rejectsreadonly x;). - Member-level visibility rode to the semantic layer for these members
(
privateon a body member was dropped); body-member visibility round-trips now. - The OMG
Variability Examples/VehicleVariabilityModel.sysmlcorpus parses with the variant forms emitted (pinned intests/issue25_test.py). Pre-existing, out of scope: assert-constraint expression bodies still glue on the first dump; whole-file dump identity is not asserted there.
0.100.0 (2026-10-30)¶
- Relationship endpoints are on the object model (issue #23, downstream report from the CARTA team). All four relationship usages parsed with the endpoints on the grammar object only; the public elements now carry them.
Dependency.clients/.suppliers— name lists as written (the grammar kept them since issue #4 / PR #7; the loader never read them), plusclient_elements/supplier_elementsresolving lazily (unambiguous names only).Allocation.source/.target— first/second end of a binaryallocate a to b;; an n-aryallocate (a, b, c);reports all ends assource(grammarAllocationUsage.connectorPart, present since issue #5 / PR #6) plussource_elements/target_elements.Requirement.requirement/.satisfying— thesatisfy R by S;endpoints (ors/ssm) andis_satisfy/satisfy_elements(). The satisfy wrapper is now built throughload_from_grammar(its endpoints were previously unreachable because the loader was bypassed).VerificationCase.verified_requirementsand aVerifychild element perverify R;member (the only grammatical home forverifyis the objective's requirement body).traceability.verified_byis populated from the same edges — previously always empty (issue #27 item 3).- Metadata applications (issue #24, same report).
metadata m : M about X, W;—Metadata.annotated(names as written),annotated_elements(lazy),type_name; the grammar carries these since the issue #3 work, the public element never read them.@M { w = 1; }inside any definition/usage body attaches to the owning element viaelement.annotations(list ofMetadata, each withtype_name,values,value_text), never uuid-named, never a child.#M part def Y;— thePrefixMetadataMemberis captured on the occurrence prefix (prefixMetadataon both occurrence prefix grammar classes), attached like@, and re-emitted as#Mon dump.- Serializer:
@M { w = 1; }dumped as@ : M {w=1;};(not re-parseable inside a definition body — the:belongs between a declared name and its type, and a braced metadata body carries no terminator);metadata m : M about X;dumped with a double terminator;#M part def Y;lost the prefix. All three fixed; annotations survive dump → parse → dump. diffsignatures andtraceabilityunaffected except where noted in 0.99.7.- Multi-line
doccomments aligned under their first line gained one indent level per dump → parse → dump cycle (CARTA round-trip finding, closing the last issue #26 item):Documentation.dumpnow renders continuation lines flush at the member indent, like anonymous block comments already did. Pinned astest_issue26_multiline_doc_indent_is_idempotent. - New example
examples/metadata_and_endpoints.py(the acceptance script for #23/#24: endpoints, verification, traceability, all three metadata notations).to_interchange→from_interchangeround-trips a model carrying all of them; annotations are deliberately not exported yet (@graphshape change deferred to the interop increment, seedocs/v0.100-endpoints-and-metadata-plan.md).
0.99.7 (2026-10-30)¶
flowusages reach the model (issue #26, downstream report from the CARTA team). A package-levelflow x from p to q;never became an element:Package.load_from_grammar's body navigation only unwrapped a wrapped usage member (PackageMember → UsageElement → …), while a flow member arrives bare (UsageElement → OccurrenceUsageElement → StructureUsageElement → FlowConnectionUsage), so it fell through tocontinue. Three more defects came out with it:FlowEndSubsetting.dumpappended a literal.to the end's qualified name, gluingflow x from p. to q.;(unparseable); the separator now lives inFlowEnd.dumpand only before a feature-chain part.- Both flow builders hardcoded an empty
DefinitionBody, soflow x from p to q { attribute note : String; }lost its members; the body is flattened fromctx.definitionBody(). - The flow element was built by assigning
grammarinstead of callingload_from_grammar, which is what loads body members; the identifier is now read throughFlowConnectionDeclaration(one level deeper than a plainUsageDeclaration), so the element carries its declared name instead of a uuid.to_interchangeon a model with a flow now round-trips. dfa_cacheenv var spelling (issue #27): readSYSSMLPY_DFA_CACHE(three S) only — a misspelling that never matched the package name.SYSMLPY_DFA_CACHEis canonical now; the old spelling stays as an alias.traceability.satisfied_bycarries qualified names (issue #27): it held the reference exactly as written (['S']) whilequalified_namewas qualified (P::R), so equal short names in different packages collided downstream. Unambiguous references are recorded qualified; ambiguous ones stay as written.as_traceability_matrix_view(elements=[...])still accepts short names.verified_bystays empty forverifyinside an objective — there is no Verify element to read yet (issue #23).diffsignatures follow: a trace edge now readssatisfy:P::T::v(qualified) instead ofsatisfy:v, which makes the signature stable across packages with colliding short names.- Regression:
tests/issue26_test.py(6),tests/issue27_test.py(6); twodiff_testand fourtraceability_testpins updated to the qualified form (they documented the old behaviour).
0.99.6 (2026-10-30)¶
DUPLICATE_NAMEno longer fires across namespaces (issue #22, Shamal Faily). A usage's body members were registered in the enclosing package's scope, sopart aComposite : Composite { :>> description = …; }next toconnection aConnection … { :>> description = …; }looked like two same-named members of ARCH. KerML'sTypespecializesNamespace: every typing element, usage included, is the namespace of the members it owns. A single predicate (owns_namespace) now decides this for all six walkers (symbol table, reference collector, expression-identifier and expression-type collectors, and the duplicate check), so table scopes and scope paths cannot drift apart. The finding also names the scope (Duplicate name 'x' in namespace 'P::A', previously a bare "in namespace").- The same leak was the single biggest source of analyzer noise on the
bundled standard library:
sysmlpy ci src/sysmlpy/library tests/fixturesgoes from 1018 DUPLICATE_NAME findings to 0, andUNRESOLVED_EXPRESSION_IDENTIFIERfrom 5736 to 5643 (body-local names now resolve in their owner's scope instead of by accident). One newUNDEFINED_SYMBOLappears —unitConversionindomain/Quantities and Units/SI.sysml— which previously resolved to itself through the leak; it is a member of the library'sUnittype, which the name-indexed library fallback cannot resolve (the known model-loading gap, unchanged). - Cross-checked against Open-MBEE's OpenSysML (Go, built from
~/proj/third_party/OpenSysML):sysml -validateon the reporter's file reports no duplicate-name diagnostic. It does report two genuine issues this analyzer does not check yet — a connection usage needs its own two ends (connection c : CD;is rejected even whenCDdeclares ends), and a member redeclaring an inherited feature name needs:>>— logged for a follow-up increment. - Regression:
tests/issue22_test.py(5: the reporter's model, same name in two usages, duplicate inside one usage body, duplicate in one definition, duplicate at package level).
0.99.5 (2026-10-30)¶
- Connection-usage members no longer drop from the model (issue #21,
Shamal Faily).
connection aConnection subsets connectors : Connection { :>> description = "…"; ref template = sharedTemplate; }dumped as bareconnection aConnection : Connection;, andconnection connectors : Connector [1..*]lost its multiplicity. Three independent visitor gaps: _make_nested_connection_usage_dictused_build_specialization_from_fsp, a duplicate partial builder that understood typings only and hardcodedmultiplicity: None. Both connection builders now use the shared_build_full_specialization_from_fsp(typings / redefinitions / subsettings / references / multiplicity) and the duplicate helper is gone — the corpus reaches only one copy, so a second copy is latent divergence.- Both connection builders hardcoded an empty
DefinitionBody. AconnectionUsagehangs its body offctx.usageBody()directly, which_get_usage_body_itemsnever reaches;_connection_usage_body_itemsnow flattens it. _make_reference_usage_dictreadusage.valuePart()although the value part rides onusage.usageCompletion()—ref template = sharedTemplate;lost its value everywhere, not just in connections. Semantic layer: a connection usage's body items were also dropped from the public tree (UsageBodynests its items one level down inbody.body, and a usage-shaped member with nochildrenwas skipped by the body dispatch).Connectionchildren now carry the body members.- Imports are visible inside the importing namespace (issue #20, same
reporter).
private import LIB::*;in package ARCH resolved at package level but reportedUNDEFINED_SYMBOLfor a type used insidepart def ArchObjt—SymbolTable.lookuphid privately-imported members from every child scope. KerML 1.0 (7.2.5.4) restricts a private import's visibility outside the namespace, not inside its own body (import-re-export still propagates only public/protected imports, so a sibling package still sees nothing). Consequences: the explicitprivate import ScalarValues::*;also stops producing bogusIMPLICIT_LIBRARY_IMPORTwarnings. - Semantic feature harvesting walks the wrapper chain instead of a fixed
three-level descent, and understands usage-shaped members that carry their
own
declaration(ConnectionUsage,InterfaceUsage, …) —connection connectors : Connector;never enteredComposite's feature set, so a legitimatesubsets connectorsreference reported UNDEFINED_SYMBOL once the visitor stopped hiding it. - A context-type member beats the library simple-name fallback: a user
feature whose name also exists somewhere in the bundled library (e.g.
VectorFunctions::VectorOf::components) is a model symbol, not an implicit standard-library reference. TheIMPLICIT_LIBRARY_IMPORTmessage now names the real library package (Connections::Connection, notScalarValues::Connection). - Dump glue (same family as the 0.99.3 serializer sweep):
Subsettings.dumpemits:> X(was:>X),SubclassificationPartno longer doubles the space after:>,DefaultReferenceUsagejoins its terminator (= "x";not= "x" ;), andReferenceUsageno longer prefixes everyref …line with a space from an empty ref prefix. - Regression:
tests/issue20_test.py(5) andtests/issue21_test.py(6, incl. the reporter's full reproducer and a re-parse idempotency check).
0.99.4 (2026-10-29)¶
part def-body feature-value members no longer drop from the model (issue #19, Shamal Faily). A:>> feature = value;member sharing its body with a sibling (the ARCH reproducer's:>> description = "ArchObjt";next topart aTemplate subsets templates : RefinedTemplate;) parsed but vanished frommodel.dump()— the shared body flatten had noDefaultReferenceUsagedispatch, so the member was not rebuilt (bare members survived only by luck of an untouched rebuild). The shared body walker now builds aReferencechild, andReference.load_from_grammarhandles theDefaultReferenceUsageshape (name/type from the:>>chain, value kept in the grammar for byte-faithful re-serialization).Reference._typed_by_namefor a bare redefinition member resolves to the redefined feature (find()navigation works).- Regression:
tests/issue19_test.py(3, incl. the full ARCH reproducer and body-order permutations). Full suite 0 failed.
0.99.3 (2026-10-29)¶
- Annex A dump round-trip (Vehicle Example, issues reported by Luciano Kruk — SYSMLPY_099_ANNEX_A_UPSTREAM_ISSUES.md): the dump of a model whose source parses emitted unparseable text in four shapes. Fixed in the grammar-class serializers:
Usage.dump/UsageCompletion.dumpjoined the declaration,defaultvaluepart, and body with no separator —attribute :>> cargoMassdefault 0[kg];(also the expression-valued and thesubject ... defaultforms) — joins are space-separated now.FeatureDeclaration.dumpglued the identification onto the specialization (shankPort:>>,I: WheelHubInterface) — space separated.InterfaceUsage.dumpdropped the statement terminator for body-less usages (interface I : Xunparseable on reparse).InterfaceEnd.dumpemitted connector-end cross multiplicities AFTER the feature chain; the grammar (connectorEnd : (ownedCrossMultiplicityMember)? (name (::>)? ownedReferenceSubsetting)) requires them FIRST — now[1] lugNutCompositePort ::> wheel1.lugNutCompositePort. Result: the complete Annex A model parses (no recovery warnings), its dump reparses cleanly, and 7 regression tests pin every form (tests/annex_a_roundtrip_test.py, incl. the withdrawn trailing-multiplicity form being rejected deterministically). Note: the report's issue 4 misquotes the source — the Annex A connect lines (640/642) already use the normative LEADING multiplicity form; the trailing form is upstream-withdrawn. Residual (cosmetic, not in scope): doc-comment text re-wraps whitespace on round trip.
0.99.2 (2026-10-29)¶
- pyproject: the
boxesextra's constraint broke Poetry/pip metadata —boxes = ["diagramboxes (>=0.15.1)"]violates Poetry's extras pattern (must be a bare name); it also referenced a dependency never declared. Fixed:diagramboxes = { version = ">=0.15.1", optional = true }plusboxes = ["diagramboxes"]— the firstsysmlpy[boxes]install that actually pulls diagramboxes. - boxes_view: an actionable error for stale diagramboxes
environments (issue #17). The v2 action-flow glyphs
(
chamfer=octagons,action_start()solid diamonds) need diagramboxes >= 0.15.1; theboxesextra used to be unconstrained, so stale environments surfaced 23 rawTypeError: Diagram.add_node() got an unexpected keyword argument 'chamfer'failures.as_action_flow_view_boxesnow capability-checksDiagram.add_nodeand raises an ImportError with the upgrade line; the extra is pinneddiagramboxes (>=0.15.1). Tests:boxes_view_test.py::TestDiagramboxesVersionGuard(2; the file is 71 green with diagramboxes 0.18.5).
0.99.0 (2026-10-28)¶
- Variation / variant / abstract round-tripping (the
SysML-v2-Release Vehicle Example, "SysML v2 Spec Annex A
SimpleVehicleModel.sysml"): the usage-level
abstract/variationref-prefixes were parsed but dropped (a bareabstract part familyproduced NO prefix dict at all) and everyvariant part/attribute xmember inside a variation body was silently dropped — the same silent-loss shape as the earlier message-in-body bug. Fixed end to end: the ref-prefix extractors now carryisAbstract/isVariationfor both the occurrence and usage dict paths; the definition/usage body walkers dispatch theVARIANT variantUsageElementalternative through a newVariantUsageMemberwrapper (grammar class + dump emitsvariant); the semantic model carriesis_variant/is_variation/is_abstracton Usage elements, and the dumps re-emit the keywords so parse -> dump -> reparse is stable. - Helper functions:
Usage.variants()— the variant members of a variation;Usage.variant_types()— the types referenced byvariant part x : Tmembers, resolved against the model tree (mirrors the corpus'variant part transmissionAutomatic:TransmissionAutomatic). - Known pre-existing (unchanged): the Annex A full-dump reparse
still fails at 0.98.0 — value parts concatenate
(
massActualdefault 0[kg]) and bind connectors serialize as[1] to ... [1]— tracked separately from this change. - tests/variation_variant_test.py: 9 tests incl. the corpus file.
0.98.1 (2026-10-28)¶
- Interchange export keeps
:>>redefinitions/typing on unnamed end features (PR #18): anallocation defre-exported throughto_interchange/dump()dropped the end redefinition/typing and the dump reparse failed; the ANTLR dict builder (_make_end_feature_usage_dict) now extracts specialization from the direct featureDeclaration too (via_build_full_specialization_from_fsp, the typings/redefinitions/ subsettings/references builder) and merges in textual order. Regression:tests/interchange_test.pyTestAllocationEndExport(round-trip, dump content, dump reparse, CLI exit code). - Includes 0.98.0 (the interaction def/usage grammar fix + the message ends/payload carrying).
0.98.0 (2026-10-28)¶
- Interaction definitions/usages parse (the
interaction defrule). The generated grammar'sinteractionrule (typePrefix INTERACTION classifierDeclaration typeBody) rejected everyinteraction def X { ... }form (and even a bareinteraction T;) - the rule now follows the part/occurrence shape:interactionDefinition : occurrenceDefinitionPrefix INTERACTION DEF definition+interactionUsage : occurrenceUsagePrefix INTERACTION usage, dispatched indefinitionElement/structureUsageElement; the parser regenerated with the bundled 4.13.2 jar.
0.97.1 (2026-10-16)¶
0.97.1 (2026-10-16)¶
- Boxes action-flow view: v2-native glyphs (with diagramboxes
0.15.x-0.17.x): action usages/definitions render as chamfered
octagons and succession starts as the solid v2 start diamond;
named succession statements (
succession s1 first start then b;) bind their keyword ends (start/done/terminate) to the control primitives, parented to the anchor action's owner box. Duplicate flow/succession edges from wrapper re-collection are deduped (_edge_once). Example:examples/v2_action_flow_poc.py(validated 10/10 against the Intro deck's providePower figure). - Fixes the stale
__version__string (shipped 0.96.4 inside the 0.97.0 wheel).
0.97.0 (2026-09-30)¶
- CI integrations: GitHub Actions, GitLab CI, pre-commit (new
sysmlpy cisubcommand). One engine (src/sysmlpy/ci_check.py) behind every integration, one exit-code contract: 0 clean, 1 findings at/above the failure level (parse failures always block), 2 operational error. - Parse gate (blocking, always on): every
.sysml/.kermlfile must parse (.kermlvia the KerML grammar). Syntax errors carryfile:line:col. - Semantic gate (advisory by default,
--semantic strictopt-in): findings are reported and labeled, but never fail the check by default — the bundled standard library is symbol-indexed, not model-loaded, so re-export facades (ISQ) and unit usages (SI::*,kg,['m/s²']) are known false-positive classes (28/71 valid-corpus files). Promote per-codebase once clean; theknown_limitationflag in JSON output identifies the classes. - GitHub reusable workflow
.github/workflows/sysml-check.yml(uses: mycr0ft/sysmlpy/.github/workflows/sysml-check.yml@vX.Y.Z) with DFA-cache restore for fast re-runs; also dogfoods on this repo's pushes/PRs (gating the bundled library + showcase fixtures). - GitLab template
.gitlab/sysml-check.gitlab-ci.yml(include: project: mycr0ft/sysmlpy, file: .gitlab/sysml-check.gitlab-ci.yml, extend.sysml-check). - pre-commit hooks
.pre-commit-hooks.yaml(sysmlpy-ci,sysmlpy-parse) — commit-time checks on changed files. - Docs:
docs/ci-integration.md(full options + promote-to-strict path); README CI section. Tests:tests/ci_check_test.py(25). -
Visitor fix: named multiplicity bounds (
[nCauses],[wallNumber]) — two of the three_make_boundcopies inantlr_visitor.pycalledint()on the bound text and crashed (invalid literal for int()) on non-numeric bounds; both now emit aFeatureReferenceExpressionlike the third copy. Found by dogfooding the new CI gate on the bundled library:CausationConnections.sysmlandShapeItems.sysmlnow parse (previously crashed at load). -
qn_registry()(P3 Vee-join side table). Everyto_interchange(stable_ids=True)document now carries"#qn_registry": deduped declared-QN path → stable@id(Identification nodes; doc-carried explicit ids included), readable with the new public helper of the same name — downstream consumers (pyoslc STEP domain) join SysML elements by qualified name without re-deriving hash chains. Empty for position-id exports. The registry is stable across export→import→export, survives JSON round-trips, and reconcile_ids adoption remaps it alongside the graph refs. Pinned bytests/qn_registry_test.py(11).
v0.96.4 (2026-09-30)¶
doc_ids=Trueonto_interchange(Phase 2b, L3 explicit identity) —doc /* @id: … */comments inside an element's own braces fix its interchange@id(impliesstable_ids): never re-minted over, surviving any edit (ancestor renames, re-nesting, cross-file moves) because the carrier rides the source text. Duplicate claims of one id raise at export. Placement contract (inside braces vs sibling-level bubbling) pinned by tests; end-to-end verified export → dump → re-parse → export. Scope record:docs/stable-identities.md§4 Phase 2b; demo:examples/element_identity.pysection 6.reconcile_ids/to_interchange(reconcile_with=...)carry forward from v0.96.3 (L3 registry reconciliation).
v0.96.3 (2026-09-28)¶
- Stable element identities across edits (L2 + L3 idempotency).
to_interchange(stable_ids=True)/ CLIsysmlpy export --stable-ids: content-addressed@ids — named elements hash their declared qualified-name path + metaclass type, unnamed elements hash the nearest named anchor + structural path. Inserting/reordering unrelated elements elsewhere leaves untouched ids unchanged. Default (stable_ids=False) stays byte-identical to the v0.63.0 position scheme.reconcile_ids(document, registry)/ CLIsysmlpy export --reconcile-with model.json -o model.json: the previous export doubles as an id registry — name-matched elements adopt registry ids, so ids survive ancestor renames and re-nesting (injective (declaredName, @type) matching keeps documents collision-free; nested{"@id"}refs are remapped so reconciled documents import cleanly; the CLI one-liner is an idempotent fixed point after the first export).- New public exports:
reconcile_ids,STABLE_NAMESPACE,doc_ids=True(v0.96.4: explicitdoc /* @id: … */ids honored at export). - New demo:
examples/element_identity.py— all identity layers (parse uuid4, position uuid5, content uuid5, registry reconciliation) runnable end to end. - New docs:
docs/stable-identities.md(idempotency levels L0-L3, options analysis, design decision: declared-path not resolved-QN, Phase 1 + Phase 2 implementation records); README section "Element Identity: Stable Interchange IDs". - All gates green: interchange 59/59 (11 stable-id + 10 reconcile tests), fast suite 654 passed/1 skipped. (Grammar 168/168, XPect conformance 123/3 optional-dep skips, KerML 5/5 — unchanged from v0.96.2, untouched by this release.)
v0.96.2 (2026-09-28)¶
- Grammar upgraded to OMG release 2026-08 — the vendored ANTLR4
grammar is now daltskin/sysml-v2-grammar v2026.08.1 (upstream
14b0d7a), replacing the 2026.05.0 base + local patches. Includes upstream #11's flat precedence-correctownedExpressioncascade and upstream #16's required import visibility (bareimport X;is now aSysMLSyntaxError; useprivate/public/protected). - Non-normative forms removed (resolved against the OMG KEBNF and
the pilot KerMLExpressions.xtext with daltskin): bare qualified
identification (
subject SystemGateway::System_Driver;— use the typed formsubject : SystemGateway::System_Driver;) and connector-end trailing multiplicity (connect a[1] to b;— use the normative leading formconnect [1] a to b;). - Visitor: structured expression chains re-emitted from the flat
left-recursive parse tree (revived v0.52.0 splice machinery);
symbol-form
&/|operators structured; multi-segmentFeatureChainMember(one context, many name segments) fully captured so feature-chain type resolution reports the whole chain. ConnectorEndpreserves the normative leading cross-multiplicity and dumps it before the declared name.-
All gates green: grammar 168/168, fast suite 595 passed/1 skipped, OMG XPect conformance 123 passed/3 skipped (optional-dep skips), KerML batteries 5/5.
-
(empty — Phase 2b released in v0.96.4, registry reconciliation in v0.96.3)
v0.96.1 (2026-09-25)¶
- doc comments survive everywhere —
doc /* ... */on a package, on any part/item/port/action/... usage or definition, and inside interface bodies is captured as.docon the API object (previously silently dropped whenever the comment shared its body with siblings; only Requirement carried doc).dump()/classtree()re-emits the doc alongside the other body items, and re-parsing the dumped text keeps.docintact. New exampleexamples/doc_ends_flows.py - 11 tests (doc_ends_flows 5/5).
- interface ends captured —
end <name>;andend <name> ::> part.port;members of an interface body now parse intoInterface.ends(name/type/multiplicity) andInterface.iface_connections(the::>targets as feature-path strings); previously the ends stayed in the grammar layer only and.endswas always empty.end ::>targets are re-emitted through the References/OwnedReferenceSubsetting/OwnedFeatureChain specialization chain, so they survive a dump round-trip (and re-parsing rebuildsiface_connections). - fix: round-trip of interface usages emitted a spurious
connectkeyword —InterfaceUsageDeclarationmarked ANYpart1as the CONNECT form, but the visitor also emits an emptypart1for plaininterface x : T { ... }; the resultinginterface x: T connect {...}dump re-parsed with a syntax error. Theconnectkeyword is now only set when the binary part actually carries the CONNECT-form ends (grammar tests 165/165). -
flows — verified end-to-end (already working):
flow a to b;parses into aFlowchild of the owning part,dump()re-emits it, and the Interconnection View renders the flow edge. -
perf: DFA cache supersede -
save_dfa_cache()refused to update an existing cache file, so DFA states learned after the file was written (short-name<K>forms,[1..*] nonuniquemultiplicity chains, STRING short-names) were re-built by every fresh process: the OMG library files SI / ISQSpaceTime / MeasurementReferences / ShapeItems and Annex A SimpleVehicleModel took 60-200 s per parse. A strictly-warmer in-process cache now atomically replaces the file; after one absorbing run per construct family, all six slowest OMG files parse in 0.2-8 s per fresh CLI process. 2 new supersede tests (dfa_cache 16/16). - New loaders for package-less snippets:
loads_wrapped()/load_wrapped()wrap bare top-level SysML (OMGSimple Tests/ training-snippet style, e.g.part def Camera { ... }with no enclosing package) in a synthetic package and load normally. Content already carrying a top-levelpackage/standard library packagepasses through untouched.Model.load's documented strictness ("Base Model must be encapsulated by a package") is unchanged. The corpus sweep helper (parse_one.py) now uses the wrapped loader, eliminating the 3 package-less rejections from the OMG release-repo sweep (DecisionTest, ControlNodeTest, Camera).
v0.96.0 (2026-09-23)¶
KerML parsing, OMG-corpus hardening, and community contributions (external PRs #10/#11/#12/#13).
- New: KerML parser (
src/sysmlpy/kerml/) - ANTLR4 grammar generated from the OMG KerML textual-notation KEBNF (Systems-Modeling/SysML-v2-Release, 2026-08 checkout) via the daltskin generator in KerML-only mode, plusparse/parse_file/parse_to_dictand a SysML-shaped visitor-dict layer. 7 documented corpus corrections (generator dead-rule reverts, KEBNF-vs-example fixes) insrc/sysmlpy/kerml/README.md. Corpus: 130/130 .kerml files parse and extract non-empty structure (OMG examples 58, OMG kernel libraries 36, bundled kernel 36). KerML imports carry no visibility keyword (unlike SysML). Tests:tests/kerml_test.py(3 pytest tests over standalone batteries). - LibrarySymbolIndex parses .kerml files (was regex-scraping):
.kermlfiles now go throughparse_to_dict;.sysmlfiles keep the line-regex walk (shared as the parse-failure fallback). Library symbols 1,604 to 2,986; all 94 OMG.kermlfiles yield symbols. 3 regex-only names were false positives (keyword-collision infeature all ...and a doc-expression line). - fix:
connect [N]with leading multiplicity through interface ends -_visit_multiplicityreads throughownedCrossMultiplicity().ownedMultiplicity(). Found by categorizing the OMG corpus-sweep failures; the Annex A SimpleVehicleModel now parses fully (241 elements). - fix: Port definitions lost
is_definition(external PR #10) -Usage.load_from_grammar's__init__()reset cleared the flag; port defs rendered as<<port>>instead of<<port def>>. - IV: boundary ports (external PR #13) - ports render as PlantUML
native
portsyntax on the hosting part's boundary, declared and inherited. - IV: interface-usage connections (external PR #12) - interface
usages render as connection edges; top-level
connect-form and body-declaredend ... ::> part.portends, nested interfaces scoped to their containing part. - IV: binding connectors (external PR #11) -
bind p = A.p;is preserved in the public tree (was silently dropped) and renders as a thick binding edge between the referenced features. - fix: UseCase missing re-declaration chain fields - loading any
model with a use case crashed with
AttributeError(_specializes_namesuninitialized).
Corpus status: the OMG release-repo sweep (404 files) now has zero correctness failures; what remains is 5 slow-but-finite large library files (42-94 s, perf tuning candidate) and 3 package-less snippet examples rejected by the loader's intentional package-wrapper guard.
Markdown tables column-align in monospace (sysmlpy.mdtables).
Every markdown table sysmlpy emits now lines up pipe-for-pipe when viewed in a monospace font:
- new
src/sysmlpy/mdtables.py:pretty_markdown_tables(text)post-processes arbitrary markdown (re-pads every pipe table that has a GFM separator; everything else passes through untouched) andformat_table(header, rows, align)builds aligned tables directly. Widths follow the East Asian Width convention (Wide/ Fullwidth = 2, combining marks = 0, Ambiguous - including the satisfy check mark - = 1) and count escaped characters (\|) as the single character they render as; GFM alignment colons are preserved through re-padding (:--left,--:right,:-:center). - wired into every markdown emitter: all PlantUML grid views
(tabular, data-value, relationship matrix) via
_format_table_rows_markdown, the traceability report (to_markdown) andas_traceability_matrix_view. - fixed a latent matrix-structure bug the alignment work
surfaced:
as_relationship_matrix_viewdata rows carried the row-label element name as the first cell but the header lacked the label column, so every row had one cell more than the header and GFM renderers silently dropped the last column. The header now carries the label column; the matrix CSV gains it too (header and rows now have equal field counts).
Honest limits (docstring): alignment cannot hold for cells whose rendered width differs from the measured one - emoji and other beyond-BMP glyphs (ambiguous across terminal fonts) or cells with embedded newlines (which GFM tables cannot carry anyway).
Test updates: new tests/mdtables_test.py (10 tests); alignment-
sensitive exact-shape asserts in plantuml/traceability/cli/
spreadsheet tests updated to width-tolerant regexes; matrix CSV
test now asserts the label column and equal field counts.
v0.95.0 (2026-09-18)¶
Interactive REPL (sysmlpy repl), runtime-showcase fixtures, and four
silent-drop fixes found by them.
Inspired by Open-MBEE's OpenSysML REPL, built on machinery sysmlpy
already had. See docs/COMPARISON.md for the three-way contrast
(sysmlpy vs OpenSysML vs gosysml) that motivated the round.
- New tool:
sysmlpy repl(src/sysmlpy/repl.py, 28 tests intests/repl_test.py). Declarations accumulate into a session model with member-granularity merge (re-declared member replaces the prior one, other members kept,note:line reports the replacement — the semanticsipython_magic.pyhas carried since v0.64.0, now shared). Multi-line submissions continue on...>while brackets stay open; a non-declaration line falls back to expression evaluation. 19%commands:%list/%show/%dump,%eval/%set/ %bindings/%calc/%check/%values(evaluator, pint-aware),%sim/%send/%step/%state(simulator session),%view(all 8 views),%load/%save/%reset/%quit,%help; readline completion over commands and element names; UUID names filtered from qualified-name display. Session core is I/O-injectable and headless-testable (same pattern assim.run_tui). - Visitor:
exhibit stateno longer silently dropped. The grammar ruleexhibitStateUsagehad zero visitor handling — both spellings (exhibit state m { ... }andexhibit state m : M;) vanished from the visitor dict, the public tree,Model.dump(), the boxes view, and the simulator. Now emitted as a StateUsage dict withexhibit: True;StateUsagegrammar class carries/dumps theexhibitkeyword. Spacecraft-comms' dump went from lossy 1,177 chars to faithful 5,334. - Public-API:
state defin part/item def bodies no longer dropped (no dispatch arm in the Usage body walk) andperform action m : Mno longer dropped (no_load_behavior_childbranch; PerformActionUsageDeclaration keeps name/typing in.children, now extracted —perform action mission : LunarMission { in budget = Flight::budget; }round-trips and surfaces as an Action child). - Evaluator: KerML math built-ins
ln,exp,log,log2,log10added (pint-aware, dimensionless results) — motivated by the showcase's rocket equation; positional calc-arg binding unchanged. - New fixtures: the five OpenSysML runtime-showcase models copied
to
tests/fixtures/runtime_showcase/(Apache-2.0, attribution README; unchanged model text) withtests/runtime_showcase_test.py(18 tests). The evaluator reproduces OpenSysML's published showcase digits exactly (stage delta-v 3037.6966629706967 / 6432.955324716369 m/s, margin 70.65198768706614) and both showcase state machines build and drive. - Docs:
README.mdcommand table + REPL example;STATUS.mdCLI section + test map;docs/COMPARISON.md.
Test totals at this release: 1,368 fast + 123 conformance passing (8 skipped for optional deps not installed).
v0.94.0 (2026-09-16)¶
Relationship Matrix View: verify cells — the Vee's V side.
verify <req>; relationships now land as V cells, closing the
requirements loop in the cross-checking grid: satisfy (check) shows
that a part claims to meet a requirement, verify (V) shows that a
verification case demonstrates it.
- new
_extract_verifiesrecovers verify references from both placements: surfaced VerifyRequirementUsage wrappers (read directly, like satisfy) and members nested anywhere in a VerificationCase/Requirement grammar's definition dict (objectives included), recovered via an iterativeget_definition()walk; qualified references (verify P::req;) resolve to the last segment, so usage-level and definition-level verifications both reach the requirement's axis name - vocabulary gains
"verify": "V"; verify wrappers join satisfy/ allocation/connection usages in the cells-not-axes exclusion - 2 new tests (verify-in-definition-objective and qualified-ref-in-usage), 13/13 matrix tests, 158/158 plantuml_test.py