Skip to content

feat(view): render GridView relationship matrices - #884

Open
devin-ai-integration[bot] wants to merge 13 commits into
developfrom
feat/gridview-relationship-matrix
Open

devin-ai-integration[bot] wants to merge 13 commits into
developfrom
feat/gridview-relationship-matrix

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

StandardViewDefinitions::GridView generalises tabular views and "relationship matrix view, e.g. presenting allocation or dependency relationships", but every GridView rendered as the element table. This adds a matrix rendering kind that a standard GridView selects with a standard element filter that names a relationship metaclass.

Selector. A view whose kind comes from GridView (directly, through grv, or through a view definition specialising it) becomes a matrix when a positive, resolved @T in its own or inherited filter members, or in the [...] clause of its own or inherited exposes, names one of these:

Selector Relationship kinds shown
SysML::SatisfyRequirementUsage satisfy
SysML::VerificationCaseUsage, SysML::VerificationCaseDefinition verify
SysML::AllocationUsage allocate
SysML::ConnectionUsage connect, allocate, derive
SysML::InterfaceUsage connect
SysML::Dependency dependency, refine
ModelingMetadata::Refinement (or a specialisation) refine
RequirementDerivation::DerivationMetadata (or a specialisation) derive
view def RelationshipMatrix :> GridView {
    filter @SysML::SatisfyRequirementUsage or @SysML::AllocationUsage or @SysML::Dependency;
}
view relationshipMatrix : RelationshipMatrix { expose Model::**; }

An unfiltered GridView, render asElementTable, a selector under not, or any other @T renders the same table it renders today, byte for byte. No OpenSysML library vocabulary is added.

Shape. Rows are relationship sources and columns are targets, both in first-appearance order. A cell holds the kind keywords of the edges between that pair, deduplicated and comma-joined in the fixed order satisfy, verify, allocate, connect, derive, refine, dependency. Each relationship element gets its most specific keyword: a derivation connection is derive, not connect, and a #refinement dependency is refine, not dependency. A #derivation connection definition contributes derive edges from its original to its derived requirement definitions. Relationships come from the exposed members and their owned members, named and unnamed, down to the tree depth limit. Exposed elements that contribute no shown edge are listed in a notice. An empty matrix reports why it is empty.

Unnamed members. A matrix needs unnamed relationships such as satisfy r1 by vehicle;, which expose enumeration previously skipped. The new Model.ExposedMembers admits them through the same visibility and filter checks. Only the matrix uses it; ExposedElements and every other rendering are unchanged.

One edge implementation. The per-element edge extraction for connection, allocation, satisfaction, verification, derivation and refinement moves from internal/doc/queryexec into semantics.Model.RelationshipEdgesOf, which also adds dependency (client × supplier). Document related queries now delegate to it, with unchanged behaviour.

Surfaces. The kind is written in text, Markdown, CSV and TSV, and in HTML/PDF document tables. Mermaid, DOT and PlantUML are refused with the same typed wrong-form error as table, so there is no graph output to screenshot. It works through CLI -render, -render-form and -render-all, REPL %render, LSP render requests, the engine's RenderView call (columns and rows, as for tables), and document Diagram blocks. A #matrix / #matrix:<target> pseudo-view shows every relationship kind without a declared view.

HTML document table
PDF document table

Specification basis

SysML v2 §10.2 leaves rendering to tools. The selection uses only standard constructs: StandardViewDefinitions::GridView and element filters (SysML v2 7.4.4, 8.3.26). The unnamed-member enumeration follows KerML visibleMemberships, which includes unnamed memberships. A new "GridView Relationship Matrix" section was added to docs/project/spec-compliance.md, and the view-rendering row now mentions the matrix.

