diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..a76d146
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,205 @@
+# EditorConfig helps developers define and
+# maintain consistent coding styles between
+# different editors and IDEs
+
+# https://editorconfig.org
+
+# top-most EditorConfig file
+root = true
+
+[*]
+indent_style = space
+insert_final_newline = true
+charset = utf-8
+
+[*.{sln,slnx,*proj,props}]
+charset = utf-8-bom
+indent_style = space
+indent_size = 2
+tab_width = 2
+
+[*.{cs,cake}]
+indent_style = space
+indent_size = 4
+tab_width = 4
+
+[*]
+file_header_template = Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt
+
+# https://github.com/nunit/docs/wiki/Coding-Standards#namespace-class-structure-interface-enumeration-and-method-definitions
+csharp_indent_braces = false
+csharp_new_line_before_catch = true
+csharp_new_line_before_else = true
+csharp_new_line_before_finally = true
+
+# https://github.com/nunit/docs/wiki/Coding-Standards#spaces
+csharp_space_after_cast = false
+csharp_space_after_comma = true
+csharp_space_after_keywords_in_control_flow_statements = true
+csharp_space_around_binary_operators = before_and_after
+csharp_space_around_declaration_statements = do_not_ignore
+csharp_space_before_open_square_brackets = false
+csharp_space_before_semicolon_in_for_statement = false
+csharp_space_between_empty_square_brackets = false
+csharp_space_between_method_call_empty_parameter_list_parentheses = false
+csharp_space_between_method_call_name_and_opening_parenthesis = false
+csharp_space_between_method_call_parameter_list_parentheses = false
+csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
+csharp_space_between_method_declaration_name_and_open_parenthesis = false
+csharp_space_between_method_declaration_parameter_list_parentheses = false
+csharp_space_between_parentheses = none
+csharp_space_between_square_brackets = false
+
+# https://github.com/nunit/docs/wiki/Coding-Standards#indentation
+csharp_indent_block_contents = true
+csharp_indent_case_contents = true
+csharp_indent_switch_labels = true
+
+csharp_prefer_braces = when_multiline:silent
+
+# https://github.com/nunit/docs/wiki/Coding-Standards#naming
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+dotnet_style_predefined_type_for_member_access = true:suggestion
+
+# The first matching rule wins, more specific rules at the top
+
+# dotnet_naming_rule.*.symbols does not yet support a comma-separated list https://github.com/dotnet/roslyn/issues/20891
+# dotnet_naming_symbols.*.applicable_kinds does not yet support namespace, type_parameter or local https://github.com/dotnet/roslyn/issues/18121
+
+dotnet_naming_style.pascal_case.capitalization = pascal_case
+
+dotnet_naming_symbols.namespaces_types_and_non_field_members.applicable_kinds = namespace, class, struct, enum, interface, delegate, type_parameter, method, property, event
+dotnet_naming_rule.namespaces_types_and_non_field_members.severity = error
+dotnet_naming_rule.namespaces_types_and_non_field_members.symbols = namespaces_types_and_non_field_members
+dotnet_naming_rule.namespaces_types_and_non_field_members.style = pascal_case
+
+dotnet_naming_symbols.visible_fields.applicable_kinds = field
+dotnet_naming_symbols.visible_fields.applicable_accessibilities = public, protected, protected_internal
+dotnet_naming_rule.visible_fields.severity = error
+dotnet_naming_rule.visible_fields.symbols = visible_fields
+dotnet_naming_rule.visible_fields.style = pascal_case
+
+dotnet_naming_symbols.internal_fields.applicable_kinds = field
+dotnet_naming_symbols.internal_fields.applicable_accessibilities = internal
+dotnet_naming_rule.internal_fields.severity = error
+dotnet_naming_rule.internal_fields.symbols = internal_fields
+dotnet_naming_rule.internal_fields.style = pascal_case
+
+dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
+dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly
+dotnet_naming_rule.static_readonly_fields.severity = error
+dotnet_naming_rule.static_readonly_fields.symbols = static_readonly_fields
+dotnet_naming_rule.static_readonly_fields.style = pascal_case
+
+dotnet_naming_symbols.constant_fields.applicable_kinds = field
+dotnet_naming_symbols.constant_fields.required_modifiers = const
+dotnet_naming_rule.constant_fields.severity = error
+dotnet_naming_rule.constant_fields.symbols = constant_fields
+dotnet_naming_rule.constant_fields.style = pascal_case
+
+dotnet_naming_style.underscore_camel_case.capitalization = camel_case
+dotnet_naming_style.underscore_camel_case.required_prefix = _
+
+dotnet_naming_symbols.remaining_fields.applicable_kinds = field
+dotnet_naming_rule.remaining_fields.severity = error
+dotnet_naming_rule.remaining_fields.symbols = remaining_fields
+dotnet_naming_rule.remaining_fields.style = underscore_camel_case
+
+dotnet_naming_style.camel_case.capitalization = camel_case
+
+dotnet_naming_symbols.parameters_and_locals.applicable_kinds = parameter, local
+dotnet_naming_rule.parameters_and_locals.severity = error
+dotnet_naming_rule.parameters_and_locals.symbols = parameters_and_locals
+dotnet_naming_rule.parameters_and_locals.style = camel_case
+
+# https://github.com/nunit/docs/wiki/Coding-Standards#file-organization
+dotnet_sort_system_directives_first = true
+
+# https://github.com/nunit/docs/wiki/Coding-Standards#use-of-the-var-keyword
+# Would be true:warning, except that that so much existing code is not consistent with the coding standard.
+csharp_style_var_when_type_is_apparent = true:suggestion
+
+# DOC100: Place text in paragraphs
+dotnet_diagnostic.DOC100.severity = silent
+
+
+# Expression-bodied members
+csharp_style_expression_bodied_accessors = when_on_single_line:warning
+csharp_style_expression_bodied_constructors = false:none
+csharp_style_expression_bodied_indexers = when_on_single_line:warning
+csharp_style_expression_bodied_lambdas = when_on_single_line:suggestion
+csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
+csharp_style_expression_bodied_methods = false:none
+csharp_style_expression_bodied_operators = when_on_single_line:suggestion
+csharp_style_expression_bodied_properties = when_on_single_line:suggestion
+
+############################################################################################
+# CSharp Analysis
+############################################################################################
+
+
+# CS3016: Arrays as attribute arguments is not CLS-compliant
+# Microsofts own MemberNotNull attribute expects an array
+dotnet_diagnostic.CS3016.severity = none
+
+# CA1512: Use ArgumentOutOfRangeException throw helper
+dotnet_diagnostic.CA1512.severity = warning
+# CA1510: Use ArgumentNullException throw helper
+dotnet_diagnostic.CA1510.severity = warning
+
+############################################################################################
+# IDE Analysis
+############################################################################################
+
+# IDE0003: Remove qualification
+dotnet_diagnostic.IDE0003.severity = warning
+
+# IDE0005: Remove unnecessary usings/imports
+dotnet_diagnostic.IDE0005.severity = error
+
+# IDE0011: Add braces
+dotnet_diagnostic.IDE0011.severity = warning
+
+# IDE0044: Add readonly modifier
+dotnet_diagnostic.IDE0044.severity = warning
+
+# IDE0055: Fix formatting (Skipping this as it doesnt say WHAT is wrong. Rely on StyleCop instead)
+dotnet_diagnostic.IDE0055.severity = none
+
+# IDE1006: Naming Styles
+dotnet_diagnostic.IDE1006.severity = warning
+
+# IDE0036: Order modifiers
+dotnet_diagnostic.IDE0036.severity = warning
+
+# IDE0290: Use primary constructor
+dotnet_diagnostic.IDE0290.severity = none
+
+##################################################################################
+# CSharpIsNull Analyzers
+
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
+
+# CSIsNull001: Use `is null` for null checks
+dotnet_diagnostic.CSIsNull001.severity = warning
+
+# CSIsNull002: Use `is object` for non-null checks
+dotnet_diagnostic.CSIsNull002.severity = warning
+dotnet_style_operator_placement_when_wrapping = beginning_of_line
+tab_width = 4
+indent_size = 4
+end_of_line = crlf
+csharp_indent_labels = one_less_than_current
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_prefer_auto_properties = true:silent
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
+csharp_using_directive_placement = outside_namespace:silent
+csharp_prefer_simple_using_statement = true:suggestion
+csharp_style_namespace_declarations = block_scoped:silent
+csharp_style_prefer_method_group_conversion = true:silent
+csharp_style_prefer_top_level_statements = true:silent
+csharp_style_prefer_primary_constructors = true:suggestion
+dotnet_style_prefer_conditional_expression_over_assignment = true:silent
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..241a2cf
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+* text=auto eol=lf
+*.cs text eol=crlf
+*.py text eol=lf
+*.yml text eol=lf
+*.json text eol=lf
diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml
new file mode 100644
index 0000000..5fe0b6b
--- /dev/null
+++ b/.github/workflows/compatibility.yml
@@ -0,0 +1,75 @@
+name: Adapter compatibility
+
+on:
+ push:
+ pull_request:
+ workflow_dispatch:
+ inputs:
+ profile:
+ description: Reviewed package and lock profile
+ type: choice
+ options:
+ - historical-alpha
+ default: historical-alpha
+ require_cooperative_stop:
+ description: Also require token delivery, finally and teardown for every runner-stop probe
+ type: boolean
+ default: false
+
+permissions:
+ contents: read
+
+concurrency:
+ group: compatibility-${{ github.ref }}
+ cancel-in-progress: false
+
+jobs:
+ compatibility:
+ name: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [windows-2025, ubuntu-24.04, macos-15]
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 25
+ defaults:
+ run:
+ shell: bash
+ env:
+ VALIDATION_PROFILE: ${{ inputs.profile || 'historical-alpha' }}
+ REQUIRE_STOP: ${{ inputs.require_cooperative_stop || false }}
+ DOTNET_CLI_TELEMETRY_OPTOUT: '1'
+ DOTNET_NOLOGO: '1'
+ PYTHONDONTWRITEBYTECODE: '1'
+ steps:
+ - name: Checkout
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - name: Set up Python
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
+ with:
+ python-version: '3.13'
+ - name: Check reporting and profile guards
+ run: python -m unittest discover -s tests -v
+ - name: Read reviewed SDK selection
+ id: profile
+ run: python run.py profile --profile "profiles/$VALIDATION_PROFILE.json" --github-output "$GITHUB_OUTPUT"
+ - name: Install SDK and target runtimes
+ uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
+ with:
+ dotnet-version: ${{ steps.profile.outputs.dotnet-versions }}
+ cache: false
+ - name: Run compatibility checks and observe runner stop
+ run: python run.py run --profile "profiles/$VALIDATION_PROFILE.json" --output artifacts/run
+ - name: Publish separate statuses and apply selected stop policy
+ if: ${{ always() }}
+ run: python ci_summary.py --results artifacts/run/results.json --summary "$GITHUB_STEP_SUMMARY" --require-stop "$REQUIRE_STOP"
+ - name: Retain reports, failures and process evidence
+ if: ${{ always() }}
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
+ with:
+ name: compatibility-${{ matrix.os }}-${{ github.run_id }}-${{ github.run_attempt }}
+ path: artifacts/run
+ if-no-files-found: warn
+ retention-days: 14
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c0c1831
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+artifacts/
+**/bin/
+**/obj/
+__pycache__/
+*.pyc
+.packages/
+.http-cache/
+.cli-home/
+reviewed-packages/
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..30c7f34
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,14 @@
+
+
+ 14
+ enable
+ disable
+ false
+ true
+ true
+ true
+ 4.6.1
+ 5.1.0-alpha.0.50
+ 6.4.0-alpha.0.46
+
+
diff --git a/EscapedNames.json b/EscapedNames.json
new file mode 100644
index 0000000..e07cd8f
--- /dev/null
+++ b/EscapedNames.json
@@ -0,0 +1,12 @@
+[
+ {
+ "uid": "NUnit.AdapterCompatibility.CompatibilityCases.Named case (with space)",
+ "displayName": "Named case (with space)",
+ "escaped": "NUnit.AdapterCompatibility.CompatibilityCases.Named case \\(with space\\)"
+ },
+ {
+ "uid": "NUnit.AdapterCompatibility.CompatibilityCases.ParameterizedIdentity(\"a \\\"quoted\\\" value\")",
+ "displayName": "ParameterizedIdentity(\"a \\\"quoted\\\" value\")",
+ "escaped": "NUnit.AdapterCompatibility.CompatibilityCases.ParameterizedIdentity\\(\"a \\\\\"quoted\\\\\" value\"\\)"
+ }
+]
diff --git a/Harness/Harness.csproj b/Harness/Harness.csproj
new file mode 100644
index 0000000..dfc491d
--- /dev/null
+++ b/Harness/Harness.csproj
@@ -0,0 +1,9 @@
+
+
+ net10.0
+ Exe
+
+
+
+
+
diff --git a/Harness/Program.cs b/Harness/Program.cs
new file mode 100644
index 0000000..36fcea3
--- /dev/null
+++ b/Harness/Program.cs
@@ -0,0 +1,497 @@
+// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt
+
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+
+using Microsoft.TestPlatform.VsTestConsole.TranslationLayer;
+using Microsoft.VisualStudio.TestPlatform.ObjectModel;
+using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
+using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
+
+namespace NUnit.AdapterCompatibility.Harness
+{
+ ///
+ /// Drives the public VSTest protocol and MTP executable without modifying either adapter.
+ ///
+ internal static class Program
+ {
+ private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true };
+ private static bool _negativeParameter;
+
+ private static async Task Main(string[] args)
+ {
+ if (args.Length is < 4 or > 5 || (args.Length == 5 && args[4] != "--baseline-only" && args[4] != "--negative-parameter"))
+ {
+ Console.Error.WriteLine("Usage: Harness [--baseline-only|--negative-parameter]");
+ return 2;
+ }
+
+ var evidence = Path.GetFullPath(args[3]);
+ if (Directory.Exists(evidence))
+ throw new IOException("Use a fresh evidence directory; previous results must remain intact.");
+
+ Directory.CreateDirectory(evidence);
+ _negativeParameter = args.Length == 5 && args[4] == "--negative-parameter";
+ try
+ {
+ object receipt = args[0] switch
+ {
+ "vstest" => await RunVSTest(Path.GetFullPath(args[1]), args[2], evidence, args.Length == 5),
+ "mtp" => await RunMtp(Path.GetFullPath(args[1]), args[2], evidence, args.Length == 5),
+ _ => throw new ArgumentException("Unknown execution path.")
+ };
+ var json = JsonSerializer.Serialize(receipt, JsonOptions);
+ File.WriteAllText(Path.Combine(evidence, "receipt.json"), json);
+ Console.WriteLine("Compatibility checks completed: " + evidence);
+ using var document = JsonDocument.Parse(json);
+ if (document.RootElement.TryGetProperty("ContractGaps", out var gaps) && gaps.GetArrayLength() != 0)
+ return 1;
+ return 0;
+ }
+ catch (Exception exception)
+ {
+ File.WriteAllText(Path.Combine(evidence, "failure.txt"), exception.ToString());
+ Console.Error.WriteLine(exception);
+ return 1;
+ }
+ }
+
+ private static async Task