Skip to content

[TST-E4] test: the six earlier declared-error slices define each door once per area - #464

Merged
Blind-Striker merged 1 commit into
masterfrom
test/tst-e4a-shared-doors-retrofit
Oct 17, 2026
Merged

Blind-Striker merged 1 commit into
masterfrom
test/tst-e4a-shared-doors-retrofit

Conversation

@Blind-Striker

@Blind-Striker Blind-Striker commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

📝 Description

What does this PR do?
It moves the six earlier declared-error slices to the shared-door shape #463 introduced. In Worktrees, Config, Credentials, Debug, Experimental and Forms, each distinct DeclaredErrorDoor becomes one private static readonly DeclaredErrorDoor <Member>Door field declared before Rows(), following FileSystem/FileSystemDeclaredErrors.cs. Every case of that door references the field.

  • Nine fields replace fourteen inline door blocks: Config 2, Credentials 3, and one each in Debug, Experimental, Forms and Worktrees. Doors with a single case become fields too, so every slice has the same shape.
  • The row data is byte-identical. Every case keeps its case id, status, wire body, _tag, CLR type and JSON pointer, in the same order. Every door keeps its nameof label, operationId, HTTP method, path and lambda unchanged inside its field; only the indentation moves. Merged doors were identical in all five parts.
  • A door's label and its call now live in exactly one place per area, which shrinks the accepted mislabel risk across all eight slices.
  • DeclaredErrorTests.cs, the records, the FileSystem and Integrations slices, the contract classes and the clone baseline are untouched.

Net line delta: +90 / −98 = −8 in test code.

🔄 Type of Change

  • 🧪 Test improvements

🎯 Protocol & API Surface

  • No change to the public API surface
  • Nothing under external/, spec/ or src/ was touched

🧪 Testing

Test mapping (mechanical: e4_test_map.py over git diff 21bb0fb8 52d38304)

File Base test method At head Target

Unmapped: 0

File Assert.That at base at head delta
tests/OpenCode.Sdk.Tests/Config/ConfigDeclaredErrors.cs 0 0 +0
tests/OpenCode.Sdk.Tests/Credentials/CredentialsDeclaredErrors.cs 0 0 +0
tests/OpenCode.Sdk.Tests/Debug/DebugDeclaredErrors.cs 0 0 +0
tests/OpenCode.Sdk.Tests/Experimental/ExperimentalDeclaredErrors.cs 0 0 +0
tests/OpenCode.Sdk.Tests/Forms/FormsDeclaredErrors.cs 0 0 +0
tests/OpenCode.Sdk.Tests/Worktrees/WorktreesDeclaredErrors.cs 0 0 +0

No test method is removed or added, so the table has no rows.

Executed cases: identical

Slice Changed lines Net DeclaredErrorTests cases before → after
Worktrees 16 +2 3 → 3
Config 45 −7 12 → 12
Credentials 61 +1 12 → 12
Debug 21 −3 6 → 6
Experimental 24 +2 3 → 3
Forms 21 −3 6 → 6
Total 188 −8 42 → 42

The full /*/*/DeclaredErrorTests/* listing on net10.0 is the same 78 display names, in the same order, at base and at head. The ordered-list SHA-256 matches: 83EE7D3D…870D0. A case's display name comes from its case id and the door's MemberName, and neither changes.

Equivalence mutants: not applicable. No method is removed and no assertion moves. The per-position byte comparison below proves that the data the spines run on is unchanged.

Review

  • Second-family review (Sol, requirements + diff only): no findings. It compared all 14 cases and all 14 base doors at the same positions against their fields, byte for byte. The only adjustment it made was the 8-space indentation shift. 0 mismatches. Reversing the extraction mechanically reproduced every base file byte for byte. All 9 labels match the invoked client and member.
  • Coordinator read: no findings. The lambdas build their request objects and streams on each call, so sharing one door between cases shares no state.

Clones

verify-clones at head: tests 586 clones, 4.99%, 0 new, the same as master. The total and the tests % do not rise, and no baseline change is needed.

Local check (Windows, at 247afa3, tree-identical to the worker's 52d38304)

  • slopwatch: 0 issues
  • dotnet build -c Release: 0 errors
  • dotnet format whitespace / style --verify-no-changes: clean
  • Tools.Tests [Category!=NativeAot]: 2086 / 2086 passed
  • Sdk.Tests [(Category!=ServiceElection)&(Category!=NativeAot)]: net10.0 2862 / 2862, net472 2867 / 2867 passed
  • verify-clones: passed (above)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@Blind-Striker
Blind-Striker added this pull request to the merge queue Oct 17, 2026
Merged via the queue into master with commit 67b4583 Oct 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant