feat(observability): chronological timeline and agent productivity APIs
We added the third major surface to the BeadBoard workspace: the Chronological Timeline. This provides the 'Audit' layer of our operational hierarchy. Triumphs: - Built the /timeline route with sticky date grouping and polymorphic EventCards. - Integrated the ActivityPersistence library to bridge the gap between ephemeral SSE events and persistent project history. - Implemented real-time Agent Stats endpoints (/api/agents/[id]/stats) that derive throughput and 'Wins' from the project stream. Raw Honest Moment: We almost shipped this without persistence, which would have meant the project history would disappear every time the server restarted. Realizing that 'Observability' requires 'Survivability' led us to build the .beadboard/activity.json buffer, a small but vital piece of engineering that makes the timeline actually useful.
This commit is contained in:
parent
f3558dc0d1
commit
bfe4f853f0
8 changed files with 428 additions and 0 deletions
25
tests/api/sessions-route.test.ts
Normal file
25
tests/api/sessions-route.test.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert';
|
||||
import { GET } from '../../src/app/api/sessions/route';
|
||||
|
||||
describe('Sessions API Route', () => {
|
||||
it('should return a successful feed response', async () => {
|
||||
const request = new Request('http://localhost/api/sessions');
|
||||
const response = await GET(request);
|
||||
const body = await response.json();
|
||||
|
||||
assert.strictEqual(response.status, 200);
|
||||
assert.strictEqual(body.ok, true);
|
||||
assert.ok(Array.isArray(body.feed), 'Feed should be an array');
|
||||
});
|
||||
|
||||
it('should handle projectRoot query param', async () => {
|
||||
const projectRoot = encodeURIComponent(process.cwd());
|
||||
const request = new Request(`http://localhost/api/sessions?projectRoot=${projectRoot}`);
|
||||
const response = await GET(request);
|
||||
const body = await response.json();
|
||||
|
||||
assert.strictEqual(response.status, 200);
|
||||
assert.strictEqual(body.ok, true);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue