show a more generic response on AI error

This commit is contained in:
Jonas Leder 2026-10-13 21:33:25 +02:00
commit 40397dfc28
15 changed files with 3130 additions and 3068 deletions

View file

@ -24,11 +24,15 @@ import (
"jonasled.dev/jonasled/feuerwehr-schadensmeldung/backend/internal/appsettings"
"jonasled.dev/jonasled/feuerwehr-schadensmeldung/backend/internal/auth"
"jonasled.dev/jonasled/feuerwehr-schadensmeldung/backend/internal/dto"
"jonasled.dev/jonasled/go-libs/log"
)
// maxToolResult keeps large tool results from filling the model's context.
const maxToolResult = 30000
// errFailed is shown to users instead of the details of a failed AI request, which are only logged.
var errFailed = errors.New("Die KI-Anfrage ist fehlgeschlagen. Bitte versuche es später erneut.")
// excludedTools are read-only tools whose results are of no use to the model.
var excludedTools = map[string]bool{"create_repair_order": true}
@ -187,18 +191,23 @@ func (r *routes) run(ctx *gin.Context, feature func(ai.Features) bool, respond f
user := auth.MustCurrentUser(ctx)
session, err := mcproutes.Connect(ctx.Request.Context(), r.router, user)
if err != nil {
apiutil.Error(ctx, http.StatusInternalServerError, err.Error())
log.Log.WithError(err).Error("Connecting the AI to the MCP server failed")
apiutil.Error(ctx, http.StatusInternalServerError, errFailed.Error())
return
}
defer session.Close()
toolbox, err := newToolbox(ctx.Request.Context(), session)
if err != nil {
apiutil.Error(ctx, http.StatusInternalServerError, err.Error())
log.Log.WithError(err).Error("Loading the AI tools failed")
apiutil.Error(ctx, http.StatusInternalServerError, errFailed.Error())
return
}
out := &output{ctx: ctx, stream: strings.Contains(ctx.GetHeader("Accept"), "text/event-stream")}
text, err := handler(connection, toolbox, user, out.events())
var notVisible errNotVisible
if err != nil && !errors.As(err, &notVisible) {
log.Log.WithError(err).WithField("path", ctx.FullPath()).Warn("AI request failed")
}
switch {
case err == nil && out.stream:
out.send(gin.H{"done": true, "text": text})
@ -206,11 +215,11 @@ func (r *routes) run(ctx *gin.Context, feature func(ai.Features) bool, respond f
ctx.JSON(http.StatusOK, respond(text))
case out.started:
// The status code was already sent with the first event.
out.send(gin.H{"error": err.Error()})
out.send(gin.H{"error": errFailed.Error()})
case errors.As(err, &notVisible):
apiutil.Error(ctx, http.StatusNotFound, notVisible.message)
default:
apiutil.Error(ctx, http.StatusBadGateway, err.Error())
apiutil.Error(ctx, http.StatusBadGateway, errFailed.Error())
}
}

View file

@ -20,9 +20,20 @@ const toolLabels: Record<string, string> = {
lookup_mp_feuer_device: "Frage MP-Feuer ab"
};
const failedMessage = "Die KI-Anfrage ist fehlgeschlagen. Bitte versuche es später erneut.";
// streamAI calls an AI endpoint and receives the answer while the model writes it (server-sent events), so slow
// models show progress right away. It resolves with the complete answer.
export async function streamAI(path: string, body: unknown, { onText, onTool }: StreamHandlers = {}): Promise<string> {
// models show progress right away. It resolves with the complete answer. Network and parse errors become a generic
// message, errors of the server keep theirs.
export async function streamAI(path: string, body: unknown, handlers: StreamHandlers = {}): Promise<string> {
try {
return await requestAI(path, body, handlers);
} catch (error) {
throw error instanceof ApiError ? error : new ApiError(failedMessage, 502);
}
}
async function requestAI(path: string, body: unknown, { onText, onTool }: StreamHandlers): Promise<string> {
const response = await fetch(path, {
method: "POST",
credentials: "include",
@ -31,7 +42,7 @@ export async function streamAI(path: string, body: unknown, { onText, onTool }:
});
if (!response.ok) {
const payload = await response.json().catch(() => ({}));
throw new ApiError(payload.error || "Anfrage fehlgeschlagen.", response.status);
throw new ApiError(payload.error || failedMessage, response.status);
}
if (!response.body || !response.headers.get("Content-Type")?.startsWith("text/event-stream")) {
const payload = await response.json();
@ -73,5 +84,5 @@ export async function streamAI(path: string, body: unknown, { onText, onTool }:
}
}
}
throw new ApiError("Die Verbindung zur KI wurde unterbrochen.", 502);
throw new ApiError(failedMessage, 502);
}

View file

@ -6,7 +6,7 @@
"4": "testing.T",
"5": "oidc.go",
"6": "MustCurrentUser",
"7": "push.ts",
"7": "NotificationSettings.tsx",
"8": "context.Context",
"9": "KioskView.tsx",
"10": "DashboardApp.tsx",
@ -28,16 +28,14 @@
"26": "constants.ts",
"27": "Frontend index.html (SPA shell)",
"28": "CLAUDE.md",
"29": "resolveHandler",
"29": "Init",
"30": "github.com/gin-gonic/gin.Context",
"31": "Enabled",
"32": "updateHandler",
"33": "webpush.go",
"31": "BindJSON",
"32": "dashboard.go",
"34": "Clock.tsx",
"35": "BindJSON",
"35": "applyFaultType",
"36": "NewDashboard",
"37": "ResolveForm.tsx",
"38": "AssigneePicker.tsx",
"39": "ai/ai.go",
"41": "configHandler",
"42": ".complete",

View file

@ -1 +1 @@
{"0": "708d7c1287abb9fc", "1": "4c3c3b2aed0acc81", "2": "a9b5ed1c90b7edf2", "3": "62a5e77fef2d24ab", "4": "1514a1d48e7ec4f8", "5": "a247c252e85bcccf", "6": "6a4e5f524a7e7534", "7": "436021faa592bef6", "8": "19c5287a93996635", "9": "45ee7e79053fa2d9", "10": "661d6568177dca6f", "11": "9b71557ad01067f7", "12": "12f6c8f8537225e0", "13": "4e85aba8d2a10932", "14": "ea09216893a30a83", "15": "7e8bce0356f1811f", "16": "8d0121412dd5f8ef", "17": "ecee2f270361e1d0", "18": "c285eaa42e0bd738", "19": "6b81c38e1948f161", "20": "51892ab38c662c38", "21": "1630d601831e0f61", "22": "99c0fcbdc4f53a0e", "23": "ac1ca522fdc2565b", "24": "7d3726f3155634d9", "25": "84bcf34e8b540e0a", "26": "2fa7c8063745f2f0", "27": "7cd2225b1595d652", "28": "6e7b82d0387bf16d", "29": "9413f186fea20c55", "30": "c03d41c1175ed15b", "31": "cbae1bfda97c425c", "32": "cd3d773c86177ceb", "33": "b759df282456ec8d", "34": "d3dc61aee3fd8542", "35": "6b5e59a10e806ac8", "36": "84f76e9029338e89", "37": "3331a0c08d77b5b3", "38": "ed0f0454762bb60b", "39": "9ab1b50db6dce25b", "41": "e0ccb2340a15a57d", "42": "a2dbc764b5f08332", "45": "6f366c36bdb2abe0", "49": "7fe524e9396b797c"}
{"0": "035f8e0e59fb6493", "1": "4c3c3b2aed0acc81", "2": "a9b5ed1c90b7edf2", "3": "747407d8cef0b32f", "4": "439e0ae49b8d4445", "5": "3d16597ece70b2e9", "6": "d7bed19af518479f", "7": "554350d98e4cac77", "8": "19c5287a93996635", "9": "8e85db424ee77bd7", "10": "661d6568177dca6f", "11": "568cc4c9f00379e6", "12": "bf8e99e5de7c4096", "13": "3ec98a69baddec13", "14": "c63e13a2f524b51f", "15": "bc4ba36c28cc56de", "16": "111c436cfc3245a8", "17": "1e9c97b6dc8fb4c2", "18": "c285eaa42e0bd738", "19": "6b81c38e1948f161", "20": "51892ab38c662c38", "21": "1630d601831e0f61", "22": "99c0fcbdc4f53a0e", "23": "ac1ca522fdc2565b", "24": "7d3726f3155634d9", "25": "b1add69a59eea38a", "26": "275e34beac32f437", "27": "7cd2225b1595d652", "28": "6e7b82d0387bf16d", "29": "9f72a779453c356b", "30": "e0493450e1915f64", "31": "600e92b272a90478", "32": "13d86f8fc690a917", "34": "d3dc61aee3fd8542", "35": "f004e6971ac8291e", "36": "c6646ef119c68176", "37": "bf24d70ef6f0826a", "39": "9ab1b50db6dce25b", "41": "e0ccb2340a15a57d", "42": "a2dbc764b5f08332", "45": "6f366c36bdb2abe0", "49": "7fe524e9396b797c"}

View file

@ -5,15 +5,15 @@
"3": "registerRoutes",
"4": "testing.T",
"5": "oidc.go",
"6": "github.com/gin-gonic/gin.Context",
"7": "NotificationSettings.tsx",
"6": "MustCurrentUser",
"7": "push.ts",
"8": "context.Context",
"9": "types.ts",
"9": "KioskView.tsx",
"10": "DashboardApp.tsx",
"11": "OverviewView.tsx",
"12": "fault.go",
"13": "User",
"14": "DashboardManager.tsx",
"14": "types.ts",
"15": "HashToken",
"16": "errorMessage",
"17": "App.tsx",
@ -24,17 +24,20 @@
"22": "Vite Env Types",
"23": "Go Module",
"24": "PWA Icon Set",
"25": "FaultError",
"25": "ParseID",
"26": "constants.ts",
"27": "Frontend index.html (SPA shell)",
"28": "CLAUDE.md",
"29": "resolveHandler",
"31": "BindJSON",
"32": "apiutil.go",
"30": "github.com/gin-gonic/gin.Context",
"31": "Enabled",
"32": "updateHandler",
"33": "webpush.go",
"34": "Clock.tsx",
"35": "applyFaultType",
"35": "BindJSON",
"36": "NewDashboard",
"37": "ResolveForm.tsx",
"38": "AssigneePicker.tsx",
"39": "ai/ai.go",
"41": "configHandler",
"42": ".complete",

View file

@ -1,11 +1,11 @@
# Graph Report - feuerwehr-schadensmeldung (2026-10-13)
## Corpus Check
- 159 files · ~98,892 words
- 159 files · ~98,926 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 1011 nodes · 2721 edges · 41 communities (38 shown, 3 thin omitted)
- 1011 nodes · 2721 edges · 44 communities (41 shown, 3 thin omitted)
- Extraction: 96% EXTRACTED · 4% INFERRED · 0% AMBIGUOUS · INFERRED: 109 edges (avg confidence: 0.81)
- Token cost: 0 input · 0 output
@ -21,15 +21,15 @@
- registerRoutes
- testing.T
- oidc.go
- github.com/gin-gonic/gin.Context
- NotificationSettings.tsx
- MustCurrentUser
- push.ts
- context.Context
- types.ts
- KioskView.tsx
- DashboardApp.tsx
- OverviewView.tsx
- fault.go
- User
- DashboardManager.tsx
- types.ts
- HashToken
- errorMessage
- App.tsx
@ -37,17 +37,20 @@
- .run
- Go Module
- PWA Icon Set
- FaultError
- ParseID
- constants.ts
- Frontend index.html (SPA shell)
- CLAUDE.md
- resolveHandler
- BindJSON
- apiutil.go
- github.com/gin-gonic/gin.Context
- Enabled
- updateHandler
- webpush.go
- Clock.tsx
- applyFaultType
- BindJSON
- NewDashboard
- ResolveForm.tsx
- AssigneePicker.tsx
- ai/ai.go
- configHandler
- .complete
@ -86,11 +89,11 @@
- **Kubernetes request routing (ingress, services, deployments)** — helm_templates_ingress, helm_templates_service_backend, helm_templates_service_frontend, helm_templates_deployment_backend, helm_templates_deployment_frontend [EXTRACTED 1.00]
- **PWA / home-screen icon set sharing the Schadensmeldung brand mark** — frontend_public_pwa_192, frontend_public_pwa_512, frontend_public_pwa_maskable_512, frontend_public_apple_touch_icon, frontend_public_pwa_192_svg, frontend_public_pwa_512_svg, public_pwa_icon_set [INFERRED 0.85]
## Communities (41 total, 3 thin omitted)
## Communities (44 total, 3 thin omitted)
### Community 0 - "catalog.go"
Cohesion: 0.16
Nodes (21): applyLocation(), createLocationHandler(), deleteLocationHandler(), listLocationsHandler(), updateLocationHandler(), AdminLocation(), LoadCatalog(), mappingTarget() (+13 more)
Cohesion: 0.24
Nodes (15): AdminLocation(), LoadCatalog(), mappingTarget(), CatalogItemResponse, CatalogResponse, MPFeuerTarget, NewFaultType(), NewLocation() (+7 more)
### Community 1 - "Swagger API Spec"
Cohesion: 0.05
@ -112,29 +115,29 @@ Nodes (65): client, fakeCompletion, fakeProvider, faultList, registeredDashboard
Cohesion: 0.12
Nodes (22): Claims, hybridKeySet, provider, groupsHandler(), UserRole, newVerifier(), claimsFromMap(), ExchangeCode() (+14 more)
### Community 6 - "github.com/gin-gonic/gin.Context"
Cohesion: 0.15
Nodes (22): createDashboardHandler(), deleteDashboardHandler(), listDashboardsHandler(), loadFaultTypes(), rotateDashboardSecretHandler(), updateDashboardHandler(), deleteUserHandler(), listUsersHandler() (+14 more)
### Community 7 - "NotificationSettings.tsx"
### Community 6 - "MustCurrentUser"
Cohesion: 0.21
Nodes (18): notificationTypes, PushDevices(), PushDevicesProps, supportHints, transportLabels, base64UrlToBytes(), currentPushSubscription(), describeDevice() (+10 more)
Nodes (9): deleteUserHandler(), listUsersHandler(), createTokenHandler(), deleteTokenHandler(), listTokensHandler(), meHandler(), listPushSubscriptionsHandler(), MustCurrentUser() (+1 more)
### Community 7 - "push.ts"
Cohesion: 0.33
Nodes (10): base64UrlToBytes(), currentPushSubscription(), enablePush(), isIOS(), isStandalone(), pushSupport, registration(), sameKey() (+2 more)
### Community 8 - "context.Context"
Cohesion: 0.08
Nodes (48): Connect(), boolPtr(), failure(), faultPath(), newServer(), WithUser(), CreateMangel(), hasTransferMode() (+40 more)
### Community 9 - "types.ts"
Cohesion: 0.09
Nodes (33): ColorBadge(), PriorityBadge(), StatusBadge(), FaultCard(), FaultCardProps, viaLabel(), FaultAction, FaultDetailDialogProps (+25 more)
### Community 9 - "KioskView.tsx"
Cohesion: 0.11
Nodes (22): ColorBadge(), PriorityBadge(), StatusBadge(), FaultCard(), FaultCardProps, viaLabel(), FaultAction, FaultDetailDialogProps (+14 more)
### Community 10 - "DashboardApp.tsx"
Cohesion: 0.14
Nodes (22): themeNames, ThemeToggle(), ThemeToggleProps, dashboardApi(), readStoredSecret(), redeemRegistrationCode(), storeSecret(), DashboardApp() (+14 more)
### Community 11 - "OverviewView.tsx"
Cohesion: 0.19
Nodes (22): entries(), Pagination(), PaginationProps, StatCard(), StatCardProps, KioskView(), queryString(), faultPayload() (+14 more)
Cohesion: 0.15
Nodes (28): FaultFilters(), entries(), Pagination(), PaginationProps, StatCard(), StatCardProps, KioskView(), queryString() (+20 more)
### Community 12 - "fault.go"
Cohesion: 0.09
@ -144,21 +147,21 @@ Nodes (29): usersHandler(), NewPagination(), FaultPayload, NewFaultList(), NewUs
Cohesion: 0.06
Nodes (64): APIToken, AppSettings, Dashboard, Fault, FaultSource, FaultType, FaultUpdate, Location (+56 more)
### Community 14 - "DashboardManager.tsx"
### Community 14 - "types.ts"
Cohesion: 0.11
Nodes (21): emptyCatalogItemForm, dateTimeFormat, formatDateTime(), relativeFormat, CatalogItem, CatalogItemForm, DashboardDevice, DashboardRegistration (+13 more)
Nodes (24): FaultTypeChips(), FaultTypeChipsProps, emptyCatalogItemForm, ApiToken, ApiTokenCreateResponse, CatalogItem, CatalogItemForm, CatalogRef (+16 more)
### Community 15 - "HashToken"
Cohesion: 0.06
Nodes (52): issueRegistration(), callbackHandler(), completeMCPAuthorization(), loginHandler(), safeRedirectPath(), StartLogin(), logoutHandler(), registerHandler() (+44 more)
### Community 16 - "errorMessage"
Cohesion: 0.16
Nodes (28): AssigneePicker(), AssigneePickerProps, normalize(), DefaultFilterForm(), FaultDetailDialog(), FaultUpdates(), MPFeuerSettings(), MPFeuerSettingsProps (+20 more)
Cohesion: 0.14
Nodes (37): App(), DefaultFilterForm(), FaultDetailDialog(), FaultUpdates(), MPFeuerSettings(), NotificationSettings(), notificationTypes, PushDevices() (+29 more)
### Community 17 - "App.tsx"
Cohesion: 0.11
Nodes (26): App(), emptyCatalog, viewTitles, defaultBranding, noAIFeatures, Notification, useNotification(), adminPath() (+18 more)
Cohesion: 0.12
Nodes (23): emptyCatalog, viewTitles, defaultBranding, noAIFeatures, adminPath(), AdminTab, adminTabs, filterKeys (+15 more)
### Community 18 - "Brand Icons"
Cohesion: 0.32
@ -168,13 +171,13 @@ Nodes (8): Apple Touch Icon (PNG), Schadensmeldung Logo (logo.svg), Shield + Wre
Cohesion: 0.17
Nodes (10): errNotVisible, output, routes, toolbox, chatPrompt(), newToolbox(), summarize(), today() (+2 more)
### Community 25 - "FaultError"
Cohesion: 0.27
Nodes (9): FaultError(), getHandler(), getVisible(), repairOrderHandler(), mpFeuerLookupHandler(), reopenHandler(), createUpdateHandler(), listUpdatesHandler() (+1 more)
### Community 25 - "ParseID"
Cohesion: 0.20
Nodes (13): deleteFaultTypeHandler(), FaultError(), ParseID(), deleteHandler(), getHandler(), getVisible(), repairOrderHandler(), mpFeuerLookupHandler() (+5 more)
### Community 26 - "constants.ts"
Cohesion: 0.14
Nodes (25): DefaultFilterFormProps, emptyDefaultFilter, FaultFilters(), FaultFiltersProps, BarcodeLookup, FaultForm(), FaultFormProps, FaultFormSubmit (+17 more)
Cohesion: 0.13
Nodes (25): DefaultFilterFormProps, emptyDefaultFilter, FaultFiltersProps, BarcodeLookup, FaultForm(), FaultFormProps, FaultFormSubmit, initialValues() (+17 more)
### Community 27 - "Frontend index.html (SPA shell)"
Cohesion: 0.67
@ -184,13 +187,17 @@ Nodes (3): Frontend index.html (SPA shell), PWA manifest link (manifest.webmanif
Cohesion: 0.19
Nodes (19): createHandler(), listHistoryHandler(), resolveHandler(), createHandler(), toInput(), resolveHandler(), MustCurrentDashboard(), NewFault() (+11 more)
### Community 31 - "BindJSON"
Cohesion: 0.17
Nodes (8): updateAISettingsHandler(), getBrandingHandler(), updateBrandingHandler(), searchMPFeuerHandler(), updateLocationMappingsHandler(), BindJSON(), sessionHandler(), Enabled()
### Community 30 - "github.com/gin-gonic/gin.Context"
Cohesion: 0.20
Nodes (16): getBrandingHandler(), updateBrandingHandler(), Error(), ParseListQuery(), queryInt(), queryUint(), RespondFaultList(), RespondSummary() (+8 more)
### Community 32 - "apiutil.go"
Cohesion: 0.12
Nodes (22): Error(), ParseListQuery(), queryInt(), queryUint(), RespondFaultList(), RespondSummary(), listOpenHandler(), summaryHandler() (+14 more)
### Community 31 - "Enabled"
Cohesion: 0.33
Nodes (4): searchMPFeuerHandler(), updateLocationMappingsHandler(), sessionHandler(), Enabled()
### Community 32 - "updateHandler"
Cohesion: 0.19
Nodes (11): updateHandler(), nonZero(), updatePreferencesHandler(), FaultPriority, FaultStatus, GetSummary(), ListQuery, List() (+3 more)
### Community 33 - "webpush.go"
Cohesion: 0.27
@ -200,14 +207,22 @@ Nodes (11): createPushSubscriptionHandler(), testPushHandler(), validPushEndpoin
Cohesion: 0.50
Nodes (3): Clock(), dateFormat, timeFormat
### Community 35 - "applyFaultType"
Cohesion: 0.31
Nodes (8): applyFaultType(), createFaultTypeHandler(), deleteFaultTypeHandler(), listFaultTypesHandler(), updateFaultTypeHandler(), adminFaultType(), normalizeColor(), normalizeGroups()
### Community 35 - "BindJSON"
Cohesion: 0.16
Nodes (15): updateAISettingsHandler(), applyFaultType(), createFaultTypeHandler(), listFaultTypesHandler(), updateFaultTypeHandler(), adminFaultType(), normalizeColor(), normalizeGroups() (+7 more)
### Community 36 - "NewDashboard"
Cohesion: 0.43
Nodes (7): createDashboardHandler(), deleteDashboardHandler(), listDashboardsHandler(), loadFaultTypes(), rotateDashboardSecretHandler(), updateDashboardHandler(), NewDashboard()
### Community 37 - "ResolveForm.tsx"
Cohesion: 0.15
Nodes (16): AISummary(), AISummaryProps, AIText(), ResolveForm(), ResolveSubmit, streamAI(), StreamHandlers, toolLabels (+8 more)
### Community 38 - "AssigneePicker.tsx"
Cohesion: 0.60
Nodes (4): AssigneePicker(), AssigneePickerProps, normalize(), UserRef
### Community 39 - "ai/ai.go"
Cohesion: 0.19
Nodes (14): completionRequest, completionResponse, Message, streamChunk, Toolbox, ToolCall, ToolFunction, Tool (+6 more)
@ -236,11 +251,11 @@ Nodes (3): compactJSON(), compactValue(), isEmpty()
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `User` connect `User` to `apiutil.go`, `user.go`, `registerRoutes`, `testing.T`, `oidc.go`, `github.com/gin-gonic/gin.Context`, `context.Context`, `fault.go`, `HashToken`, `.run`, `resolveHandler`?**
- **Why does `User` connect `User` to `updateHandler`, `user.go`, `registerRoutes`, `testing.T`, `oidc.go`, `MustCurrentUser`, `context.Context`, `fault.go`, `HashToken`, `.run`, `resolveHandler`?**
_High betweenness centrality (0.074) - this node is a cross-community bridge._
- **Why does `createSession()` connect `testing.T` to `oidc.go`, `HashToken`?**
_High betweenness centrality (0.040) - this node is a cross-community bridge._
- **Why does `HashToken()` connect `HashToken` to `registerRoutes`, `testing.T`, `github.com/gin-gonic/gin.Context`?**
- **Why does `HashToken()` connect `HashToken` to `registerRoutes`, `testing.T`, `MustCurrentUser`?**
_High betweenness centrality (0.028) - this node is a cross-community bridge._
- **What connects `consentData`, `empty`, `faultIDInput` to the rest of the system?**
_89 weakly-connected nodes found - possible documentation gaps or missing edges._

File diff suppressed because it is too large Load diff

View file

@ -835,8 +835,8 @@
"semantic_hash": ""
},
"frontend/src/views/admin/AISettingsForm.tsx": {
"mtime": 1791919512.3597054,
"ast_hash": "18e2e08dd40e4e33243fabffff5649b8",
"mtime": 1791919556.511592,
"ast_hash": "262bcf9ff6afea0812465e6c4ffa8a50",
"semantic_hash": ""
},
"backend/api/fault_updates_test.go": {

View file

@ -1,16 +1,16 @@
# Graph Report - feuerwehr-schadensmeldung (2026-10-13)
## Corpus Check
- 159 files · ~98,926 words
- 159 files · ~99,038 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 1011 nodes · 2721 edges · 44 communities (41 shown, 3 thin omitted)
- 1012 nodes · 2723 edges · 42 communities (39 shown, 3 thin omitted)
- Extraction: 96% EXTRACTED · 4% INFERRED · 0% AMBIGUOUS · INFERRED: 109 edges (avg confidence: 0.81)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `7e795c07`
- Built from commit: `94fddc99`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
@ -22,7 +22,7 @@
- testing.T
- oidc.go
- MustCurrentUser
- push.ts
- NotificationSettings.tsx
- context.Context
- KioskView.tsx
- DashboardApp.tsx
@ -41,16 +41,14 @@
- constants.ts
- Frontend index.html (SPA shell)
- CLAUDE.md
- resolveHandler
- Init
- github.com/gin-gonic/gin.Context
- Enabled
- updateHandler
- webpush.go
- Clock.tsx
- BindJSON
- dashboard.go
- Clock.tsx
- applyFaultType
- NewDashboard
- ResolveForm.tsx
- AssigneePicker.tsx
- ai/ai.go
- configHandler
- .complete
@ -89,11 +87,11 @@
- **Kubernetes request routing (ingress, services, deployments)** — helm_templates_ingress, helm_templates_service_backend, helm_templates_service_frontend, helm_templates_deployment_backend, helm_templates_deployment_frontend [EXTRACTED 1.00]
- **PWA / home-screen icon set sharing the Schadensmeldung brand mark** — frontend_public_pwa_192, frontend_public_pwa_512, frontend_public_pwa_maskable_512, frontend_public_apple_touch_icon, frontend_public_pwa_192_svg, frontend_public_pwa_512_svg, public_pwa_icon_set [INFERRED 0.85]
## Communities (44 total, 3 thin omitted)
## Communities (42 total, 3 thin omitted)
### Community 0 - "catalog.go"
Cohesion: 0.24
Nodes (15): AdminLocation(), LoadCatalog(), mappingTarget(), CatalogItemResponse, CatalogResponse, MPFeuerTarget, NewFaultType(), NewLocation() (+7 more)
Cohesion: 0.15
Nodes (22): applyLocation(), createLocationHandler(), deleteLocationHandler(), listLocationsHandler(), updateLocationHandler(), AdminLocation(), LoadCatalog(), mappingTarget() (+14 more)
### Community 1 - "Swagger API Spec"
Cohesion: 0.05
@ -105,63 +103,63 @@ Nodes (25): newNotificationPreferences(), NewPushSubscription(), NewUser(), nonN
### Community 3 - "registerRoutes"
Cohesion: 0.07
Nodes (32): trustedUserKey, Register(), Register(), Register(), catalogHandler(), Register(), Register(), Register() (+24 more)
Nodes (31): trustedUserKey, Register(), Register(), Register(), Register(), Register(), Register(), Register() (+23 more)
### Community 4 - "testing.T"
Cohesion: 0.05
Nodes (65): client, fakeCompletion, fakeProvider, faultList, registeredDashboard, fakeAIServer(), lastMessage(), TestAIIntegration() (+57 more)
Cohesion: 0.06
Nodes (63): client, fakeCompletion, fakeProvider, faultList, registeredDashboard, fakeAIServer(), lastMessage(), TestAIIntegration() (+55 more)
### Community 5 - "oidc.go"
Cohesion: 0.12
Nodes (22): Claims, hybridKeySet, provider, groupsHandler(), UserRole, newVerifier(), claimsFromMap(), ExchangeCode() (+14 more)
Nodes (22): Claims, hybridKeySet, provider, groupsHandler(), newVerifier(), claimsFromMap(), ExchangeCode(), OAuth2Config() (+14 more)
### Community 6 - "MustCurrentUser"
Cohesion: 0.21
Nodes (9): deleteUserHandler(), listUsersHandler(), createTokenHandler(), deleteTokenHandler(), listTokensHandler(), meHandler(), listPushSubscriptionsHandler(), MustCurrentUser() (+1 more)
Nodes (11): createTokenHandler(), deleteTokenHandler(), listTokensHandler(), meHandler(), createPushSubscriptionHandler(), deletePushSubscriptionHandler(), listPushSubscriptionsHandler(), validPushEndpoint() (+3 more)
### Community 7 - "push.ts"
Cohesion: 0.33
Nodes (10): base64UrlToBytes(), currentPushSubscription(), enablePush(), isIOS(), isStandalone(), pushSupport, registration(), sameKey() (+2 more)
### Community 7 - "NotificationSettings.tsx"
Cohesion: 0.15
Nodes (24): DefaultFilterFormProps, MPFeuerSettingsProps, NotificationSettingsProps, notificationTypes, PushDevices(), PushDevicesProps, supportHints, transportLabels (+16 more)
### Community 8 - "context.Context"
Cohesion: 0.08
Nodes (48): Connect(), boolPtr(), failure(), faultPath(), newServer(), WithUser(), CreateMangel(), hasTransferMode() (+40 more)
### Community 9 - "KioskView.tsx"
Cohesion: 0.11
Nodes (22): ColorBadge(), PriorityBadge(), StatusBadge(), FaultCard(), FaultCardProps, viaLabel(), FaultAction, FaultDetailDialogProps (+14 more)
Cohesion: 0.13
Nodes (19): ColorBadge(), PriorityBadge(), StatusBadge(), FaultCard(), FaultCardProps, viaLabel(), FaultAction, FaultDetailDialogProps (+11 more)
### Community 10 - "DashboardApp.tsx"
Cohesion: 0.14
Nodes (22): themeNames, ThemeToggle(), ThemeToggleProps, dashboardApi(), readStoredSecret(), redeemRegistrationCode(), storeSecret(), DashboardApp() (+14 more)
### Community 11 - "OverviewView.tsx"
Cohesion: 0.15
Nodes (28): FaultFilters(), entries(), Pagination(), PaginationProps, StatCard(), StatCardProps, KioskView(), queryString() (+20 more)
Cohesion: 0.14
Nodes (31): FaultFilters(), FaultFiltersProps, entries(), Pagination(), PaginationProps, StatCard(), StatCardProps, KioskView() (+23 more)
### Community 12 - "fault.go"
Cohesion: 0.09
Nodes (29): usersHandler(), NewPagination(), FaultPayload, NewFaultList(), NewUserRefs(), BrandingEnvelope, BrandingPayload, CatalogRef (+21 more)
Nodes (28): usersHandler(), NewPagination(), FaultPayload, NewUserRefs(), BrandingEnvelope, BrandingPayload, CatalogRef, DashboardFaultPayload (+20 more)
### Community 13 - "User"
Cohesion: 0.06
Nodes (64): APIToken, AppSettings, Dashboard, Fault, FaultSource, FaultType, FaultUpdate, Location (+56 more)
Cohesion: 0.05
Nodes (77): APIToken, AppSettings, Dashboard, Fault, FaultPriority, FaultSource, FaultStatus, FaultType (+69 more)
### Community 14 - "types.ts"
Cohesion: 0.11
Nodes (24): FaultTypeChips(), FaultTypeChipsProps, emptyCatalogItemForm, ApiToken, ApiTokenCreateResponse, CatalogItem, CatalogItemForm, CatalogRef (+16 more)
Nodes (20): AssigneePicker(), AssigneePickerProps, normalize(), FaultTypeChips(), FaultTypeChipsProps, FaultUpdatesProps, AIModel, ApiToken (+12 more)
### Community 15 - "HashToken"
Cohesion: 0.06
Nodes (52): issueRegistration(), callbackHandler(), completeMCPAuthorization(), loginHandler(), safeRedirectPath(), StartLogin(), logoutHandler(), registerHandler() (+44 more)
Nodes (51): issueRegistration(), callbackHandler(), completeMCPAuthorization(), loginHandler(), safeRedirectPath(), StartLogin(), logoutHandler(), registerHandler() (+43 more)
### Community 16 - "errorMessage"
Cohesion: 0.14
Nodes (37): App(), DefaultFilterForm(), FaultDetailDialog(), FaultUpdates(), MPFeuerSettings(), NotificationSettings(), notificationTypes, PushDevices() (+29 more)
Cohesion: 0.12
Nodes (41): DefaultFilterForm(), FaultDetailDialog(), FaultUpdates(), MPFeuerSettings(), NotificationSettings(), RepairOrderForm(), api(), apiBlob() (+33 more)
### Community 17 - "App.tsx"
Cohesion: 0.12
Nodes (23): emptyCatalog, viewTitles, defaultBranding, noAIFeatures, adminPath(), AdminTab, adminTabs, filterKeys (+15 more)
Cohesion: 0.13
Nodes (22): App(), emptyCatalog, viewTitles, Notification, useNotification(), adminPath(), AdminTab, adminTabs (+14 more)
### Community 18 - "Brand Icons"
Cohesion: 0.32
@ -172,56 +170,48 @@ Cohesion: 0.17
Nodes (10): errNotVisible, output, routes, toolbox, chatPrompt(), newToolbox(), summarize(), today() (+2 more)
### Community 25 - "ParseID"
Cohesion: 0.20
Nodes (13): deleteFaultTypeHandler(), FaultError(), ParseID(), deleteHandler(), getHandler(), getVisible(), repairOrderHandler(), mpFeuerLookupHandler() (+5 more)
Cohesion: 0.16
Nodes (20): FaultError(), ParseID(), createHandler(), listHistoryHandler(), resolveHandler(), createHandler(), toInput(), getHandler() (+12 more)
### Community 26 - "constants.ts"
Cohesion: 0.13
Nodes (25): DefaultFilterFormProps, emptyDefaultFilter, FaultFiltersProps, BarcodeLookup, FaultForm(), FaultFormProps, FaultFormSubmit, initialValues() (+17 more)
Cohesion: 0.16
Nodes (17): emptyDefaultFilter, BarcodeLookup, FaultForm(), FaultFormProps, FaultFormSubmit, initialValues(), defaultBranding, emptyCatalogItemForm (+9 more)
### Community 27 - "Frontend index.html (SPA shell)"
Cohesion: 0.67
Nodes (3): Frontend index.html (SPA shell), PWA manifest link (manifest.webmanifest), #root mount point
### Community 29 - "resolveHandler"
Cohesion: 0.19
Nodes (19): createHandler(), listHistoryHandler(), resolveHandler(), createHandler(), toInput(), resolveHandler(), MustCurrentDashboard(), NewFault() (+11 more)
### Community 29 - "Init"
Cohesion: 0.24
Nodes (9): autoMigrate(), Init(), migrateAIBaseURL(), migrateLegacySchema(), migrateNotificationColumns(), TestMigrateAIBaseURL(), TestMigrateNotificationColumns(), seedDefaults() (+1 more)
### Community 30 - "github.com/gin-gonic/gin.Context"
Cohesion: 0.20
Nodes (16): getBrandingHandler(), updateBrandingHandler(), Error(), ParseListQuery(), queryInt(), queryUint(), RespondFaultList(), RespondSummary() (+8 more)
Cohesion: 0.16
Nodes (18): deleteUserHandler(), listUsersHandler(), Error(), ParseListQuery(), queryInt(), queryUint(), RespondFaultList(), RespondSummary() (+10 more)
### Community 31 - "Enabled"
Cohesion: 0.33
Nodes (4): searchMPFeuerHandler(), updateLocationMappingsHandler(), sessionHandler(), Enabled()
### Community 31 - "BindJSON"
Cohesion: 0.18
Nodes (8): updateAISettingsHandler(), getBrandingHandler(), updateBrandingHandler(), searchMPFeuerHandler(), updateLocationMappingsHandler(), BindJSON(), nonZero(), updatePreferencesHandler()
### Community 32 - "updateHandler"
Cohesion: 0.19
Nodes (11): updateHandler(), nonZero(), updatePreferencesHandler(), FaultPriority, FaultStatus, GetSummary(), ListQuery, List() (+3 more)
### Community 33 - "webpush.go"
Cohesion: 0.27
Nodes (11): createPushSubscriptionHandler(), testPushHandler(), validPushEndpoint(), Enabled(), Message, HashEndpoint(), keys(), PublicKey() (+3 more)
### Community 32 - "dashboard.go"
Cohesion: 0.36
Nodes (8): DashboardEnvelope, DashboardListResponse, DashboardPayload, DashboardRegisterPayload, DashboardRegistrationResponse, DashboardResponse, DashboardSecretResponse, DashboardSessionResponse
### Community 34 - "Clock.tsx"
Cohesion: 0.50
Nodes (3): Clock(), dateFormat, timeFormat
### Community 35 - "BindJSON"
Cohesion: 0.16
Nodes (15): updateAISettingsHandler(), applyFaultType(), createFaultTypeHandler(), listFaultTypesHandler(), updateFaultTypeHandler(), adminFaultType(), normalizeColor(), normalizeGroups() (+7 more)
### Community 35 - "applyFaultType"
Cohesion: 0.31
Nodes (8): applyFaultType(), createFaultTypeHandler(), deleteFaultTypeHandler(), listFaultTypesHandler(), updateFaultTypeHandler(), adminFaultType(), normalizeColor(), normalizeGroups()
### Community 36 - "NewDashboard"
Cohesion: 0.43
Nodes (7): createDashboardHandler(), deleteDashboardHandler(), listDashboardsHandler(), loadFaultTypes(), rotateDashboardSecretHandler(), updateDashboardHandler(), NewDashboard()
Cohesion: 0.31
Nodes (8): createDashboardHandler(), deleteDashboardHandler(), listDashboardsHandler(), loadFaultTypes(), rotateDashboardSecretHandler(), updateDashboardHandler(), sessionHandler(), NewDashboard()
### Community 37 - "ResolveForm.tsx"
Cohesion: 0.15
Nodes (16): AISummary(), AISummaryProps, AIText(), ResolveForm(), ResolveSubmit, streamAI(), StreamHandlers, toolLabels (+8 more)
### Community 38 - "AssigneePicker.tsx"
Cohesion: 0.60
Nodes (4): AssigneePicker(), AssigneePickerProps, normalize(), UserRef
Nodes (16): AISummary(), AISummaryProps, AIText(), ResolveForm(), ResolveSubmit, requestAI(), streamAI(), StreamHandlers (+8 more)
### Community 39 - "ai/ai.go"
Cohesion: 0.19
@ -251,9 +241,9 @@ Nodes (3): compactJSON(), compactValue(), isEmpty()
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `User` connect `User` to `updateHandler`, `user.go`, `registerRoutes`, `testing.T`, `oidc.go`, `MustCurrentUser`, `context.Context`, `fault.go`, `HashToken`, `.run`, `resolveHandler`?**
_High betweenness centrality (0.074) - this node is a cross-community bridge._
- **Why does `createSession()` connect `testing.T` to `oidc.go`, `HashToken`?**
- **Why does `User` connect `User` to `user.go`, `registerRoutes`, `oidc.go`, `MustCurrentUser`, `context.Context`, `fault.go`, `HashToken`, `.run`?**
_High betweenness centrality (0.073) - this node is a cross-community bridge._
- **Why does `createSession()` connect `testing.T` to `User`, `HashToken`?**
_High betweenness centrality (0.040) - this node is a cross-community bridge._
- **Why does `HashToken()` connect `HashToken` to `registerRoutes`, `testing.T`, `MustCurrentUser`?**
_High betweenness centrality (0.028) - this node is a cross-community bridge._
@ -264,4 +254,4 @@ _Questions this graph is uniquely positioned to answer:_
- **Should `user.go` be split into smaller, more focused modules?**
_Cohesion score 0.12615384615384614 - nodes in this community are weakly interconnected._
- **Should `registerRoutes` be split into smaller, more focused modules?**
_Cohesion score 0.0707070707070707 - nodes in this community are weakly interconnected._
_Cohesion score 0.07293868921775898 - nodes in this community are weakly interconnected._

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
1791919494.704543
1791919946.621027

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -770,8 +770,8 @@
"semantic_hash": ""
},
"backend/api/airoutes/register.go": {
"mtime": 1791918681.7540774,
"ast_hash": "2e76d56edf53e8856dd4ee3586c99542",
"mtime": 1791919968.8404472,
"ast_hash": "80068ef4309ae79ad436a286fe4200d1",
"semantic_hash": ""
},
"backend/api/dashboardroutes/registration.go": {
@ -865,8 +865,8 @@
"semantic_hash": ""
},
"frontend/src/lib/ai.ts": {
"mtime": 1791840199.4567149,
"ast_hash": "0a2873b3753813932ff15e47c8055f38",
"mtime": 1791919982.7714984,
"ast_hash": "4ea5cdc867dc3a915386955cd961689c",
"semantic_hash": ""
},
"backend/internal/ai/thinking.go": {