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
docs(ui): reproduce the review call feedback and plan the fixes
Bernhard Jackiewicz92224c4463a5
diff --git a/docs/development/pr-2068-call-feedback-plan.md b/docs/development/pr-2068-call-feedback-plan.mdnew file mode 100644index 000000000..6f75dfd04--- /dev/null+++ b/docs/development/pr-2068-call-feedback-plan.md@@ -0,0 +1,235 @@+# PR 2068: review call feedback, reproduction and plan++Prepared on 2 October 2026 (Europe/Berlin) after the review call between Martin and Bernhard. Base: `feat/codeatlas-web` at `50a6a67b89f2e2bd901b903fe0f2affabc1cb449`. This document is a plan for approval. No product code has been changed for it yet; the only code in this branch is the capture script that produced the evidence.++Every point from the call was reproduced in a real browser before a fix was proposed. Where the call notes or the first code reading guessed a cause, the measurement below decides. Two guesses were refuted that way; both are marked.++## How the evidence was produced++- **Binary:** built from `50a6a67b` with the UI embedded (`scripts/build.sh --with-ui` into a separate `BUILD_DIR`). It ran with an isolated `HOME`, `CBM_CACHE_DIR` and `CBM_RUNTIME_DIR` on a free port, so no existing installation or daemon was touched.+- **Indexes:**+ - Django 5.2.7, a shallow clone indexed as project `django-demo`: 52,402 nodes and 274,549 edges, indexed in 19.5 s.+ - This repository at `50a6a67b` as a control, project `cbm`: 44,214 nodes and 178,535 edges.+- **Browser:** Chromium from Playwright 1.62.1, headed with the GPU, because the browser model needs WebGPU. Viewport 1600x1000 CSS pixels at device scale 2.+- **Capture script:** [`graph-ui/tools/call-feedback-capture.mjs`](../../graph-ui/tools/call-feedback-capture.mjs). Every interaction becomes a numbered series of screenshots: before the action, on hover, at the click, then after 250 ms, 1 s and 3 s, plus every wheel step on its own. A ring marks the mouse position, because screenshots do not show the cursor. For each image the script also records:+ - the identity of the canvas element (a remount gets a new number)+ - the camera, via `__atlasGalaxyFit.measure()`+ - the `__atlasGalaxy` counters+ - the messages sent to the browser model, which contain the prompt it actually received+- **What is committed:** the full series (121 images, 86 MB) stays local under `graph-ui/verification/call-feedback-2026-10-02/` and is not committed. The 17 images in [`pr-2068-call-feedback/`](pr-2068-call-feedback/) are downscaled JPEGs, 2.3 MB in total.++## Corrections to the call notes++The notes were written by a speech-to-text summary without the repository. These items read differently against the code and the screenshots:++| Notes | Actual |+| --- | --- |+| "GraphiQL" as visual reference | Graphify (`Graphify-Labs/graphify`), its shortest-path view: path nodes highlighted, edges labelled ("uses", "references"), the rest dimmed |+| "JSON-Bag", "jsonl.agg" | `JSONBAgg` in `django/contrib/postgres/aggregates/general.py` and its tests `test_jsonb_agg_*` |+| "Trace Path, an LCP for it" | The MCP tool `trace_path`. Galaxy does not use it; Galaxy reads `query_graph` only |+| "Interactive 2.5 Coder 0.5" | Qwen2.5 Coder 0.5B, running in the browser on WebGPU (transformers.js), not llama-server |+| Edge types "Calls, Test, Defines, Inherits" | INHERITS, CALLS, IMPORTS, TESTS, DEFINES_METHOD, USAGE, DECORATES, DEFINES |+| "Output stops at item 16, output token limit suspected" | No hard limit of 16 exists. Manual chat gets 512 output tokens and decodes greedily without a repetition penalty. In the reproduction the answer repeats one line from item 13 and stops at item 48 |+| "Django: System structure and Behavior empty because of a budget" | Not the node or edge budget: Django is below both. It is the 32 MB JSON budget of the projection (see S1) |++## Findings and proposed changes++Priorities:+- **P1:** release-relevant bugs.+- **P2:** improvements that need a decision (see the list at the end).+- **Backend:** C changes, proposed only.++### Galaxy++**G1 (P1) The view resets: the canvas is rebuilt on every scope step.**+- **Measured:** the canvas element changes on every step. Selecting `JSONBAgg` goes from element 1 to no canvas, then element 2. Each `Expand +1` replaces it twice (3, 4, then 5, 6). The fit counter rises with every step (1, 2, 4, 6), and the camera jumps to a new orientation each time ([blank canvas right after the click](pr-2068-call-feedback/01-galaxy-select-blank-canvas.jpg)).+- **Side observation:** in 2 of 4 runs, `Cannot read properties of null (reading 'addEventListener')` was thrown during a selection. It is not localized yet and is probably a listener attached during the remount.+- **Cause:** `useOrganicLayout` returns no result while it computes (`galaxy/use-organic-layout.ts:75`). `shown` becomes `undefined` and `GraphScene` unmounts, since it is mounted only while `shown` exists (`galaxy/GalaxyPanel.tsx:2385`). Each new picture also counts as a new fit request (`GalaxyPanel.tsx:1435-1503`, `fitRequest` at 1442). A stale fly-to replays on mount (`galaxy/GraphScene.tsx`, `CameraAnimator` 165-320).+- **Change:**+ - Keep the last laid-out picture visible, marked stale, while the next layout runs, so the scene stays mounted.+ - Refit only when the root, direction or edge types change, not on expansion or on the step from preview to complete result.+ - Do not replay an old fly-to on mount.+- **Tests:** `GalaxyPanel.test.tsx` gets remount and fit counters through `__atlasGalaxy`. `use-organic-layout.test.tsx` keeps "never presents the previous source as current" by exposing the previous picture as stale, not as current.++**G2 (P1) A symbol opens as an isolated node with no edges.**+- **Measured:** after selecting a symbol the toolbar reads "0 layers · 1 node · 0 edges" ([image](pr-2068-call-feedback/02-galaxy-select-isolated-node.jpg)). The edge-type filter then says "No edges in this view" and cannot be used until the user expands ([image](pr-2068-call-feedback/03-galaxy-edge-filter-empty-at-depth-0.jpg)).+- **Cause:** `select` sets depth 0 (`galaxy/use-graph-scope.ts:130`). `loadGraphScope` runs zero hops for a single root (`galaxy/graph-scope.ts:136`).+- **Change:** node and symbol scopes start at depth 1, and the minus button stops at 1 for them. File and folder scopes keep depth 0; they already include their internal edges.+- **Tests:** `use-graph-scope.test.tsx` load-count expectations.++**G3 (P1) Zoom goes to the screen centre, never to the cursor.**+- **Measured:** wheel zoom moves the camera exactly along its view direction (ratio 1.000) for both cursor positions. That holds for the single node, for one layer around `JSONBAgg` (49.6 units) and for the whole graph (1,058 units). The Architecture scenes behave the same way.+- **Cause:** the OrbitControls have no `zoomToCursor` (`galaxy/GraphScene.tsx:933`, `architecture/ArchitectureScene.tsx:340`, `architecture/SystemArchitectureScene.tsx:286`). The installed three-stdlib 2.36.1 supports it and drei passes the prop through.+- **Change:** enable `zoomToCursor` in all three scenes, and check that it interacts correctly with the custom camera animator.+- **Verification:** the same capture. With the fix, the ratio must drop clearly below 1 and the node under the cursor must stay under it.++**G4 (P1) The starting node is lost after expanding.**+- **Measured:** at one layer `JSONBAgg` is still the visual centre. At two layers (90 nodes, 201 edges) it cannot be found ([image](pr-2068-call-feedback/04-galaxy-two-layers-root-lost.jpg)). `Func` at one layer (99 nodes, 112 edges) is the starburst from the call, with labels stacked in the centre ([image](pr-2068-call-feedback/05-galaxy-func-starburst.jpg)).+- **Cause:**+ - The organic layout pins the root only through `previous`, which is dropped when `organicKey` changes (`galaxy/organic-clusters.ts:285-305`).+ - The fit centres the cloud, not the root (`galaxy/camera-frame.ts:fitCamera`).+ - Screen separation pushes nodes radially and may move them out of view (`galaxy/screen-node-spacing.ts:78-112`).+ - Nothing marks the root (`GalaxyPanel.tsx:2393`).+- **Change:**+ - Pin the roots at the origin across expansions.+ - Give the root its own marker (ring and halo) and an always-visible label.+ - Centre the fit on the root.+ - Exclude the root from separation, and fit after separation so no node ends up outside the view.+ - The organic layout stays: rings were rejected deliberately (`organic-clusters.test.ts:109`).+- **Tests:** `organic-clusters.test.ts` (root fixed across expansion), `camera-frame.test.ts`.++**G5 (P2) Tracing and path view.** Step-by-step call order is missing, as said in the call. Proposal: a path overlay modelled on Graphify.+- Pick a target node; the shortest path inside the loaded scope is highlighted with labelled edge types and everything else is dimmed.+- Step through it hop by hop, and order calls by `edge.line`.+- Data: the scope edges and `levels` that are already loaded, so both directions work without a backend change. `/api/trace` today is outbound only, CALLS or data, and callables only (`src/ui/atlas_flows.c:770-867`).+- Two small bugs to fix on the way:+ - `RpcIntelligenceClient.tracePath` sends `callers`/`callees` and `max_depth`, but the server expects `inbound`/`outbound` and `depth` (`graph-ui/src/provider/rpc-client.ts:335-346`).+ - The hop columns of `scopedHierarchy` are wrong while loading, because the hop is derived from global z values (`galaxy/graph-scope.ts:215`).++**G6 (P2) Distance with meaning** (hops, code distance, or file and folder hierarchy). Proposal: use hops only, and only inside the path view and the hierarchy view. The overview stays as it is.++**G7 (P1, small) The toolbar wraps.** At 1600 CSS pixels the Galaxy toolbar breaks into a second row ("Edges 20.000" moves down), even with the chat closed.++### Chat and local agent++**C1 (P1) The model reads and repeats internal field names.**+- **Measured:** the prompt actually sent for `JSONBAgg` is a dump of JSON paths:+ ```+ Snapshot.view: "galaxy"+ Snapshot.generation: "unavailable"+ Scope.renderedNodes: 15+ Relationships.items[0].source.qualifiedName: ...+ Upstream omissions[0].path: "$.relationships.items[17].source"+ ```+- **What the model makes of it:**+ - The automatic explanation invents names such as `djangodevelopers.postgres.aggregates.jsonbaGG` and stops mid-sentence ([image](pr-2068-call-feedback/07-chat-explanation-hallucinated-truncated.jpg)).+ - For `BaseCommand` it says the command "has no roots", its "scope is not complete and requires indexing" and there are "up to 4 upstream omissions". At the same time the graph shows 130 nodes ([image](pr-2068-call-feedback/09-chat-basecommand-internal-keys.jpg)).+- **Cause:** `GalaxyPanel.tsx:1137-1157` builds the evidence, and `browser-ai/explanation-context.ts:115-187` turns it into `path: value` lines.+- **Change:** format Galaxy evidence as readable facts. For example: the selection with kind and file; incoming relationships grouped by edge type with complete counts and names; then outgoing ones. Internal keys (snapshot, view, generation, renderedNodes, omission paths) never reach the prompt.++**C2 (P1) "Who calls JSONBAgg?" gets no caller at all.**+- **Measured:**+ - **Index:** 23 incoming rows: 11 test functions in `tests/postgres_tests/test_aggregates.py` with CALLS, the same 11 with TESTS, and DEFINES from `general.py`.+ - **Prompt:** contains exactly one of 18 relationship items, the outgoing INHERITS of `JSONBAgg` itself, followed by "14 additional graph summary lines omitted". Not one caller name.+ - **Answer:** it lists `django.db.models.fields.*`, repeats `django.db.models.fields.DateTimeField` from item 13 to item 47 and stops at item 48 ([image](pr-2068-call-feedback/08-chat-who-calls-repetition.jpg)).+- **Cause:**+ - Arrays are cut to three items before the budget is even applied (`explanation-context.ts:120`).+ - Edges are cut to 24 (`GalaxyPanel.tsx:1149`).+ - Callers and callees are mixed under `both`.+ - Manual chat decodes greedily with no repetition penalty and 512 tokens (`browser-ai/browser-ai.worker.ts:132-152`, `browser-ai/model-policy.ts:45`).+- **Change:**+ - Caller and callee questions get a deterministic list from the loaded graph, complete counts by edge type, then names up to the budget, then "+N more". The model only phrases it, as the PR design already intends ("deterministic source-cited answers with an optional local-model wording pass").+ - Apply the repetition penalty and n-gram block in manual chat too.+ - The worker reports why it stopped, and the UI shows "shortened (token limit)".+ - Show a capacity note when the scope does not fit the prompt, e.g. "104 nodes / 117 edges: too large for the local 0.5B model; showing N".+ - Trim history to the input budget (`chat-model.ts:97-101`).++**C3 (P1) "Selection details" covers the chat input and blocks the send button.**+- **Measured:** the toggle sits at x 1452-1588, y 922-961, inside the input at x 1193-1588, y 904-965 ([image](pr-2068-call-feedback/06-chat-selection-details-covers-input.jpg)). Playwright cannot click Send: `<summary>Selection details</summary> ... intercepts pointer events`. The question had to be sent with Enter.+- **Cause:** `.galaxy-selection-evidence` is absolutely positioned. `.atlas-galaxy` has no `position` in the Galaxy workspace, so the box is placed relative to `.atlas-workspace-content`, the grid that also holds the chat column (`why/selection-context.css:13`, `galaxy/graph-exploration.css:33`, `styles/workspace.css:18-36`).+- **Change:** `position: relative` for `.atlas-galaxy` in the Galaxy workspace. Verify with chat open, chat closed and fullscreen.++**C4 (P1) Explanations are generated again on every return.**+- **Measured:** going back to the same selection shows "Explaining selection..." and the agent runs again.+- **Cause:** there is one explanation slot and no cache per selection (`BrowserChatDock.tsx:77-169`). The key contains values that change while a scope loads (`proactive-selection.ts:22`). An explanation can also start before the expansion completes; the `BaseCommand` text above describes the state before it.+- **Change:**+ - A per-selection cache keyed by project, workspace, root id, direction, edge types and depth.+ - No volatile counts in the key.+ - Start an explanation only once the scope is complete.++**C5 (P2) Token limits in the agent configuration.**+- **Measured:** the dialog offers model, automatic explanations and history only ([image](pr-2068-call-feedback/10-agent-configuration-no-token-limits.jpg)). Model choice and the automatic flag are `useState` only and reset on reload (`BrowserChatDock.tsx:76, 89`).+- **Change:** input and output token limits per model, bounded by `model-policy.ts`, stored in the browser following `settings/view-preferences.ts`. Also store the model choice and the automatic flag.++**C6 (P2) Header.**+- **Current:** "● Agent active · Qwen2.5 Coder 0.5B" next to the panel toggle ([image](pr-2068-call-feedback/11-header-agent-status.jpg)).+- **Proposal from the call:** a robot icon with a status lamp; a click opens the agent configuration (it already does); the model name moves to the tooltip and the configuration.+- **Code:** `app/AtlasChrome.tsx:680-689`. `AtlasChrome.test.tsx:94` expects the model name in the header and changes with it.++### Architecture++**A1 (P1) Overview loses its perspective after opening a large area.**+- **Measured:**+ - The Django root shows 7 parts in the tilted 3D view ([image](pr-2068-call-feedback/12-overview-django-root.jpg)).+ - After "Open area" on `django`, the plates fill the whole canvas. Full-path labels ("django/contrib/...") overlap, and the footer reads "Partial map · 40 parts" ([image](pr-2068-call-feedback/13-overview-django-drill-in-flat.jpg)).+ - "Fit map" and three wheel steps do not change that.+ - Control: opening `src/mcp` in this repository keeps the perspective, but external areas (`src/cli`, `graph-ui`, `(root)`) sit inside the picture ([image](pr-2068-call-feedback/14-overview-cbm-drill-in-control.jpg)).+- **Cause:**+ - The folder layout is computed for every file of the area, but only 40 are drawn. The pruned platforms keep their full size and the fit frames them (`architecture/semantic-graph.ts:425, 446`).+ - Areas are one folder deep except under `src|lib|internal|packages|apps|services`, so `django/` jumps straight to files (`architecture/repository-map.ts:25-34`).+ - File heights are scaled against the largest area (`architecture/source-metrics.ts:120-124`).+ - Labels are full paths and are never culled outside hotspots (`ArchitectureScene.tsx:338`).+- **Change:**+ - Opening an area shows its next folder level as area blocks, with `areaOf` relative to the current path.+ - Cap before the layout.+ - Scale heights per scope.+ - Use basename labels with `adaptiveLabels`.+ - Put external areas in a separate lane.+ - Goal: the same perspective at every level.++**A2 (P1) System structure is empty for Django and does not say why.**+- **Measured:** `get_architecture` (`system_structure`) returns `status: "limited"` with the warning "The architecture response exceeded its memory budget; narrow the requested projection." after 451 ms, with 0 components and 0 entry points. Totals are 52,402 nodes and 274,549 edges, below the 100,000 / 500,000 budgets.+- **Refuted guess:** the edge budget does not explain this. The limit is the 32 MB JSON budget (`src/store/architecture_projection.c:18`, `2008-2012`).+- **What the UI shows:** "No component projection is available within this analysis budget." with the default filters ([image](pr-2068-call-feedback/15-system-structure-django-empty.jpg)), and "No component cycles match the current filters" with "Group cycles" enabled (the call screenshot). The actual warning is visible only inside the collapsed "Evidence and limits" section.+- **Frontend change:** when the result is limited or has zero groups, show the warning text in the empty state, and choose the message before the cycle filter (`architecture/SystemArchitecture.tsx:286-299, 371-382`).+- **Backend (proposal):** a repository of Django's size should not exceed the response budget with the displayed projection already capped. Martin to decide whether to cap earlier or stream.++**A3 (P1) Behavior is empty for Django.**+- **Measured:** the start list holds only "Choose an operation…" for Django ([image](pr-2068-call-feedback/16-behavior-django-empty.jpg)). For the control repository it holds 128 operations (`main` plus TS/JS exports).+- **Causes:**+ - The projection is limited, see A2, so no entry points are emitted.+ - Python entry points are only functions named `main` (`internal/cbm/extract_defs.c:3815-3826`).+ - The frontend auto-pick accepts only `main` (`architecture/SystemArchitecture.tsx:25-31`).+ - `behavior.source_id` arrives as `0` when nothing is chosen, and `??` does not fall through on `0` (`architecture/behavior-journey-model.ts:104`).+- **Frontend change:**+ - Treat `0` as no selection.+ - When there are no entry points, fill the list from `/api/flows` (route handlers, call-graph roots), or allow searching any Function or Method.+ - Widen the auto-pick beyond `main`.+- **Backend (proposal):** Python entry points beyond `main`, such as Django views and route handlers. `ap_test_path` also marks `django/test/` as test code and misses `tests.py`.++**A4 (P2) Routes, Endpoints: the idea is good but the view is verbose.** Dozens of route labels overlap, most of them registered under `tests/` ([image](pr-2068-call-feedback/17-routes-endpoints-django.jpg)). Proposal:+- group by first path segment or app folder, with counts+- hide test routes by default+- enable `adaptiveLabels`++The model already supports `filter` and `maxNodes`, but the UI hard-wires the filter to `''` (`architecture/ArchitecturePanel.tsx:115`).++### Confirmed as intended, no change++- Hotspots of folders are drawn flat on purpose.+- Explorer and Galaxy share the same selected-node view on purpose.+- System shows configuration, indexes, watchers and "Errors and logs" with a severity filter. How an error entry stands out was not exercised, since no error occurred during the run.++### Side finding: the style gate fails on `50a6a67b`++`node tools/style-gate.mjs` in `graph-ui/` exits 1 on the unchanged PR head. The new files of this branch add no hit.++- 16 long dashes, in `fixtures/adr/*.md`, `src/browser-ai/BrowserChatDock.test.tsx` and `src/browser-ai/reader-chat-context*.ts`.+- 11 hardcoded chrome strings: `src/app/AtlasChrome.tsx` (7), `src/App.tsx` (3), `src/projects/ProjectsPanel.tsx` (1).+- 2 attribution name hits outside the rule files, in `README.md` and `src/settings/ConfigReference.tsx`.++`scripts/ci/test-ui.sh` runs this gate, so the `test-ui` job would fail on the current head. I propose fixing it together with the P1 commits, unless Martin prefers to do it himself.++## Decisions requested++1. Depth 1 as the start for node and symbol scopes, with a minimum of 1 (G2).+2. Pin and mark the root and centre the fit on it, while keeping the organic layout (G4).+3. Path view as an overlay on the loaded scope; `/api/trace` stays unchanged for now (G5).+4. Distance as hops, only in the path and hierarchy views (G6).+5. Deterministic caller and callee lists in chat, with the model for wording only (C2).+6. Token limits and model choice stored in the browser, per model, within the model policy (C5).+7. Robot icon with a status lamp in the header; the model name moves to the tooltip (C6).+8. Routes grouped, with test routes hidden by default (A4).+9. Backend, for Martin: the JSON budget for Django-sized projections (A2), Python entry points and `ap_test_path` (A3).+10. Evidence policy: only these 17 images are committed; the full series stays local.++## Order and verification after approval++1. **P1 frontend fixes**, one commit per topic: G1, G2, G3, G4, C3, C1, C2, C4, A2, A3, A1, G7. Each comes with focused vitest coverage:+ - `GalaxyPanel.test.tsx`, `use-graph-scope.test.tsx`, `use-organic-layout.test.tsx`, `organic-clusters.test.ts`+ - explanation-context and chat dock tests+ - `behavior-journey-model.test.ts` with `source_id: 0`+ - `SystemArchitecture.test.tsx` with an empty limited result+ - `semantic-graph.test.ts` above 40 nodes+2. **P2 items** as approved.+3. **Final checks:** `scripts/ci/test-ui.sh`, then the same capture script against Django and the control repository. Before and after appear side by side, with the canvas, camera and prompt measurements above as acceptance criteria.diff --git a/docs/development/pr-2068-call-feedback/01-galaxy-select-blank-canvas.jpg b/docs/development/pr-2068-call-feedback/01-galaxy-select-blank-canvas.jpgnew file mode 100644index 000000000..8f23c1377Binary files /dev/null and b/docs/development/pr-2068-call-feedback/01-galaxy-select-blank-canvas.jpg differdiff --git a/docs/development/pr-2068-call-feedback/02-galaxy-select-isolated-node.jpg b/docs/development/pr-2068-call-feedback/02-galaxy-select-isolated-node.jpgnew file mode 100644index 000000000..0cb7583c1Binary files /dev/null and b/docs/development/pr-2068-call-feedback/02-galaxy-select-isolated-node.jpg differdiff --git a/docs/development/pr-2068-call-feedback/03-galaxy-edge-filter-empty-at-depth-0.jpg b/docs/development/pr-2068-call-feedback/03-galaxy-edge-filter-empty-at-depth-0.jpgnew file mode 100644index 000000000..76816c563Binary files /dev/null and b/docs/development/pr-2068-call-feedback/03-galaxy-edge-filter-empty-at-depth-0.jpg differdiff --git a/docs/development/pr-2068-call-feedback/04-galaxy-two-layers-root-lost.jpg b/docs/development/pr-2068-call-feedback/04-galaxy-two-layers-root-lost.jpgnew file mode 100644index 000000000..fcfe436c2Binary files /dev/null and b/docs/development/pr-2068-call-feedback/04-galaxy-two-layers-root-lost.jpg differdiff --git a/docs/development/pr-2068-call-feedback/05-galaxy-func-starburst.jpg b/docs/development/pr-2068-call-feedback/05-galaxy-func-starburst.jpgnew file mode 100644index 000000000..121574da1Binary files /dev/null and b/docs/development/pr-2068-call-feedback/05-galaxy-func-starburst.jpg differdiff --git a/docs/development/pr-2068-call-feedback/06-chat-selection-details-covers-input.jpg b/docs/development/pr-2068-call-feedback/06-chat-selection-details-covers-input.jpgnew file mode 100644index 000000000..657e023f1Binary files /dev/null and b/docs/development/pr-2068-call-feedback/06-chat-selection-details-covers-input.jpg differdiff --git a/docs/development/pr-2068-call-feedback/07-chat-explanation-hallucinated-truncated.jpg b/docs/development/pr-2068-call-feedback/07-chat-explanation-hallucinated-truncated.jpgnew file mode 100644index 000000000..6843a8355Binary files /dev/null and b/docs/development/pr-2068-call-feedback/07-chat-explanation-hallucinated-truncated.jpg differdiff --git a/docs/development/pr-2068-call-feedback/08-chat-who-calls-repetition.jpg b/docs/development/pr-2068-call-feedback/08-chat-who-calls-repetition.jpgnew file mode 100644index 000000000..88d102ab0Binary files /dev/null and b/docs/development/pr-2068-call-feedback/08-chat-who-calls-repetition.jpg differdiff --git a/docs/development/pr-2068-call-feedback/09-chat-basecommand-internal-keys.jpg b/docs/development/pr-2068-call-feedback/09-chat-basecommand-internal-keys.jpgnew file mode 100644index 000000000..f26bce5eaBinary files /dev/null and b/docs/development/pr-2068-call-feedback/09-chat-basecommand-internal-keys.jpg differdiff --git a/docs/development/pr-2068-call-feedback/10-agent-configuration-no-token-limits.jpg b/docs/development/pr-2068-call-feedback/10-agent-configuration-no-token-limits.jpgnew file mode 100644index 000000000..132d50963Binary files /dev/null and b/docs/development/pr-2068-call-feedback/10-agent-configuration-no-token-limits.jpg differdiff --git a/docs/development/pr-2068-call-feedback/11-header-agent-status.jpg b/docs/development/pr-2068-call-feedback/11-header-agent-status.jpgnew file mode 100644index 000000000..7a15f8f98Binary files /dev/null and b/docs/development/pr-2068-call-feedback/11-header-agent-status.jpg differdiff --git a/docs/development/pr-2068-call-feedback/12-overview-django-root.jpg b/docs/development/pr-2068-call-feedback/12-overview-django-root.jpgnew file mode 100644index 000000000..c2da76c31Binary files /dev/null and b/docs/development/pr-2068-call-feedback/12-overview-django-root.jpg differdiff --git a/docs/development/pr-2068-call-feedback/13-overview-django-drill-in-flat.jpg b/docs/development/pr-2068-call-feedback/13-overview-django-drill-in-flat.jpgnew file mode 100644index 000000000..4c20607a2Binary files /dev/null and b/docs/development/pr-2068-call-feedback/13-overview-django-drill-in-flat.jpg differdiff --git a/docs/development/pr-2068-call-feedback/14-overview-cbm-drill-in-control.jpg b/docs/development/pr-2068-call-feedback/14-overview-cbm-drill-in-control.jpgnew file mode 100644index 000000000..1823e4584Binary files /dev/null and b/docs/development/pr-2068-call-feedback/14-overview-cbm-drill-in-control.jpg differdiff --git a/docs/development/pr-2068-call-feedback/15-system-structure-django-empty.jpg b/docs/development/pr-2068-call-feedback/15-system-structure-django-empty.jpgnew file mode 100644index 000000000..bc8a6fbf3Binary files /dev/null and b/docs/development/pr-2068-call-feedback/15-system-structure-django-empty.jpg differdiff --git a/docs/development/pr-2068-call-feedback/16-behavior-django-empty.jpg b/docs/development/pr-2068-call-feedback/16-behavior-django-empty.jpgnew file mode 100644index 000000000..69150aea9Binary files /dev/null and b/docs/development/pr-2068-call-feedback/16-behavior-django-empty.jpg differdiff --git a/docs/development/pr-2068-call-feedback/17-routes-endpoints-django.jpg b/docs/development/pr-2068-call-feedback/17-routes-endpoints-django.jpgnew file mode 100644index 000000000..e290a5171Binary files /dev/null and b/docs/development/pr-2068-call-feedback/17-routes-endpoints-django.jpg differdiff --git a/graph-ui/tools/call-feedback-capture.mjs b/graph-ui/tools/call-feedback-capture.mjsnew file mode 100644index 000000000..4345ecb96--- /dev/null+++ b/graph-ui/tools/call-feedback-capture.mjs@@ -0,0 +1,600 @@+#!/usr/bin/env node+/*+ * Screenshot-Serien zum Feedback aus dem Review-Call vom 02.10.2026.+ *+ * node tools/call-feedback-capture.mjs --origin http://127.0.0.1:4350 \+ * --out verification/call-feedback-2026-10-02/ist --profile /tmp/profile \+ * [--project django-demo] [--control cbm] [--scenarios galaxy,chat,architecture] [--headless]+ *+ * Ein Video kann der Pruefer nicht ansehen. Darum zerlegt dieses Skript jede+ * Bewegung in einzelne Bilder: vor der Aktion, beim Hovern, direkt nach dem+ * Klick und dann nach 250 ms, 1 s und 3 s, jeder Mausrad-Schritt einzeln. Ein+ * eingeblendeter Ring zeigt, wo der Mauszeiger steht, denn Screenshots zeigen+ * ihn nicht. Zu jedem Bild schreibt das Skript den gemessenen Zustand mit:+ * Kamera, ob die Zeichenflaeche dieselbe geblieben ist, die Zaehler der+ * Galaxie und die Statuszeile. Ohne diese Zahlen waere ein Zuruecksetzen+ * zwischen zwei Bildern unsichtbar.+ *+ * Es startet keinen Server. Es braucht einen laufenden Server mit UI, dessen+ * Index die Projekte enthaelt, und ein eigenes Browserprofil, damit ein+ * heruntergeladenes Modell beim naechsten Lauf wieder da ist.+ */++import { chromium } from 'playwright';+import { mkdir, writeFile } from 'node:fs/promises';+import { join, resolve } from 'node:path';++const argv = process.argv.slice(2);+const arg = (name, fallback) => {+ const index = argv.indexOf(`--${name}`);+ if (index < 0) return fallback;+ const value = argv[index + 1];+ return value === undefined || value.startsWith('--') ? true : value;+};++const ORIGIN = String(arg('origin', 'http://127.0.0.1:4350')).replace(/\/$/, '');+const OUT = resolve(String(arg('out', 'verification/call-feedback-2026-10-02/ist')));+const PROFILE = resolve(String(arg('profile', join(OUT, '..', 'profile'))));+const PROJECT = String(arg('project', 'django-demo'));+const CONTROL = String(arg('control', 'cbm'));+const SCENARIOS = String(arg('scenarios', 'galaxy,chat,architecture,header,system')).split(',');+const HEADLESS = arg('headless', false) === true;+const CHAT_MODEL = arg('chat-model', true) !== 'false';++const VIEWPORT = { width: 1600, height: 1000 };++/* ------------------------------------------------------------------ */+/* Server-Abfragen, damit die Bilder gegen echte Kanten gehalten werden */++let rpcId = 1;+async function tool(name, args) {+ const res = await fetch(`${ORIGIN}/rpc`, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: rpcId++, method: 'tools/call', params: { name, arguments: args } }),+ });+ const body = await res.json();+ const text = body?.result?.content?.[0]?.text ?? '';+ try { return JSON.parse(text); } catch { return { raw: text, error: body?.error }; }+}++async function cypher(project, query) {+ return tool('query_graph', { project, query });+}++/* ------------------------------------------------------------------ */+/* Was in jede Seite eingesetzt wird */++function pageProbe() {+ try { localStorage.setItem('cbm.workspace.setup', 'done'); } catch { /* ohne Speicher geht es auch */ }++ // Der sichtbare Mauszeiger.+ const mountCursor = () => {+ if (document.getElementById('probe-cursor')) return;+ const dot = document.createElement('div');+ dot.id = 'probe-cursor';+ dot.style.cssText = 'position:fixed;left:-100px;top:-100px;width:22px;height:22px;margin:-11px 0 0 -11px;'+ + 'border:2px solid #ff3b6b;border-radius:50%;box-shadow:0 0 0 2px rgba(0,0,0,.6);pointer-events:none;z-index:2147483647;';+ const cross = document.createElement('div');+ cross.style.cssText = 'position:absolute;left:9px;top:9px;width:4px;height:4px;background:#ff3b6b;border-radius:50%;';+ dot.appendChild(cross);+ document.documentElement.appendChild(dot);+ document.addEventListener('mousemove', (event) => {+ dot.style.left = `${event.clientX}px`;+ dot.style.top = `${event.clientY}px`;+ }, true);+ };+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', mountCursor);+ else mountCursor();++ // Welche Zeichenflaeche gerade steht: eine neu aufgebaute bekommt eine neue Nummer.+ window.__probeCanvasSeq = 0;+ window.__probeCanvasId = () => {+ const canvas = document.querySelector('.atlas-galaxy canvas') ?? document.querySelector('canvas');+ if (!canvas) return null;+ if (!canvas.dataset.probeId) canvas.dataset.probeId = String(++window.__probeCanvasSeq);+ return canvas.dataset.probeId;+ };++ // Was zwischen Seite und Modell-Worker hin und her geht: der echte Prompt.+ window.__probeWorker = [];+ const keep = (entry) => {+ window.__probeWorker.push(entry);+ if (window.__probeWorker.length > 4000) window.__probeWorker.splice(0, 1000);+ };+ const safe = (value) => {+ try { return JSON.parse(JSON.stringify(value, (key, item) => (typeof item === 'string' && item.length > 20000 ? `${item.slice(0, 20000)}...` : item))); }+ catch { return String(value); }+ };+ const NativeWorker = window.Worker;+ window.Worker = class ProbeWorker extends NativeWorker {+ constructor(url, options) {+ super(url, options);+ this.__probeSrc = String(url);+ if (this.__probeSrc.includes('browser-ai')) {+ this.addEventListener('message', (event) => keep({ dir: 'from-worker', t: performance.now(), data: safe(event.data) }));+ }+ }+ postMessage(message, transfer) {+ if (this.__probeSrc.includes('browser-ai')) keep({ dir: 'to-worker', t: performance.now(), data: safe(message) });+ return super.postMessage(message, transfer);+ }+ };++ // Ein Zeitstrahl der Kamera, alle 100 ms, unabhaengig von den Bildern.+ window.__probeTimeline = [];+ setInterval(() => {+ const fit = globalThis.__atlasGalaxyFit?.measure?.();+ const galaxy = globalThis.__atlasGalaxy;+ window.__probeTimeline.push({+ t: Math.round(performance.now()),+ canvas: window.__probeCanvasId?.() ?? null,+ camera: fit ? fit.camera.position.map((v) => Number(v.toFixed(2))) : null,+ direction: fit ? fit.camera.direction.map((v) => Number(v.toFixed(3))) : null,+ nodes: galaxy?.nodes ?? null,+ fits: galaxy?.fits ?? null,+ targets: galaxy?.targetChanges ?? null,+ });+ if (window.__probeTimeline.length > 6000) window.__probeTimeline.splice(0, 2000);+ }, 100);+}++/* ------------------------------------------------------------------ */+/* Bilder und Zustand */++class Series {+ constructor(page, name, title) {+ this.page = page;+ this.dir = join(OUT, name);+ this.name = name;+ this.title = title;+ this.entries = [];+ this.n = 0;+ this.notes = [];+ }++ async state() {+ return this.page.evaluate(() => {+ const fit = globalThis.__atlasGalaxyFit?.measure?.();+ const galaxy = globalThis.__atlasGalaxy;+ const status = [...document.querySelectorAll('.atlas-galaxy-toolbar, .atlas-galaxy-scope-status, [role="status"]')]+ .map((el) => el.textContent?.trim()).filter(Boolean).slice(0, 6);+ return {+ url: location.pathname + location.search,+ canvas: window.__probeCanvasId?.() ?? null,+ canvases: document.querySelectorAll('canvas').length,+ galaxy: galaxy ? {+ nodes: galaxy.nodes, fits: galaxy.fits, targetChanges: galaxy.targetChanges,+ highlighted: galaxy.highlightedCount, lastTargetQn: galaxy.lastTargetQn, mode: galaxy.mode,+ headline: galaxy.headline, drawnEdges: galaxy.drawnEdges, edgeNote: galaxy.edgeNote,+ lastFit: galaxy.lastFit,+ } : null,+ fit: fit ? {+ nodes: fit.nodes, inside: fit.inside, outside: fit.outside, behind: fit.behind,+ marginPx: fit.marginPx, box: fit.box, fill: fit.fill, camera: fit.camera, worst: fit.worst,+ } : null,+ status,+ };+ });+ }++ async shot(label, note, options = {}) {+ this.n += 1;+ const file = `${String(this.n).padStart(2, '0')}-${label}.png`;+ await mkdir(this.dir, { recursive: true });+ await this.page.screenshot({ path: join(this.dir, file), fullPage: false, ...(options.clip ? { clip: options.clip } : {}) });+ const state = await this.state().catch((error) => ({ error: String(error) }));+ this.entries.push({ file, note, at: Date.now(), state, ...(options.extra ? { extra: options.extra } : {}) });+ console.log(`[${this.name}] ${file} ${note}`);+ return state;+ }++ note(text) {+ this.notes.push(text);+ console.log(`[${this.name}] note: ${text}`);+ }++ async save(extra = {}) {+ await mkdir(this.dir, { recursive: true });+ const timeline = await this.page.evaluate(() => window.__probeTimeline ?? []).catch(() => []);+ await writeFile(join(this.dir, 'state.json'), JSON.stringify({ title: this.title, entries: this.entries, notes: this.notes, timeline, ...extra }, null, 2));+ const lines = [`# ${this.title}`, '', '| Bild | Was es zeigt | Zeichenflaeche | Kamera |', '|---|---|---|---|'];+ for (const entry of this.entries) {+ const cam = entry.state?.fit?.camera?.position?.map((v) => v.toFixed(0)).join(', ') ?? '';+ lines.push(`| ${entry.file} | ${entry.note} | ${entry.state?.canvas ?? ''} | ${cam} |`);+ }+ if (this.notes.length) lines.push('', '## Notizen', '', ...this.notes.map((note) => `- ${note}`));+ await writeFile(join(this.dir, 'index.md'), `${lines.join('\n')}\n`);+ }+}++const wait = (ms) => new Promise((done) => setTimeout(done, ms));++/** Nach einer Aktion: sofort, 250 ms, 1 s, 3 s. */+async function settle(series, label, note) {+ await series.shot(`${label}-0ms`, `${note} (sofort)`);+ await wait(250);+ await series.shot(`${label}-250ms`, `${note} (nach 250 ms)`);+ await wait(750);+ await series.shot(`${label}-1s`, `${note} (nach 1 s)`);+ await wait(2000);+ await series.shot(`${label}-3s`, `${note} (nach 3 s)`);+}++async function open(page, project, workspace) {+ await page.goto(`${ORIGIN}/?project=${encodeURIComponent(project)}&workspace=${workspace}`, { waitUntil: 'domcontentloaded' });+ await page.waitForSelector('.atlas-shell', { timeout: 30000 });+ await wait(1500);+}++async function galaxyReady(page, timeout = 60000) {+ await page.waitForFunction(() => (globalThis.__atlasGalaxy?.nodes ?? 0) > 0 && globalThis.__atlasGalaxyFit !== undefined, null, { timeout });+ await wait(1500);+}++async function canvasCenter(page) {+ const box = await page.locator('.atlas-galaxy canvas').first().boundingBox();+ if (!box) throw new Error('keine Galaxie-Zeichenflaeche');+ return { box, cx: box.x + box.width / 2, cy: box.y + box.height / 2 };+}++async function searchAndSelect(page, name) {+ const input = page.getByRole('searchbox', { name: 'Find a graph node' }).first();+ await input.click();+ await input.fill('');+ await input.type(name, { delay: 30 });+ const choice = page.locator('.atlas-galaxy-search-results button', { has: page.locator('strong', { hasText: new RegExp(`^${name}$`) }) }).first();+ await choice.waitFor({ timeout: 20000 });+ return choice;+}++async function selectWithLayer(page, name) {+ const choice = await searchAndSelect(page, name);+ await choice.click();+ await wait(3000);+ const expand = page.getByRole('button', { name: 'Expand +1' });+ const text = await page.locator('.atlas-galaxy').innerText().catch(() => '');+ if (/\b0 layers\b/.test(text) && await expand.isEnabled().catch(() => false)) {+ await expand.click();+ await wait(4000);+ }+}++/* ------------------------------------------------------------------ */+/* Szenarien */++async function galaxySelection(page, symbol, prefix, title) {+ const series = new Series(page, `${prefix}-${symbol.toLowerCase()}`, title);+ await open(page, PROJECT, 'galaxy');+ await galaxyReady(page);+ await series.shot('ganzer-graph', 'Galaxie, ganzer Graph, nichts ausgewaehlt');+ const choice = await searchAndSelect(page, symbol);+ await series.shot('suche', `Suche nach ${symbol}, Trefferliste offen`);+ await choice.hover();+ await choice.click();+ await settle(series, 'auswahl', `${symbol} ausgewaehlt`);+ await wait(3000);+ await series.shot('auswahl-6s', `${symbol} ausgewaehlt (nach 6 s, ohne Eingabe)`);++ const expand = page.getByRole('button', { name: 'Expand +1' });+ if (await expand.isEnabled().catch(() => false)) {+ await expand.hover();+ await series.shot('expand-hover', 'Maus auf Expand +1');+ await expand.click();+ await settle(series, 'expand1', 'Expand +1 geklickt');+ if (await expand.isEnabled().catch(() => false)) {+ await expand.click();+ await settle(series, 'expand2', 'Expand +1 ein zweites Mal');+ }+ } else series.note('Expand +1 war nicht klickbar');+ await series.save();+ return series;+}++async function galaxyTraceIncoming(page) {+ const series = new Series(page, 'g3-basecommand-incoming', 'BaseCommand, Trace Incoming, nur CALLS, 2 Ebenen');+ await open(page, PROJECT, 'galaxy');+ await galaxyReady(page);+ const choice = await searchAndSelect(page, 'BaseCommand');+ await choice.click();+ await wait(2500);+ await series.shot('auswahl', 'BaseCommand ausgewaehlt');+ await page.getByLabel('Trace direction').selectOption('inbound');+ await settle(series, 'incoming', 'Richtung Incoming');+ const filter = page.locator('details.atlas-trace-edge-filter').first();+ await filter.locator('summary').click();+ await wait(400);+ await series.shot('kantentypen-offen', 'Edge-types-Liste offen');+ const only = page.getByRole('button', { name: 'Only CALLS', exact: true });+ if (await only.count()) {+ await only.first().click();+ await settle(series, 'nur-calls', 'Nur CALLS');+ } else series.note('Kein Only-Knopf fuer CALLS gefunden');+ await filter.locator('summary').click().catch(() => {});+ const expand = page.getByRole('button', { name: 'Expand +1' });+ if (await expand.isEnabled().catch(() => false)) {+ await expand.click();+ await settle(series, 'expand1', 'Expand +1 mit nur CALLS, Incoming');+ }+ await series.save();+}++async function galaxyZoom(page, whole = false) {+ const series = new Series(page, whole ? 'g5-zoom-ganzer-graph' : 'g4-zoom',+ whole ? 'Mausrad-Zoom an zwei Cursorpositionen, ganzer Graph' : 'Mausrad-Zoom an zwei Cursorpositionen, JSONBAgg mit einer Ebene');+ await open(page, PROJECT, 'galaxy');+ await galaxyReady(page);+ if (!whole) {+ const choice = await searchAndSelect(page, 'JSONBAgg');+ await choice.click();+ await wait(3000);+ const expand = page.getByRole('button', { name: 'Expand +1' });+ const layers = await page.locator('.atlas-galaxy').innerText().catch(() => '');+ if (/\b0 layers\b/.test(layers) && await expand.isEnabled().catch(() => false)) await expand.click();+ await wait(5000);+ } else {+ await wait(2000);+ }+ const { box, cx, cy } = await canvasCenter(page);+ const spots = [+ { label: 'rechts-oben', x: Math.min(box.x + box.width - 80, cx + box.width * 0.28), y: Math.max(box.y + 80, cy - box.height * 0.25) },+ { label: 'links-unten', x: Math.max(box.x + 80, cx - box.width * 0.3), y: Math.min(box.y + box.height - 80, cy + box.height * 0.28) },+ ];+ const measures = [];+ for (const spot of spots) {+ await page.getByRole('button', { name: 'fit view' }).click().catch(() => {});+ await wait(1500);+ await page.mouse.move(spot.x, spot.y, { steps: 8 });+ await wait(300);+ const before = await series.shot(`${spot.label}-start`, `Cursor ${spot.label} (${Math.round(spot.x)}, ${Math.round(spot.y)}), vor dem Zoomen`);+ measures.push({ spot: spot.label, step: 0, camera: before?.fit?.camera });+ for (let step = 1; step <= 5; step += 1) {+ await page.mouse.wheel(0, -240);+ await wait(700);+ const after = await series.shot(`${spot.label}-zoom${step}`, `Cursor ${spot.label}, Mausrad-Schritt ${step} hinein`);+ measures.push({ spot: spot.label, step, camera: after?.fit?.camera });+ }+ }+ // Wohin die Kamera beim Zoomen wandert: entlang der Blickrichtung (Zoom zur Mitte)+ // oder seitlich weg (Zoom zum Cursor).+ const analysis = [];+ for (const spot of spots) {+ const rows = measures.filter((row) => row.spot === spot.label && row.camera);+ if (rows.length < 2) continue;+ const a = rows[0].camera;+ const b = rows[rows.length - 1].camera;+ const delta = a.position.map((v, i) => b.position[i] - v);+ const length = Math.hypot(...delta) || 1;+ const along = Math.abs(delta.reduce((sum, v, i) => sum + v * a.direction[i], 0)) / length;+ analysis.push({ spot: spot.label, moved: Number(length.toFixed(2)), alongViewDirection: Number(along.toFixed(4)) });+ }+ series.note(`Kamerabewegung beim Zoomen (1.0 = genau entlang der Blickrichtung, also Zoom zur Bildmitte): ${JSON.stringify(analysis)}`);+ await series.save({ zoomAnalysis: analysis, measures });+}++async function chatScenario(page) {+ const series = new Series(page, 'c1-chat', 'Chat in der Galaxie: Ueberlappung, Prompt, Antwort, Cache');+ await open(page, PROJECT, 'galaxy');+ await galaxyReady(page);+ await selectWithLayer(page, 'JSONBAgg');+ await series.shot('chat-zu', 'JSONBAgg mit einer Ebene, Chat geschlossen');+ const toggle = page.getByRole('button', { name: 'Open chat' });+ if (await toggle.count()) {+ await toggle.click();+ await wait(1200);+ }+ await series.shot('chat-offen', 'Chat geoeffnet');+ const measureOverlap = async (label) => {+ const row = page.locator('.cbm-chat-input-row');+ if (!(await row.count())) { series.note(`${label}: keine Chat-Eingabe sichtbar`); return; }+ const composer = await row.first().boundingBox();+ const details = await page.locator('.atlas-galaxy-selection-details').first().boundingBox().catch(() => null);+ const overlap = composer && details ? !(details.x > composer.x + composer.width || details.x + details.width < composer.x+ || details.y > composer.y + composer.height || details.y + details.height < composer.y) : null;+ series.note(`${label}: Selection details ${JSON.stringify(details)}; Chat-Eingabe ${JSON.stringify(composer)}; ueberlappen: ${overlap}`);+ if (composer) {+ const x = Math.max(0, composer.x - 220);+ const y = Math.max(0, composer.y - 120);+ await series.shot(`${label}-eingabe-ausschnitt`, `${label}: Ausschnitt Chat-Eingabe unten rechts`, {+ clip: { x, y, width: Math.min(VIEWPORT.width - x, composer.width + 240), height: Math.min(260, VIEWPORT.height - y) },+ });+ }+ };+ await measureOverlap('vor-agent');++ if (CHAT_MODEL) {+ const enable = page.getByRole('button', { name: 'Enable agent' });+ if (await enable.count()) {+ await enable.click();+ await wait(800);+ await series.shot('agent-konfiguration', 'Agent configuration geoeffnet');+ const load = page.getByRole('button', { name: /Download & load|Load model|Reload model/ });+ if (await load.count()) {+ await load.first().click();+ series.note('Modell wird geladen (Download beim ersten Lauf)');+ await page.waitForFunction(() => !document.querySelector('.cbm-chat-enable'), null, { timeout: 900000 }).catch(() => series.note('Modell nicht innerhalb von 15 min geladen'));+ }+ await page.keyboard.press('Escape').catch(() => {});+ await wait(1000);+ }+ await series.shot('agent-bereit', 'Agent nach dem Laden');+ await measureOverlap('agent-bereit');+ // Die automatische Erklaerung abwarten.+ await page.waitForFunction(() => {+ const section = document.querySelector('.cbm-chat-explanation');+ return section && !section.textContent?.includes('Preparing') && section.querySelector('.cbm-chat-retry');+ }, null, { timeout: 240000 }).catch(() => series.note('Keine fertige automatische Erklaerung binnen 4 min'));+ await series.shot('erklaerung', 'Automatische Erklaerung der Auswahl');+ const auto = await page.evaluate(() => window.__probeWorker.filter((entry) => entry.dir === 'to-worker'));+ series.note(`Nachrichten an den Worker bis zur Erklaerung: ${auto.length}`);++ const before = await page.evaluate(() => window.__probeWorker.length);+ const prompt = page.locator('#cbm-chat-prompt');+ await prompt.click();+ await prompt.fill('Who calls JSONBAgg? List every caller and the edge type.');+ await series.shot('frage', 'Frage eingegeben: Who calls JSONBAgg?');+ try {+ await page.getByRole('button', { name: 'Send ↑' }).click({ timeout: 4000 });+ series.note('Senden-Knopf per Maus klickbar');+ } catch (error) {+ const reason = String(error?.message ?? error).match(/<summary>[^<]*<\/summary>[^\n]*intercepts pointer events/)?.[0] ?? String(error?.message ?? error).split('\n')[0];+ series.note(`Senden-Knopf per Maus NICHT klickbar: ${reason}`);+ await prompt.press('Enter');+ }+ await wait(1500);+ await series.shot('antwort-laeuft', 'Antwort wird erzeugt');+ await page.waitForFunction(() => !document.querySelector('.cbm-chat-send[aria-label="Stop"]'), null, { timeout: 300000 }).catch(() => series.note('Antwort nicht binnen 5 min fertig'));+ await wait(800);+ await series.shot('antwort', 'Antwort fertig');+ const transcript = await page.locator('.cbm-chat-transcript').innerText().catch(() => '');+ const sent = await page.evaluate((from) => window.__probeWorker.slice(from), before);++ // Zum Vergleich: die echten eingehenden Kanten aus dem Index.+ const truth = await cypher(PROJECT, "MATCH (a)-[r]->(b) WHERE b.name = 'JSONBAgg' RETURN a.name AS source, type(r) AS type, a.file_path AS file ORDER BY type, source LIMIT 200");++ // Cache: weg und wieder zurueck zur selben Auswahl.+ await selectWithLayer(page, 'BaseCommand');+ await wait(4000);+ await series.shot('andere-auswahl', 'Andere Auswahl (BaseCommand, eine Ebene)');+ const mark = await page.evaluate(() => window.__probeWorker.length);+ await selectWithLayer(page, 'JSONBAgg');+ await series.shot('zurueck-1s', 'Zurueck zu JSONBAgg (nach 1,5 s)');+ await wait(6000);+ await series.shot('zurueck-7s', 'Zurueck zu JSONBAgg (nach 7,5 s)');+ const again = await page.evaluate((from) => window.__probeWorker.slice(from).filter((entry) => entry.dir === 'to-worker').length, mark);+ series.note(`Neue Worker-Auftraege nach Rueckkehr zur selben Auswahl: ${again} (0 hiesse: aus dem Cache)`);+ await series.save({ transcript, workerAfterQuestion: sent, workerAuto: auto, truth });+ } else {+ await series.save();+ }+}++async function headerScenario(page) {+ const series = new Series(page, 'h1-header', 'Agent-Anzeige oben rechts');+ await open(page, PROJECT, 'galaxy');+ await wait(1500);+ const header = await page.locator('.atlas-agent-group, .atlas-browser-ai-action').first().boundingBox().catch(() => null);+ await series.shot('kopfzeile', 'Kopfzeile');+ if (header) await series.shot('agent-ausschnitt', 'Ausschnitt Agent-Anzeige', { clip: { x: Math.max(0, header.x - 360), y: Math.max(0, header.y - 12), width: Math.min(VIEWPORT.width - Math.max(0, header.x - 360), header.width + 420), height: header.height + 24 } });+ await series.save();+}++async function architectureScenario(page, project, prefix) {+ const series = new Series(page, `${prefix}-architecture-${project}`, `Architecture-Tabs, Projekt ${project}`);+ await open(page, project, 'architecture');+ await wait(4000);+ await series.shot('overview-wurzel', 'Overview auf Wurzelebene');+ const tabs = ['Overview', 'Routes', 'Hotspots', 'System structure', 'Behavior'];+ const views = { Overview: 'overview', Routes: 'routes', Hotspots: 'hotspots', 'System structure': 'structure', Behavior: 'behavior' };+ const tab = (name) => page.locator(`button.atlas-arch-tab[data-view="${views[name]}"]`).first();++ // Reinklicken: den groessten Bereich doppelt anklicken.+ const area = project === 'django-demo' ? 'django' : 'src/mcp';+ const label = page.locator('button.architecture-node-label', { hasText: new RegExp(`^\\W*${area.replace('/', '\\/')}\\s*$`) }).first();+ if (await label.count()) {+ await label.hover();+ await series.shot('overview-hover', `Maus auf Bereich ${area}`);+ await label.click();+ await wait(600);+ await series.shot('overview-auswahl', `Bereich ${area} ausgewaehlt`);+ const openArea = page.getByRole('button', { name: /Open area/ }).first();+ if (await openArea.count()) {+ await openArea.hover();+ await series.shot('overview-open-area-hover', 'Maus auf Open area');+ await openArea.click();+ } else {+ await page.locator(`button.architecture-node-label.is-selected`).first().dblclick();+ }+ await settle(series, 'overview-drillin', `In ${area} hineingeklickt`);+ const fit = page.getByRole('button', { name: 'Fit map' });+ if (await fit.count()) { await fit.click(); await wait(1200); await series.shot('overview-drillin-fit', 'Fit map nach dem Hineinklicken'); }+ const canvas = await page.locator('.architecture-scene canvas, canvas').first().boundingBox();+ if (canvas) {+ await page.mouse.move(canvas.x + canvas.width * 0.7, canvas.y + canvas.height * 0.3, { steps: 6 });+ for (let step = 1; step <= 3; step += 1) { await page.mouse.wheel(0, -240); await wait(600); await series.shot(`overview-zoom${step}`, `Mausrad-Schritt ${step}, Cursor rechts oben`); }+ }+ } else series.note(`Bereich ${area} als Label nicht gefunden`);++ for (const name of tabs.slice(1)) {+ await tab(name).click().catch(() => series.note(`Tab ${name} nicht gefunden`));+ await wait(name === 'System structure' || name === 'Behavior' ? 9000 : 4000);+ await series.shot(`tab-${name.toLowerCase().replace(/\s+/g, '-')}`, `Tab ${name}`);+ if (name === 'Routes') {+ const endpoints = page.getByRole('button', { name: 'Endpoints', exact: true });+ if (await endpoints.count()) { await endpoints.click(); await wait(3000); await series.shot('routes-endpoints', 'Routes, Endpoints'); }+ }+ if (name === 'System structure') {+ const evidence = page.locator('summary', { hasText: 'Evidence and limits' }).first();+ if (await evidence.count()) { await evidence.click(); await wait(500); await series.shot('system-evidence', 'Evidence and limits aufgeklappt'); }+ }+ if (name === 'Behavior') {+ const start = page.locator('select').first();+ const options = await start.locator('option').allTextContents().catch(() => []);+ series.note(`Behavior, Startliste (${options.length} Eintraege): ${JSON.stringify(options.slice(0, 15))}`);+ }+ }+ const backend = await tool('get_architecture', { project, aspects: ['system_structure'], format: 'json' });+ const summary = {+ status: backend?.status ?? backend?.result?.status, warnings: backend?.warnings ?? backend?.result?.warnings,+ totals: backend?.totals ?? backend?.result?.totals, limits: backend?.limits ?? backend?.result?.limits,+ elapsed_ms: backend?.elapsed_ms ?? backend?.result?.elapsed_ms,+ groups: (backend?.groups ?? backend?.result?.groups ?? []).length, entrypoints: (backend?.entrypoints ?? backend?.result?.entrypoints ?? []).length,+ keys: Object.keys(backend ?? {}),+ };+ series.note(`get_architecture system_structure: ${JSON.stringify(summary)}`);+ await series.save({ systemStructure: summary });+}++async function systemScenario(page) {+ const series = new Series(page, 's1-system', 'System-Tab: Konfiguration, Indizes, Watcher, Logs');+ await open(page, PROJECT, 'system');+ await wait(3000);+ await series.shot('system', 'System-Tab');+ for (const name of ['Configuration', 'Indexes', 'Logs']) {+ const control = page.getByRole('tab', { name, exact: true }).first();+ if (await control.count()) { await control.click().catch(() => {}); await wait(1500); await series.shot(`system-${name.toLowerCase()}`, `System, ${name}`); }+ }+ await series.save();+}++/* ------------------------------------------------------------------ */++const context = await chromium.launchPersistentContext(PROFILE, {+ headless: HEADLESS,+ viewport: VIEWPORT,+ deviceScaleFactor: 2,+ args: ['--enable-unsafe-webgpu', '--ignore-gpu-blocklist'],+});+await context.addInitScript(pageProbe);+const page = context.pages()[0] ?? await context.newPage();+page.on('pageerror', (error) => console.error(`[pageerror] ${error.message}`));+await mkdir(OUT, { recursive: true });++const failures = [];+const run = async (name, fn) => {+ try { await fn(); }+ catch (error) { failures.push({ name, error: String(error?.stack ?? error) }); console.error(`[${name}] FEHLER ${error?.message ?? error}`); }+};++if (SCENARIOS.includes('galaxy')) {+ await run('g1', () => galaxySelection(page, 'JSONBAgg', 'g1', 'JSONBAgg auswaehlen, warten, zweimal Expand +1'));+ await run('g2', () => galaxySelection(page, 'Func', 'g2', 'Func (grosser Fall) auswaehlen, warten, Expand +1'));+ await run('g3', () => galaxyTraceIncoming(page));+ await run('g4', () => galaxyZoom(page));+ await run('g5', () => galaxyZoom(page, true));+}+if (SCENARIOS.includes('zoom')) {+ await run('g4', () => galaxyZoom(page));+ await run('g5', () => galaxyZoom(page, true));+}+if (SCENARIOS.includes('header')) await run('h1', () => headerScenario(page));+if (SCENARIOS.includes('architecture')) {+ await run('a1', () => architectureScenario(page, PROJECT, 'a1'));+ await run('a2', () => architectureScenario(page, CONTROL, 'a2'));+}+if (SCENARIOS.includes('system')) await run('s1', () => systemScenario(page));+if (SCENARIOS.includes('chat')) await run('c1', () => chatScenario(page));++await writeFile(join(OUT, 'run.json'), JSON.stringify({ origin: ORIGIN, project: PROJECT, control: CONTROL, scenarios: SCENARIOS, failures }, null, 2));+await context.close();+if (failures.length) { console.error(`${failures.length} Szenario(s) mit Fehler`); process.exitCode = 1; }