davsclaus opened a new pull request, #28724:
URL: https://github.com/apache/camel/pull/28724

   https://issues.apache.org/jira/browse/CAMEL-26416
   
   In the r24 run of the local-model benchmark (qwen3.6:35b on Ollama), the 
model read fields that the data does not have. A field that is not there is 
null, so nothing failed, and the logs were wrong:
   - `${body[lineCount]}` and `${body[quantity]}` on an order, which has lines 
(route-filter-and-multicast step 2, 2 runs). The read was in the `direct:` 
route that a multicast sends the order to.
   - `${body[orderId]}` inside the split of the lines of an order. A line has 
sku, qty and price (connect-http-client step 2).
   
   **What the tools read**
   - `ValidatorFacts.jsonFields` reads the fields of the JSON data the routes 
read:
     - the files in the directory a file consumer reads (`file:orders`, or 
`directoryName: orders`);
     - the file a `resource:` loads.
   - Fields are the keys of the objects, the union over the files. For a field 
that holds a list of objects, it also reads the keys of those objects.
   - The data is left out when its files are not all of one shape, when one 
file is not JSON, or when there are more than 50 files.
   - This goes to the validator as `ProjectFacts.jsonFields`.
   
   **What the validator checks**
   `TextBodyFlow` checks a simple read of a field of the body after an 
`unmarshal: json` of that data:
   - in the route, and in the predicates of a filter or a choice;
   - inside a split of a field that holds a list of objects, against the fields 
of those objects. A field of the data that was split gets the advice to read it 
before the split, into a variable;
   - in a `direct:` or `seda:` route that every call of the file sends the same 
data to. The route is walked again with that data, and only these reports are 
kept.
   
   The message names the fields the data has, and the number of a list 
(`${body[lines].size()}`) where one is.
   
   Methods of the body and its own properties (`size()`, `isEmpty`) are not 
reported.
   
   **Tests**
   - New tests: `TextBodyFlowTest` and `ValidatorFactsTest`.
   - camel-yaml-dsl-validator: 326 tests pass.
   - The AI tool tests in camel-jbang-core: 828 tests pass.
   - None of the 85 reference route files of the benchmark gets a report from 
this check, or from the checks of #28718 and #28723. I checked this with a 
throwaway test that validates each reference route with its project's data 
files.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to