Skip to content

fix(queryexec): the missing-feature fan-out keeps every element lacking the feature; the ambiguousName finding names the owning namespace - #1586

Merged
HuiJun merged 9 commits into
developfrom
feature/query-fanout-failures
Oct 27, 2026
Merged

HuiJun merged 9 commits into
developfrom
feature/query-fanout-failures

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Two alignments of the native QVTS record with the reference semantics in Open-MBEE/qvts, both surfaced by its three-way differential (make native, Open-MBEE/qvts#7; Lean vs SPARQL image vs native), plus a record-figures fix the full tier exposed:

  1. Fan-out keeps every failing element. Project/WhereFeature on a feature that several element rows lack reported only the first such element: the loop kept one missing-feature error per column and dropped the rest (MassTable/FanOut were pathError@Feature(mass)×2 in Lean and the image, ×1 natively). Now every element lacking the feature yields its failure and joinMissing folds them into one error: the record carries one Failure{Feature(<name>), expected, frontier at <element> with its features} per element, the message names the first element and counts the others — … its features are mas, volume (also absent on Observatory::root::c) — via the new Error.Also. tolerate = true is unchanged.
  2. The ambiguousName finding names the namespace declaring the duplicates. Named on a name declared twice put the duplicated name in Finding.Element; the reference semantics (lean/QVTS/Ops.lean, Model.named) name the namespace that owns two members of one name — it, not the name, violates the constraint. denoted now keeps every registration the name matched (a declaration or an alias) with the element it denotes; elementsOf deduplicates the targets for Named's resolution and Error.Candidates; ambiguousElement emits one finding per namespace declaring a matched registration (an alias counts where it is declared, not where its target is), each listing every element denoted there. So Named("Duplicates::a") → Observatory::Duplicates; an unqualified Named("a") matching two namespaces → one finding each; two Pick aliases in Choices → Observatory::Choices = Targets::t1, Targets::t2, even when another namespace aliases the same target.
  3. The API-JSON differential record restates the baseline's figures. feat(queryexec): Project and WhereFeature tell a feature the element lacks from one that is empty — a missing-feature path error with the QVTS record, tolerate to keep the empty cell #1577's re-record (3fed3b3) moved docs/project/api-json-differential-baseline.json (re-pinned libraries, the examples that now say tolerate) but left docs/project/api-json-differential.md's scorecard headline and launch-ready gap rows at the earlier totals, so TestRecordStatesTheBaselinesFigures fails in the rest shard on develop too. The 23 figures are rewritten from the baseline; go run -C tools ./cmd/doc-counts -check is "already current".

Specification basis

Not a SysML v2 clause: QVTS-Core fan-out and finding semantics (docs/qvts-core.md §3, lean/QVTS/Outcome.lean fanOut, lean/QVTS/Ops.lean Model.named). No row of docs/project/spec-compliance.md moves.

How it was verified

  • internal/doc/queryexec/missing_feature_test.go: the fixture gains a third part c lacking mass; Masses/HeavyOnes assert two failures (root::b with mas, volume, root::c with volume) and the (also absent on …) message; ToleratedMasses keeps three rows with two empty cells.
  • internal/doc/queryexec/outcome_test.go: Duplicates (owner from the candidates), Partial (Named("Duplicates::a")), Spread (unqualified name over two namespaces), Aliased (two aliases in one namespace to distinct targets), Shared (A aliases t1; B aliases t1 and t2 — B's finding lists both).
  • go test -C tools ./referee/apijson passes; go run -C tools ./cmd/doc-counts -check.
  • Locally: go test ./internal/doc/queryexec/ ./internal/frontend/repl/ ./internal/frontend/grpc/ ./cmd/sysml/ ./examples/ pass; go vet, staticcheck, gofmt clean; make changelog-check.

Checklist

  • make test and make lint pass locally (packages touched; full tier in CI)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (docs/internals/design/query-outcomes.md)
  • Changelog entry added as changes/unreleased/query-fanout-failures.fixed.md
  • No gate count moved (the record's figures catch up with the already-recorded baseline)
  • No internal work-item labels in the body, docs, or changelog

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

…ng the feature in the record, naming the others in the message

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@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 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.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@NicolasRouquette
NicolasRouquette marked this pull request as ready for review October 27, 2026 16:22
…the duplicates, as the QVTS reference semantics do

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@devin-ai-integration devin-ai-integration Bot changed the title fix(queryexec): the missing-feature fan-out keeps every element lacking the feature in the QVTS record fix(queryexec): the missing-feature fan-out keeps every element lacking the feature; the ambiguousName finding names the owning namespace Oct 27, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

…lved candidates, one finding per owning namespace

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
devin-ai-integration[bot]

This comment was marked as resolved.

…ng the duplicate names, aliases where they are declared

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
devin-ai-integration[bot]

This comment was marked as resolved.

…finding; only the targets are deduplicated

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
devin-ai-integration Bot and others added 3 commits October 27, 2026 17:31
…the re-recorded baseline

The baseline moved with the re-pinned libraries and the tolerate examples (3fed3b3) but the
record's scorecard headline and launch-ready gap rows were left at the earlier totals, failing
TestRecordStatesTheBaselinesFigures in the rest shard.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…kdown from the re-recorded baseline

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…rent rows from the re-recorded baseline

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@HuiJun
HuiJun enabled auto-merge October 27, 2026 17:51
…rrent baseline

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@HuiJun
HuiJun merged commit 6170a51 into develop Oct 27, 2026
57 of 60 checks passed
@HuiJun
HuiJun deleted the feature/query-fanout-failures branch October 27, 2026 21:22
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.

2 participants