How it was verified

  • Text, Markdown, CSV and TSV goldens for a matrix model with anonymous and named satisfy, verify through a verification case objective, allocation over feature chains, connection, a #derivation connection, a #refinement dependency and a plain dependency, including a cell holding two kinds.
  • Activation cases: a single-kind matrix, an inherited filter, grv, render asElementTable, not, an unknown selector (output equals the ordinary table) and a mixed selector. Empty-matrix cases cover both "exposes nothing" and "exposes nothing related".
  • Graph-form refusal tests, a pseudo-view test, and CLI, REPL, LSP, docplan and docrender (Markdown/HTML) tests.
  • Semantics tests for RelationshipEdgesOf and ExposedMembers. The existing queryexec tests pass unchanged.
  • No existing rendering golden changed. The only changed existing expectations are lists of kinds and pseudo-views gaining matrix / #matrix, plus the self-model kind counts.
  • examples/gridview-relationship-matrix.sysml and internal/ir/view/testdata/matrix.sysml report 0 errors with the pinned pilot validator. Adding the example moves the pilot-differential and RDF corpus figures, which were regenerated with make docs-counts.
  • go build ./..., go vet ./..., gofmt -l ., go test ./..., make docs-check, make docs-counts, make man-check, changelog check.

Checklist

  • make test and make lint pass locally
  • 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

@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

Copy link
Copy Markdown
Contributor Author

Runtime verification at 29a7ea1:

  • CLI: text, Markdown, CSV and TSV matrix forms; Mermaid/DOT/PlantUML wrong-form errors (status 2); -render-all; #matrix:<target>. Adversarial selector checks also pass: grv, inherited filters, expose-clause filters, specialised Refinement metadata, unresolved selectors, empty and unrelated exposure, and multi-kind cells.
  • Byte-identical regression against develop: 16 table comparisons (unfiltered GridView, render asElementTable with a relationship filter, not @SysML::Dependency, @SysML::SuccessionAsUsage, each in four forms), plus 119 artifacts across 31 renderable fixture sets from examples/ and internal/ir/view/testdata, 15 of them tables. This testing found that a non-relationship @T filter under expose P::** altered the ordinary table; 29a7ea1 fixes it, with a regression test.
  • REPL %render, LSP views listing, render and didChange, and the VS Code extension all render the declared matrix and #matrix.
REPL VS Code
REPL matrices VS Code matrix

Document output: the HTML table scrolls horizontally, and every column is reachable. The default WeasyPrint PDF fits the table on a landscape page, but the title and caption land on separate portrait pages.

HTML Default PDF
HTML matrix PDF matrix

Known limitation: with the optional -pdf-engine pandoc, long qualified headers overlap. An ordinary wide table with equally long headers is also unreadable under pandoc on develop (it runs off the page), so this is an existing wide-table limitation of that engine rather than something specific to the matrix.

pandoc, matrix pandoc, develop wide table
pandoc matrix pandoc develop

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 4, 2026 04:28
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 5 commits October 4, 2026 05:16
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>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the feat/gridview-relationship-matrix branch from 4ede181 to 41300c8 Compare October 4, 2026 05:35
devin-ai-integration Bot and others added 7 commits October 4, 2026 06:18
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tionship-matrix

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

# Conflicts:
#	docs/reference/lsp.md
…tionship-matrix

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/pilot-differential-baseline.json
#	docs/project/pilot-differential.md
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tionship-matrix

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

# Conflicts:
#	docs/project/pilot-differential-baseline.json
Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

This branch now conflicts with develop. Conflicting files, and the merged PRs that changed them:

To resolve: merge current develop into this branch with an ordinary merge commit (no rebase or force-push).
Don't hand-merge generated files: regenerate docs/project/pilot-differential-baseline.json with go run -C tools ./cmd/pilot-diff -update after the merge.

Planned merge order for the view and docs PRs: #889 → #881 → #871 → #882 → #884 → #885 → #886. Each needs these files regenerated again after the one before it merges.

Re-run the full gate (go build ./..., go vet ./..., gofmt -l ., make lint, make docs-check, go test ./...) and wait for green CI before marking ready.

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