feat(protocol): deliver 'War Room' UI with Incursion Engine

We've transformed the Social-Dense Hub into a high-fidelity operational surface.
- BACKEND: Implemented Global Incursion Engine in agent-sessions.ts (N^2 overlap detection) and added the 60m 'Idle' state.
- API: Enriched the sessions payload with full metadata and active conflict arrays.
- HEADER: Delivered 4-state agent stations (Active/Stale/Evicted/Idle) with real-time 'time-ago' timers.
- FEED: Implemented the 'Fire Map' visuals:
  * Global Incursion Ticker: High-visibility alerts for agent collisions.
  * Local Conflict Badges: Pulsing pills on affected task cards.
- Refactored components for React-static compliance and strict TypeScript safety.

This commit completes the visibility track, allowing the human supervisor to monitor agent presence and friction in real-time.

OPERATIVE: silver-castle
SESSION: 2026-02-14-1430
This commit is contained in:
zenchantlive 2026-02-14 11:36:32 -08:00
parent e010e0b10b
commit eec1d6e28f
10 changed files with 224 additions and 41 deletions

View file

@ -1,7 +1,8 @@
import { NextResponse } from 'next/server';
import { readIssuesFromDisk } from '../../../lib/read-issues';
import { activityEventBus } from '../../../lib/realtime';
import { buildSessionTaskFeed, getCommunicationSummary, getAgentLivenessMap } from '../../../lib/agent-sessions';
import { buildSessionTaskFeed, getCommunicationSummary, getAgentLivenessMap, calculateIncursions } from '../../../lib/agent-sessions';
import { listAgents } from '../../../lib/agent-registry';
export const dynamic = 'force-dynamic';
@ -14,10 +15,18 @@ export async function GET(request: Request): Promise<Response> {
const activity = activityEventBus.getHistory(projectRoot);
const communication = await getCommunicationSummary();
const livenessMap = await getAgentLivenessMap();
const incursions = await calculateIncursions();
const agentsResult = await listAgents({});
const feed = buildSessionTaskFeed(issues, activity, communication, livenessMap);
return NextResponse.json({ ok: true, feed });
return NextResponse.json({
ok: true,
feed,
livenessMap,
incursions,
agents: agentsResult.data ?? []
});
} catch (error) {
console.error('[API/Sessions] Failed to load session feed:', error);
return NextResponse.json(