Repository navigation
verify: align recorded(RequestMatch) XPath element value with rift 0.23 (rift#1495) - #335
Merged
Merged
Conversation
…ift 0.23.0 rift 0.23.0 reads a selected element as Mountebank's nodeValue, its first child node's text, or "undefined" when it has none or starts with an element (rift#1495). The client-side evaluator behind recorded(RequestMatch) still read the element's whole text, so on 0.23 it could disagree with what the engine matched and verify counted. It now reads the first child, parses text, references and CDATA as one node, and evaluates a string-valued selector such as string(//a), the engine's way to read the whole text, instead of refusing it. Closes #330
This was referenced Oct 27, 2026
EtaCassiopeia
added a commit
that referenced
this pull request
Oct 28, 2026
…rules apply (#350) recorded(match) filtered the journal with a JVM copy of Mountebank's predicate rules. That copy drifted from the engine three times (#330, #335, and rift 0.24.0's repeated-key and JSON-body array rules), so a filter could disagree with what the engine matched. It now asks the engine's verify with includeRequests, as verify itself does since #127: one call, the engine's answer, and inject predicates work too. PredicateEvaluator is no longer called and is deprecated for removal. Closes #337
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
rift 0.23.0 (rift#1495, PR achird-labs/rift#1529) reads an XPath-selected element as Mountebank's
nodeValuedoes: as its first child node's text, or"undefined"when it has no children or starts with a child element. So//aon<a>x<b/>y</a>isx, notxy.PredicateEvaluatorbacksImposter.recorded(RequestMatch), but it still readgetTextContent(), the element's whole text. On the 0.23.0 pin,recorded(match)could therefore disagree with what the engine'sxpathstub matched and with whatverifycounted.undefined. Text and attribute nodes read their own value.string(//a)(the engine's documented way to read an element's whole text) orcount(//a), is evaluated to that one value. It used to be refused as an invalid selector. A malformed selector still throwsInvalidDefinition.Tests
PredicateEvaluatorTest:<a>x<b/>y</a>readsx(and notxy);<a><b/>z</a>and<a/>readundefined;text(),@idandstring(//a)read their own values.Both new tests were red before the fix. The existing XXE and malformed-selector tests still pass.
XPathRecordedMatchIT(conformance, spawn and embedded lanes, live rift 0.23.0): two XML bodies go through an imposter whose stub matchesbody == "x"at//a. The engine matches only the first, andrecorded(match)agrees, for bothxandundefined.Verification
The core and conformance unit tests pass against the 0.23.0 corpus, and the IT passes on both lanes against the rift 0.23.0 binary and dylib.
rift-scala: no change. It inherits the evaluator through rift-java.
Closes #330
🤖 Generated with Claude Code