Repository navigation
feat(conformance): mark provider-supplied leaves in expected responses - #53
Merged
Merged
Conversation
Teakowa
requested changes
Oct 6, 2026
Teakowa
left a comment
Contributor
There was a problem hiding this comment.
Three contract-correctness findings block merge. CI is green, but the current matcher can both weaken normative fixtures and reject/accept provider results inconsistently with the v1 spec. Please resolve these against the owning spec before retargeting/merging.
e54-bot
pushed a commit
that referenced
this pull request
Oct 6, 2026
…pability set Review on #53 found three contract gaps: markers validated kind but not position, so a fixture could weaken a contract-owned leaf; exact key matching at result.capabilities required every declared id despite §7.3 permitting any advertised subset (absent == not offered), which also contradicted §7.2's required-fields wording; and languageList accepted malformed extensions. Marker validation now enforces the §20.1 position whitelist with sibling context (data.lpp.kind, negotiated protocolVersion), a marked capabilities object must cover exactly the version's declared ids while a provider may advertise any subset, and extensions must be lowercase without a leading dot. §7.2 now states the object is required while keys are any subset of the declared ids, matching §7.3.
Expected responses previously asserted verbatim JSON equality, so the six session templates and inline handshake scenarios pinned reference-mock identity (serverInfo, languages, capability values) and provider prose. A leaf written { "$provider": "<kind>" } now asserts the leaf's contract shape — boolean, languageList, nonEmptyString, or protocolVersions — while every unmarked leaf keeps verbatim equality, letting providers other than lpp-mock-provider satisfy protocol-scope scenarios. Scenarios carrying providerArgs keep their negotiated capability map verbatim and remain adapter-specific. Verified with a foreign-language stub: all ten protocol scenarios that exercise neither x-demo-lang semantics nor providerArgs pass unchanged. Fixes #49
…pability set Review on #53 found three contract gaps: markers validated kind but not position, so a fixture could weaken a contract-owned leaf; exact key matching at result.capabilities required every declared id despite §7.3 permitting any advertised subset (absent == not offered), which also contradicted §7.2's required-fields wording; and languageList accepted malformed extensions. Marker validation now enforces the §20.1 position whitelist with sibling context (data.lpp.kind, negotiated protocolVersion), a marked capabilities object must cover exactly the version's declared ids while a provider may advertise any subset, and extensions must be lowercase without a leading dot. §7.2 now states the object is required while keys are any subset of the declared ids, matching §7.3.
e54-bot
force-pushed
the
feat/provider-owned-leaves
branch
from
October 6, 2026 17:59
67d894e to
ce33751
Compare
Teakowa
requested changes
Oct 6, 2026
Teakowa
left a comment
Contributor
There was a problem hiding this comment.
The three previous findings are resolved. One regression remains in the new capability-subset matching path.
Review on #53: the §7.3 missing-key exemption applied to every result.capabilities object, so a providerArgs scenario asserting an explicit negotiated map — for example reconstruct: false — would pass when the provider omitted the id entirely. The exemption now applies only when the expected capabilities object is fully marker-checked; verbatim maps keep exact key matching. Adds a regression test for the omitted-false-key case.
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.
Summary
Closes #49. Rebased onto
mainafter #51 (refactor/conformance-tooling-seams) merged.Expected responses used verbatim JSON equality, so the six session templates and inline handshake scenarios pinned reference-mock identity (
serverInfo,languages, capability values,supportedProtocolVersions) and provider prose (error.message,refusalCode, provider-defineddetails.reason). This change introduces a provider-leaf marker:{ "$provider": "<kind>" }inexpectResponseasserts the leaf's contract shape instead of a literal. Four kinds cover every spec-declared provider-supplied position:nonEmptyString(serverInfo fields, error prose,refusalCode, unenumeratedreason),boolean(capability values),languageList(thelanguagesarray),protocolVersions(supportedProtocolVersionsasMAJOR.MINORstrings).matcher.rsowns the recursive compare with path-aware mismatch errors. Fixture validation enforces the marker positions as a whitelist — a marker on a contract-owned leaf (protocolVersion,error.code, an enumeratedinvalidRequestreason, an undeclared capability id) is a fixture error, with sibling context (data.lpp.kind, negotiatedprotocolVersion) deciding positions that are provider-supplied only under some error kinds.capabilitiessemantics follow §7.3: a provider may advertise any subset (absent == not offered), so missing keys are exempt at that position while undeclared ids still fail the closed-set check. A marked capabilities object must cover exactly the ids declared for the negotiated version. §7.2's "requires the eight fields" wording is corrected to match — the object is required, its keys are any declared subset.invalidRequestreasons (notInitialized,alreadyInitialized,notificationNotSupported) stay pinned — they are spec values, not provider prose.providerArgsremains an adapter-owned surface: scenarios carrying it keep their negotiated capability map verbatim (thefalseleaves are the assertion) and are not expected to run on third-party providers.serverInfo.versioncoupling to workspaceCARGO_PKG_VERSIONis gone: no fixture pinslpp-mock-provider,0.1.0, or thex-demo-langlanguage entry anymore.Documented in
docs/spec/conformance.md§20.1 andconformance/README.md.Test plan
cargo fmt --all --check,cargo clippy --all-targets -- -D warnings,cargo test --workspace(incl. 6 new matcher unit tests)--validate-only: 61/61 passlpp-mock-provider: 61/61 pass — no behavioral change for the reference adapterx-demo-langsemantics norproviderArgs— fixture content unchangedgit diff --check