Skip to content

Span annotations for human feedback#55

Draft
chtushar wants to merge 1 commit intomainfrom
chtushar/trace-annotations
Draft

Span annotations for human feedback#55
chtushar wants to merge 1 commit intomainfrom
chtushar/trace-annotations

Conversation

@chtushar
Copy link
Copy Markdown
Contributor

Summary

Add support for annotating individual spans with structured human feedback (scores, labels, comments). This enables reviewers to provide quality signals on trace execution, supporting evaluation datasets, prompt iteration, and quality monitoring workflows.

Changes

  • Database: New span_annotations table with discriminated type (score/label/comment) and JSONB value
  • Datalayer: CRUD methods with Zod validation
  • API: 4 endpoints nested under traces (GET list, POST create, PATCH update, DELETE)
  • Client: Query hook and mutation hooks with auto-invalidation
  • UI: New "Annotations" collapsible section in SpanDetailView with list + inline form

Testing

  • Core package typechecks clean
  • No annotation-specific lint errors
  • Auto-migration creates table on startup
  • Annotations work on any span via the detail view

Add support for annotating individual spans with scores, labels, and comments.
This enables reviewers to provide structured feedback on trace execution,
supporting evaluation datasets, prompt iteration, and quality monitoring.

Changes:
- Add span_annotations table with type-discriminated value column
- Implement CRUD datalayer with validation
- Add 4 API endpoints (GET/POST/PATCH/DELETE) nested under traces
- Create query and mutation hooks for React Query
- Add annotation UI section to SpanDetailView with inline form
- Support scores (numeric), labels (categorical), and comments (free text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant