Files
Martin VogelandBernhard Jackiewicz 67e39d16c0 feat(ui): replace graph-ui with CodeAtlasWeb by Bernhard Jackiewicz
Imports the CodeAtlasWeb companion frontend verbatim from
BernhardJackiewicz/CodeAtlasWeb at commit
1825f9c850ac794066e02606012508b9d393c6aa as the new graph-ui and removes
the previous React frontend.

This is Bernhard Jackiewicz's work, contributed with his agreement and
squashed here from his development history (41 commits, cycles W0
through W15). The maintainer only relocates it: every product decision,
line of code and test below graph-ui/ is his. The seven galaxy files
that originate in this repository's previous graph-ui, and the pinned
3D libraries, are listed in graph-ui/THIRD_PARTY.md.

What it is: a local reading IDE on the CBM read surface. A read-only
Monaco source reader, a semantic twin that follows the caret, entry,
bug-hunt, change-scope and flow reading modes, deterministic
source-cited explanations with an optional local-model wording pass
(llama-server sidecar, off unless the reader starts one; no model or
binary ships), a persistent galaxy with focus following in both
directions, a live-agent overlay fed by a loopback bridge, explicit
air-gap, provenance and index-limit messaging, and an offline
acceptance and browser verification harness.

It consumes POST /rpc (the read-only tool allowlist), GET /api/layout,
and the atlas routes /api/tree, /api/trace, /api/flows and /api/flow,
plus the real ingest_traces store for observed calls; all of these are
on feat/atlas-r1 (#1860), which this change stacks on.

Not imported: CLAUDE.md (an agent-instruction file, which stays
local-only in this repository), and the recorded proof artifacts under
graph-ui/verification/, which follow in a separate commit so they can
be reviewed and dropped on their own.

Build wiring, the dev-proxy port contract, the CSP allowance for the
sidecar and bridge ports, and the control surfaces the previous
frontend had (project indexing, ADR editor, logs) follow in separate
maintainer commits.

Design and tracking: #1964.

Co-authored-by: Bernhard Jackiewicz <bj@techport.io>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-09-05 20:05:43 +02:00

78 lines
3.1 KiB
JavaScript

/**
* Die Grenzen als Regel, an erfundenen Ergebnissen bewiesen.
*
* Ein Trockentest und kein Modellauf, und das ist hier keine Bequemlichkeit:
* geprueft wird die ENTSCHEIDUNG, nicht die Messung. Ein Test, der sechs
* Modelle laden muesste, um zu zeigen, dass 0.55 unter 0.6 liegt, waere ein
* Test, den niemand bei jedem `npm run test:unit` fahren wuerde, und genau
* dieser Test muss bei jedem Lauf mitkommen: er ist die Absicherung dagegen,
* dass die Grenzen wieder zu einem Satz im ADR werden.
*/
import { describe, expect, it } from 'vitest';
import { EVAL_BOUNDS, boundViolations, violationsOf } from './eval-bounds.mjs';
const good = { name: 'Qwen3.5-2B', passRate: 0.682, citationCompliance: 0.932 };
const gemma = { name: 'gemma-4-E4B', passRate: 0.841, citationCompliance: 1 };
describe('EVAL_BOUNDS', () => {
it('nennt die zwei Zahlen des ADR und wo sie herkommen', () => {
expect(EVAL_BOUNDS.passRate).toBe(0.6);
expect(EVAL_BOUNDS.citationCompliance).toBe(0.9);
expect(EVAL_BOUNDS.source).toMatch(/w5b\.test\.mjs/);
});
});
describe('violationsOf', () => {
it('schweigt zu einem Ergebnis, das beide Grenzen haelt', () => {
expect(violationsOf('Klasse A', good)).toEqual([]);
});
it('meldet eine zu niedrige Trefferquote mit Zahl und Grenze', () => {
const found = violationsOf('Klasse A', { ...good, passRate: 0.59 });
expect(found).toHaveLength(1);
expect(found[0]).toMatch(/passRate 0\.59/);
expect(found[0]).toMatch(/0\.6/);
});
it('meldet eine zu niedrige Zitattreue getrennt von der Trefferquote', () => {
const found = violationsOf('Klasse A', { ...good, citationCompliance: 0.899 });
expect(found).toHaveLength(1);
expect(found[0]).toMatch(/Zitattreue/);
});
it('laesst die Grenze selbst gelten und nicht erst den Wert darueber', () => {
expect(violationsOf('x', { passRate: 0.6, citationCompliance: 0.9 })).toEqual([]);
});
it('haelt eine fehlende Zahl fuer eine Verletzung und nicht fuer unbekannt', () => {
expect(violationsOf('x', {})).toHaveLength(2);
expect(violationsOf('x', { passRate: 0.7 })[0]).toMatch(/nicht gemessen/);
});
it('meldet beide Grenzen, wenn ein Modell beide reisst', () => {
expect(violationsOf('x', { passRate: 0.2, citationCompliance: 0.3 })).toHaveLength(2);
});
});
describe('boundViolations', () => {
it('laesst den aufgezeichneten Lauf durch, beide Sieger', () => {
expect(boundViolations({ A: good, B: gemma })).toEqual([]);
});
it('haelt eine Klasse ohne Sieger fuer eine Verletzung', () => {
const found = boundViolations({ A: good, B: undefined });
expect(found).toHaveLength(1);
expect(found[0]).toMatch(/kein Sieger/);
});
it('nennt die Klasse und das Modell, damit man weiss, wen es betrifft', () => {
const found = boundViolations({ A: { name: 'LFM2.5-1.2B', passRate: 0.295, citationCompliance: 0.432 } });
expect(found).toHaveLength(2);
for (const line of found) {
expect(line).toMatch(/Klasse A \(LFM2\.5-1\.2B\)/);
}
});
});