Skip to content

feat(qvts): write a query's answer as a QVTS::QueryResult view on every query surface - #2116

Merged
HuiJun merged 58 commits into
developfrom
feat/qvts-query-result-view
Nov 20, 2026
Merged

HuiJun merged 58 commits into
developfrom
feat/qvts-query-result-view

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

Every query surface can now write its answer as a QVTS::QueryResult view, and the Magic MDK plugin can write that view and render documents from Cameo.

  • Library. QVTS (Outcome, QueryResult) is vendored through the extension-library pin, with QVTS and QVTS::QueryResult in engine-contract.json.
  • Writer. internal/doc/queryexec/resultview.go is the one writer the surfaces share: a single view <name> : QVTS::QueryResult that exposes each selected element by qualified name (elements only, never copies of projected cells) and redefines query, source, outcome and provenance. An empty selection is Outcome::established; a path or model error writes pathError/modelError and exposes the frontier at elements and the findings' elements. A name the view's own scope, the library or an inherited feature would capture is exposed from the root (expose $::source::cabin;). The text is byte-for-byte the same for the same commit.
  • Surfaces. CLI -as-view <file|-> on -run-query, -run-inline-query and -query; REPL %run-query -as-view and %query -as-view; gRPC as_view on RunDocumentQueryRequest and QueryRequest, result_view on both responses, a QueryResultView detail on a failed query, all under the query_result_view capability; MCP query and run_document_query take asView. OSLC translator failures (an unknown property, for one) are now typed path outcomes, so the Query path writes a pathError view as the document-query path does.
  • Rendering. RenderView renders a QueryResult view — the four attributes as the repeated header, the exposed elements as the rows — and writes it as a document through the request's one form field: markdown, html or asciidoc on such a view, answered in RenderViewResponse.text like every other form. A form the view's kind does not write is INVALID_ARGUMENT; a document form needs both the render_view_form and query_result_view capabilities. MCP render_model_view takes form.
  • Clients. Go, Python and Java carry the view on results and on the typed failure, pass the document form through the same form option as any other renderView form and read it from text, and refuse html or asciidoc from a service that cannot write result views; the generated Node and Rust code is regenerated, and docs/reference/client-parity.md records what the remaining high-level clients lack.
  • Magic MDK. Run query writes the view beside the migration report (v1) or as a sidecar next to the project (v2), named by query; Render document… on a migrated DocumentQueries::Document, a v1 DocGen «Document» and a QueryResult view writes Markdown and HTML and opens the folder; the DocGen bridge RunQuery can emit the view text and render through RenderView, so a DocGen table and a rendered view agree.

Dependency

The pin points at the head of the unmerged library pull request Open-MBEE/OpenSysML-Extensions-Library#21. It has to merge first, and the pin then moves to the merged commit on this branch before this is merged.

Companion

The agent skills that describe these flags, RPC fields and client methods are updated in Open-MBEE/OpenSysML-MDK-Skills#14, which should merge after this.

Merge of develop

develop is merged in to resolve conflicts, most recently at 9d9b320bb1. The source conflicts were RenderView's form field, which develop introduced for the ordinary view forms and this branch now shares (above), the capability list, where query_result_view stays last, the Go client's Query, which keeps develop's capability checks and adds the one for as_view, and the Magic MDK Engine, which keeps develop's publication to a SysML v2 API server beside this branch's result views. The count baselines merge cell-wise through scripts/install-baseline-merge-driver.sh.

