Skip to content

Implement REST API v1 — event log/audit trail endpoint #7

@treblereel

Description

@treblereel

Context

Part of epic #1 — Build production-ready REST microservice with k8s deployment on top of casehub-engine. This exposes the immutable event log for observability, debugging, and compliance.

What

Implement event log query endpoint:

  • GET /api/v1/cases/{caseId}/events — retrieve event log/audit trail for case instance

Acceptance Criteria

  • Returns chronological list of all events (worker executions, state transitions, signals received)
  • Each event includes: timestamp, event type, actor/worker name, context diff, trace ID
  • Supports pagination (offset/limit or cursor-based)
  • Supports filtering by event type (e.g., ?type=WORKER_EXECUTION_COMPLETED)
  • Returns 404 if caseId doesn't exist
  • Error responses follow RFC 7807 format
  • Integration tests verify events appear after worker execution, signal processing, state changes

Notes

  • Use casehub-engine's event log mechanism for retrieving case events
  • Consider including context diffs from ContextDiffStrategy SPI (casehubio/engine #55)
  • Event log should be immutable and append-only
  • File paths: casehub-engine's event handling, CaseLifecycleEvent, event storage

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions