fix: SHIP handshake conformance (CMI/PROT/TERM abort behavior)#101
Open
andig wants to merge 1 commit into
Open
fix: SHIP handshake conformance (CMI/PROT/TERM abort behavior)#101andig wants to merge 1 commit into
andig wants to merge 1 commit into
Conversation
Fixes six SHIP high-level test-spec non-conformances in the handshake and connection lifecycle: - TC_SHIP_CMI_001: as server, reject an invalid CMI message by sending a CMI message (MessageType=0, MessageValue=0) before closing. - TC_SHIP_PROT_003: server protocol-handshake wait-timer expiry now sends protocolHandshakeError error=1 (timeout) instead of no frame. - TC_SHIP_PROT_004: client wait-timer expiry now sends error=1 (timeout) instead of error=2 (unexpected message). - TC_SHIP_PROT_005: server unexpected/malformed proposal now sends error=2 (unexpected message) instead of no frame. - TC_SHIP_PROT_006: client valid-but-non-select message now sends error=2 (unexpected message); malformed select remains error=3 (selection mismatch). - TC_SHIP_TERM_001: the announced close message now carries a valid SHIP ConnectionCloseReasonType; free-form reasons map to "unspecific". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Closes #98. Contributes to #95 (SHIP TestSpecification V1.0.0 compliance).
Fixes six non-conformances against the SHIP High-Level Test Specification, all in the handshake / connection-lifecycle abort paths. #98 covers PROT_003/004; this PR also resolves CMI_001, PROT_005/006 and TERM_001 in the same area.
{0,0}reject before closingprotocolHandshakeErrorerror=1 (timeout)"User close") asreasonConnectionCloseReasonType(unspecific)How
handleStatedispatch for the server/client protocol-handshake states before the message handler runs, so a nil-message timeout is not misclassified as an unexpected message.abortProtocolHandshake(which emits the error frame) instead ofendHandshakeWithError(which does not) for message-rejection paths; genuine send errors still useendHandshakeWithError.validCloseReasonsanitizes the announced close reason.Tests
New/updated conformance tests assert the exact SHIP error codes on the sent frame (
Test_ListenProposal_Timeout,Test_ListenProposal_Failure,Test_ListenChoice_Timeout,Test_ListenChoice_UnexpectedMessage,Test_ListenChoice_SelectionMismatch,Test_ServerWait_Invalid*,TestValidCloseReason). Every test is annotated with its TC id. Full module test suite passes.🤖 Generated with Claude Code