feat(api): apply participant session commands over HTTP - #204
Draft
cursor[bot] wants to merge 1 commit into
Draft
Conversation
Add in-process POST /v1/sessions/{session_ref}/commands for Activate,
Pause, Resume, Complete, and Cancel with exact Idempotency-Key replay
and RFC 9457 problems. After Activate, post responses; after the last
item, Complete. Scoring commands stay off this route.
Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A purchaser can create a session (#149) and can post responses only after the session is already Active (#195). Protected main has the domain command machine, but TRD
POST /v1/sessions/{session_ref}/commandswas still Target. Without Activate/Complete over HTTP, the assessment loop cannot start or freeze answers.This slice is intentionally not on the #98 published-release load stack. Prefer #180 for locked start-from-store. Prefer #177 for recovery
claim_deadline_at.What this PR does
POST /v1/sessions/{session_ref}/commandsapplies Activate, Pause, Resume, Complete, or Cancel.Idempotency-Keyreplay returns the original resulting state and sequence without minting a new command.begin_scoring,record_score,release,expire,invalidate) fail closed and tell the caller to stay on this participant family until Complete.openapi/session-commands.yaml).Out of scope
Test plan
cargo test --test session_command_http_contract --test session_command_http_listener_contract --test session_state --test session_aggregate_lifecycle --test documentation_architecture_contract --test traceability_active_pr_contractcargo clippy --all-targets -- -D warningscargo fmt --all -- --checkOperator next action
After exact-head Runtime CI and an independent last-push review, bind
0.0.0.0:$PORTandPOST {"command":"activate"}with an opaqueIdempotency-Key. ThenPOST /v1/sessions/{session_ref}/responsesfor each published item. After the last answer,{"command":"complete"}.Do not merge until exact-head checks and independent last-push approval are satisfied. Never self-approve.