Claus Ibsen created CAMEL-25750:
-----------------------------------
Summary: camel-jbang - camel validate fills the gaps of its body
walk with the body types a running app observed, and an MCP tool says what the
body was at each step
Key: CAMEL-25750
URL: https://issues.apache.org/jira/browse/CAMEL-25750
Project: Camel
Issue Type: Improvement
Components: camel-jbang, camel-yaml-dsl
Reporter: Claus Ibsen
Fix For: 4.24.0
Step 2 of the design note of 2026-10-05 on CAMEL-24844 (observed types feed the
authoring tools).
The body walk of the YAML validator ({{BodyTypeFlow}} and {{TextBodyFlow}} in
camel-yaml-dsl-validator) reports only where it is certain what the body is:
after the file consumer, a setBody with a constant, a marshal, a convertBodyTo
String or byte[], or a {{direct:}} route that ends with one of those. After
kafka, jms, an HTTP call, a bean or a Kamelet it does not know the body and
says nothing, which is right for a file that has never run.
In a dev loop the app has usually run those steps already ({{camel run --dev}},
or a model through camel-jbang-mcp), and the message history recorded the body
type at each one ({{MessageHistory.getBodyType()}}, 4.23). Today that fact is
shown for one exchange only: {{camel history}} and the
{{camel_runtime_history}} tool return the history of the last completed
exchange.
h3. Proposal
# *Observed types per step.* With message history on (the dev profile), the
running app keeps the body types seen at each route node: the last one, and
whether it varied. Each node carries its source location (CAMEL-24972), so a
tool can match it to a line of the file. camel-jbang reads it like the other
runtime facts.
# *The validator takes them as facts.* When {{camel validate}} or
{{camel_validate_source}} checks a file of a running app, an observed type
fills a step where the static walk says unknown, and the existing checks apply:
{{$\{body\[x\]\}}} on a body that was seen to be a String is reported, whatever
component produced it. A type that varied, or a step that has not run, stays
unknown and gets no report.
# *An MCP tool says what the body was at each step* of the running app, from
the same data and not only the last exchange, so a model reads it before it
writes the next step instead of guessing.
This covers what was run, and only that. Paths that were not tried stay
unknown, which is honest.
h3. Measure
The body type collisions per series of the local-model benchmark, with the
static walk alone and with observed types.
h3. Not in scope
The error messages (step 1, CAMEL-25749), the catalog metadata (CAMEL-24961).
_Filed by Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)