Skip to content

[RT-E6] test: the door refusals and the contender exit head are pinned before RT-E6 rewrites them - #461

Merged
Blind-Striker merged 1 commit into
masterfrom
test/rt-e6-char-door
Oct 17, 2026
Merged

Blind-Striker merged 1 commit into
masterfrom
test/rt-e6-char-door

Conversation

@Blind-Striker

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

Copy link
Copy Markdown
Collaborator

What

This PR adds test-only characterization for the last two RT-E6 targets (C5 and C6). It pins the public doors' command-validation messages and the background-service contender's exit-message head before RT-E6 rewrites them. In RT-E6, step 2 merges SnapshotCommand with EnsureRequest.CopyCommand, and step 4 rewrites StderrTail. Product code does not change.

The change

C6: OpenCodeServerContractTests

The two existing door tests stay as they are; they pin only the exception type. Two [Arguments] tests sit beside them, one per door:

  • StartAsync_Should_Name_The_Refused_Command_And_Its_Options
  • EnsureAsync_Should_Name_The_Refused_Command_And_Its_Options

For the empty command and for the blank entry, each test pins the exact ArgumentException.Message and pins ParamName == "options". options is the public parameter of both doors.

The four texts:

  • Launcher, empty command: "OpenCodeServerOptions.Command needs the executable and its leading arguments."
  • Launcher, blank entry: "OpenCodeServerOptions.Command entries cannot be blank."
  • Ensure: the same two texts with the OpenCodeServerEnsureOptions. prefix.

Every case refuses before anything spawns.

Both tests use one helper, AssertOptionsRefusalAsync(door, text), which holds the shared Throws, Message and ParamName assertions. The first local check found the two test bodies to be a clone of each other.

The expected message is written out per runtime: text (Parameter 'options') on .NET, and text, a newline, then Parameter name: options on .NET Framework. The characterization spec suggested building it with new ArgumentException(text, "options"), but CA2208 rejects that form in a test method. Hiding the name from the analyzer would be a dodge, so the test states the BCL's format instead.

C5: ServiceContenderSpawnerTests

One assertion is added to TryGetFailure_Should_Report_A_Nonzero_Exit_With_The_Stderr_Tail, and its existing assertions are unchanged.

The message must start with "The background service contender (pid ) exited with code 2." followed by "\n". Exit codes keep their spelling under U3-16, so the pin is stable. Only the head and the "\n" join are new.

Proof

Each mutant is a compiling product edit unless noted, run on net10.0 and on net472. The two runtimes gave identical results, and the edits were restored afterwards: src is clean.

Mutant Effect
Launcher empty-command text changed The StartAsync row goes red. The two existing type-only door tests stay green, as does everything else.
Launcher blank-entry text changed Same as above.
Launcher ParamName: nameof(options) → "command" The build is rejected (CA2208, MA0015, S3928). This is a second guard.
Ensure prefix changed The EnsureAsync row goes red. Everything else stays green.
Ensure ParamName: CopyCommand(..., "command") The EnsureAsync row goes red. Everything else stays green.
Contender join: "\n" → " " TryGetFailure goes red at the new StartsWith. Its failure message shows that the two existing Contains checks still hold.

Checks:

  • The two classes: 41 of 41 on net10.0 and on net472.
  • Local check: GATE PASS on 6015a2e1 (master 282a4c1e): all 8 steps, and 10,563 tests with 0 failed. The first run failed verify-clones on the duplicated test bodies, before the helper was extracted.

Process note

The Sol worker for this task stopped twice before editing anything. Both stops were justified by the coordinator's prompt. The first time, "do not edit src" contradicted the per-assertion product-mutant proof. The second time, the exception added for that proof listed the text lines but not the ParamName sites. The coordinator then wrote the tests by hand.


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
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 17, 2026
@Blind-Striker
Blind-Striker added this pull request to the merge queue Oct 17, 2026
Merged via the queue into master with commit e3ab508 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