Skip to content

fix(grpc): GetElementProperties reads a model one document at a time - #2052

Closed
devin-ai-integration[bot] wants to merge 25 commits into
feat/element-properties-symbol-structurefrom
feat/element-properties-per-document
Closed

devin-ai-integration[bot] wants to merge 25 commits into
feat/element-properties-symbol-structurefrom
feat/element-properties-per-document

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Fixes #2029

Stacked on #2042 (base branch feat/element-properties-symbol-structure); retarget to develop once that merges.

GetElementProperties answered the same error for every element of a model when any one document had a syntax error or declared a top-level name another document also declares. It now reads the model one document at a time.

What the RPC reads and how refused documents are reported

  • The RPC reads the symbol-backed metamodel.SymbolStructure (feat(grpc): GetElementProperties reads the symbol-backed metamodel structure #2042). CachedModel.documentExclusions (internal/frontend/grpc/element_properties.go) lists, in document order, each document the model is read without: one convert.SyntaxErrorOf refuses (the parser could not read it whole), and one declaring a top-level name an earlier document already declares (Index.TopLevelBindings; the earlier declaration stays readable, the later document is excluded — the same declaration Convert refuses the model for). A validation error alone (an unresolved reference) excludes nothing.
  • A request for an element of an excluded document answers that document's error in error; a request for any other element is answered. Every response carries excluded_documents (new field 4, ExcludedDocument{document, error}, wire-compatible), empty when the whole model was read, so a client can tell a complete model from a partial one.
  • Convert keeps its whole-model contract untouched.

Clients

  • Go: ElementProperties.ExcludedDocuments []ExcludedDocument.
  • Python: ElementProperties.excluded_documents; ConversionError is raised only when the requested element's own document is excluded and carries excluded_documents as (document, error) pairs.
  • TypeScript: ElementProperties.excludedDocuments.
  • Java: the generated ExcludedDocument message and getExcludedDocumentsList() on GetElementPropertiesResponse (message classes are generated by the Maven build from api/proto/sysml.proto).
  • Go, Python, TypeScript and Rust stubs regenerated (make proto).

Specification basis

No new clause: the documents left out are exactly the declarations Convert already refuses a whole model for (a document the parser could not read whole; two documents minting one element id). No compliance row moves.

How it was verified

  • internal/frontend/grpc/element_properties_documents_test.go: a syntax error in another document, a top-level name declared again by a later document, and a validation error only.
  • internal/frontend/grpc/element_properties_corpora_test.go: the reporter's reproduction — examples/pilot-corpora and examples/sysml-v2-training loaded as one model (313 documents, 12 excluded for duplicate top-level declarations); 8,775 elements answered, the 50 of excluded documents answer their document's error.
  • Python: client/python/tests/test_element_properties.py decodes excluded_documents and checks ConversionError.excluded_documents.
  • go build ./..., go vet ./..., gofmt -l ., go test ./... on the pushed head.

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/e543991fdf9549d7b1dd87e0695bae23
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/e543991fdf9549d7b1dd87e0695bae23?variant=devin
Requested by: @HuiJun


👀 Devin fixed 2 findings · 1 finding for you to triage · Follow Devin's work

Devin Review

Re-stack on #2042's merged head

  • Merged feat(grpc): GetElementProperties reads the symbol-backed metamodel structure #2042 at b1d029d2d5 (develop e074d3f40c and 480c3f4f5e in). Conflicts: internal/frontend/grpc/element_properties.go (symbolIDs keeps its excluded-documents parameter), the GetElementProperties row of docs/project/spec-compliance/08-grpc-service-layer.md (develop's Query row beside this PR's row), and the generated Node, Python and Rust stubs, regenerated with make proto.
  • The excluded_documents proto comment fits two lines; it keeps the KerML clause citations and the pilot's behaviour, and the compliance row carries the full basis.
  • Client suites on the pushed head: Rust 152 passed (library_members_are_listed_on_request fails locally, also on develop locally, green in CI); Node 482 passed, 0 failed; Java install with the service required passed; Python 1771 passed, 6 known local failures (4 unnamed-metaobject identity tests that fail on develop locally too and are green in CI; 2 test_version two-checkout artifacts).

devin-ai-integration Bot and others added 2 commits November 7, 2026 20:57
A document the parser could not read whole, or one declaring a top-level
name an earlier document already declares, is left out of the model and
reported in the response (excluded_documents) instead of refusing every
element of every document. An element of an excluded document answers
that document's error; any other element is answered. The Go, Python and
TypeScript clients surface the excluded documents.

Fixes #2029

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… documents

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot and others added 14 commits November 7, 2026 21:09
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ment-properties-per-document

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	client/python/tests/test_element_properties.py
#	internal/frontend/grpc/element_properties.go
…ment-properties-per-document

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	api/proto/sysml.pb.go
#	client/node/src/generated/sysml_pb.ts
#	client/python/opensysml/proto/sysml_pb2.py
#	client/rust/conformance/sysml.descriptor.binpb
…ment-properties-per-document

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	internal/frontend/grpc/element_properties.go
…ment-properties-per-document

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	client/rust/conformance/sysml.descriptor.binpb
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review November 9, 2026 15:28
…declarations

documentExclusions counted the top-level declarations of a document it had
already refused for a syntax error, so a valid later declaration of the same
package was refused too, and it keyed collisions by every binding name, so a
package sharing only a short name with another was refused although their ids
differ. Bindings of refused documents are skipped and only the primary name,
which mints the id, is compared.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 3 commits November 9, 2026 16:35
GetElementPropertiesResponse gained excluded_documents, and the Rust client's
ergonomic layer did not carry it: ElementProperties now lists the documents
the model was read without as ExcludedDocument {document, error}, the
conformance runner writes them back to the wire, and the decoding test covers
one. Without the field the client's test and conformance crates did not
compile against the regenerated wire types.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…'s element

GetElementProperties keeps a value that points into an excluded document
rather than dropping or marking it: the derived properties it answers
(KerML 8.3.3.3 Feature::type, 8.3.3.1 Type::inheritedMembership, 8.2.3
Namespace::member) are defined over the whole model, and the pilot keeps a
partially parsed file's elements the same way. A request for such an
element answers its document's error, and excluded_documents says why the
document is unavailable. Stated on the proto field and in the
GetElementProperties compliance row; stubs regenerated (comments only).

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tructure' into feat/element-properties-per-document

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	docs/project/spec-compliance/08-grpc-service-layer.md
…tructure' into feat/element-properties-per-document
…tructure' into feat/element-properties-per-document
devin-ai-integration Bot and others added 2 commits November 9, 2026 23:18
Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	client/node/src/generated/sysml_pb.ts
#	client/python/opensysml/proto/sysml_pb2.py
#	client/rust/conformance/sysml.descriptor.binpb
#	docs/project/spec-compliance/08-grpc-service-layer.md
#	internal/frontend/grpc/element_properties.go
The clause citations and the pilot's behaviour stay in the comment; the
GetElementProperties compliance row carries the full basis. Stubs regenerated.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Superseded by #2424 (merged), and carried by #2042: restacked on #2042's head the tree is identical, so nothing is left to add here.

Written by Devin

@devin-ai-integration
devin-ai-integration Bot deleted the feat/element-properties-per-document branch November 23, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant