feat(edit): add member modifiers, satisfy usages and requirement constraints to ApplyEdits - #611
Merged
Merged
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
This was referenced Sep 26, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Closes #595, #596, #597, #598, #603 and #604, and covers the authoring half of #605.
ApplyEditscould add a named declaration but not the modifiers, redefinitions, parameters, results, satisfy statements or requirement constraints these models need.add_membergainsabstract,redefines,defaultanddirection, plus the SysMLrefandreturnkinds. An empty name withredefineswrites the:>> xshorthand;returnmay be unnamed when it has a type or multiplicity.add_satisfywrites[assert] [not] satisfy <requirement> [by <feature>];.add_requirement_constraintwritesrequire|assume constraint [name] { <expr> }, and the expression must parse as one expression.satisfy_authoring(arm 7),requirement_constraint_authoring(arm 8), andmember_modifiers(newAddMemberEditfields or theref/returnkinds). All of them also needauthoring. An older service would drop the unknown fields or decode the new arms as unset, so the service and the Go, Python and Java clients refuse unless the capability is advertised.add_member(..., abstract=False, redefines=None, default=False, direction=None),add_satisfy(owner, requirement, by=None, asserted=False, negated=False),add_requirement_constraint,add_require_constraint,add_assume_constraint,add_parameter(owner, direction, name, type=None, kind="ref"),add_return,add_succession, and typed helpers for action, state, constraint and requirement kinds. Go and Java get the matching fields andAddSatisfy/AddRequirementConstrainttypes.make proto.Example:
add_parameter("Demo::Energy", "in", "power", type="ISQ::PowerValue")thenadd_return("Demo::Energy", type="ISQ::EnergyValue", value="power * duration")writesin ref power : ISQ::PowerValue;andreturn : ISQ::EnergyValue = power * duration;.Specification basis
Every written form is a production of the pinned SysML v2 pilot grammar. The edit layer refuses placements the grammar does not admit, even where analysis would accept them:
abstractusesBasicDefinitionPrefix/RefPrefix, so it is refused onenum def(EnumerationDefinitionhas no prefix), onmetadatausages, and on subject, actor, stakeholder, objective, control-node and return members. Direction follows the same rule and is written beforeabstract.default = visFeatureValue'sisDefaultform.redefinesapplies to usages only, and definitions keepspecializes.returnis aReturnParameterMember, admitted only byCalculationBody(calc and constraint) andCaseBody. It is refused in action, part and requirement bodies (actions useout), and at most one per body.return <expr>;is never written.satisfyis aSatisfyRequirementUsage, aBehaviorUsageElement, so it is admitted in packages and in any body that admits usages. It is refused in enumeration and metadata bodies and in KerML.require/assume constraintis aRequirementConstraintMember, admitted only inRequirementBody(requirement, concern, viewpoint, objective and satisfy).How it was verified
go test ./internal/check/edit/... ./internal/syntax/parser/... ./internal/frontend/grpc/... ./client/opensysml/... ./tests/grpc/...andgo test -C tools ./cmd/conformance/.... New tests cover each written form, including clean reanalysis, and each refusal above. They also cover the capability gates, where the service refuses without the dedicated capability and each client refuses before sending.OPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1. No baseline changed.test_edit.py/test_wire_compat.py: 115 passed, 0 skipped, including live round trips againstsysml-grpc.08-apply-edits.json.make lint,make docs-check,python3 scripts/changelog.py check,make proto-lint proto-breaking(additive only).Checklist
make testandmake lintpass locally (make lintand the focused suites above; the fullmake testis left to CI)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (no gate count moved)F4,K5) in the body, docs, or changelog