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

   _Claude Code on behalf of davsclaus_
   
   Follow-up to CAMEL-25928. The local-model benchmark r22 found six gaps in 
the body type checks. The checks it had were precise (0 false positives in r21 
and r22), but they ran rarely and changed no outcome. These gaps cover about 20 
failed steps of that series.
   
   ## Write time (YAML validator)
   
   1. **Field reads outside `simple:` and `groovy:` keys.** The validator now 
also looks in the simple templates a step evaluates: a log message, the uri of 
a `toD` or a `wireTap`, and an endpoint option such as the `fileName` of `file`.
   2. **A `wireTap` or an `enrich` of parsed data to a file.** Reported as a 
`to` is. `wireTap` gets an `eipIn` in the catalog: from `producerIn`, and `any` 
with `variableSend`. This is checked at runtime in `EipBodyTypesTest`.
   3. **Unmarshal of data that is parsed already**, for the body and for a 
variable (`variableSend`). The message says the body is data already, and how 
to unmarshal a variable in place.
   4. **Variables.** What `variableReceive` (pollEnrich, enrich, to, toD, 
unmarshal, marshal, from) or a `setVariable` of the body puts in a variable is 
followed. A field read on a variable that holds text or the file as read is 
reported (`${variable.customer[name]}`, `${variables.customer.name}`). Any step 
that may set a variable (bean, process, a call of a route the walk does not 
follow, a block with such a step) makes the walk forget them, so it stays quiet 
when it is not sure.
   5. **The "no body" check now fires when the first step is an `unmarshal`, a 
`marshal` or a `convertBodyTo`.** Before, it fired only for `setBody`. There is 
now a positive test (a GET whose route starts with `unmarshal`).
   6. **Wording.**
      - After a marshal of parsed data, a later field read now says "read the 
field before the marshal, or marshal into a variable". It no longer says 
"unmarshal is the step, not marshal". A marshal of text still gets the old 
wording.
      - A file write of parsed data now says to read the fields that are still 
needed before the marshal. When the step's own `fileName` reads a field, it 
names that read.
   
   ## Runtime hints
   
   - `UnmarshalProcessor`: an unmarshal of a Map or a List says the body or the 
variable is data already, instead of the bare "No type converter available ... 
LinkedHashMap to ... InputStream". The exception type is unchanged.
   - `BodyFacts`: a field read on text that a marshal wrote from a Map or a 
List says to read the field before the marshal. The marshal is found in the 
message history, which `camel run --dev` turns on.
   - `BeanExpression`: a key read on the payload of the body gets one hint, the 
body facts. It no longer gets a second one that disagrees. 
`${variable.customer.name}` on a variable that holds a GenericFile gets the 
same hint as the `[name]` form.
   - `GroovyExpression`: "the value read here is still text ... unmarshal it 
first" is given only when the body is text. On parsed data the hint says the 
value is text inside the data, and lists the keys (`customer.customerNo` on 
`{customer: "C-482"}`).
   
   ## Checked against the r22 runs
   
   I replayed the edits in the r22 traces to rebuild 602 route file versions. I 
ran the validator from main and this branch on all of them:
   - 28 new findings, all in the steps the gap list names: ai-ticket-classifier 
step 2, route-enrich-and-dedupe steps 2-3, connect-service-sql step 1. They 
match the runtime failures in `camel-run.out`, such as 4062 "LinkedHashMap to 
InputStream" errors and the GenericFile key and method failures.
   - 11 messages are reworded (the file and marshal wording). No finding of 
main was lost.
   
   ## Tests
   
   The tests below pass, run locally against a scratch Maven repo:
   - `camel-yaml-dsl-validator`: all tests.
   - `camel-core`: `BodyFactsTest`, `UnmarshalProcessorTest`, `SimpleTest`, 
`SimpleSyntaxHintsTest`, `EipBodyTypesTest`.
   - `camel-groovy` and `camel-bean`: all tests.
   - `camel-jbang-core`: the validator and AI tool tests.
   - `camel-jbang-plugin-tui`: `SourceChecksTest`.
   
   The catalog's `models/wireTap.json` is a copy of the model's generated file. 
CI's regen check confirms it.
   
   🤖 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