Skip to content

SWF(bug): render same-named Magic MDK result views apart, write documents under their planned file name, refuse a nil QueryResult rendering - #2492

Merged
HuiJun merged 4 commits into
developfrom
fix/mdk-result-view-names
Nov 21, 2026
Merged

HuiJun merged 4 commits into
developfrom
fix/mdk-result-view-names

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

Three review findings on the QVTS::QueryResult view work merged in #2116, each fixed at its cause with a test that fails without the fix.

1. Magic MDK: views of one declared name were all laid out as the first

Run query over a subject whose queries share a last name (P::Rows, Q::Rows) writes two views that are both named RowsResult::rows. Engine.renderViews parsed every written view into one model and rendered each by name, so both were rendered from the first.

  • Failing test: ResultViewEndToEndTest.viewsOfOneNameAreRenderedAsTheirOwnAnswers — the second rendered view showed P::Rows's header and rows.
  • Fix: Engine.renderViews partitions the views (distinctlyNamed) so that no parsed model holds two views of one declared name, and renders each view against the model that holds its own source. Differently named views are still parsed together.

2. Magic MDK: a rendered document was not written where its sibling documents link it

Render document… named the output from the qualified name (QVTSDemo.MassReport.md) and ignored RenderedDocument.fileName, the name the service plans and other documents link (QVTSDemo-MassReport.md), so links between documents rendered into one folder did not resolve.

  • Failing test: ResultViewEndToEndTest.documentsLinkingEachOtherAreWrittenWhereTheirLinksPoint.
  • Fix: DocumentRenderer writes a document under RenderedDocument.fileName(), and refuses a planned name that is empty, ., .. or contains a path separator. A result view is still named by its qualified name.

3. docir.QueryResult(nil) dereferenced a nil rendering

  • Failing test: TestQueryResultRefusesNilRendering (panicked before the fix); TestQueryResultOfZeroRendering holds the empty case.
  • Fix: docir.QueryResult returns (*Document, error) and answers a nil rendering with a typed *docir.Error of the new kind ErrorMissingRendering. Its two callers (internal/frontend/grpc/resultview.go, internal/frontend/repl/docrender.go) propagate the error.
  • This guards a path that is unreachable today: both callers pass a rendering only after a successful render. No user-visible behaviour changes, so the changelog fragment does not mention it.

No generated files are touched: no baselines, goldens, protobuf output or expectation files.

How it was verified

On the pushed head 4a6ffc2f40 (a merge of develop bd572ad9d1):

  • gofmt -l . empty, go build ./..., go vet ./..., make lint, make changelog-check
  • go test ./internal/doc/... ./internal/frontend/...
  • mvn -f client/java/pom.xml install -DskipTests, then mvn -f editors/mdk/pom.xml verify under JDK 17: 92 plugin tests and 24 bridge tests pass

The full go test ./... with the downloaded corpora and the tools tests are running on this head now; results follow in a comment.

Checklist

  • make test and make lint pass locally — make lint passes; the full suite is running (see above)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (editors/mdk/README.md, docs/internals/design/mdk-plugin.md)
  • Changelog entry added as changes/unreleased/mdk-result-view-names.fixed.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved — none moved
  • 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 3 commits November 20, 2026 20:54
…part, write documents under their planned names

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tes documents to their planned files

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 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: No Issues Found

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

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Rest of the gate, run locally: go vet ./..., the full go test -count=1 ./... with the training, pilot, specification-example, pilot-library-XMI and PSSM corpora required, go test -C tools -count=1 ./..., scripts/check-doc-ids.py and tests/hygiene all pass. The run started on 4a6ffc2f40; the head 5fa84d3b51 differs from it by one deleted comment line.

@HuiJun
HuiJun added this pull request to the merge queue Nov 21, 2026
Merged via the queue into develop with commit 0e2e95f Nov 21, 2026
35 checks passed
@HuiJun
HuiJun deleted the fix/mdk-result-view-names branch November 21, 2026 02:07
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