Repository navigation
[TST-E4] test: twelve more declared-error doors become table rows, each door defined once per area - #463
Merged
Conversation
…efined once per area TST-E4a P04b. The FileSystem, Integration and Integrations contract classes' declared-error door methods become rows of DeclaredErrorTests, proven on both spines and traced to the pinned spec, in FileSystem/FileSystemDeclaredErrors.cs and Integrations/IntegrationsDeclaredErrors.cs. Each door is defined once per area and its cases reference it, so a door's label and call live in one place. Four retained Integration tests drop member names that no longer exist (GetIntegrationAsync -> GetAsync, PostConnectKeyAsync -> ConnectWithKeyAsync, PostOAuthConnectAsync -> BeginOAuthConnectionAsync).
This was referenced Oct 17, 2026
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.
📝 Description
What does this PR do?
It is TST-E4a's second batch of declared-error door conversions, and the first using one shared door per area. Twelve more methods become rows of the door table: four in FileSystem, six in Integration and two in Integrations. Each of them proved only "door D answers declared status S with error type T" on one spine.
OpenCodeApiException, the exact status and the exact type. On the NoThrow spine it assertsIsError, the exact status and the exact type. The one-way guard checks every row against its declaration in the pinnedspec/openapi.json.FileSystem/FileSystemDeclaredErrors.csandIntegrations/IntegrationsDeclaredErrors.cs, which also holds the Integration rows. TheirRows()are 35 and 67 lines.static readonly DeclaredErrorDoor, and every case of that door references it. A door'snameoflabel and its call now live in exactly one place, which shrinks the accepted mislabel risk.DeclaredErrorTests.EveryDoor()appends the two new slices. The existing slices adopt shared doors in a separate small PR.GetIntegrationAsync→GetAsync,PostConnectKeyAsync→ConnectWithKeyAsync,PostOAuthConnectAsync→BeginOAuthConnectionAsync. Each new name is the member the test calls, and the old names exist nowhere undersrc. Only the names change; the bodies don't.Net line delta: +174 / −162 = +12 in test code. P04a's was +94; shared doors account for most of the difference.
🔄 Type of Change
🎯 Protocol & API Surface
external/,spec/orsrc/was touched🧪 Testing
Test mapping (mechanical:
e4_test_map.pyovergit diff 77bb1b51 336ac386)tests/OpenCode.Sdk.Tests/FileSystem/FileSystemClientContractTests.csListEntriesAsync_Should_Throw_The_Declared_400_Errorfs.list:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/FileSystem/FileSystemClientContractTests.csListEntriesAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinefs.list:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/FileSystem/FileSystemClientContractTests.csFindEntriesAsync_Should_Throw_The_Declared_400_Errorfs.find:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/FileSystem/FileSystemClientContractTests.csFindEntriesAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinefs.find:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csGetIntegrationAsync_Should_Return_The_Typed_IntegrationGetAsync_Should_Return_The_Typed_Integrationtests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csGetIntegrationAsync_Should_Throw_The_Declared_404_When_The_Integration_Is_UnknownGetAsync_Should_Throw_The_Declared_404_When_The_Integration_Is_Unknowntests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csGetIntegrationAsync_Should_Throw_The_Declared_400_Errorintegration.get:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csGetIntegrationAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineintegration.get:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csPostConnectKeyAsync_Should_Send_The_Typed_Body_On_The_Handle_RouteConnectWithKeyAsync_Should_Send_The_Typed_Body_On_The_Handle_Routetests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csPostConnectKeyAsync_Should_Throw_The_Declared_400_Errorintegration.connect.key:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csPostConnectKeyAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineintegration.connect.key:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csPostOAuthConnectAsync_Should_Return_The_Typed_AttemptBeginOAuthConnectionAsync_Should_Return_The_Typed_Attempttests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csPostOAuthConnectAsync_Should_Throw_The_Declared_400_Errorintegration.oauth.connect:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.csPostOAuthConnectAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineintegration.oauth.connect:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Integrations/IntegrationsClientContractTests.csListIntegrationsAsync_Should_Throw_The_Declared_400_Errorintegration.list:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Integrations/IntegrationsClientContractTests.csListIntegrationsAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineintegration.list:401:UnauthorizedErrorUnmapped: 0
tests/OpenCode.Sdk.Tests/Common/Errors/DeclaredErrorTests.cstests/OpenCode.Sdk.Tests/FileSystem/FileSystemClientContractTests.cstests/OpenCode.Sdk.Tests/FileSystem/FileSystemDeclaredErrors.cstests/OpenCode.Sdk.Tests/Integrations/IntegrationClientContractTests.cstests/OpenCode.Sdk.Tests/Integrations/IntegrationsClientContractTests.cstests/OpenCode.Sdk.Tests/Integrations/IntegrationsDeclaredErrors.csThe negative deltas are the deleted methods' assertions. The rows assert the same status and exact type on both spines.
Equivalence mutants: one per source class (scratch only; restored byte-identically)
In each class's response adapter,
Status400Tagswas emptied for one door.src/OpenCode.Sdk/)FileSystem/Internal/FsListResponseAdapter.cs:9ListEntriesAsync_Should_Throw_The_Declared_400_Errorfs.list:400:InvalidRequestErrorIntegrations/Internal/IntegrationResponseAdapter.cs:9GetIntegrationAsync_Should_Throw_The_Declared_400_Errorintegration.get:400:InvalidRequestErrorIntegrations/Internal/IntegrationListResponseAdapter.cs:9ListIntegrationsAsync_Should_Throw_The_Declared_400_Errorintegration.list:400:InvalidRequestErrorBase: 3 failed. Finished table: 6 failed (3 rows × 2 spines). Two row-oracle mutants are also killed: a wrong expected type turns both spines red, and a pointer into another operation turns the guard red.
Clone baseline (regenerated, totals fall)
77bb1b51The baseline loses 59 fingerprints and gains 42. None of the 42 duplicates that jscpd reports as new involves a file this PR changes. All of them sit between untouched files whose text is byte-identical to master: once their FileSystem and Integration twins are deleted, jscpd pairs the still-unconverted declared-error methods differently.
Review
spec/openapi.json, that all 12nameoflabels match the call their lambda makes, that each door is defined once per area, and the renames. It could not verify the baseline regrouping from hashes alone; the jscpd analysis above is that evidence.✅ Completion Gate
Local check (
quality-gates.md) on head336ac386, base77bb1b51. Every step's own exit code was read:dotnet build --configuration Release: 0 warnings, 0 errorsdotnet format whitespace/dotnet format style --severity warn: no changesverify-clones: passed, 0 new (tests 4.99%)OpenCode.Sdk.Tools.Tests(all but NativeAot): 2086, 0 failedOpenCode.Sdk.Tests(all but ServiceElection/NativeAot): 8591, 0 failedThe host runs Bun 1.4.3, a maintainer-named off-pin host (
OPENCODE_SDK_TESTS_BUN_MISMATCH=allow); the pin is 1.4.2.✅ Code Quality Checklist
Need help on this PR? Tag
@codesmith-botwith what you need.