Repository navigation
feat(self-model): model the QVTS query path and use it in the architecture document - #2048
Merged
Merged
Conversation
Add examples/self-model/queries.sysml (OpenSysMLQueries): the DocumentQueries library and the plan operations the compiler binds its calc defs to, the executor and its outcome record (step kinds, constraints, StepOutcome), the surfaces a query is run from, the QVTS recordings as a conformance oracle, the outcomesAreDistinct invariant and the toolchain's satisfactions. Move QueryCompiler/QueryExecutor there from surfaces.sysml, append a "Queries and outcomes" section of real Tree/Differ/Verdicts/RelatedElements/WhereType queries to document.sysml with three views, and read every stated fact back from the implementation in examples/self_model_queries_test.go. Describe the path in docs/internals/architecture.md and re-record both pilot differential baselines for the new file under examples/. 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)".
|
…ueries in the query path Frontier members and features are Member and FeatureRef records and nearest a single spelling; the service bounds a QueryOutcome detail to failureLimit failures or findings and frontierLimit entries per frontier list, each with its whole count, read from docquery.go and the protobuf descriptors. Every surface also runs a query written inline (-run-inline-query, %run-query inline, inline_query under the inline_document_query capability), and the QVTS oracle holds 27 recordings. Co-Authored-By: jason.han <hanhuijun@gmail.com>
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>
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>
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>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…-qvts 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>
… path The examples root gains queries.sysml (57 models); the query-library test's doc comment is two lines. 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>
…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>
… baselines for the self-model query path after merging develop and #2324 Co-Authored-By: jason.han <hanhuijun@gmail.com>
…metadata-owning-membership-native
… 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>
Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # .agents/skills/testing-pilot-corpora-gate/SKILL.md # .agents/skills/testing-pilot-differential/SKILL.md # .agents/skills/testing-pilot-execution-referee/SKILL.md # .agents/skills/testing-pilot-xpect/SKILL.md # README.md # docs/internals/architecture.md # docs/project/api-json-differential/examples/self-model/surfaces.sysml.json # docs/project/api-json-differential/index.json # docs/project/pilot-differential-baseline.json # docs/project/pilot-differential.md # internal/semantic/metamodel/derived_census_baseline.json # internal/translate/export/testdata/structure_differential_expected.txt
… baselines for the self-model query path after merging develop and #2116 Co-Authored-By: jason.han <hanhuijun@gmail.com>
…uery path Co-Authored-By: jason.han <hanhuijun@gmail.com>
…rty-two QVTS recordings The executor's Frontier carries an unexported element symbol as its own bookkeeping; the self-model's attribute defs mirror a record's exported fields, so the consistency test walks those only. The QVTS oracle holds thirty-two recordings now; the model says so. Census, pilot and api-json baselines re-recorded by their tools: the examples digest moved, no cell. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ry-result-view Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks done
github-merge-queue
Bot
removed this pull request from the merge queue due to invalid changes in the merge commit
Nov 20, 2026
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 21, 2026
…ucture Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential.md # docs/project/api-json-differential/examples/self-model/document.sysml.json # docs/project/api-json-differential/examples/self-model/queries.sysml.json # docs/project/api-json-differential/examples/self-model/surfaces.sysml.json # docs/project/api-json-differential/examples/self-model/views.sysml.json # docs/project/api-json-differential/index.json # docs/project/api-json-differential/pilot-examples/Cause and Effect Examples/CauseAndEffectExample.sysml.json # docs/project/api-json-differential/training/20. Assignment Actions/Assignment Example.sysml.json # docs/project/pilot-differential-baseline.json # internal/doc/queryexec/elementids.go # internal/semantic/metamodel/derived_census_baseline.json # internal/semantic/semantics/annotations.go # internal/semantic/semantics/flow_ends.go # internal/semantic/semantics/reflective_annotations.go # internal/semantic/semantics/reflective_memberships.go # internal/semantic/semantics/reflective_memberships_test.go # internal/translate/export/api_json_symbol_structure_test.go # internal/translate/export/testdata/structure_differential_expected.txt # tests/export/testdata/convert/irregular_layout.golden.ttl.sha256
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.
Chained behind #2116. This branch contains
refs/pull/2116/head60e19cf (the predecessor in the baseline lane, now in the merge queue; it carries #2280 26ba873 and #2324 92e8c43) andorigin/develop57da054 (#2002 and #2432, where this branch's expression typing landed, have merged); one merge base against each.What and why
The architecture self-model (
examples/self-model) knew the query path only as two part defs,QueryCompiler(immutablePlans) andQueryExecutor(orderedRows), insurfaces.sysml, while the implementation has grown QVTS — Query, View, Transformation for SysML v2: theDocumentQuerieslibrary,queryplan,queryexecwith its outcome record, four surfaces and a recorded example suite. This PR models that path and makes the self-model's own document use it.examples/self-model/queries.sysml(new, packageOpenSysMLQueries):QueryLibrarywith the twenty-six calc defs ofDocumentQueriesand the twenty-two plan operationsqueryplanbinds them to (oneLibraryQuerypart each),QueryCompilerandQueryExecutor(moved here fromsurfaces.sysml), the outcome record field for field (Step,Frontier,Failure,Finding,PathError,ModelError,Outcomeas attribute defs;StepKind×10,OutcomeKind×3 andModelConstraint×5 as enum defs),StepOutcome— a state def by which a step answers a value, a path error or a model error (model error outranks path error; a tolerated miss is a value), the fourQuerySurfaces (-run-querywith exit status 2 andchecks[].outcomeunder-json,%run-query,RunDocumentQuerywith theQueryOutcomedetail, a documentTable),QvtsOraclebeside the other conformance oracles (referenceOpen-MBEE/qvts, baselineexamples/qvts/expected, gating), the invariantoutcomesAreDistinct, andsatisfy requirement … byassertions of the twenty existing invariants on the parts that are their subjects, soVerdictscan table them.surfaces.sysml: only the two moved part defs and theDocumentPipelineblock (now typed fromOpenSysMLQueries, with aQueryPlanflow from the compiler to the executor).document.sysml: a new "Queries and outcomes" section whose seven tables are real queries over the model —Treeover the document pipeline's parts,Differkeyed by name between the toolchain's and the query path's code units,Verdictsover the toolchain and the query path,RelatedElementsalong specialization,WhereType(exact = true)over the step kinds, and two projections — plus two diagrams.views.sysmlgainsqueryPath,stepOutcomeandlibraryOperations, appended at the end.queries.sysmlrow, a "Run a query over the model" section with a real-run-queryrecording, and the nine-files / twenty-one-invariants / forty-three-views counts.docs/internals/architecture.mdgains a "Queries and documents" subsection pointing at the design note and the guide.examples/(pilot-diffandpilot-apijson-diff); the quoted figures indocs/project/pilot-differential.md,docs/project/api-json-differential.md,README.md,docs/internals/architecture.mdand the four.agents/skills/testing-pilot-*/SKILL.mdfiles restated to match, with a round paragraph in each differential record.queries.sysmlis read clean by the pilot; the seven new pilot-only rows are thekind-mismatchwarning the pilot already gives the document's existing table bindings.Develop and lane merges, re-recorded baselines
Merged
origin/developfe073d0,refs/pull/2324/headc8659fb,origin/develop8a7f51e,refs/pull/2324/head92e8c43,origin/develop0e0f08a andrefs/pull/2116/headee07f91, each--no-ffwith the cell-wise baseline driver andmake stdlib-snapshotafter it. Generated conflicts (the self-model api-json fragments andindex.json,pilot-differential-baseline.json,derived_census_baseline.json,structure_differential_expected.txt) took the develop/predecessor side; the quoted pilot-differential figures inREADME.md,docs/internals/architecture.md,docs/project/pilot-differential.mdand the fourtesting-pilot-*skills were resolved to the predecessor's text with the combined figures, and the two re-record paragraphs ofdocs/project/api-json-differential.mdwere both kept. Re-recorded by tool only what-checkrefused, each time for the same cause —examples/self-model/queries.sysmlis one more file underexamples/: the structure differential (theexamplesroot alone),derived-census -update(theexamplesroot's totals and records, no per-rule movement),pilot-diff -update(937 files, 540 fully agreeing, 126 only ours, 2458 only the pilot's: the new file reads clean and the seven new table bindings carry thekind-mismatchwarning the existing ones already had) andpilot-apijson-diff -update(the nineself-modelfragments andindex.json, nothing else: 948 files, 110420 → 112401 elements matched, present-equal 2234290 → 2276244, present-different 162796 → 165367, ours-missing 187345 → 190133).LiteralString.resultentered the launch-ready top 25 with the new literals and is adjudicated as theLiteralIntegerrow is. The convert goldens and the gRPC library table reproduce;training_examples_expected.txtis untouched.How it was verified
examples/self_model_queries_test.go(new) reads every stated fact back from the implementation: the calc defs andNON-NORMATIVEmarker from the library file, the bindings fromqueryplan/compiler.goand theOperationconstants fromplan.go, the step kinds, constraints and record fields fromqueryexec(by source and reflection), the outcome kinds fromOutcome.Kind(), the-run-queryflag,cmdRunQuery, theRunDocumentQueryRPC andQueryOutcomemessage fromusage.go,meta.goand the protobuf descriptors, the oracle's paths and recording count from disk, the invariant throughEvaluateRequirement, and the rendered section's tables for rows.go build ./...,go vet ./...,gofmt -l .(empty),go test -count=1 ./examples/ ./tests/hygiene ./tests/qvts,go test -C tools ./referee/...,make self-model(renders the three new views and the document),sysml examples/self-model/*.sysml -validateclean,scripts/check-doc-links.py,scripts/check-doc-figures.pyandscripts/changelog.py check.Checklist
make testandmake lintpass locally (the gates above; full suite in CI)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/8065da5282134d858dc95570144d001e
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/8065da5282134d858dc95570144d001e?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work