After the merge the API JSON fragments, the pilot differential baseline, the derived-property census and the structure differential are re-recorded by their tools over the merged tree under JDK 21. Against develop only the examples root moves (57 to 68 files, by the eleven examples/qvts files' own elements) together with the OpenSysML Libraries provenance (17 to 18 files): the pilot differential goes from 925 files, 528 fully agreeing to 936 and 539 with every diagnostic count unchanged, and the API JSON differential from 936 to 947 files, 109597 to 110219 matched elements. training_examples_expected.txt is untouched.

Specification basis

Open-MBEE/qvts docs/qvts-core.md: §2 (the outcome of a query: a value, a path error, a model error, and the frontier), §3.4 (determinism), and examples/QVTS.sysml / examples/result.sysml for the view's shape. examples/result.sysml is carried under examples/qvts with attribution and parses and renders against the shipped library. No row of docs/project/spec-compliance/ changes verdict; the extension-library counts move from 17 to 18.

How it was verified

  • go build ./..., go vet ./..., gofmt -l . (empty), make lint, make proto-lint, make changelog-check, make docs-counts, make man-check, make extension-libraries-pin-check.
  • go test ./internal/doc/... ./internal/ir/... ./internal/frontend/... ./tests/grpc/... ./tests/hygiene/... ./cmd/sysml ./tests/kpar ./internal/workspace/...: unit tests of the writer (CabinMass, EmptySelection, MissingMassProject, MisspelledName, duplicate names, root-qualified exposure), CLI and REPL goldens, gRPC conformance including the OSLC success and unknown-property cases over examples/qvts/lander.sysml, recorded expectations under examples/qvts/expected, and the MCP tools.
  • mvn -f client/java/pom.xml -pl :opensysml -am verify -Dopensysml.requireService=true and install -DskipTests; mvn -f editors/mdk/pom.xml verify (plugin, bridge and OpenApiFloorTest); the Python client's pytest (1633 passed).
  • Baselines, each movement adjudicated before re-recording: both pilot differentials (only the eleven examples/qvts files and the library file are new, no existing verdict moved), both corpus round-trip ratchets (eleven new stable entries), the derived-property census and the structure differential (the examples root goes from 57 to 68 models). pilot-diff -check, pilot-apijson-diff -check and derived-census -check -require-exporter reproduce them.
  • The race suite over every package but internal/exec/runtime, internal/translate/export and tests/export, which run without the race detector; the tools module under -race; the Rust client's fmt, clippy, workspace tests and conformance; tests/wasm, every binary under its budget.

Checklist

  • make test and make lint pass locally — the race suite as described above
  • 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/1cb9400fae2e41888d76085f38572ba4
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/1cb9400fae2e41888d76085f38572ba4?variant=devin
Requested by: @HuiJun


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 9 commits November 10, 2026 18:04
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…entries

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

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…cuments from Cameo

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…d MDK surfaces

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ry and the result-view examples

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

The catalog classifies -as-view and the capability, render_model_view takes a
document form, and the figures that count the bundled libraries follow the
seventeenth: the manual pages, the self-model, the kpar install test, the two
round-trip ratchets and both differential baselines (digest only).

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

An element whose first segment is the view's name, a QVTS name the view
imports or a feature QueryResult inherits is written `expose $::…`. The
structure differential is re-recorded for the eleven new example models.

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

devin-ai-integration Bot and others added 5 commits November 10, 2026 22:51
develop's objective and body-constraint export change and this branch's
eleven example models both moved the two baselines; they are re-recorded
over the merged tree.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ted name holding :: stays one segment, and an element under an unnamed owner is counted, not exposed

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…query joins a name that is not plain

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…haring its name — the frontier keeps the element where a quoted name makes two share a qualified name

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

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 findings. Devin automatically fixed all 3 findings.

Fixed by Devin (3)
  • Inherited result headers render as blanks — statedValue now falls back to the nearest supertype that binds the attribute; tests/qvts TestResultViewHeaderIsInherited covers it.
  • Successful query response shape is misdocumented — docs/reference/api.md now says the successful result_view is a string and only the error detail is a QueryResultView.
  • New comments exceed the repository limit — The eight new comment blocks under editors/mdk are trimmed to two lines; the Java client's Javadoc keeps that module's @PARAM convention.

View findings in Devin Review · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 2 commits November 11, 2026 06:54
develop split the api-json differential baseline into per-file fragments and gave every MCP
catalog tool a scope; both met this branch's re-recorded baselines and its as-view flag on the
query tool. Generated baselines in conflict took develop's side and are re-recorded next.

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

The API-JSON fragments, the pilot differential and the derived-property
census take the eleven examples/qvts files and the QVTS library; only the
examples root and the OpenSysML Libraries provenance move.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot and others added 7 commits November 13, 2026 19:42
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…sult-view

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

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot and others added 17 commits November 19, 2026 22:59
…sult-view

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…a-owning-membership-native

Conflicts:
- internal/semantic/semantics/annotations.go: the member, ownedMember,
  feature, ownedFeature and ownedElement views keep develop's flow-end
  feature and constraint result members and this branch's prefix-first
  order and FeatureMembership filter.
- internal/translate/export/testdata/structure_differential_expected.txt:
  re-recorded on the merged tree.

With the prefix a member, the nested*/owned* usage collections follow
their two derivations on both evaluators: nestedMetadata and
ownedMetadata select from ownedMember, every other one from ownedFeature
(deriveUsageNestedMetadata, deriveUsageNestedUsage and the Definition
pair). The derived census and the api-json differential are re-recorded
for it, and the comments this branch touches are cut to two lines.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
The structure differential expectation took develop's side where the cell-wise merge refused; it is re-recorded on the chain head.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…metadata-owning-membership-native

The reflective member views keep both the leading prefix metadata and the synthesized members.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Source conflicts keep both sides: the capability list ends with coordinate_frame_values then query_result_view. The census records and the differential index merged cell by cell; the census baseline, the structure differential and the protobuf stubs took develop's side, the stubs regenerated.

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

The census records and the differential index merged cell by cell.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… on the chain head

The derived census moves one record, Usage::nestedItem over manual-examples (ours.value 37 to 36, ours.empty 748 to 749; the pilot answers 36). Seven api-json fragments move a bucket each, three kerml-examples fragments are restored from a textual merge, and the structure differential is re-recorded over the merged tree.

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

The census records and the differential index merged cell by cell; no source file conflicted.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
… on the chain head

The differential, the derived census and the structure differential move in the examples root alone, which gains the QVTS result-view models. The census was re-recorded against the live pilot because the recorded pilot column does not hold the new models. The record adjudicates the LiteralString result gap, which enters the launch-ready rows, as the LiteralInteger one.

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

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot added a commit that referenced this pull request Nov 20, 2026
… baselines for the self-model query path after merging develop and #2116

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to invalid changes in the merge commit Nov 20, 2026
@HuiJun
HuiJun added this pull request to the merge queue Nov 20, 2026
Merged via the queue into develop with commit bd572ad Nov 20, 2026
35 checks passed
@HuiJun
HuiJun deleted the feat/qvts-query-result-view branch November 20, 2026 23:20
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