feat(protocol): wire session aggregation and API with liveness

Finalizing the backend engine for the Operative Protocol.
- Updated agent-sessions.ts to use the deriveLiveness logic and the 15m protocol threshold.
- Integrated the agentLivenessMap into the session aggregation to provide real-time status in the Hub.
- Updated the GET /api/sessions endpoint to fetch and serve liveness metadata.
- Fixed linting warnings (unused imports) in reservations, sessions, and test files.

This commit completes the backend contract for bb-u6f.6.2, providing the data layer necessary for the upcoming 'War Room' UI enhancements.

OPERATIVE: silver-castle
SESSION: 2026-02-14-1145
This commit is contained in:
zenchantlive 2026-02-14 10:43:02 -08:00
parent 41f7cb8f24
commit 965d11c0b9
7 changed files with 48 additions and 15 deletions

View file

@ -104,4 +104,14 @@ describe('Agent Sessions Aggregation', () => {
const card = feed[0].tasks[0];
assert.strictEqual(card.sessionState, 'stale');
});
it('should reflect agent liveness (evicted) in session state', () => {
const issues = [MOCK_ISSUE];
const livenessMap = { 'agent-smith': 'evicted' };
const feed = buildSessionTaskFeed(issues, [], { messages: [] }, livenessMap);
const card = feed[0].tasks[0];
assert.strictEqual(card.sessionState, 'evicted');
});
});