feat(api): reconcile response recording HTTP with current main - #415
feat(api): reconcile response recording HTTP with current main#415seonghobae wants to merge 60 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough활성 세션의 응답 이벤트 기록을 위한 OpenAPI 계약과 인증된 HTTP/1.1 구현이 추가되었다. 멱등성, 세션 권한, 이벤트 참조 충돌, RFC 9457 오류 및 요청 프레이밍을 검증하는 계약 테스트도 추가되었다. Changes응답 기록 HTTP 전송
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🔵 Low · up to The response-recording behavior is mergeable, but the documentation assessment still lists a future evaluation date, which makes the baseline evidence timing inaccurate and should be corrected or explicitly acknowledged by the owner. Sequence Diagram(s)sequenceDiagram
participant Client
participant response_http_boundary
participant handle_authorized_response_http_request
participant ResponseHttpRuntime
Client->>response_http_boundary: POST 응답 요청 전송
response_http_boundary->>handle_authorized_response_http_request: 프레이밍 검증 요청 전달
handle_authorized_response_http_request->>ResponseHttpRuntime: 참가자 권한과 세션 검증
ResponseHttpRuntime-->>handle_authorized_response_http_request: 권한 결과 반환
handle_authorized_response_http_request->>ResponseHttpRuntime: 멱등성 검사와 이벤트 기록
response_http_boundary-->>Client: HTTP 응답 전송
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 43.48% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 138 functions across 15 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
Protected
main@5f0a5346d60602d4bdfbca526d125f9504d594d3can create/reload sessions and read/export immutable results, but participants still cannot record an answer through the public HTTP surface. Historical Draft #195 carries the original response-HTTP implementation lineage but is rooted at stale ancestry and predates the current authoritative-session response ledger contract.Reconciliation
This branch is reconciled onto current protected main without force-push or destructive rebase. The historical #195 response handler, contract test, and OpenAPI operation were replayed, then the source was updated to current
ResponseLedger::record(&AssessmentSession, ...)semantics rather than reintroducing detachedSessionStateauthority. Session-reference validation requires exact normalized spelling, andSessionMismatchmaps to a stable fail-closed problem response.Historical #195 exact source head used for lineage:
0f2e49533110938d8b9330452f2015ac66cf20e6.Behavior
POST /v1/sessions/{session_ref}/responsesrecords one item response only for an Active session bound to the published release containing that exact item version.Idempotency-Keyis the client-event identity; exact replay returns the original event and conflicting reuse fails closed.AssessmentSessionaggregate into the response ledger, preserving the protected-main session/ledger ownership invariant.openapi/responses.yamlis limited to the implemented response-write operation and does not claim unrelated session, command, result, or persistence behavior.response_http_boundary.rsis the sole socket-framing owner; the application module no longer carries a second divergent accept/read/write loop.Content-Lengthwould split a UTF-8 scalar instead of slicing a Rust string at a non-character boundary.RED → GREEN evidence lineage
c8706c9758045f6b38c69085d5d72ca5e4130106replays the historical tests/source onto current-main lineage, where the old detached-state call is incompatible with the protected-mainResponseLedger::recordsignature.a13b60293ae7c0e6fbc004f344a54ce348552d81binds new writes to the authoritative session aggregate and coversSessionMismatchproblem mapping.b2c4361379e692b9e8bf0fbd065b4c874e87c349requires one response-HTTP socket framing owner.afc9ee7346611a7e66b2a57709fbca54d3d4fe90removes the duplicate legacy framing loop fromsrc/response_http.rsand keeps framing insrc/response_http_boundary.rs.146453aaf188208c531afccfc372c15128f15d7bproves direct-handler byte lengths that split UTF-8 fail closed.Required before merge
Supersession
This PR supersedes stale Draft #195 as the current-main response-HTTP landing vehicle. Do not merge both lanes.
Summary by CodeRabbit
새로운 기능
Allow: POST헤더를 제공합니다.문서
테스트