Skip to content

add experimental question HttpApi slice#22357

Merged
kitlangton merged 10 commits intodevfrom
kit/question-httpapi-spike
Apr 14, 2026
Merged

add experimental question HttpApi slice#22357
kitlangton merged 10 commits intodevfrom
kit/question-httpapi-spike

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • add an experimental question HttpApi slice mounted under /experimental/httpapi/question with a focused end-to-end server test
  • migrate Question boundary schemas to Effect Schema with derived .zod compatibility, and update existing question HTTP/tool boundaries to consume the canonical schemas
  • expand the HttpApi migration notes with a repeatable vertical-slice plan and placement guidance

Testing

  • bun test test/server/question-httpapi.test.ts test/question/question.test.ts

Align the experimental question API schemas with the repo's Effect modeling style and keep the TUI answer rendering compatible with readonly arrays.
Decode pending question requests through the Schema.Class constructor path so the HttpApi list endpoint returns valid Question.Request instances while keeping QuestionID as a newtype.
Replace the ad hoc Object.assign wrapper with the shared schema helper so the Answer schema follows the same static attachment pattern as the rest of the codebase.
Capture the reusable pattern from the question HttpApi spike and turn the follow-up work into a checklist so the next route-group migrations can follow the same shape.
@kitlangton kitlangton marked this pull request as ready for review April 14, 2026 02:22
@kitlangton kitlangton enabled auto-merge (squash) April 14, 2026 02:22
Resolve the question service once when constructing the HttpApi group layer and close over the resulting handlers, instead of doing a tag lookup inside each handler invocation.
Build the question HttpApi handlers with an effectful group callback so the service is resolved once at layer construction time and the endpoint handlers close over the resulting service methods.
@kitlangton kitlangton merged commit f2525a6 into dev Apr 14, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant