Repository navigation
[TST-E4] test: fourteen more declared-error doors become table rows in five new slices - #474
Merged
Merged
Conversation
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 18, 2026
…rops the stale ones, and the tests ceiling falls to 5%
Blind-Striker
force-pushed
the
test/tst-e4a-p05b-door-rows
branch
from
October 18, 2026 08:57
eef2a35 to
e223af2
Compare
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 P05b, the second half of P05: fourteen more declared-error door methods become rows of the door table. LanguageModels has 4, the root
OpenCodeClientContractTests2, Permissions 2, Projects 4 and Server 2. Each method 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.LanguageModels/,Permissions/,Projects/,Server/, and a rootOpenCodeClientDeclaredErrors.cs(because the area follows the source class). TheirRows()are 19 to 35 lines long.DeclaredErrorTests.EveryDoor()appends them.UpdateProjectAsyncmethods call it with"prj_9"(404) and"prj_1"(401), so they get two fields,UpdateProjectPrj9DoorandUpdateProjectPrj1Door. No argument is normalized.using OpenCode.Sdk.Models;directives are removed from Permissions and Server, because nothing there uses them any more (IDE0005).CloneScopes, its two Tools test expectations and the canon sentence change together.Net line delta: +242 / −177 = +65 in Sdk test code, from five slice files' boilerplate. Over the whole PR it is +260 / −215, including the baseline and the ceiling.
🔄 Type of Change
🎯 Protocol & API Surface
external/,spec/orsrc/was touched🧪 Testing
Test mapping (mechanical:
e4_test_map.pyovergit diff a323b4d3 8007a4f8, the worker's commit; the conversion commit here is tree-identical)tests/OpenCode.Sdk.Tests/LanguageModels/LanguageModelsClientContractTests.csGetDefaultAsync_Should_Throw_The_Declared_400_Errormodel.default:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/LanguageModels/LanguageModelsClientContractTests.csGetDefaultAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinemodel.default:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/LanguageModels/LanguageModelsClientContractTests.csListModelsAsync_Should_Throw_The_Declared_400_Errormodel.list:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/LanguageModels/LanguageModelsClientContractTests.csListModelsAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinemodel.list:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/OpenCodeClientContractTests.csGetLocationAsync_Should_Throw_The_Declared_400_Errorlocation.get:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/OpenCodeClientContractTests.csGetLocationAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinelocation.get:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Permissions/PermissionsClientContractTests.csListSavedAsync_Should_Throw_The_Declared_400_Errorpermission.saved.list:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Permissions/PermissionsClientContractTests.csListSavedAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinepermission.saved.list:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Projects/ProjectsClientContractTests.csListProjectsAsync_Should_Throw_The_Declared_400_Errorproject.list:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Projects/ProjectsClientContractTests.csListProjectsAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineproject.list:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Projects/ProjectsClientContractTests.csUpdateProjectAsync_Should_Throw_The_Declared_404_Errorproject.update:404:ProjectNotFoundErrortests/OpenCode.Sdk.Tests/Projects/ProjectsClientContractTests.csUpdateProjectAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineproject.update:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Server/ServerClientContractTests.csGetInfoAsync_Should_Throw_The_Declared_400_Errorserver.info:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Server/ServerClientContractTests.csGetInfoAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineserver.info:401:UnauthorizedErrorUnmapped: 0
tests/OpenCode.Sdk.Tests/Common/Errors/DeclaredErrorTests.cstests/OpenCode.Sdk.Tests/LanguageModels/LanguageModelsClientContractTests.cstests/OpenCode.Sdk.Tests/LanguageModels/LanguageModelsDeclaredErrors.cstests/OpenCode.Sdk.Tests/OpenCodeClientContractTests.cstests/OpenCode.Sdk.Tests/OpenCodeClientDeclaredErrors.cstests/OpenCode.Sdk.Tests/Permissions/PermissionsClientContractTests.cstests/OpenCode.Sdk.Tests/Permissions/PermissionsDeclaredErrors.cstests/OpenCode.Sdk.Tests/Projects/ProjectsClientContractTests.cstests/OpenCode.Sdk.Tests/Projects/ProjectsDeclaredErrors.cstests/OpenCode.Sdk.Tests/Server/ServerClientContractTests.cstests/OpenCode.Sdk.Tests/Server/ServerDeclaredErrors.csThe negative deltas are the deleted methods' assertions. The rows assert the same status and exact type on both spines.
Equivalence and row mutants (scratch only; restored from saved Git blobs; net10.0, analyzers on)
src/OpenCode.Sdk/…)LanguageModels/Internal/ModelDefaultResponseAdapter.cs:9, the 400 tag replacedGetDefaultAsync_Should_Throw_The_Declared_400_Errorredmodel.default:400:InvalidRequestErrorred on both spinesLocation/Internal/LocationResponseAdapter.cs:9, the 400 tag replacedGetLocationAsync_Should_Throw_The_Declared_400_Errorredlocation.get:400:InvalidRequestErrorred on both spinesPermissions/Internal/PermissionSavedListResponseAdapter.cs:9, the 400 tag replacedListSavedAsync_Should_Throw_The_Declared_400_Errorredpermission.saved.list:400:InvalidRequestErrorred on both spinesProjects/Internal/ProjectUpdateResponseAdapter.cs:11, the project tag removedUpdateProjectAsync_Should_Throw_The_Declared_404_Errorredproject.update:404:ProjectNotFoundErrorred on both spinesServer/Internal/ServerInfoResponseAdapter.cs:9, the 400 tag replacedGetInfoAsync_Should_Throw_The_Declared_400_Errorredserver.info:400:InvalidRequestErrorred on both spinesmodel.default:400model.list's 400 responseThe five adapter mutants ran in one scratch build. Each one breaks a different adapter, and each old method and each row exercises only its own adapter, so every red is still attributable. Base: 0 passed, 5 failed. Head: 10 failed, that is 5 rows × 2 spines.
Clones: 13 regrouped pairs, 0 new duplicates
Deleting the methods removes the fragment that jscpd had paired several other locations with. Those locations now pair with each other, which gives them new fingerprints for code that was already duplicated. For each of the 13 pairs below, both ends were clones, on master a323b4d, of the same fragment in a deleted LanguageModels method. None touches a file this PR changes. Master's report was taken from its own worktree. The baseline diff is +13 (these pairs) and −33 (stale).
These are the not-yet-converted door methods of P06 and P07, which remove them.
Review
spec/openapi.json, including the/anyOf/0branch of project.update's 404."prj_9"and"prj_1".Local check (Windows, on master a323b4d;
external/opencodesynced to the gitlink 843a6c5)dotnet build -c Release: 0 warnings, 0 errors.dotnet formatwhitespace and style: clean.[(Category!=ServiceElection)&(Category!=NativeAot)]: net10.0 2933 / 2933, net472 2938 / 2938 passed.[Category!=NativeAot]: 2086 / 2086 passed.Need help on this PR? Tag
@codesmith-botwith what you need.