feat(apess): real per-team activity counts + judge board evidence

Stage E deeper — derive real signal from the board event stream:

- Collective reducer tallies per-team {calls, flashes, errors} from
  node:activity (thinking→calls, flash→flashes, error→errors); exposed
  as `counts` alongside the existing activity feed.
- Admin gains a room-wide "Flashes" pulse stat.
- Judge review card shows a live "Board evidence" panel — streams the
  reviewed team's own board activity via its SSE feed, so scoring can
  reference real on-device work, not just the submitted code.

Tests: front-end 182, typecheck clean, prod build passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
Omar Sobh
2026-07-03 09:19:53 -07:00
co-authored by Claude Opus 4.8
parent 66785601a2
commit 56324d7c89
5 changed files with 83 additions and 6 deletions
+10
View File
@@ -10,6 +10,7 @@ const api = vi.hoisted(() => ({
getLeaderboard: vi.fn(),
postScore: vi.fn(),
openCollective: vi.fn(() => () => {}),
openTeamActivity: vi.fn(() => () => {}),
}))
vi.mock('@/lib/api', () => api)
@@ -56,6 +57,15 @@ describe('Judge', () => {
await waitFor(() => expect(screen.getByTestId('add-review')).toHaveTextContent('KIT-01-AAA'))
})
it("opens the selected team's live board-evidence feed", async () => {
const user = userEvent.setup()
renderJudge()
await waitFor(() => expect(screen.getByTestId('submission-list')).toBeInTheDocument())
await user.click(within(screen.getByTestId('submission-list')).getByText('Alpha'))
await waitFor(() => expect(screen.getByText(/board evidence/i)).toBeInTheDocument())
expect(api.openTeamActivity).toHaveBeenCalledWith('a', expect.any(Function))
})
it('posts a score and refreshes', async () => {
const user = userEvent.setup()
renderJudge()