Skip to content

feat: refactor HTTPServer to use pipeline - #77

Merged
rsclarke merged 2 commits into
mainfrom
feat/59-refactor-httpserver-pipeline
Feb 2, 2026
Merged

rsclarke merged 2 commits into
mainfrom
feat/59-refactor-httpserver-pipeline

Conversation

@rsclarke

@rsclarke rsclarke commented Feb 2, 2026

Copy link
Copy Markdown
Owner

Summary

Refactors the HTTP server to create events and dispatch through the pipeline instead of calling db functions directly.

Changes

  • HTTPServer now has Pipeline field instead of DB
  • Creates InteractionDraft and HTTPEvent from HTTP requests
  • Dispatches through pipeline via ProcessHTTP()
  • Writes response from HTTPResponsePlan after pipeline processing
  • storage.Plugin now implements plugins.Store interface directly (eliminates duplication)
  • No direct imports of internal/db in http.go

Files Modified

  • internal/server/http.go - Refactored to use pipeline
  • internal/server/http_test.go - Updated tests to use pipeline
  • internal/plugins/core/storage/plugin.go - Implements Store interface
  • internal/plugins/core/storage/plugin_test.go - Updated tests
  • cmd/oastrix/server.go - Initialize pipeline with plugins

Acceptance Criteria

  • HTTPServer has Pipeline field instead of DB
  • Creates InteractionDraft and HTTPEvent from request
  • Dispatches through pipeline
  • Writes response from HTTPResponsePlan
  • All existing HTTP tests pass
  • No direct imports of internal/db in http.go

Closes #59

- Replace direct db calls with pipeline.ProcessHTTP()
- Add SQLiteStore adapter implementing plugins.Store interface
- Update HTTPServer to use Pipeline field instead of DB field
- Create InteractionDraft and HTTPEvent from HTTP requests
- Write response from HTTPResponsePlan after pipeline processing
- Update all HTTP tests to use pipeline with storage and defaultresponse plugins
- Update cmd/oastrix/server.go to initialize pipeline

Closes #59
- Remove SQLiteStore adapter (duplicate of storage plugin functionality)
- Add ResolveTokenID, CreateInteraction, SaveAttributes to storage.Plugin
  implementing plugins.Store interface
- Update cmd/oastrix/server.go to use storagePlugin as the store
- Update tests to use storagePlugin directly as store
- Rename Store() to CreateInteraction() for interface compliance
@rsclarke
rsclarke merged commit 4158794 into main Feb 2, 2026
1 check passed
@rsclarke
rsclarke deleted the feat/59-refactor-httpserver-pipeline branch February 2, 2026 08:30
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.

Refactor HTTPServer to use pipeline

1 participant