Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.
C aiderastclaude-codecode-analysiscode-intelligencecodexcursorcypherdeveloper-toolsgemini-cligraph-visualizationkilocodeknowledge-graphmcpmcp-servermodel-context-protocolopencodesqlitetree-sitterwindsurf
fix(ui): tell the chat when a Galaxy layer stopped at the render limit (C1)
Bernhard Jackiewicz03bbf2c3aae2
diff --git a/graph-ui/src/browser-ai/galaxy-evidence.fixture.ts b/graph-ui/src/browser-ai/galaxy-evidence.fixture.tsindex afab5a94e..d0f61ced9 100644--- a/graph-ui/src/browser-ai/galaxy-evidence.fixture.ts+++ b/graph-ui/src/browser-ai/galaxy-evidence.fixture.ts@@ -25,13 +25,21 @@ export function jsonbAggScope(): { nodes: GraphNode[]; edges: GraphEdge[]; roots}/** The context GalaxyPanel publishes for that scope, with optional scope overrides. */-export function jsonbAggEvidence(overrides: { depth?: number; direction?: string; state?: GalaxyScope['state']; edges?: GraphEdge[]; nodes?: GraphNode[] } = {}): BrowserChatContext {+export function jsonbAggEvidence(overrides: { depth?: number; direction?: string; state?: GalaxyScope['state']; edges?: GraphEdge[]; nodes?: GraphNode[];+ renderLimit?: GalaxyScope['renderLimit'] } = {}): BrowserChatContext {const scope = jsonbAggScope();const [root] = scope.nodes;return selectionEvidenceContext(galaxyScopeEvidence({ project: 'django-demo', identity: { kind: 'symbol', qualifiedName: root.qualified_name!, name: 'JSONBAgg' },nodes: [...scope.nodes, ...overrides.nodes ?? []], edges: overrides.edges ?? scope.edges, roots: scope.roots,depth: overrides.depth ?? 1, direction: overrides.direction ?? 'both', edgeTypes: 'all',- state: overrides.state ?? 'complete-indexed-scope', exhausted: false }));+ state: overrides.state ?? 'complete-indexed-scope', exhausted: false, ...overrides.renderLimit ? { renderLimit: overrides.renderLimit } : {} }));+}++/** JSONBAgg after Expand +1 twice in the hand test of 2026-10-04: layer 3 stopped at the render limit (C1). */+export function jsonbAggRenderLimited(): BrowserChatContext {+ const further = Array.from({ length: 5533 }, (_, index) => node(50_000 + index, `further_${index}`, 'Function', 'django/db/models/further.py'));+ const beyond = Array.from({ length: 15_648 }, (_, index) => ({ source: further[index % further.length].id, target: further[(index * 7 + 1) % further.length].id, type: 'CALLS' }));+ return jsonbAggEvidence({ depth: 3, state: 'render-limit-partial', renderLimit: { layer: 3, kind: 'nodes', limit: 5000 }, nodes: further, edges: [...jsonbAggScope().edges, ...beyond] });}/** A folder of 40 documented symbols with five incoming and five outgoing edge types of 30 symbols each. */diff --git a/graph-ui/src/browser-ai/galaxy-evidence.ts b/graph-ui/src/browser-ai/galaxy-evidence.tsindex 135df32ab..c55bc2d96 100644--- a/graph-ui/src/browser-ai/galaxy-evidence.ts+++ b/graph-ui/src/browser-ai/galaxy-evidence.ts@@ -16,7 +16,10 @@ export interface GalaxyEvidence {edgeTypes: 'all' | string[];nodes: number;edges: number;- state: 'complete' | 'loading' | 'partial';+ /** `limited`: loaded, but a layer stopped at the render limit (C1). */+ state: 'complete' | 'loading' | 'partial' | 'limited';+ /** Where a `limited` scope stopped. */+ renderLimit?: { layer: number; kind: 'nodes' | 'edges'; limit: number };error?: string;exhausted: boolean;/** Distinct related symbols per side; undefined when the snapshot lost the total. */@@ -65,7 +68,11 @@ export function readGalaxyEvidence(snapshot: string): GalaxyEvidence | undefinedconst total = (value: unknown) => typeof value === 'number' ? count(value) : undefined;const direction = scope.direction === 'inbound' || scope.direction === 'outbound' ? scope.direction : 'both';const edgeTypes = Array.isArray(scope.edgeTypes) ? scope.edgeTypes.flatMap(type => text(type, 60) ?? []) : 'all';- const state = limits?.state === 'complete-indexed-scope' ? 'complete' : limits?.state === 'loading-partial-preview' ? 'loading' : 'partial';+ const stopped = record(limits?.renderLimit);+ const renderLimit = stopped && line(stopped.layer) && line(stopped.limit) && (stopped.kind === 'nodes' || stopped.kind === 'edges')+ ? { layer: stopped.layer as number, kind: stopped.kind as 'nodes' | 'edges', limit: stopped.limit as number } : undefined;+ const state = limits?.state === 'complete-indexed-scope' ? 'complete' : limits?.state === 'loading-partial-preview' ? 'loading'+ : limits?.state === 'render-limit-partial' && renderLimit ? 'limited' : 'partial';const roots = records(selected?.roots).flatMap(root => {const name = text(root.name, 120);return name ? [{ name, kind: text(root.kind, 40), qualifiedName: text(root.qualifiedName, 400), filePath: text(root.filePath, 240), startLine: line(root.startLine),@@ -76,7 +83,7 @@ export function readGalaxyEvidence(snapshot: string): GalaxyEvidence | undefinedidentity, selectionKind: text(identity.kind, 20) ?? 'node',roots, rootCount: Math.max(count(selected?.rootCount), roots.length),depth: count(scope.depth), direction, edgeTypes, nodes: count(scope.nodes), edges: count(scope.edges),- state, error: text(limits?.error, 200), exhausted: limits?.exhausted === true,+ state, ...state === 'limited' ? { renderLimit } : {}, error: text(limits?.error, 200), exhausted: limits?.exhausted === true,relationships: { incoming: groups(relationships?.incoming), incomingSymbols: total(relationships?.incomingSymbols),outgoing: groups(relationships?.outgoing), outgoingSymbols: total(relationships?.outgoingSymbols),internal: totals(relationships?.internal), beyond: totals(relationships?.beyond) },@@ -128,7 +135,9 @@ export function relationshipLine(group: RelationshipGroup, side: 'incoming' | 'oexport function scopeSentence(evidence: GalaxyEvidence, words: RelationshipWords): string {const direction = evidence.direction === 'inbound' ? words.inbound : evidence.direction === 'outbound' ? words.outbound : words.both;const types = evidence.edgeTypes === 'all' ? words.allTypes : words.onlyTypes(evidence.edgeTypes);- const state = evidence.state === 'complete' ? words.complete : evidence.state === 'loading' ? words.loading : words.partial(evidence.error);+ const state = evidence.state === 'complete' ? words.complete : evidence.state === 'loading' ? words.loading+ : evidence.state === 'limited' && evidence.renderLimit ? words.renderLimited(evidence.renderLimit.layer, evidence.renderLimit.limit, evidence.renderLimit.kind)+ : words.partial(evidence.error);const notes = [state, ...evidence.state === 'complete' && evidence.exhausted ? [words.exhausted] : [], ...evidence.truncated ? [words.truncated] : []];return words.scope(`${words.hops(evidence.depth)} ${direction}, ${types}`, words.size(evidence.nodes, evidence.edges), notes.join('; '));}diff --git a/graph-ui/src/browser-ai/grounded-explanation.test.ts b/graph-ui/src/browser-ai/grounded-explanation.test.tsindex 01f18c010..4fead8595 100644--- a/graph-ui/src/browser-ai/grounded-explanation.test.ts+++ b/graph-ui/src/browser-ai/grounded-explanation.test.ts@@ -3,7 +3,7 @@ import { selectionEvidenceContext } from '../galaxy/selection-evidence';import { behaviorMainEvidence, djangoAreaEvidence } from './architecture-evidence.fixture';import { prepareExplanationContext, selectionSummary } from './explanation-context';import { explanationMessages, explanationSentence, formatExplanationEvidence } from './explanation-response';-import { jsonbAggEvidence, largeFolderScope } from './galaxy-evidence.fixture';+import { jsonbAggEvidence, jsonbAggRenderLimited, largeFolderScope } from './galaxy-evidence.fixture';import { carriedSource, sourceTargetOf, symbolSource } from './symbol-source';describe('Architecture selections as readable facts (K7)', () => {@@ -113,4 +113,12 @@ describe('the selected symbol source in a Galaxy explanation (K14)', () => {]);expect(selectionSummary(djangoAreaEvidence())[0]).toBe('Selected source area: `django` (2310 files · 15299 indexed nodes).');});++ it('says that a scope stopped at the render limit is partial, in the card and in the prompt (C1)', () => {+ const partial = 'Scope: 3 hops in both directions, all relationship types; 5,548 symbols and 15,673 relationships; '+ + 'partial: layer 3 stopped at the render limit of 5,000 nodes, so counts and names further out can be incomplete.';+ expect(selectionSummary(jsonbAggRenderLimited()).at(-1)).toBe(partial);+ expect(formatExplanationEvidence(prepareExplanationContext(undefined, jsonbAggRenderLimited(), 3200))).toContain(partial);+ expect(selectionSummary(jsonbAggRenderLimited()).join('\n')).not.toContain('complete for the indexed graph');+ });});diff --git a/graph-ui/src/browser-ai/proactive-selection.test.ts b/graph-ui/src/browser-ai/proactive-selection.test.tsindex 0446a45b9..ee018406d 100644--- a/graph-ui/src/browser-ai/proactive-selection.test.ts+++ b/graph-ui/src/browser-ai/proactive-selection.test.ts@@ -35,6 +35,10 @@ describe('selection identity for explanations', () => {expect(explanationInput('p:galaxy', undefined, jsonbAggEvidence())?.waiting).toBeUndefined();expect(explanationInput('p:galaxy', undefined, jsonbAggEvidence({ state: 'loading-partial-preview' }))?.waiting).toBe('loading');expect(explanationInput('p:galaxy', undefined, jsonbAggEvidence({ state: 'partial' }))?.waiting).toBe('partial');+ // A layer that stopped at the render limit is settled: it is explained, and its facts say it is partial (C1).+ const limited = jsonbAggEvidence({ state: 'render-limit-partial', renderLimit: { layer: 2, kind: 'nodes', limit: 500 } });+ expect(explanationInput('p:galaxy', undefined, limited)).toMatchObject({ evidence: limited.id });+ expect(explanationInput('p:galaxy', undefined, limited)?.waiting).toBeUndefined();const architecture = { id: 'a', label: 'Component', text: JSON.stringify({ evidence: { kind: 'current-selection-evidence', view: 'architecture-structure', selected: { name: 'api' } } }) };expect(explanationInput('p:architecture', undefined, architecture)).toEqual({ key: JSON.stringify(['p:architecture', 'Component', architecture.text]), label: 'Component', graph: architecture });});diff --git a/graph-ui/src/browser-ai/proactive-selection.ts b/graph-ui/src/browser-ai/proactive-selection.tsindex 46733430b..37e98b492 100644--- a/graph-ui/src/browser-ai/proactive-selection.ts+++ b/graph-ui/src/browser-ai/proactive-selection.ts@@ -28,7 +28,9 @@ export function explanationInput(scope: string, reader?: BrowserChatReaderContexif (galaxy) {// The selection and how its scope is drawn; counts and loading state change while it loads.const key = JSON.stringify([scope, 'galaxy', galaxy.identity, galaxy.direction, galaxy.edgeTypes, galaxy.depth]);- return { key, label: graph.label, graph: { ...graph }, ...galaxy.state === 'complete' ? { evidence: graph.id } : { waiting: galaxy.state } };+ // A layer stopped at the render limit is settled: explained, with facts that say it is partial (C1).+ const settled = galaxy.state === 'complete' || galaxy.state === 'limited';+ return { key, label: graph.label, graph: { ...graph }, ...settled ? { evidence: graph.id } : { waiting: galaxy.state === 'loading' ? 'loading' : 'partial' } };}return { key: JSON.stringify([scope, graph.label, graph.text]), label: graph.label, graph: { ...graph } };}diff --git a/graph-ui/src/browser-ai/relationship-answer.test.ts b/graph-ui/src/browser-ai/relationship-answer.test.tsindex 3d5b400ad..34a12ae43 100644--- a/graph-ui/src/browser-ai/relationship-answer.test.ts+++ b/graph-ui/src/browser-ai/relationship-answer.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest';import { selectionEvidenceContext } from '../galaxy/selection-evidence';-import { JSONB_AGG_CALLERS, jsonbAggEvidence, largeFolderScope } from './galaxy-evidence.fixture';+import { JSONB_AGG_CALLERS, jsonbAggEvidence, jsonbAggRenderLimited, largeFolderScope } from './galaxy-evidence.fixture';import { correctRelationWords, relationshipAnswer, relationshipQuestion, relationshipSuggestion } from './relationship-answer';const line = (markdown: string, type: string) => markdown.split('\n').find(item => item.startsWith(`- **${type}** `)) ?? '';@@ -80,6 +80,15 @@ describe('listed relationship answers', () => {expect(answer.markdown).toContain('Ausschnitt: 1 Schritt in beide Richtungen');});+ it('says in the language of the question that a scope stopped at the render limit, with numbers written in that language (C1)', () => {+ expect(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggRenderLimited()])!.markdown).toContain('Scope: 3 hops in both directions, all relationship types; '+ + '5,548 symbols and 15,673 relationships; partial: layer 3 stopped at the render limit of 5,000 nodes, so counts and names further out can be incomplete.');+ const german = relationshipAnswer('Wer ruft JSONBAgg auf?', [jsonbAggRenderLimited()])!.markdown;+ expect(german).toContain('Ausschnitt: 3 Schritte in beide Richtungen, alle Beziehungstypen; 5.548 Symbole und 15.673 Beziehungen; '+ + 'unvollständig: Ebene 3 hielt am Darstellungslimit von 5.000 Knoten an, Anzahlen und Namen weiter außen können daher fehlen.');+ expect(german).not.toContain('vollständig für den indizierten Graphen');+ });+it('never reports "no callers" for a side the scope did not load or while it is still loading', () => {expect(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggEvidence({ direction: 'outbound' })])!.markdown).toContain('does not follow incoming relationships');diff --git a/graph-ui/src/browser-ai/strings.ts b/graph-ui/src/browser-ai/strings.tsindex 4923a5608..5aabfea7b 100644--- a/graph-ui/src/browser-ai/strings.ts+++ b/graph-ui/src/browser-ai/strings.ts@@ -32,29 +32,35 @@ export const browserAiText = {};/** Words for graph facts in the prompt (always English) and for the listed- * relationship answer, which follows the language of the question. */+ * relationship answer, which follows the language of the question. Numbers are+ * written as the language writes them: 5,548 and 5.548 (C1). */+const en = (value: number) => value.toLocaleString('en-US');+const de = (value: number) => value.toLocaleString('de-DE');const englishRelationshipWords = {from: 'from', to: 'to',- more: (count: number) => `+${count} more`,+ more: (count: number) => `+${en(count)} more`,hops: (depth: number) => depth === 0 ? 'the selection only' : depth === 1 ? '1 hop' : `${depth} hops`,both: 'in both directions', inbound: 'incoming only', outbound: 'outgoing only',allTypes: 'all relationship types',onlyTypes: (types: readonly string[]) => types.length ? `only ${types.join(', ')}` : 'no relationship types',- size: (nodes: number, edges: number) => `${nodes} ${nodes === 1 ? 'symbol' : 'symbols'} and ${edges} ${edges === 1 ? 'relationship' : 'relationships'}`,+ size: (nodes: number, edges: number) => `${en(nodes)} ${nodes === 1 ? 'symbol' : 'symbols'} and ${en(edges)} ${edges === 1 ? 'relationship' : 'relationships'}`,complete: 'complete for the indexed graph',loading: 'still loading, so this is a partial preview',partial: (error?: string) => `incomplete${error ? `: ${error}` : ''}`,+ /** A layer stopped at the render limit: the layers inside it are whole, it and those further out are not (C1). */+ renderLimited: (layer: number, limit: number, kind: 'nodes' | 'edges') => `partial: layer ${layer} stopped at the render limit of ${en(limit)} ${kind}, `+ + (layer > 1 ? 'so counts and names further out can be incomplete' : 'so counts and names can be incomplete, the direct relationships included'),exhausted: 'nothing further beyond this depth',scope: (shape: string, size: string, state: string) => `Scope: ${shape}; ${size}; ${state}.`,- incoming: (total: number, symbols?: number) => `Incoming relationships: ${total}${symbols === undefined ? '' : ` from ${symbols} ${symbols === 1 ? 'symbol' : 'symbols'}`}.`,- outgoing: (total: number, symbols?: number) => `Outgoing relationships: ${total}${symbols === undefined ? '' : ` to ${symbols} ${symbols === 1 ? 'symbol' : 'symbols'}`}.`,+ incoming: (total: number, symbols?: number) => `Incoming relationships: ${en(total)}${symbols === undefined ? '' : ` from ${en(symbols)} ${symbols === 1 ? 'symbol' : 'symbols'}`}.`,+ outgoing: (total: number, symbols?: number) => `Outgoing relationships: ${en(total)}${symbols === undefined ? '' : ` to ${en(symbols)} ${symbols === 1 ? 'symbol' : 'symbols'}`}.`,noIncoming: 'Incoming relationships: none in this scope.',noOutgoing: 'Outgoing relationships: none in this scope.',incomingNotLoaded: 'Incoming relationships: not loaded; the scope does not follow incoming edges.',outgoingNotLoaded: 'Outgoing relationships: not loaded; the scope does not follow outgoing edges.',cut: (side: 'incoming' | 'outgoing') => `${side === 'incoming' ? 'Incoming' : 'Outgoing'} relationships: left out of this snapshot.`,truncated: 'the snapshot left part of its relationships out, so counts and names can be incomplete',- moreTypes: (count: number) => `+${count} more relationship ${count === 1 ? 'type' : 'types'}`,+ moreTypes: (count: number) => `+${en(count)} more relationship ${count === 1 ? 'type' : 'types'}`,internal: (summary: string) => `Between the selected symbols: ${summary}.`,beyond: (summary: string) => `Further out in the scope: ${summary}.`,callersOf: (name: string) => `Callers of ${name} in the loaded graph`,@@ -83,26 +89,28 @@ export const relationshipWords: { en: RelationshipWords; de: RelationshipWords }en: englishRelationshipWords,de: {from: 'von', to: 'zu',- more: (count: number) => `+${count} weitere`,+ more: (count: number) => `+${de(count)} weitere`,hops: (depth: number) => depth === 0 ? 'nur die Auswahl' : depth === 1 ? '1 Schritt' : `${depth} Schritte`,both: 'in beide Richtungen', inbound: 'nur eingehend', outbound: 'nur ausgehend',allTypes: 'alle Beziehungstypen',onlyTypes: (types: readonly string[]) => types.length ? `nur ${types.join(', ')}` : 'keine Beziehungstypen',- size: (nodes: number, edges: number) => `${nodes} ${nodes === 1 ? 'Symbol' : 'Symbole'} und ${edges} ${edges === 1 ? 'Beziehung' : 'Beziehungen'}`,+ size: (nodes: number, edges: number) => `${de(nodes)} ${nodes === 1 ? 'Symbol' : 'Symbole'} und ${de(edges)} ${edges === 1 ? 'Beziehung' : 'Beziehungen'}`,complete: 'vollständig für den indizierten Graphen',loading: 'lädt noch, das ist eine Vorschau',partial: (error?: string) => `unvollständig${error ? `: ${error}` : ''}`,+ renderLimited: (layer: number, limit: number, kind: 'nodes' | 'edges') => `unvollständig: Ebene ${layer} hielt am Darstellungslimit von ${de(limit)} ${kind === 'nodes' ? 'Knoten' : 'Kanten'} an, `+ + (layer > 1 ? 'Anzahlen und Namen weiter außen können daher fehlen' : 'Anzahlen und Namen können daher fehlen, auch bei den direkten Beziehungen'),exhausted: 'dahinter folgt nichts mehr',scope: (shape: string, size: string, state: string) => `Ausschnitt: ${shape}; ${size}; ${state}.`,- incoming: (total: number, symbols?: number) => `Eingehende Beziehungen: ${total}${symbols === undefined ? '' : ` von ${symbols} ${symbols === 1 ? 'Symbol' : 'Symbolen'}`}.`,- outgoing: (total: number, symbols?: number) => `Ausgehende Beziehungen: ${total}${symbols === undefined ? '' : ` zu ${symbols} ${symbols === 1 ? 'Symbol' : 'Symbolen'}`}.`,+ incoming: (total: number, symbols?: number) => `Eingehende Beziehungen: ${de(total)}${symbols === undefined ? '' : ` von ${de(symbols)} ${symbols === 1 ? 'Symbol' : 'Symbolen'}`}.`,+ outgoing: (total: number, symbols?: number) => `Ausgehende Beziehungen: ${de(total)}${symbols === undefined ? '' : ` zu ${de(symbols)} ${symbols === 1 ? 'Symbol' : 'Symbolen'}`}.`,noIncoming: 'Eingehende Beziehungen: keine in diesem Ausschnitt.',noOutgoing: 'Ausgehende Beziehungen: keine in diesem Ausschnitt.',incomingNotLoaded: 'Eingehende Beziehungen: nicht geladen; der Ausschnitt folgt keinen eingehenden Kanten.',outgoingNotLoaded: 'Ausgehende Beziehungen: nicht geladen; der Ausschnitt folgt keinen ausgehenden Kanten.',cut: (side: 'incoming' | 'outgoing') => `${side === 'incoming' ? 'Eingehende' : 'Ausgehende'} Beziehungen: in diesem Schnappschuss ausgelassen.`,truncated: 'der Schnappschuss hat einen Teil der Beziehungen ausgelassen, Anzahlen und Namen können unvollständig sein',- moreTypes: (count: number) => `+${count} weitere ${count === 1 ? 'Beziehungstyp' : 'Beziehungstypen'}`,+ moreTypes: (count: number) => `+${de(count)} weitere ${count === 1 ? 'Beziehungstyp' : 'Beziehungstypen'}`,internal: (summary: string) => `Zwischen den ausgewählten Symbolen: ${summary}.`,beyond: (summary: string) => `Weiter außen im Ausschnitt: ${summary}.`,callersOf: (name: string) => `Aufrufer von ${name} im geladenen Graphen`,diff --git a/graph-ui/src/galaxy/GalaxyPanel.layers.test.tsx b/graph-ui/src/galaxy/GalaxyPanel.layers.test.tsxindex 3025a9e80..23cb91269 100644--- a/graph-ui/src/galaxy/GalaxyPanel.layers.test.tsx+++ b/graph-ui/src/galaxy/GalaxyPanel.layers.test.tsx@@ -105,6 +105,23 @@ it('K8: a layer past the render limit stops there, says it is partial and cannotawait settle(() => expect(status()?.textContent).toBe('2 nodes · 1 edge'));});+it('C1: tells the chat that a layer stopped at the render limit, not that the scope is complete', async () => {+ window.localStorage.setItem(viewPreferencesKey('sample'), JSON.stringify({ version: 1, preferences: { galaxyNodes: 500, galaxyEdges: 1000 } }));+ const fan = Array.from({ length: 600 }, (_, at) => scopeNode(100 + at));+ const edges: GraphEdge[] = [{ id: 1, source: 1, target: 2, type: 'CALLS' }, ...fan.map((node, at) => ({ id: 10 + at, source: 2, target: node.id, type: 'CALLS' }))];+ const onSelectionEvidence = vi.fn();+ await act(async () => root.render(<GalaxyPanel project="sample" visible workspaceExpanded onOpenNode={vi.fn()} onSelectionEvidence={onSelectionEvidence}+ fetch={scopeFetch({ nodes: [scopeNode(1), scopeNode(2), ...fan], edges }).fetch} />));+ await settle(() => expect(seam().nodes).toBeGreaterThan(0));+ await act(async () => { seam().clickNode('sample.n1'); });+ await settle(() => expect(status()?.textContent).toBe('2 nodes · 1 edge'));+ const limitations = () => JSON.parse(onSelectionEvidence.mock.lastCall![0].text).evidence.limitations;+ expect(limitations().state).toBe('complete-indexed-scope');+ await act(async () => button('Expand +1').click());+ await settle(() => expect(status()?.textContent).toBe('Partial: 602 nodes · 601 edges'));+ await settle(() => expect(limitations()).toMatchObject({ state: 'render-limit-partial', renderLimit: { layer: 2, kind: 'nodes', limit: 500 } }));+});+it('K8: a large finished layer keeps its arranged cloud instead of being pushed apart on screen', async () => {const fan = Array.from({ length: 1600 }, (_, at) => scopeNode(100 + at));const nodes = [scopeNode(1), ...fan];diff --git a/graph-ui/src/galaxy/GalaxyPanel.tsx b/graph-ui/src/galaxy/GalaxyPanel.tsxindex be266df88..3389f9561 100644--- a/graph-ui/src/galaxy/GalaxyPanel.tsx+++ b/graph-ui/src/galaxy/GalaxyPanel.tsx@@ -1212,9 +1212,12 @@ export default function GalaxyPanel(props: GalaxyPanelProps): JSX.Element {const agentEvidence = useMemo(() => scope.scope ? galaxyScopeEvidence({ project, identity: scope.scope,nodes: scope.result?.data.nodes ?? [], edges: scope.result?.data.edges ?? [], roots: scope.result?.roots ?? new Set<number>(),depth: scope.depth, direction: props.workspaceExpanded ? scope.direction : 'both', edgeTypes: traceTypes ?? 'all',- state: scope.complete ? 'complete-indexed-scope' : scope.loading ? 'loading-partial-preview' : 'partial',- error: scope.error, exhausted: scope.result?.exhausted }) : undefined,- [project, scope.scope, scope.result, scope.depth, scope.direction, scope.complete, scope.loading, scope.error, traceTypes, props.workspaceExpanded]);+ // A layer that stopped at the render limit is loaded, not complete: the chat says so (C1).+ state: scope.complete ? scope.result?.partial ? 'render-limit-partial' : 'complete-indexed-scope' : scope.loading ? 'loading-partial-preview' : 'partial',+ error: scope.error, exhausted: scope.result?.exhausted,+ ...scope.complete && scope.result?.partial ? { renderLimit: { layer: scope.result.partial.layer, kind: scope.result.partial.limit,+ limit: scope.result.partial.limit === 'nodes' ? nodeBudget : edgeBudget } } : {} }) : undefined,+ [project, scope.scope, scope.result, scope.depth, scope.direction, scope.complete, scope.loading, scope.error, traceTypes, props.workspaceExpanded, nodeBudget, edgeBudget]);useSelectionEvidence(props.onSelectionEvidence, agentEvidence, visible && props.workspaceExpanded === true);const toggleKind = useCallback((type: string) => {if (props.workspaceExpanded && scope.scope) {diff --git a/graph-ui/src/galaxy/selection-evidence.ts b/graph-ui/src/galaxy/selection-evidence.tsindex f36239e05..2afc79c42 100644--- a/graph-ui/src/galaxy/selection-evidence.ts+++ b/graph-ui/src/galaxy/selection-evidence.ts@@ -115,9 +115,12 @@ export interface GalaxyScope {depth: number;direction: string;edgeTypes: readonly string[] | 'all';- state: 'complete-indexed-scope' | 'loading-partial-preview' | 'partial';+ /** `render-limit-partial`: loading finished, but a layer stopped at the render limit (C1). */+ state: 'complete-indexed-scope' | 'loading-partial-preview' | 'partial' | 'render-limit-partial';error?: string;exhausted?: boolean;+ /** The layer that stopped and the limit it stopped at. */+ renderLimit?: { layer: number; kind: 'nodes' | 'edges'; limit: number };}/** Every scope edge is classified against the roots first; only the names are@@ -129,7 +132,7 @@ export function galaxyScopeEvidence(scope: GalaxyScope): SelectionEvidence {documentation: root.documentation?.slice(0, ROOT_DOCUMENTATION_CHARACTERS) })), omittedRoots: Math.max(0, roots.length - ROOTS_LISTED) },scope: { depth: scope.depth, direction: scope.direction, edgeTypes: scope.edgeTypes, nodes: scope.nodes.length, edges: scope.edges.length },relationships: scopeRelationships(scope.nodes, scope.edges, scope.roots),- limitations: { state: scope.state, error: scope.error, exhausted: scope.exhausted, indexCoverage: 'unavailable',+ limitations: { state: scope.state, error: scope.error, exhausted: scope.exhausted, ...scope.renderLimit ? { renderLimit: scope.renderLimit } : {}, indexCoverage: 'unavailable',interpretation: 'Static indexed relationships, not runtime activity. Scope completeness is relative to the indexed graph and selected depth/types.' } };}