feat: add audit/activity log view with timeline and event filtering (#17)
Add a dedicated /audit route displaying a chronological timeline of orchestration events (state transitions, tool invocations, errors, messages) grouped by session. Includes session selector, event type filtering, URL deep-linking via ?session=id, and audit event capture during chat streaming. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,3 +18,4 @@
|
||||
| #14 | Preset configurations | COMPLETED | [issue-014.md](issue-014.md) |
|
||||
| #15 | Agent lineage visualization | COMPLETED | [issue-015.md](issue-015.md) |
|
||||
| #16 | Memory candidates viewer | COMPLETED | [issue-016.md](issue-016.md) |
|
||||
| #17 | Audit/activity log view | COMPLETED | [issue-017.md](issue-017.md) |
|
||||
|
||||
56
implementation-plans/issue-017.md
Normal file
56
implementation-plans/issue-017.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# Issue #17 — Audit/Activity Log View
|
||||
|
||||
**Status: COMPLETED**
|
||||
|
||||
## Overview
|
||||
|
||||
Timeline view of all orchestration events for a session — state transitions, tool invocations, errors. Populated from the streamed responses captured during the session.
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
### 1. Audit Event Store (`src/lib/stores/audit.svelte.ts`) — COMPLETED
|
||||
|
||||
- Created `AuditEvent` type with `id`, `sessionId`, `timestamp`, `eventType`, `details`, `state?`
|
||||
- Event types: `state_change`, `tool_invocation`, `error`, `message`
|
||||
- Store events grouped by session using `SvelteMap`, persisted to `localStorage`
|
||||
- Functions: `addEvent()`, `getEventsBySession()`, `getAllSessions()`, `clearSession()`
|
||||
- Sample data seeded for demo sessions
|
||||
|
||||
### 2. AuditTimeline Component (`src/lib/components/AuditTimeline.svelte`) — COMPLETED
|
||||
|
||||
- Vertical timeline with left-aligned time markers and event cards
|
||||
- Color-coded type badges: state change=blue, tool=green, error=red, message=gray
|
||||
- Each event shows timestamp, type badge, state label (when applicable), and detail text
|
||||
- Date headers when events span multiple days
|
||||
- Hover shadow effect on event cards
|
||||
|
||||
### 3. Audit Route (`src/routes/audit/+page.svelte`) — COMPLETED
|
||||
|
||||
- Dedicated `/audit` route with session selector dropdown and timeline
|
||||
- Filter controls for event type (all, state changes, tool invocations, errors, messages)
|
||||
- URL query param `?session=id` for deep linking to specific session
|
||||
- Empty states when no events or no session selected
|
||||
- Header with back-to-chat link and "Sample Data" badge
|
||||
|
||||
### 4. Audit Route Config (`src/routes/audit/+page.ts`) — COMPLETED
|
||||
|
||||
- `export const prerender = false` and `export const ssr = false`
|
||||
|
||||
### 5. Homepage Navigation (`src/routes/+page.svelte`) — COMPLETED
|
||||
|
||||
- Added "Audit Log" navigation link alongside existing Chat, Lineage, Memory links
|
||||
|
||||
### 6. Chat Page Integration (`src/routes/chat/+page.svelte`) — COMPLETED
|
||||
|
||||
- Added "Audit" link in the header navigation bar
|
||||
- Capture orchestration state changes during streaming into the audit store
|
||||
- Capture errors into the audit store
|
||||
|
||||
## Files Changed
|
||||
|
||||
- `src/lib/stores/audit.svelte.ts` (new)
|
||||
- `src/lib/components/AuditTimeline.svelte` (new)
|
||||
- `src/routes/audit/+page.svelte` (new)
|
||||
- `src/routes/audit/+page.ts` (new)
|
||||
- `src/routes/+page.svelte` (modified)
|
||||
- `src/routes/chat/+page.svelte` (modified)
|
||||
Reference in New Issue
Block a user