fix(review): tolerate added gates and projections, keep mandatory features exact - #263
Merged
Merged
Conversation
capabilities.gates and capabilities.projections used assertExactSet, rejecting any provider release that advertises one extra gate or projection beyond the required floor. Decode both as plain string arrays instead of enumArray-against-the-known-enum, so an unknown addition reaches assertSupersetOf instead of being rejected earlier by the enum check, matching the superset-tolerant handling already used for operations and schemas. Unknown advertised gates/projections are still not leaked into internal use: the decoded ReviewCapabilitiesV2 narrows to the required members only, the same pattern already used for operations and schemas. Mandatory features keep assertExactSet unchanged, per the provider's own unknown_mandatory: "reject" contract.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughChangesCapability decoding
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 1, 2026
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.
Quick win. Independent of the release-artifact initiative and of any tracker.
Problem
lib/review-integration-v2.tsvalidated the provider's advertised capability surface inconsistently: operations and schemas usedassertSupersetOf(additive-tolerant, correct), while gates, projections and mandatory features usedassertExactSet.The file's own comment already recorded the lesson from v2.2.0 — "demanding an exact match rejects a compatible provider release" — but it was applied to only half the surface. Under the current provider release cadence, that rejects compatible releases repeatedly and predictably.
Change
Gates and projections become required floors that tolerate additions. Unknown added names decode safely, the required floor is verified, and internal use narrows to the supported required members so additions never leak into behavior.
Mandatory features intentionally stay exact and keep rejecting unknown additions. The provider's own contract advertises
compatibility.unknown_mandatory: "reject"(contracts/review-integration/v2/fixtures/capabilities.fixture.json, constrained by"unknown_mandatory": {"const": "reject"}in the schema). Relaxing them would violate the contract the provider publishes.Not a one-line swap
enumArrayrejected unknown members before any assertion ran, and the gates/projections calls passed fixedminimum/maximumbounds of 5 and 2. Swapping only the assertion would have leftenumArrayrejecting first and the fix would silently have done nothing. The decode path itself changed.Tests
Six behaviors, RED first:
TypeError: capabilities.gates has an invalid length, now passespnpm run check:transaction-runnerpasses (runtime/regenerated, never hand-edited).Three tests in
native-review-parity-runtime.test.tsfail on this branch and fail identically on cleanmain— they require receipt-driven development to be enabled, which is globally off in this environment. Verified independently against the base commit.Rollback
Single commit. No consumer code outside
decodeReviewCapabilitiesV2reads the raw gates/projections locals, so reverting restores exact-match validation with no other side effects.Summary by CodeRabbit