refactor: rename agent group→application across entire codebase
All checks were successful
CI / build (push) Successful in 1m22s
CI / cleanup-branch (push) Has been skipped
CI / docker (push) Successful in 52s
CI / deploy (push) Successful in 39s
CI / deploy-feature (push) Has been skipped

Complete the group→application terminology rename in the agent
registry subsystem:

- AgentInfo: field group → application, all wither methods updated
- AgentRegistryService: findByGroup → findByApplication
- AgentInstanceResponse: field group → application (API response)
- AgentRegistrationRequest: field group → application (API request)
- JwtServiceImpl: parameter names group → application (JWT claim
  string "group" preserved for token backward compatibility)
- All controllers, lifecycle monitor, command controller updated
- Integration tests: JSON request bodies "group" → "application"
- Frontend: schema.d.ts, openapi.json, agent queries, AgentHealth

RBAC group references (groups table, GroupAdminController, etc.)
are NOT affected — they are a separate domain concept.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-24 08:48:12 +01:00
parent 413839452c
commit ff76751629
28 changed files with 104 additions and 4618 deletions

File diff suppressed because one or more lines are too long

View File

@@ -3,12 +3,12 @@ import { api } from '../client';
import { config } from '../../config';
import { useAuthStore } from '../../auth/auth-store';
export function useAgents(status?: string, group?: string) {
export function useAgents(status?: string, application?: string) {
return useQuery({
queryKey: ['agents', status, group],
queryKey: ['agents', status, application],
queryFn: async () => {
const { data, error } = await api.GET('/agents', {
params: { query: { ...(status ? { status } : {}), ...(group ? { group } : {}) } },
params: { query: { ...(status ? { status } : {}), ...(application ? { application } : {}) } },
});
if (error) throw new Error('Failed to load agents');
return data!;

View File

@@ -28,7 +28,7 @@ export function useDiagramByRoute(application: string | undefined, routeId: stri
queryKey: ['diagrams', 'byRoute', application, routeId],
queryFn: async () => {
const { data, error } = await api.GET('/diagrams', {
params: { query: { group: application!, routeId: routeId! } },
params: { query: { application: application!, routeId: routeId! } },
});
if (error) throw new Error('Failed to load diagram for route');
return data!;

View File

@@ -625,10 +625,10 @@ export interface paths {
cookie?: never;
};
/**
* Find diagram by application group and route ID
* @description Resolves group to agent IDs and finds the latest diagram for the route
* Find diagram by application and route ID
* @description Resolves application to agent IDs and finds the latest diagram for the route
*/
get: operations["findByGroupAndRoute"];
get: operations["findByApplicationAndRoute"];
put?: never;
post?: never;
delete?: never;
@@ -683,7 +683,7 @@ export interface paths {
};
/**
* List all agents
* @description Returns all registered agents with runtime metrics, optionally filtered by status and/or group
* @description Returns all registered agents with runtime metrics, optionally filtered by status and/or application
*/
get: operations["listAgents"];
put?: never;
@@ -1158,7 +1158,7 @@ export interface components {
agentId: string;
name: string;
/** @default default */
group: string;
application: string;
version?: string;
routeIds?: string[];
capabilities?: {
@@ -1384,7 +1384,7 @@ export interface components {
AgentInstanceResponse: {
id: string;
name: string;
group: string;
application: string;
status: string;
routeIds: string[];
/** Format: date-time */
@@ -3133,10 +3133,10 @@ export interface operations {
};
};
};
findByGroupAndRoute: {
findByApplicationAndRoute: {
parameters: {
query: {
group: string;
application: string;
routeId: string;
};
header?: never;
@@ -3154,7 +3154,7 @@ export interface operations {
"*/*": components["schemas"]["DiagramLayout"];
};
};
/** @description No diagram found for the given group and route */
/** @description No diagram found for the given application and route */
404: {
headers: {
[name: string]: unknown;
@@ -3239,7 +3239,7 @@ export interface operations {
parameters: {
query?: {
status?: string;
group?: string;
application?: string;
};
header?: never;
path?: never;

View File

@@ -63,7 +63,7 @@ function AgentOverviewContent({ agent }: { agent: any }) {
<dl className={styles.detailList}>
<div className={styles.detailRow}>
<dt>Application</dt>
<dd><MonoText>{agent.group ?? '—'}</MonoText></dd>
<dd><MonoText>{agent.application ?? '—'}</MonoText></dd>
</div>
<div className={styles.detailRow}>
<dt>Version</dt>
@@ -175,7 +175,7 @@ export default function AgentHealth() {
const agentsByApp = useMemo(() => {
const map: Record<string, any[]> = {};
(agents || []).forEach((a: any) => {
const g = a.group;
const g = a.application;
if (!map[g]) map[g] = [];
map[g].push(a);
});
@@ -185,7 +185,7 @@ export default function AgentHealth() {
const liveCount = (agents || []).filter((a: any) => a.status === 'LIVE').length;
const staleCount = (agents || []).filter((a: any) => a.status === 'STALE').length;
const deadCount = (agents || []).filter((a: any) => a.status === 'DEAD').length;
const uniqueApps = new Set((agents || []).map((a: any) => a.group)).size;
const uniqueApps = new Set((agents || []).map((a: any) => a.application)).size;
const activeRoutes = (agents || []).filter((a: any) => a.status === 'LIVE').reduce((sum: number, a: any) => sum + (a.activeRoutes || 0), 0);
const totalTps = (agents || []).filter((a: any) => a.status === 'LIVE').reduce((sum: number, a: any) => sum + (a.tps || 0), 0);