The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
tech(KF-3, D-W3-7b): der tote Doppel-Dekodier-Zweig im Mobile-Client, die lockere Sperrklinke, und das letzte Raster-Hauszeichen
Davidb133160bcdee
diff --git a/mobile-client/agent-core.js b/mobile-client/agent-core.jsindex 63f17c5b..2842dd85 100644--- a/mobile-client/agent-core.js+++ b/mobile-client/agent-core.js@@ -76,14 +76,31 @@ import { stripNonCanonicalTags } from './personas.js'if(raw == null) return {};if(typeof raw === 'object') return raw;if(typeof raw !== 'string') return {};- var trimmed = raw.trim();- if(!trimmed) return {};- try{ var parsed = JSON.parse(trimmed); return (parsed && typeof parsed === 'object') ? parsed : {}; }catch(_){}- // Some models double-encode the args (string of a string of JSON)- if(trimmed.charAt(0) === '"' && trimmed.charAt(trimmed.length-1) === '"'){- try{ var inner = JSON.parse(trimmed); if(typeof inner === 'string'){- try{ var parsed2 = JSON.parse(inner); return (parsed2 && typeof parsed2 === 'object') ? parsed2 : {}; }catch(_){}- }}catch(_){}+ var text = raw.trim();+ // Peel the JSON wrappers one layer at a time.+ //+ // The ordinary shape is `'{"path":"a.txt"}'`. The other one models really+ // send is that string ENCODED AGAIN — `'"{\"path\":\"a.txt\"}"'` — and it+ // is why this is a loop and not one parse followed by a special case.+ //+ // The special case that stood here until 01.09.2026 could never run. A+ // double-encoded argument IS valid JSON (a JSON string), so the first+ // `JSON.parse` SUCCEEDED, `typeof parsed` was 'string', and the function+ // returned `{}` before reaching the unwrapping written below it — exactly+ // the failure that branch claimed to repair. Feeding the result back+ // through the parser is the whole fix.+ //+ // The bound is belt and braces: each successful parse of a JSON string+ // yields a strictly shorter string, so the loop terminates on its own.+ // Four layers is far past anything a model has been seen to emit and+ // stops adversarial input from buying more than four parses.+ for(var layer = 0; layer < 4; layer++){+ if(!text) return {};+ var parsed;+ try{ parsed = JSON.parse(text); }catch(_){ return {}; }+ if(parsed && typeof parsed === 'object') return parsed;+ if(typeof parsed !== 'string') return {};+ text = parsed.trim();}return {};}diff --git a/mobile-client/client.js b/mobile-client/client.jsindex 4d7f78b1..2a5b1ea3 100644--- a/mobile-client/client.js+++ b/mobile-client/client.js@@ -103,6 +103,27 @@ import {// Expose for inline handlers (rare path, but keeps symmetry with prev API)window._svgIcon = svgIcon;+ // ── Das Hauszeichen ──+ //+ // Zeigt den <symbol id="lu-monogram"> aus index.html. Bis 01.09.2026 stand+ // an den vier Stellen darunter je ein <img src="/LU-monogram-white.png"> —+ // dieselbe 512x512-Bitmap, heruntergerechnet auf 18, 22, 64 und 82 Pixel,+ // waehrend die Desktop-App laengst public/LU-monogram.svg zeigte (0b9c0f66).+ //+ // Warum <use> und kein <img src="/LU-monogram.svg">: der Remote-Server+ // liefert keine Dateien aus mobile-client/ aus. Er baut EINE Seite+ // (src-tauri/src/mobile_page.rs) und haelt daneben genau eine Bildroute,+ // `/LU-monogram-white.png`. Ein SVG-Pfad waere ein 404 gewesen. Inline+ // gebraucht die Seite gar keine Route mehr.+ //+ // `label` leer heisst dekorativ: das Zeichen steht dann neben einer+ // Textmarke, die dasselbe schon sagt, und wird ausgeblendet statt doppelt+ // vorgelesen.+ function monogram(cls, label){+ var a11y = label ? 'role="img" aria-label="' + label + '"' : 'aria-hidden="true"';+ return '<svg class="' + cls + '" ' + a11y + ' focusable="false"><use href="#lu-monogram"/></svg>';+ }+//@@LU_CAVEMAN@@// Cached copy of the desktop's RemotePermissions (filesystem / downloads /@@ -469,7 +490,7 @@ import {if(!TOKEN){el('app').innerHTML ='<div class="auth-screen">' +- '<img class="auth-mark" src="/LU-monogram-white.png" alt="">' ++ monogram('auth-mark') +'<div class="auth-logo">LU</div>' +'<div class="auth-sub">Remote</div>' +'<form class="auth-form" id="auth-form">' +@@ -638,7 +659,7 @@ import {'<div class="app-header">' +'<button class="icon-btn" onclick="window._toggleDrawer()" aria-label="Menu"><span class="material-symbols-outlined">'+svgIcon('menu')+'</span></button>' +'<span class="header-brand" aria-label="LU">' +- '<img class="header-mark" src="/LU-monogram-white.png" alt="LU">' ++ monogram('header-mark', 'LU') +'</span>' +modeTag +'<button class="model-badge" onclick="window._openModelPicker()" aria-label="Select model">' +@@ -706,7 +727,7 @@ import {'<aside class="drawer'+(drawerOpen?' open':'')+'">' +'<div class="drawer-header">' +'<span class="drawer-brand">' +- '<img class="drawer-mark" src="/LU-monogram-white.png" alt="">' ++ monogram('drawer-mark') +'<span class="drawer-logo">LU</span>' +'</span>' +'<button class="drawer-close" onclick="window._toggleDrawer()" aria-label="Close"><span class="material-symbols-outlined">'+svgIcon('close')+'</span></button>' +@@ -883,7 +904,7 @@ import {: (currentModel ? 'Ready' : 'Select a model');p.innerHTML ='<div class="chat-welcome">' +- '<img class="chat-welcome-mark" src="/LU-monogram-white.png" alt="">' ++ monogram('chat-welcome-mark') +'<div class="chat-welcome-logo">LU</div>' +'<div class="chat-welcome-tag">'+H(tag)+'</div>' +'</div>';diff --git a/mobile-client/index.html b/mobile-client/index.htmlindex 8f32ca39..bbd1ff6f 100644--- a/mobile-client/index.html+++ b/mobile-client/index.html@@ -18,6 +18,16 @@</style></head><body>+<!-- Das Hauszeichen als Vektor, EINMAL im Dokument. Die vier Stellen, die+ es zeigen (Anmeldung 64px, Kopfzeile 22px, Schublade 18px, Willkommen+ 82px), holen es per <use>. Bis 01.09.2026 stand hier viermal ein 512px-+ PNG ueber /LU-monogram-white.png; die Desktop-App war da laengst auf+ public/LU-monogram.svg umgestellt (0b9c0f66). Inline statt <img src>,+ weil der Remote-Server keine Dateien aus mobile-client/ ausliefert: er+ baut EINE Seite und haelt genau eine Bildroute. Die Pfaddaten sind+ Byte fuer Byte die aus public/LU-monogram.svg — festgehalten von+ src/api/__tests__/mobile-hauszeichen-ist-vektor.test.ts. -->+<svg class="svg-sprite" aria-hidden="true" focusable="false"><symbol id="lu-monogram" viewBox="0 0 1024.000000 1024.000000" preserveAspectRatio="xMidYMid meet"><g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)" fill="#ffffff" stroke="none"> <path d="M6400 8490 c0 -7 -560 -10 -1660 -10 -1100 0 -1660 -3 -1660 -10 0 -5 -22 -10 -50 -10 -27 0 -50 -4 -50 -10 0 -5 -18 -10 -40 -10 -22 0 -40 -4 -40 -10 0 -5 -13 -10 -30 -10 -16 0 -30 -4 -30 -10 0 -5 -13 -10 -30 -10 -16 0 -30 -4 -30 -10 0 -5 -13 -10 -30 -10 -16 0 -30 -4 -30 -10 0 -5 -9 -10 -20 -10 -11 0 -20 -4 -20 -10 0 -5 -9 -10 -20 -10 -11 0 -20 -4 -20 -10 0 -5 -9 -10 -20 -10 -11 0 -20 -4 -20 -10 0 -5 -8 -10 -18 -10 -10 0 -24 -9 -32 -20 -8 -11 -22 -20 -32 -20 -10 0 -18 -4 -18 -10 0 -5 -8 -10 -18 -10 -10 0 -24 -9 -32 -20 -8 -11 -21 -20 -28 -20 -7 0 -31 -18 -52 -40 -21 -22 -43 -40 -49 -40 -15 0 -201 -186 -201 -201 0 -6 -18 -28 -40 -49 -22 -21 -40 -45 -40 -52 0 -7 -9 -20 -20 -28 -11 -8 -20 -22 -20 -32 0 -10 -4 -18 -10 -18 -5 0 -10 -8 -10 -18 0 -10 -9 -24 -20 -32 -11 -8 -20 -22 -20 -32 0 -10 -4 -18 -10 -18 -5 0 -10 -9 -10 -20 0 -11 -4 -20 -10 -20 -5 0 -10 -9 -10 -20 0 -11 -4 -20 -10 -20 -5 0 -10 -9 -10 -20 0 -11 -4 -20 -10 -20 -5 0 -10 -13 -10 -30 0 -16 -4 -30 -10 -30 -5 0 -10 -13 -10 -30 0 -16 -4 -30 -10 -30 -5 0 -10 -13 -10 -30 0 -16 -4 -30 -10 -30 -5 0 -10 -18 -10 -40 0 -22 -4 -40 -10 -40 -5 0 -10 -22 -10 -50 0 -27 -4 -50 -10 -50 -7 0 -10 -633 -10 -1880 0 -1247 -3 -1880 -10 -1880 -5 0 -10 -18 -10 -40 0 -22 5 -40 10 -40 6 0 10 -43 10 -110 0 -67 4 -110 10 -110 6 0 10 -27 10 -60 0 -33 4 -60 10 -60 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -18 10 -40 0 -22 5 -40 10 -40 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -9 10 -20 0 -11 5 -20 10 -20 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -9 10 -20 0 -11 5 -20 10 -20 6 0 10 -9 10 -20 0 -11 5 -20 10 -20 6 0 10 -8 10 -18 0 -10 9 -24 20 -32 11 -8 20 -22 20 -32 0 -10 5 -18 10 -18 6 0 10 -8 10 -18 0 -10 9 -24 20 -32 11 -8 20 -21 20 -28 0 -7 18 -31 40 -52 22 -21 40 -43 40 -49 0 -15 166 -181 181 -181 5 0 32 -22 59 -50 27 -27 55 -50 62 -50 8 0 20 -9 28 -20 8 -11 22 -20 32 -20 10 0 18 -4 18 -10 0 -5 8 -10 18 -10 10 0 24 -9 32 -20 8 -11 22 -20 32 -20 10 0 18 -4 18 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -10 0 -5 14 -10 30 -10 17 0 30 -4 30 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -10 0 -5 14 -10 30 -10 17 0 30 -4 30 -10 0 -5 14 -10 30 -10 17 0 30 -4 30 -10 0 -5 18 -10 40 -10 22 0 40 -4 40 -10 0 -6 27 -10 60 -10 33 0 60 -4 60 -10 0 -7 680 -10 2020 -10 1340 0 2020 3 2020 10 0 6 27 10 60 10 33 0 60 4 60 10 0 6 18 10 40 10 22 0 40 5 40 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 9 10 20 10 11 0 20 5 20 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 9 10 20 10 11 0 20 5 20 10 0 6 9 10 20 10 11 0 20 5 20 10 0 6 8 10 18 10 10 0 24 9 32 20 8 11 22 20 32 20 10 0 18 5 18 10 0 6 7 10 16 10 9 0 29 14 44 30 15 17 33 30 40 30 7 0 25 14 40 30 15 17 33 30 39 30 15 0 201 186 201 201 0 6 14 24 30 39 17 15 30 33 30 40 0 7 14 25 30 40 17 15 30 35 30 44 0 9 5 16 10 16 6 0 10 8 10 18 0 10 9 24 20 32 11 8 20 22 20 32 0 10 5 18 10 18 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 14 10 30 0 17 5 30 10 30 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 14 10 30 0 17 5 30 10 30 6 0 10 14 10 30 0 17 5 30 10 30 6 0 10 18 10 40 0 22 5 40 10 40 6 0 10 27 10 60 0 33 4 60 10 60 7 0 10 683 10 2030 0 1347 -3 2030 -10 2030 -5 0 -10 23 -10 50 0 28 -4 50 -10 50 -5 0 -10 18 -10 40 0 22 -4 40 -10 40 -5 0 -10 14 -10 30 0 17 -4 30 -10 30 -5 0 -10 14 -10 30 0 17 -4 30 -10 30 -5 0 -10 14 -10 30 0 17 -4 30 -10 30 -5 0 -10 9 -10 20 0 11 -4 20 -10 20 -5 0 -10 9 -10 20 0 11 -4 20 -10 20 -5 0 -10 9 -10 20 0 11 -4 20 -10 20 -5 0 -10 8 -10 18 0 10 -9 24 -20 32 -11 8 -20 22 -20 32 0 10 -4 18 -10 18 -5 0 -10 8 -10 18 0 10 -9 24 -20 32 -11 8 -20 21 -20 28 0 8 -13 27 -30 42 -16 15 -30 33 -30 39 0 15 -226 241 -241 241 -6 0 -24 14 -39 30 -15 17 -34 30 -42 30 -7 0 -20 9 -28 20 -8 11 -21 20 -30 20 -9 0 -22 9 -30 20 -8 11 -22 20 -32 20 -10 0 -18 5 -18 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -13 10 -30 10 -16 0 -30 5 -30 10 0 6 -13 10 -30 10 -16 0 -30 5 -30 10 0 6 -13 10 -30 10 -16 0 -30 5 -30 10 0 6 -18 10 -40 10 -22 0 -40 5 -40 10 0 6 -22 10 -50 10 -27 0 -50 5 -50 10 0 6 -43 10 -110 10 -67 0 -110 4 -110 10 0 16 -337 13 -343 -2 -4 -10 -8 -9 -17 2 -9 11 -13 12 -17 3 -6 -15 -63 -18 -63 -3 0 6 -9 10 -20 10 -11 0 -20 -4 -20 -10 0 -5 -9 -10 -20 -10 -11 0 -20 5 -20 10 0 6 -4 10 -10 10 -5 0 -10 -4 -10 -10z m700 -360 c0 -5 23 -10 50 -10 28 0 50 -4 50 -10 0 -5 18 -10 40 -10 22 0 40 -4 40 -10 0 -5 14 -10 30 -10 17 0 30 -4 30 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -10 0 -5 14 -10 30 -10 17 0 30 -4 30 -10 0 -5 8 -10 18 -10 10 0 24 -9 32 -20 8 -11 22 -20 32 -20 10 0 18 -4 18 -10 0 -5 8 -10 18 -10 10 0 24 -9 32 -20 8 -11 21 -20 28 -20 7 0 31 -18 52 -40 21 -22 43 -40 49 -40 15 0 121 -106 121 -121 0 -6 18 -28 40 -49 22 -21 40 -45 40 -52 0 -7 9 -20 20 -28 11 -8 20 -22 20 -32 0 -10 5 -18 10 -18 6 0 10 -8 10 -18 0 -10 9 -24 20 -32 12 -8 20 -26 20 -42 0 -15 5 -28 10 -28 6 0 10 -9 10 -20 0 -11 5 -20 10 -20 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -27 10 -60 0 -33 4 -60 10 -60 7 0 10 -663 10 -1970 0 -1307 -3 -1970 -10 -1970 -5 0 -10 -22 -10 -50 0 -27 -4 -50 -10 -50 -5 0 -10 -18 -10 -40 0 -22 -4 -40 -10 -40 -5 0 -10 -13 -10 -30 0 -16 -4 -30 -10 -30 -5 0 -10 -9 -10 -20 0 -11 -4 -20 -10 -20 -5 0 -10 -13 -10 -30 0 -16 -4 -30 -10 -30 -5 0 -10 -8 -10 -18 0 -10 -9 -24 -20 -32 -11 -8 -20 -22 -20 -32 0 -10 -4 -18 -10 -18 -5 0 -10 -8 -10 -18 0 -10 -9 -24 -20 -32 -11 -8 -20 -21 -20 -28 0 -7 -18 -31 -40 -52 -22 -21 -40 -43 -40 -49 0 -15 -106 -121 -121 -121 -6 0 -28 -18 -49 -40 -21 -22 -45 -40 -52 -40 -7 0 -20 -9 -28 -20 -8 -11 -21 -20 -30 -20 -9 0 -22 -9 -30 -20 -8 -11 -22 -20 -32 -20 -10 0 -18 -4 -18 -10 0 -5 -9 -10 -20 -10 -11 0 -20 -4 -20 -10 0 -5 -13 -10 -30 -10 -16 0 -30 -4 -30 -10 0 -5 -9 -10 -20 -10 -11 0 -20 -4 -20 -10 0 -5 -13 -10 -30 -10 -16 0 -30 -4 -30 -10 0 -5 -18 -10 -40 -10 -22 0 -40 -4 -40 -10 0 -5 -22 -10 -50 -10 -27 0 -50 -4 -50 -10 0 -7 -667 -10 -1980 -10 -1313 0 -1980 3 -1980 10 0 6 -22 10 -50 10 -27 0 -50 5 -50 10 0 6 -18 10 -40 10 -22 0 -40 5 -40 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -13 10 -30 10 -16 0 -30 5 -30 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -8 10 -18 10 -10 0 -24 9 -32 20 -8 11 -21 20 -30 20 -9 0 -22 9 -30 20 -8 11 -20 20 -28 20 -7 0 -35 23 -62 50 -27 28 -54 50 -60 50 -14 0 -60 46 -60 60 0 7 -18 29 -40 50 -22 21 -40 45 -40 52 0 7 -9 20 -20 28 -11 8 -20 21 -20 30 0 9 -9 22 -20 30 -11 8 -20 22 -20 32 0 10 -4 18 -10 18 -5 0 -10 9 -10 20 0 11 -4 20 -10 20 -5 0 -10 9 -10 20 0 11 -4 20 -10 20 -5 0 -10 9 -10 20 0 11 -4 20 -10 20 -5 0 -10 14 -10 30 0 17 -4 30 -10 30 -5 0 -10 14 -10 30 0 17 -4 30 -10 30 -5 0 -10 14 -10 30 0 17 -4 30 -10 30 -5 0 -10 23 -10 50 0 28 -4 50 -10 50 -7 0 -10 667 -10 1980 0 1313 3 1980 10 1980 6 0 10 23 10 50 0 28 5 50 10 50 6 0 10 18 10 40 0 22 5 40 10 40 6 0 10 14 10 30 0 17 5 30 10 30 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 13 10 28 0 16 8 34 20 42 11 8 20 22 20 32 0 10 5 18 10 18 6 0 10 7 10 16 0 9 14 29 30 44 17 15 30 33 30 40 0 7 14 25 30 40 17 15 30 33 30 39 0 15 106 121 121 121 6 0 28 18 49 40 21 22 45 40 52 40 7 0 20 9 28 20 8 11 21 20 30 20 9 0 22 9 30 20 8 11 22 20 32 20 10 0 18 5 18 10 0 6 9 10 20 10 11 0 20 5 20 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 9 10 20 10 11 0 20 5 20 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 18 10 40 10 22 0 40 5 40 10 0 6 18 10 40 10 22 0 40 5 40 10 0 7 670 10 1990 10 1320 0 1990 -3 1990 -10z"/> <path d="M3033 6805 c-10 -11 -13 -363 -13 -1690 l0 -1675 900 0 c593 0 900 -3 900 -10 0 -15 57 -12 64 3 5 10 7 10 12 0 7 -16 41 -17 46 -2 3 8 10 8 25 -2 12 -7 25 -10 29 -7 8 9 -21 38 -38 38 -8 0 -20 9 -28 20 -8 11 -21 20 -30 20 -9 0 -22 9 -30 20 -8 11 -21 20 -28 20 -8 0 -27 14 -42 30 -15 17 -33 30 -39 30 -15 0 -241 226 -241 241 0 6 -14 24 -30 39 -16 15 -30 34 -30 42 0 7 -9 20 -20 28 -11 8 -20 22 -20 32 0 10 -4 18 -10 18 -5 0 -10 8 -10 18 0 10 -9 24 -20 32 -11 8 -20 22 -20 32 0 17 -19 18 -290 18 l-290 0 0 1346 c0 1153 -2 1347 -14 1360 -21 21 -715 20 -733 -1z"/> <path d="M4340 5750 c0 -707 3 -1070 10 -1070 6 0 10 -27 10 -60 0 -33 4 -60 10 -60 6 0 10 -22 10 -50 0 -27 5 -50 10 -50 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -9 10 -20 0 -11 5 -20 10 -20 6 0 10 -13 10 -30 0 -16 5 -30 10 -30 6 0 10 -9 10 -20 0 -11 5 -20 10 -20 6 0 10 -9 10 -20 0 -11 5 -20 10 -20 6 0 10 -8 10 -18 0 -10 9 -24 20 -32 11 -8 20 -22 20 -32 0 -10 5 -18 10 -18 6 0 10 -7 10 -16 0 -9 14 -29 30 -44 16 -15 30 -33 30 -39 0 -15 226 -241 241 -241 6 0 24 -13 39 -30 15 -16 34 -30 42 -30 7 0 20 -9 28 -20 8 -11 22 -20 32 -20 10 0 18 -4 18 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -10 0 -5 14 -10 30 -10 17 0 30 -4 30 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -10 0 -5 14 -10 30 -10 17 0 30 -4 30 -10 0 -5 18 -10 40 -10 22 0 40 -4 40 -10 0 -5 23 -10 50 -10 28 0 50 -4 50 -10 0 -6 37 -10 90 -10 53 0 90 -4 90 -10 0 -6 43 -10 110 -10 67 0 110 4 110 10 0 6 33 10 80 10 47 0 80 4 80 10 0 6 27 10 60 10 33 0 60 4 60 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 9 10 20 10 11 0 20 5 20 10 0 6 14 10 30 10 17 0 30 5 30 10 0 6 8 10 18 10 10 0 24 9 32 20 8 11 22 20 32 20 10 0 18 5 18 10 0 6 8 10 18 10 10 0 24 9 32 20 8 11 21 20 28 20 8 0 27 14 42 30 15 17 33 30 39 30 15 0 161 146 161 161 0 6 14 24 30 39 17 15 30 34 30 42 0 7 9 20 20 28 11 8 20 21 20 30 0 9 9 22 20 30 11 8 20 22 20 32 0 10 5 18 10 18 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 9 10 20 0 11 5 20 10 20 6 0 10 14 10 30 0 17 5 30 10 30 6 0 10 18 10 40 0 22 5 40 10 40 6 0 10 14 10 30 0 17 5 30 10 30 6 0 10 23 10 50 0 28 5 50 10 50 6 0 10 33 10 80 0 47 4 80 10 80 7 0 10 349 10 1026 0 875 -2 1028 -14 1040 -22 21 -710 21 -732 0 -12 -12 -14 -169 -14 -1070 0 -697 -3 -1056 -10 -1056 -5 0 -10 -18 -10 -40 0 -22 -4 -40 -10 -40 -5 0 -10 -13 -10 -30 0 -16 -4 -30 -10 -30 -5 0 -10 -13 -10 -30 0 -16 -4 -30 -10 -30 -5 0 -10 -9 -10 -20 0 -11 -4 -20 -10 -20 -5 0 -10 -8 -10 -18 0 -10 -9 -24 -20 -32 -11 -8 -20 -20 -20 -27 0 -19 -146 -163 -165 -163 -8 0 -15 -4 -15 -10 0 -5 -9 -10 -20 -10 -11 0 -20 -4 -20 -10 0 -5 -9 -10 -20 -10 -11 0 -20 -4 -20 -10 0 -5 -13 -10 -30 -10 -16 0 -30 -4 -30 -10 0 -5 -18 -10 -40 -10 -22 0 -40 -4 -40 -10 0 -6 -53 -10 -140 -10 -87 0 -140 4 -140 10 0 6 -18 10 -40 10 -22 0 -40 5 -40 10 0 6 -13 10 -30 10 -16 0 -30 5 -30 10 0 6 -9 10 -20 10 -11 0 -20 5 -20 10 0 6 -8 10 -18 10 -10 0 -24 9 -32 20 -8 11 -20 20 -27 20 -17 0 -143 126 -143 143 0 7 -9 19 -20 27 -11 8 -20 22 -20 32 0 10 -4 18 -10 18 -5 0 -10 9 -10 20 0 11 -4 20 -10 20 -5 0 -10 14 -10 30 0 17 -4 30 -10 30 -5 0 -10 14 -10 30 0 17 -4 30 -10 30 -5 0 -10 18 -10 40 0 22 -4 40 -10 40 -6 0 -10 27 -10 60 0 33 -4 60 -10 60 -7 0 -10 343 -10 1010 l0 1010 -370 0 -370 0 0 -1070z"/> </g></symbol></svg><div id="app"></div><script>//@@LU_SCRIPT@@diff --git a/mobile-client/styles.css b/mobile-client/styles.cssindex 6363853e..9c2b781a 100644--- a/mobile-client/styles.css+++ b/mobile-client/styles.css@@ -22,6 +22,12 @@ body{font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-target the icon. The SVG inside scales to `font-size` via width:1em. */.material-symbols-outlined{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;user-select:none;line-height:0}.material-symbols-outlined svg{width:1em;height:1em;display:block}+/* Der <symbol>-Traeger fuer das Hauszeichen (index.html, direkt hinter+ <body>). Er wird nie selbst gezeichnet, nur von <use> referenziert.+ `display:none` waere die naheliegende Regel und die falsche: in mehreren+ Engines rendert ein <use> nicht mehr, wenn sein Sprite ausgeblendet ist.+ Null Groesse, aus dem Fluss genommen, ist die Form, die ueberall haelt. */+.svg-sprite{position:absolute;width:0;height:0;overflow:hidden}button{-webkit-appearance:none;appearance:none}/* ── Auth ── */diff --git a/src/api/__tests__/mobile-client-shell.ts b/src/api/__tests__/mobile-client-shell.tsindex 74906794..96bde073 100644--- a/src/api/__tests__/mobile-client-shell.ts+++ b/src/api/__tests__/mobile-client-shell.ts@@ -122,3 +122,29 @@ export function loadFromClient<T extends Record<string, unknown>>() as (...args: unknown[]) => Treturn factory(...depNames.map((k) => deps[k]))}++/**+ * One of the client's source files with its COMMENTS removed.+ *+ * Needed because the reasons in this repository name the things they replaced:+ * the note above `monogram()` in client.js and the one above the sprite in+ * index.html both spell out `/LU-monogram-white.png`, and a guard that greps+ * for that string would fire on the explanation of why it is gone.+ *+ * The stripping is deliberately LINE-BASED and not the usual pair of regexes.+ * `src.replace(/\/\*[\s\S]*?\*\//g, '')` was tried first and ate 400 lines of+ * client.js in one bite: the file contains `/*` inside ordinary JavaScript+ * strings (a prompt, a regex), so the "block" it found ran from a string to+ * whatever `*` + `/` came next. Dropping whole comment LINES cannot do that —+ * a line that begins with `//`, `/*` or a continuation `*` is a comment line+ * in all four of these files, and nothing else is touched. HTML comments are+ * the one multi-line form that is removed as a block, because `<!--` cannot+ * appear inside an HTML attribute or a CSS value.+ */+export function codeOnly(source: string): string {+ return source+ .replace(/<!--[\s\S]*?-->/g, '')+ .split('\n')+ .filter((line) => !/^\s*(?:\/\/|\/\*|\*)/.test(line))+ .join('\n')+}diff --git a/src/api/__tests__/mobile-codex-parity.test.ts b/src/api/__tests__/mobile-codex-parity.test.tsindex 9c195b40..e66247e5 100644--- a/src/api/__tests__/mobile-codex-parity.test.ts+++ b/src/api/__tests__/mobile-codex-parity.test.ts@@ -149,29 +149,30 @@ describe('Mobile tool-call repair', () => {})/**- * FINDING (01.09.2026, first real test of this function): the- * double-encoding branch below the first `JSON.parse` is unreachable.+ * FINDING (01.09.2026): the double-encoding branch below the first+ * `JSON.parse` was unreachable. FIXED (KF-3/1, same day).*- * The source reads:+ * The source read:** try{ var parsed = JSON.parse(trimmed);* return (parsed && typeof parsed === 'object') ? parsed : {}; }catch(_){}- * if(trimmed.charAt(0) === '"' && …) // ← double-decode lives here+ * if(trimmed.charAt(0) === '"' && …) // ← double-decode lived here** A double-encoded argument IS valid JSON — a JSON string — so the first- * parse succeeds, `typeof parsed` is 'string', and the function returns `{}`- * before it ever reaches the unwrapping it was written for. The branch can- * only be entered by input that both fails to parse and is quoted at both- * ends, and that input fails the inner parse too.+ * parse succeeded, `typeof parsed` was 'string', and the function returned+ * `{}` before it ever reached the unwrapping it was written for. The branch+ * could only be entered by input that both failed to parse and was quoted at+ * both ends, and that input failed the inner parse too.*- * This test pins what the shipped client really does rather than what the- * comment above the branch says. It is deliberately NOT fixed here: T-75- * moves this code out of a Rust string without changing a byte of it, and- * the page this repository serves is proven identical to the one it served- * before. The fix is its own change.+ * The assertion here used to PIN that `{}` — deliberately, because T-75 moved+ * this code out of a Rust string without changing a byte of it. The move is+ * done, so the pin is pulled forward and now demands the repair the comment+ * always claimed. `repairToolCallArgs` peels layers in a loop; the full+ * range of inputs is played through in+ * mobile-doppelt-kodierte-werkzeugargumente.test.ts.*/- it('does NOT unwrap a double-encoded string — the repair branch is dead code', () => {- expect(repairToolCallArgs(JSON.stringify('{"path":"a.txt"}'))).toEqual({})+ it('unwraps a double-encoded string — the branch that was dead now runs', () => {+ expect(repairToolCallArgs(JSON.stringify('{"path":"a.txt"}'))).toEqual({ path: 'a.txt' })})it('answers {} for null, empty and unparseable input rather than throwing', () => {diff --git a/src/api/__tests__/mobile-doppelt-kodierte-werkzeugargumente.test.ts b/src/api/__tests__/mobile-doppelt-kodierte-werkzeugargumente.test.tsnew file mode 100644index 00000000..0c9ac3a0--- /dev/null+++ b/src/api/__tests__/mobile-doppelt-kodierte-werkzeugargumente.test.ts@@ -0,0 +1,133 @@+/**+ * Die Wache fuer KF-3 (1) — `repairToolCallArgs` im Mobile-Client.+ *+ * ## Was kaputt war+ *+ * `mobile-client/agent-core.js` hatte unter dem ersten `JSON.parse` einen+ * Zweig mit der Aufschrift „Some models double-encode the args". Erreichbar+ * war er nie. Ein doppelt kodiertes Argument — `'"{\"path\":\"a.txt\"}"'` —+ * IST gueltiges JSON, naemlich eine JSON-Zeichenkette. Das erste `JSON.parse`+ * gelang also, `typeof parsed` war `'string'`, und die Funktion gab `{}`+ * zurueck, bevor sie den Zweig auch nur sah. Genau der Fehler, den der+ * Kommentar darueber zu beheben behauptete: der Rust-Endpunkt+ * `/remote-api/agent-tool` bekam ein leeres Argumentobjekt und `file_write`+ * antwortete „needs argument".+ *+ * Bis zum 01.09.2026 war dieses Verhalten sogar FESTGENAGELT+ * (`mobile-codex-parity.test.ts`, „does NOT unwrap a double-encoded string"),+ * weil T-75 den Client byteweise unveraendert aus einem Rust-String heben+ * musste. Der Pin ist mit dieser Reparatur nachgezogen.+ *+ * ## Was diese Datei prueft+ *+ * Nicht die Bytes der Funktion, sondern ihr Verhalten an echten Eingaben:+ * einfach kodiert, doppelt kodiert, dreifach kodiert, mit Leerraum+ * drumherum, kaputt, leer, gar keine Zeichenkette — und dieselben Faelle+ * einmal auf dem Weg, auf dem der Client sie wirklich bekommt (der gezaeunte+ * ```json-Block, den kleine Modelle statt `tool_calls` schicken).+ *+ * ## Gemessener Unterschied zum Desktop (kein Fehler DIESER Datei)+ *+ * `src/lib/tool-call-repair.ts` hat denselben Defekt und behaelt ihn: gemessen+ * am 01.09.2026 gibt `repairToolCallArgs(JSON.stringify('{"path":"a.txt"}'))`+ * dort `{}` zurueck, weil `repairJson` eine geparste Skalar-Zeichenkette ueber+ * `asRepairedJson` zu `null` macht und nie ein zweites Mal parst. Mobile ist+ * damit an dieser Stelle jetzt BESSER als Desktop. Das steht hier als+ * Messwert und nicht als Zusicherung — ein `expect(desktop(...)).toEqual({})`+ * waere wieder ein Pin auf einen Fehler.+ *+ * Lauf: npx vitest run src/api/__tests__/mobile-doppelt-kodierte-werkzeugargumente.test.ts+ */+import { describe, it, expect } from 'vitest'+import {+ extractToolCallsFromContent,+ repairToolCallArgs,+} from '../../../mobile-client/agent-core.js'++/** Das Argumentobjekt, das am Ende jedes Mal herauskommen soll. */+const ZIEL = { path: 'a.txt', content: 'hallo' }+const EINFACH = JSON.stringify(ZIEL)+const DOPPELT = JSON.stringify(EINFACH)+const DREIFACH = JSON.stringify(DOPPELT)++describe('repairToolCallArgs — die Lagen werden wirklich abgetragen', () => {+ it('ein Objekt geht unveraendert durch (identisch, nicht nur gleich)', () => {+ const o = { path: 'a.txt' }+ expect(repairToolCallArgs(o)).toBe(o)+ })++ it('einfach kodiert: die Zeichenkette wird zum Objekt', () => {+ expect(repairToolCallArgs(EINFACH)).toEqual(ZIEL)+ })++ it('DOPPELT kodiert: der Fall, den der tote Zweig behauptete', () => {+ // Vor der Reparatur: {}. Das war der Befund.+ expect(repairToolCallArgs(DOPPELT)).toEqual(ZIEL)+ })++ it('dreifach kodiert — die Schleife haelt nicht nach einer Lage an', () => {+ expect(repairToolCallArgs(DREIFACH)).toEqual(ZIEL)+ })++ it('Leerraum um die aeussere Lage stoert nicht', () => {+ expect(repairToolCallArgs(' ' + DOPPELT + '\n')).toEqual(ZIEL)+ })++ it('die Schleife ist gedeckelt: mehr Lagen als vier ergeben {}, nicht eine Endlosschleife', () => {+ let tief: string = EINFACH+ for (let i = 0; i < 6; i++) tief = JSON.stringify(tief)+ expect(repairToolCallArgs(tief)).toEqual({})+ })++ it('kaputt bleibt kaputt — {} statt eines Wurfs', () => {+ expect(repairToolCallArgs('not json')).toEqual({})+ expect(repairToolCallArgs('{"path":')).toEqual({})+ expect(repairToolCallArgs('"nur eine Zeichenkette"')).toEqual({})+ expect(repairToolCallArgs('""')).toEqual({})+ })++ it('leer, null, undefined und Nicht-Zeichenketten ergeben {}', () => {+ expect(repairToolCallArgs('')).toEqual({})+ expect(repairToolCallArgs(' ')).toEqual({})+ expect(repairToolCallArgs(null)).toEqual({})+ expect(repairToolCallArgs(undefined)).toEqual({})+ expect(repairToolCallArgs(7)).toEqual({})+ expect(repairToolCallArgs(true)).toEqual({})+ expect(repairToolCallArgs('null')).toEqual({})+ })++ it('ein JSON-Array bleibt ein Array — geerbtes Verhalten, hier nur festgehalten', () => {+ // Kein Argumentobjekt, aber der Desktop reicht es genauso durch+ // (src/lib/tool-call-repair.ts, `Array.isArray`-Zweig). Wer das aendert,+ // aendert beide Seiten.+ expect(repairToolCallArgs('[1,2]')).toEqual([1, 2])+ })+})++describe('und auf dem Weg, auf dem der Client die Argumente wirklich bekommt', () => {+ const bekannt = ['file_write', 'shell_execute']++ it('gezaeunter Aufruf mit doppelt kodierten Argumenten kommt entpackt an', () => {+ // Genau das, was qwen2.5-coder in `content` legt statt in `tool_calls`:+ // der Aufruf als ```json-Block, und `arguments` darin noch einmal als+ // Zeichenkette kodiert.+ const content =+ 'ich schreibe die Datei\n```json\n' ++ JSON.stringify({ name: 'file_write', arguments: EINFACH }) ++ '\n```\nfertig'+ const { calls } = extractToolCallsFromContent(content, bekannt)+ expect(calls).toHaveLength(1)+ expect(calls[0].function.name).toBe('file_write')+ expect(calls[0].function.arguments).toEqual(ZIEL)+ })++ it('und ein kaputtes `arguments` liefert {} statt den Aufruf zu verlieren', () => {+ const content =+ '```json\n' ++ JSON.stringify({ name: 'shell_execute', arguments: '{command:' }) ++ '\n```'+ const { calls } = extractToolCallsFromContent(content, bekannt)+ expect(calls).toHaveLength(1)+ expect(calls[0].function.arguments).toEqual({})+ })+})diff --git a/src/api/__tests__/mobile-hauszeichen-ist-vektor.test.ts b/src/api/__tests__/mobile-hauszeichen-ist-vektor.test.tsnew file mode 100644index 00000000..8e69fcaa--- /dev/null+++ b/src/api/__tests__/mobile-hauszeichen-ist-vektor.test.ts@@ -0,0 +1,116 @@+/**+ * Die Wache fuer das Hauszeichen auf dem Telefon.+ *+ * ## Was war+ *+ * `mobile-client/client.js` zog an vier Stellen — Anmeldung 64px, Kopfzeile+ * 22px, Schublade 18px, Willkommensbild 82px — `/LU-monogram-white.png`,+ * dieselbe 512x512-Bitmap, viermal heruntergerechnet. Die Desktop-App war zu+ * dem Zeitpunkt seit `0b9c0f66` komplett auf `public/LU-monogram.svg` und von+ * `src/components/layout/__tests__/kein-raster-als-hauszeichen.test.ts`+ * verriegelt; jene Wache nimmt `mobile-client/` ausdruecklich aus, weil+ * `mobile-html-content.test.ts` den PNG-Pfad woertlich forderte. Der+ * Mobile-Client war damit die letzte Rasterstelle im Baum, und der Test, der+ * ihn hielt, war der Grund, warum niemand ihn anfasste.+ *+ * ## Warum <symbol> + <use> und nicht `<img src="/LU-monogram.svg">`+ *+ * Gemessen, nicht vermutet: der Remote-Server liefert KEINE Datei aus+ * `mobile-client/` aus. `src-tauri/src/mobile_page.rs` baut aus den sechs+ * Quelldateien EINE HTML-Seite, `build.rs` bettet sie ein, und der Router in+ * `src-tauri/src/commands/remote.rs` kennt genau eine Bildroute+ * (`/LU-monogram-white.png` → `include_bytes!("../../../public/…")`). Es gibt+ * kein `ServeDir`, keinen statischen Zweig, und der Fallback ist ein 302 auf+ * `/mobile`. Ein `<img src="/LU-monogram.svg">` haette also nichts geladen,+ * sondern die Anmeldeseite als Bild angefordert.+ *+ * Der Vektor liegt deshalb IM Dokument. Das kostet die Seite die Pfaddaten+ * einmal und spart ihr dafuer eine HTTP-Anfrage; die vier Anzeigestellen+ * teilen sich das eine `<symbol>`.+ *+ * ## Wovor diese Datei schuetzt+ *+ * Eine Kopie driftet. Die Pfaddaten im Sprite muessen Zeichen fuer Zeichen die+ * aus `public/LU-monogram.svg` sein — dieselbe Datei, die die Desktop-Wache+ * prueft. Wer das SVG neu exportiert und den Mobile-Client vergisst, wird+ * hier rot.+ *+ * Lauf: npx vitest run src/api/__tests__/mobile-hauszeichen-ist-vektor.test.ts+ */+import { describe, it, expect } from 'vitest'+import { readFileSync } from 'node:fs'+import { resolve } from 'node:path'+import { codeOnly } from './mobile-client-shell'++const ROOT = resolve(__dirname, '..', '..', '..')+const read = (...teile: string[]) => readFileSync(resolve(ROOT, ...teile), 'utf8')++const HTML = read('mobile-client', 'index.html')+const JS = read('mobile-client', 'client.js')+const CSS = read('mobile-client', 'styles.css')+const VEKTOR = read('public', 'LU-monogram.svg')++/** Die eine Zeichengruppe einer dieser Dateien — der eigentliche Inhalt. */+function zeichengruppe(quelle: string): string {+ const treffer = quelle.match(/<g [\s\S]*<\/g>/)+ expect(treffer, 'keine <g>-Gruppe gefunden').not.toBeNull()+ return treffer![0]+}++describe('das Hauszeichen auf dem Telefon ist der Vektor aus public/', () => {+ it('die Pfaddaten im Sprite sind Zeichen fuer Zeichen die der Vektordatei', () => {+ expect(zeichengruppe(HTML)).toBe(zeichengruppe(VEKTOR))+ })++ it('und es sind wirklich Pfade, nicht ein eingebettetes Raster', () => {+ // Ein exportiertes SVG kann eine PNG als <image href="data:…"> enthalten.+ // Das waere derselbe Befund in neuer Verpackung.+ expect(HTML).not.toMatch(/<image\b/)+ expect(HTML).not.toContain('data:image/')+ expect([...zeichengruppe(HTML).matchAll(/<path d="/g)]).toHaveLength(3)+ })++ it('das viewBox kommt mit — sonst zeichnet <use> ins Leere', () => {+ const symbol = HTML.match(/<symbol id="lu-monogram"[^>]*>/)?.[0] ?? ''+ const wurzel = VEKTOR.match(/<svg[^>]*>/)?.[0] ?? ''+ const viewBox = (s: string) => s.match(/viewBox="([^"]+)"/)?.[1]+ expect(viewBox(symbol)).toBe(viewBox(wurzel))+ expect(viewBox(symbol)).toBeTruthy()+ })++ it('eine Farbe, an einer Stelle — dieselbe Zusicherung wie auf dem Desktop', () => {+ const fuellungen = [...zeichengruppe(HTML).matchAll(/fill="([^"]+)"/g)].map((m) => m[1])+ expect(fuellungen).toEqual(['#ffffff'])+ })+})++describe('und die Seite holt sich kein Bild mehr ueber HTTP', () => {+ it('kein <img> zeigt auf einen Markenpfad — es gaebe keine Route dafuer', () => {+ // Ohne Kommentare: die Begruendungen NENNEN beide Pfade.+ for (const [name, quelle] of [+ ['index.html', codeOnly(HTML)],+ ['client.js', codeOnly(JS)],+ ['styles.css', codeOnly(CSS)],+ ] as const) {+ const treffer = [...quelle.matchAll(/(?:src|href|url\()\s*=?\s*["']?(\/LU-[^"')\s]+)/g)].map(+ (m) => m[1],+ )+ expect(treffer, `${name} laedt ${treffer.join(', ')} — der Server routet das nicht`).toEqual([])+ }+ })++ it('die vier Anzeigestellen teilen sich das eine Symbol', () => {+ expect(codeOnly(JS).match(/<use href="#lu-monogram"\/>/g)).toHaveLength(1)+ expect(codeOnly(JS).match(/monogram\('/g)).toHaveLength(4)+ expect(codeOnly(HTML).match(/id="lu-monogram"/g)).toHaveLength(1)+ })++ it('der Sprite-Traeger ist unsichtbar, ohne display:none zu benutzen', () => {+ // display:none auf dem Sprite laesst <use> in mehreren Engines leer+ // rendern. Die Regel muss die Null-Groessen-Form sein.+ const regel = CSS.match(/\.svg-sprite\{([^}]*)\}/)?.[1] ?? ''+ expect(regel).toContain('position:absolute')+ expect(regel).toContain('width:0')+ expect(regel).not.toContain('display:none')+ })+})diff --git a/src/api/__tests__/mobile-html-content.test.ts b/src/api/__tests__/mobile-html-content.test.tsindex b78f2036..82ecd7d2 100644--- a/src/api/__tests__/mobile-html-content.test.ts+++ b/src/api/__tests__/mobile-html-content.test.ts@@ -28,6 +28,7 @@ import { describe, it, expect } from 'vitest'import { readFileSync } from 'node:fs'import { resolve } from 'node:path'import { CAVEMAN_PROMPTS, CAVEMAN_REMINDERS } from '../../../mobile-client/caveman.js'+import { codeOnly } from './mobile-client-shell'import { CODEX_PROMPT, PERSONAS, THINKING_COMPATIBLE } from '../../../mobile-client/personas.js'const read = (name: string) =>@@ -109,19 +110,57 @@ describe('mobile page › no third-party requests (Bug #5)', () => {})})+/**+ * ── 01.09.2026: der Pin wurde umgedreht ──+ *+ * Bis hierher stand an dieser Stelle `expect(JS).toContain(+ * '/LU-monogram-white.png')` — der Pfad WOERTLICH gefordert. Das war die+ * Falle: die Desktop-App war mit 0b9c0f66 komplett auf `public/LU-monogram.svg`+ * umgestellt und durch `kein-raster-als-hauszeichen.test.ts` verriegelt, und+ * diese Zeile hielt den Mobile-Client als letzte Stelle beim 512px-Raster+ * fest. Wer ihn umgestellt haette, waere hier rot geworden.+ *+ * Jetzt verlangt der Pin die Vektorfassung und VERBIETET das Raster. Der Weg+ * dorthin ist ein <symbol> in index.html plus vier <use>: der Remote-Server+ * liefert keine Datei aus mobile-client/ aus (er baut eine Seite und haelt+ * genau eine Bildroute), ein <img src="/LU-monogram.svg"> waere also ein 404.+ */describe('mobile page › LU branding assets', () => {- it('references the white-transparent monogram path', () => {- expect(JS).toContain('/LU-monogram-white.png')- })-- it('does NOT reference the old bw monogram (should have been migrated)', () => {- expect(JS).not.toContain('/LU-monogram-bw.png')- expect(HTML).not.toContain('/LU-monogram-bw.png')+ // Kommentare raus — die Begruendungen NENNEN den alten Rasterpfad.+ const JS_CODE = codeOnly(JS)+ const HTML_CODE = codeOnly(HTML)++ it('das Zeichen liegt EINMAL im Dokument, als <symbol>', () => {+ expect(HTML_CODE).toContain('<symbol id="lu-monogram"')+ expect(HTML_CODE.match(/<symbol id="lu-monogram"/g)).toHaveLength(1)+ // Und der Traeger ist wirklich ein Traeger, kein sichtbares Bild.+ expect(HTML_CODE).toContain('class="svg-sprite"')+ expect(CSS).toContain('.svg-sprite{')+ })++ it('kein Marken-Rasterbild mehr — weder white noch bw, in keiner der drei Dateien', () => {+ // Dasselbe Muster wie kein-raster-als-hauszeichen.test.ts: nicht ein Name,+ // sondern die Form. Ein zweiter Dateiname fuer dieselbe Bitmap faellt hier+ // genauso durch.+ const RASTER_MARKE = /[\w@-]*(?:monogram|logo|brand|wordmark)[\w@-]*\.(?:png|jpe?g|webp|gif|bmp|ico|avif)/i+ for (const [name, code] of [+ ['index.html', HTML_CODE],+ ['styles.css', codeOnly(CSS)],+ ['client.js', JS_CODE],+ ] as const) {+ expect(code.match(RASTER_MARKE)?.[0], `${name} zeigt die Marke als Raster`).toBeUndefined()+ }})- it('uses the monogram in at least 4 places (auth, header, drawer, welcome)', () => {- const matches = JS.match(/\/LU-monogram-white\.png/g) || []- expect(matches.length).toBeGreaterThanOrEqual(4)+ it('die vier Stellen (Anmeldung, Kopfzeile, Schublade, Willkommen) zeigen alle den Vektor', () => {+ const marken = ['auth-mark', 'header-mark', 'drawer-mark', 'chat-welcome-mark']+ for (const m of marken) {+ expect(JS_CODE, `${m} zieht das Zeichen nicht ueber monogram()`).toContain(`monogram('${m}'`)+ // Die Groessenregel bleibt, wo sie war — nur der Traeger ist jetzt <svg>.+ expect(CSS).toContain(`.${m}{`)+ }+ expect(JS_CODE.match(/<use href="#lu-monogram"\/>/g)).toHaveLength(1)+ expect(JS_CODE.match(/monogram\('/g)).toHaveLength(4)})it('the in-page wordmark is LU', () => {diff --git a/src/api/__tests__/tool-description-parity.test.ts b/src/api/__tests__/tool-description-parity.test.tsindex effccb5b..ccecfa98 100644--- a/src/api/__tests__/tool-description-parity.test.ts+++ b/src/api/__tests__/tool-description-parity.test.ts@@ -175,10 +175,33 @@ const mobileTools = AGENT_TOOLSdescribe('tool-description-parity — extraction sanity', () => {it('parses the desktop BUILTIN_TOOLS list', () => {+ // Still a lower bound, and still earning its keep: this half IS a parser+ // (the brace scan over builtin-tools.ts above), so the only thing it can+ // honestly claim is "the scan found the catalogue rather than nothing".expect(builtinTools.length).toBeGreaterThanOrEqual(13)})- it('parses the mobile AGENT_TOOLS list', () => {- expect(mobileTools.length).toBeGreaterThanOrEqual(9)++ /**+ * KF-3 (6). This assertion read `toBeGreaterThanOrEqual(9)` while the array+ * held TEN tools — todo_write, web_search, web_fetch, file_read, file_write,+ * file_list, file_search, shell_execute, screenshot, image_generate. A lost+ * tool would have slipped through the slack, and the number had no way of+ * noticing that it had gone stale.+ *+ * It is not re-pinned to 10 either, because 10 goes stale the same way the+ * 9 did. The count is DERIVED: the mobile catalogue is by definition the+ * desktop catalogue minus MOBILE_SKIP, which is the same ledger the name-set+ * test below reads. Add a desktop tool and wire it to mobile and this stays+ * green; add one and forget mobile, or drop one from mobile, and it goes red+ * with both numbers in the message.+ *+ * MOBILE_SKIP is declared below this block on purpose — the ledger belongs+ * next to the set comparison it explains. `it` bodies run after the module+ * has finished evaluating, so the reference is resolved by then.+ */+ it('the mobile AGENT_TOOLS list holds every desktop tool it is meant to', () => {+ const erwartet = builtinTools.filter((t) => !MOBILE_SKIP.has(t.name)).length+ expect(mobileTools).toHaveLength(erwartet)})})