Skip to content

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

Open
devin-ai-integration[bot] wants to merge 16 commits into
developfrom
feat/qvts-query-result-view
Open

devin-ai-integration[bot] wants to merge 16 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 header, the exposed elements as the rows — and, with RenderViewRequest.form, as Markdown, HTML or AsciiDoc; MCP render_model_view takes form.
  • Clients. Go, Python and Java carry the view on results and on the typed failure, and take a document form on renderView; 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.

Merge of develop

develop is merged in twice, each time to resolve a conflict. The first: its objective and body-constraint export change re-recorded the API JSON and structure differentials that this branch's eleven example models also move. The second: internal/frontend/mcp/catalog/catalog.go and the sysml-mcp man page conflicted with the MCP scopes change, and the API JSON baseline this branch re-records became per-file fragments under docs/project/api-json-differential/.

After the second merge the API JSON fragments, the pilot differential baseline and the derived-property census are re-recorded over the merged tree. Only the examples root moves (56 to 67 files, by the eleven examples/qvts files' own elements; 946 files, 106047 elements matched in the API JSON differential) together with the OpenSysML Libraries provenance (16 to 17 files). In the census every count of the examples root grows or stays, and the summary and the silent list are unchanged; scripts/rebaseline-movement.py reports those census records as not explained by the merge because this branch had not recorded the census before.

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 16 to 17.

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 (935 files, 535 agreeing; 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) and the structure differential (117 rows, none added or removed; the examples root goes from 56 to 67 models).
  • Not green locally: make test as one race run. It timed out in internal/exec/runtime, internal/translate/export and tests/export; all three pass without the race detector.

Checklist

  • make test and make lint pass locally — make lint passes; make test 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 2 findings. Devin automatically fixed all 2 findings.

Fixed by Devin (2)
  • Failed query exposes another element — The frontier now keeps the element the step stopped at, and a name-only record is exposed only when its spelling picks one element; regression test covers 'a::b' beside a::b. Commit is local and goes out with the next push.
  • File naming comment exceeds two lines — The fileName Javadoc is now one line. Commit is local and goes out with the next push.

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>

This branch has not been deployed

No deployments
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