Skip to content

fix(domain): give the instance graph's blank nodes short ids - #666

Merged
ixuz merged 1 commit into
mainfrom
fix/instance-graph-blank-ids
Nov 8, 2026
Merged

ixuz merged 1 commit into
mainfrom
fix/instance-graph-blank-ids

Conversation

@ixuz

@ixuz ixuz commented Nov 8, 2026

Copy link
Copy Markdown
Member

What and why

Studio's instance graph named a blank node by its label joined to its
document's address. A label may be as long as a term may be, so the
joined id could get too long to hash quickly, and building, labeling,
laying out and drawing the graph took time that grew with the square
of the number of such nodes.

Each blank node of a document now gets a short number as its id, looked
up by its document and its term as a path, never as one joined string.
The node keeps its term:

  • the node pane shows a blank node's term, not its number;
  • the layout orders blank nodes by document, then term, so where a
    cycle breaks still doesn't depend on unrelated nodes;
  • the search finds a blank node by its term or its document's address;
  • a kept layout is reused only for a graph with the same blank labels.

The Studio also counts the labels it tells apart by a path of file name
and label. docs/deck-library.md and docs/studio.md describe the new ids.
The node= route parameter of a blank node now holds its number, which
stays valid while the instance's data stays the same.

Refs: GHSA-6qgg-9wcf-9vqr

The Studio's graph named a blank node by its label joined to its
document's address. A label may be as long as a term may be, so the
joined id could be longer than V8 hashes all of, and the graph's maps,
and the Studio's labels, node index, layout and view, would key many
such ids in time growing with the square of their number.

Each blank node of a document now gets a number of its own as its id,
looked up by the path of its document and its term, never one joined
string. The node keeps its term, which the graph still shows as its
label. The Studio also counts labels it tells apart by a file's name
and a label as a path of the two.

The number depends on the documents read before, so the Studio does
not use it where it would show or matter: the layout orders blank
nodes by their document, then their term, compared apart, so where a
cycle breaks still does not depend on unrelated nodes; the node pane
shows a blank node's term, not its number; and the search finds a
blank node by its term or its document's address.

Refs: GHSA-6qgg-9wcf-9vqr
@ixuz ixuz added the bug Something isn't working label Nov 8, 2026
@ixuz
ixuz enabled auto-merge November 8, 2026 17:07
@ixuz
ixuz added this pull request to the merge queue Nov 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 8, 2026
@ixuz
ixuz added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit ed2d4a3 Nov 8, 2026
51 checks passed
@ixuz
ixuz deleted the fix/instance-graph-blank-ids branch November 8, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant