Skip to content

[P0] conformance: pin harness 0.2.0-alpha.11 and run per-revision legs - #371

Merged
jeanmatthieu merged 1 commit into
rel/1.0.0from
conformance/p0-harness
Nov 25, 2026
Merged

jeanmatthieu merged 1 commit into
rel/1.0.0from
conformance/p0-harness

Conversation

@jeanmatthieu

@jeanmatthieu jeanmatthieu commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor
Part P0 of P0–P35, merged into rel/1.0.0 in order (next: P1 (#370))
Branch conformance/p0-harness
Base rel/1.0.0
Commit 8574edb conformance: pin harness 0.2.0-alpha.11 and run per-revision legs
Size 11 files, +2661 / -119

Summary

Pins the MCP conformance harness to @modelcontextprotocol/[email protected] and runs it in three legs: one per spec revision (2025-11-25, 2026-07-28) and the harness default wire. Each leg checks its own generated baseline of known failures, and a separate leg scores the frozen requirement set the way conformance tier-check does. This PR changes no SDK code; it records where the SDK stands before the 2026-07-28 work in the rest of the stack.

The harness and its dependency tree are installed from a lockfile with npm ci. Every step of a leg checks its exit status, and CI pins its actions by commit and builds the fixtures once for all legs.

Motivation

On main, CI runs the modelcontextprotocol/[email protected] action against the core suite at a single wire, with an unpinned package in scripts/run-conformance.sh. That setup cannot tell 2025-11-25 regressions apart from missing 2026-07-28 features, and it cannot reach scenarios added in later harness releases (SEP-2575 stateless requests, SEP-2243 headers, SEP-2322 multi round-trip requests, SEP-2549 caching, extension scenarios). Version alpha.11 also adds a wire-schema-valid check to every scenario, which validates every message the SDK sends against the JSON schema. Each later PR in the stack shrinks these baselines.

Changes

Scripts

  • scripts/run-conformance.sh: rewritten.
    • Legs: --spec-version <rev> runs --suite all --spec-version <rev> against conformance-baseline.<rev>.yml. With no option, the script runs --suite all against conformance-baseline.yml. --requirements <rev> runs the frozen requirement set with no baseline.
    • Options: --mode client|server|both, --update-baseline, --bin-path (skip swift build), --port (default 3001), --output-dir (default .build/conformance), --solo-attempts (default 1).
    • Server readiness: polls http://127.0.0.1:<port>/mcp for up to 30 s, detects early exit, and refuses to start when the port is in use.
    • Flake handling: reruns each unexpected failure and each stale baseline entry alone up to --solo-attempts times. A stale entry that also passes alone fails the run.
    • Harness: installed from scripts/conformance-harness/package-lock.json with npm ci into .build/conformance-harness. CONFORMANCE_PKG runs another package with npx instead. npm_config_registry selects the npm registry.
  • scripts/conformance-baseline.mjs (new): generates a leg's baseline from harness results. Each FAILURE or WARNING check becomes a <scenario>:<check-id> entry, so the passing checks of a partly failing scenario stay enforced. A scenario that the harness summary marks failed, but whose results hold no failing check, becomes a bare <scenario> entry. A role whose results are not given keeps its existing entries.
  • scripts/conformance-score.mjs (new): scores a --requirements run. A scored scenario passes when it has at least one SUCCESS check and no FAILURE check. A scenario without results fails. Exit status 1 when a scored scenario fails or the role has no scored scenario.
  • scripts/conformance-harness/package.json, package-lock.json (new): pin the harness and its dependency tree.

Baselines

  • conformance-baseline.yml (default leg), conformance-baseline.2025-11-25.yml, conformance-baseline.2026-07-28.yml: generated, one per leg.

CI (.github/workflows/ci.yml)

  • conformance-fixtures job (new): runs scripts/tests/run-conformance-test.sh, builds mcp-everything-client and mcp-everything-server once and uploads them as an artifact.
  • conformance job: matrix over the legs 2025-11-25, 2026-07-28 and default, with fail-fast: false, Node 22, a timeout raised to 20 minutes, and results uploaded as conformance-<leg> artifacts. Runs the downloaded fixtures with --bin-path.
  • tier-score job (new): matrix over 2025-11-25 and 2026-07-28, runs --requirements against the downloaded fixtures. The job is report-only (continue-on-error: true) until every scored scenario passes.

Docs

  • README.md: new "Conformance" section with the three run modes, the baseline rule and the harness lockfile.

Review fixes

Scripts

  • scripts/run-conformance.sh:
    • npx --yes <pkg> resolved the harness's dependencies at run time. The harness now comes from scripts/conformance-harness/package-lock.json, installed with npm ci --ignore-scripts (integrity-checked) into .build/conformance-harness and reinstalled when the lockfile changes. CONFORMANCE_PKG still runs another version with npx.
    • run_leg_role runs as run_leg_role ... || STATUS=1, where bash ignores set -e, so a failing baseline generator, requirement listing or scorer did not fail the leg. Each step now checks its own status and fails the leg.
    • A stale baseline entry failed the leg at once, so a flaky listed check could fail CI. Stale entries are now re-run alone like unexpected failures; one that passes alone is reported as stale.
    • The server fixture wrote to server.log, which the harness also writes. It now logs to server-fixture.log.
  • scripts/conformance-score.mjs: always exited 0. It now exits 1 when a scored scenario fails or the list has no scored scenario for the role.

Second review (8574edb)

  • scripts/conformance-baseline.mjs: a scenario that the summary marks failed was recorded as a bare entry only when it wrote no results, so a scenario that wrote results without a failing check was not recorded at all. It is now a bare entry whenever its results hold no failing check. The baseline headers say so; no entry changes.
  • scripts/run-conformance.sh:
    • A server fixture that exited during a run looked like a set of failures: they were re-run alone, and --update-baseline recorded them. When the fixture has exited (server_exited), the leg now fails, without solo re-runs and without writing the baseline.
    • --update-baseline also fails when the harness run did not reach its summary (SUMMARY === missing from the log).
    • Only the fixtures that --mode needs are built and required: --mode client no longer needs the server fixture, and --mode server no longer needs the client fixture.
  • scripts/conformance-score.mjs: a --role other than server or client is a usage error (exit status 2).
  • .github/workflows/ci.yml: the conformance-fixtures job sets up Node 22 like the other jobs, for the script tests.

CI (.github/workflows/ci.yml)

  • Actions are pinned by commit, with the release in a comment.
  • The pull-requests: write permission is removed.
  • The fixtures are built once (conformance-fixtures) and shared by the conformance and tier jobs.
  • The static Linux SDK build script is fetched from a pinned commit of swiftlang/github-workflows with curl -sf, not from main.

Tests

  • scripts/tests/run-conformance-test.sh (new), run in CI.

Diagram

flowchart LR
    S["run-conformance.sh"] --> L{"leg"}
    L -->|"--spec-version rev"| R["--suite all --spec-version rev"]
    L -->|"no option"| D["--suite all"]
    L -->|"--requirements rev"| Q["--requirements rev"]
    R --> RB["conformance-baseline.rev.yml"]
    D --> DB["conformance-baseline.yml"]
    Q --> SC["conformance-score.mjs tier score"]
    RB --> U{"unexpected failure"}
    DB --> U
    U -->|"yes"| SO["solo re-run"]
Loading

API changes

None.

Behavior changes

  • scripts/run-conformance.sh has a new command line. The --baseline option and the BASELINE_FILE and MODE environment variables are removed. Each leg selects its baseline file.
  • CI fails on any failure missing from a leg's baseline, and on any baseline entry that still passes when re-run alone.
  • --update-baseline and --requirements legs fail when the baseline generator, the requirement listing or the scorer fails.
  • A leg fails when the server fixture exits during the run, and --update-baseline fails when the harness run does not reach its summary; neither writes the baseline.
  • --mode client and --mode server build and need only their own fixture.
  • The first run installs the harness with npm ci (network access to the npm registry); later runs reuse .build/conformance-harness.

Conformance

Baseline entries (server / client) recorded by this PR:

Leg Before After
2025-11-25 n/a 2 / 2
2026-07-28 n/a 108 / 47
default core suite, harness v0.1.15, empty client list 108 / 48

Before this PR, CI checked one core-suite baseline at a single wire, so the counts are not comparable.

Tier score:

  • 2026-07-28: client 5/32, server 1/37.
  • 2025-11-25: client scenarios all pass. Server fails resources-list (wire-schema-valid) and the flaky elicitation-sep1330-enums scenario.

The 2025-11-25 entries are:

  • server elicitation-sep1330-enums:elicitation-sep1330-general: a server-initiated request reaches the standalone GET stream instead of the originating POST stream.
  • server resources-list:wire-schema-valid: the fixture lists the template URI test://template/{id} as a concrete resource.
  • client json-schema-2020-12-preservation: the client fixture does not handle this scenario.

P1 (#370) fixes all three.

Tests

No Swift test changes. swift test: 565 tests pass.

scripts/tests/run-conformance-test.sh (new) checks run-conformance.sh, conformance-baseline.mjs and conformance-score.mjs with a fake harness and fixtures (Node.js, no network), 15 cases:

  • --update-baseline fails when the generator fails, and when the harness run does not finish;
  • --mode client needs only the client fixture;
  • a flaky baseline entry is re-run alone and accepted; a stale entry fails the leg;
  • a flaky unexpected failure is re-run alone and accepted; an unexpected failure that also fails alone fails the leg;
  • a server fixture that exits during the run fails the leg;
  • the generator succeeds, and records per-check and bare entries;
  • the scorer fails scenarios without results, a scenario with a failed check and an empty scored set, passes when every scenario passes, and rejects an unknown role.

Review notes

  • The harness is a pre-release (0.2.0-alpha.11). It is pinned, with its dependency tree, so that baselines are reproducible. Moving the pin requires regenerating the lockfile and every baseline.
  • The baselines are large on purpose: they record the starting point. Every later PR that fixes a scenario must regenerate the affected baselines, because stale entries fail the run.
  • Only the default leg reaches extension-tagged scenarios (tasks-*, auth/dpop*, auth/enterprise-managed-authorization, auth/wif-jwt-bearer). These scenarios are not scored.
  • auth/2025-03-26-oauth-endpoint-fallback fails in the default leg (backward compatibility). P8 ([P8] oauth: issuer checks, application_type, AS migration (SEP-2468/837/2352) #363) (P8) fixes it.
  • With a private npm registry configured, run with export npm_config_registry=https://registry.npmjs.org.

Verification

export npm_config_registry=https://registry.npmjs.org
swift test
swift build
scripts/tests/run-conformance-test.sh
scripts/run-conformance.sh --spec-version 2025-11-25 --bin-path $(swift build --show-bin-path)
scripts/run-conformance.sh --spec-version 2026-07-28 --bin-path $(swift build --show-bin-path)
scripts/run-conformance.sh --bin-path $(swift build --show-bin-path)
scripts/run-conformance.sh --requirements 2025-11-25 --bin-path $(swift build --show-bin-path)
scripts/run-conformance.sh --requirements 2026-07-28 --bin-path $(swift build --show-bin-path)

The --requirements legs are expected to fail at this point. They are report-only in CI.

Every branch of the stack builds and passes swift test; at this branch, 565 swift-testing tests, all passed (the package has no XCTest cases). The three conformance legs pass at their baselines.


AI usage disclosure: the changes, the tests, the commit messages and this description were written with Claude Opus 5.5 and reviewed by the authors.

Pins the MCP conformance harness to
`@modelcontextprotocol/[email protected]` and runs it in three
legs: one per spec revision (2025-11-25, 2026-07-28) and the harness
default wire. Each leg checks its own generated baseline of known
failures, and a separate leg scores the frozen requirement set the way
`conformance tier-check` does. It changes no SDK code; it records where
the SDK stands before the 2026-07-28 work.

The harness and its dependency tree are installed from a lockfile with
`npm ci`. Every step of a leg checks its exit status, and CI pins its
actions by commit and builds the fixtures once for all legs.

The baseline generator records a scenario the harness summary marks
failed as a bare entry whenever its results hold no failing check, not
only when it wrote no results.

A server fixture that exits during a run fails the leg: its failures
are not re-run alone and not recorded by --update-baseline, which also
fails when the harness run did not reach its summary.

Only the fixture the selected --mode needs is built and required, the
scorer rejects an unknown --role, and the conformance-fixtures job pins
Node like the other jobs. The baseline headers are regenerated; no
entry changes.

The script tests cover the unexpected-failure retry path, a fixture
that exits mid-run, an unfinished --update-baseline run, a single-mode
run, and the generator's entries directly.

@canarik canarik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jeanmatthieu

@jeanmatthieu
jeanmatthieu merged commit bf24a66 into rel/1.0.0 Nov 25, 2026
9 of 11 checks passed
@jeanmatthieu
jeanmatthieu deleted the conformance/p0-harness branch November 25, 2026 12:17
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.

2 participants