feat(api): create and reload in-process sessions over HTTP - #149
feat(api): create and reload in-process sessions over HTTP#149cursor[bot] wants to merge 1 commit into
Conversation
Add POST /v1/sessions and GET /v1/sessions/{session_ref} so a purchaser
can start an assessment against a published locale-specific release.
The server mints the session reference, pins provenance, and returns
the same Created session for an exact Idempotency-Key replay.
Unpublished releases and locale mismatches fail closed with RFC 9457
problem details. OpenAPI 3.2 lists only these two operations.
Process-restart durability remains a later persist slice.
Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
There was a problem hiding this comment.
First public session HTTP family
Head c590b5e adds in-process POST /v1/sessions and GET /v1/sessions/{session_ref} with server-minted opaque refs, exact Idempotency-Key replay, RFC 9457 problems, and OpenAPI 3.2 limited to those two operations.
Create pins one cataloged published locale-specific release through AssessmentSession::new. Unpublished, locale mismatch, missing/conflicting idempotency, and unknown JSON fail closed. This slice does not add assessment_session persistence.
Residuals (documented, not a reason to open a second HTTP PR):
- In-process store only; restart durability stays on the persist landing (#146, not #129).
- No anonymous credential / resource authorization yet (#84/#86/#144).
- GET is capability-URL by opaque
session_ref; do not mint guessable refs in a hosted bind. - Does not import #87
ApiProblem; wire shape matches operator health HTTP.
Do not mix persist or auth stacks onto this branch. Independent last-push approval and exact-head required checks remain required. This review does not approve.
Sent by Cursor Automation: Fix Issues
|
Closing as superseded, not merged. #232 is the current public-session HTTP landing: it implements the same |


Why
A purchaser still cannot start an assessment over HTTP. Domain session creation exists on protected main, but TRD
POST /v1/sessions/GET /v1/sessions/{session_ref}were Target. Session persist stays on the #125/#129 lineage; this slice does not addassessment_session.Scope
src/session_http.rsmints a Created session bound to one cataloged published locale-specific release.Idempotency-Keyreplay returns the original session without minting a second identity.openapi/sessions.yaml(OpenAPI 3.2.0) lists only these two operations.Out of scope
ApiProblemprimitive (this slice uses the same RFC 9457 wire shape as operator health HTTP)Test plan
cargo test --test session_http_contract --test session_http_listener_contract --test documentation_architecture_contractcargo test --lib session_httpcargo fmt --all -- --checkcargo clippy --all-targets -- -D warningsDo not merge until exact-head checks and independent last-push approval are satisfied. Never self-approve.