[ 
https://issues.apache.org/jira/browse/CAMEL-26960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144943#comment-18144943
 ] 

Claus Ibsen commented on CAMEL-26960:
-------------------------------------

Step 1 is merged: https://github.com/apache/camel/pull/29906 (commit 
b5267ea19501ed4a61665de935e48f97d98d99f6, 4.24.0).

What went in besides the marks:
- a camel.* key of a group Camel does not have is reported when a Camel key is 
near it (camel.tracing.enabled -> camel.trace.enabled), and camel.logging.level 
with logging.level.root;
- a jdbc: endpoint written as a JDBC url is told that jdbc: takes the name of a 
DataSource bean;
- camel_properties_translate takes camel.trace., not camel.tracing., as a Camel 
prefix;
- two validator bugs found by the benchmark answers.

Measured on the temperature A/B run (1,272 answers): 156 marks in 84 answers, 
in 1.2 s. Of the 99 options the grader found invented, 79 are shown (56 on 
their line, 19 under a marked parent, 4 by the onException-as-a-list mark). 59 
more marks are in answers where the grader found nothing; sampled by kind, all 
real. The benchmark will count the marks as its main measure of invented code, 
with the grader as a cross-check.

Measured and not built: marking an unknown step at the top of a fragment (- 
retry:, otherwise2:) when a near EIP name exists. Over 1,590 answers that is 4 
real marks against 22 false ones.

The issue stays open for steps 2 and 3 (comment #3). Step 2 waits for the twin 
benchmark (qwen vs Claude), blocked on CAMEL-26962.

_Claude Code on behalf of Claus Ibsen (davsclaus)_

> camel-jbang - Mark the mistakes in the code of AI answers, such as unknown 
> options
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-26960
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26960
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jbang
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 4.24.0
>
>
> The AI clients of the Camel CLI show code in their answers: YAML routes, 
> application.properties lines, endpoint URIs. Nothing checks that code. A file 
> the model writes goes through the validator, but code in an answer does not, 
> and a beginner copies it.
> *Data* from a benchmark with a local model (Nov 13-14 2026, qwen3.6:35b-mlx, 
> 5 example apps, 53 beginner questions in 3 rounds, so 159 answers per run):
> * Without an instruction: 6 unknown options in 4 answers.
> * With an instruction in the first message to look options up and to check 
> every snippet with camel_validate_source: 32 unknown options in 14 answers. 
> The model wrote 221 code blocks (84 without the instruction) and checked none 
> of them. Its 3 calls of camel_validate_source checked the route file, not a 
> snippet.
> Examples from the answers:
> * {{idempotentConsumer}} with {{messageIdCache}} and {{cacheName}} (the 
> option is {{idempotentRepository}})
> * {{redeliveryPolicy}} with {{multiplier}} (the option is 
> {{backOffMultiplier}})
> * {{camel.metrics-enabled}} (the key is {{camel.metrics.enabled}}), 
> {{camel.tracing}}, {{camel.health.check-routes-on-startup}}
> * {{log:ERROR?level=ERROR&message=...}} (the log endpoint has no message 
> option)
> * {{onException}} with the exception class as a YAML key
> * {{forceOpen}}, {{failureThreshold}} and {{openDuration}} on a circuit 
> breaker
> *Proposal: mark the mistakes, do not change the answer.*
> * When an answer is complete, take its fenced code blocks (YAML, XML, Java, 
> properties) and check them with the same checks as camel_validate_source with 
> content.
> * Under each block with a problem, show one line per problem with the nearest 
> valid names. For example: "multiplier is not an option of redeliveryPolicy; 
> did you mean backOffMultiplier?"
> * Add the findings to the conversation, so the next answer does not repeat 
> the mistake.
> * No extra model call. Always on.
> *Where*
> * The check itself goes in camel-jbang-core, next to camel_validate_source, 
> so all clients share it.
> * camel ask: print the findings below the answer.
> * The AI panel: mark the blocks in the answer, for the built-in model and for 
> ACP agents (their answers come in the same way).
> * External MCP clients never show Camel their answer. They can get a tool 
> that checks the code blocks of a text. This can be a follow-up.
> *Fragments*
> Most code in an answer is a fragment, not a whole route. {{camel validate 
> yaml}} finds {{messageIdCache}} in a whole route. But it refuses a bare 
> {{redeliveryPolicy:}} block for its shape ("object found, array expected") 
> before it checks the options. The check needs a fragment mode: check the 
> block against the schema of its EIP, or wrap a list of steps in a route.
> *How to measure*
> The benchmark counts unknown options in answers. With this in place, no 
> unknown option should be shown without a mark (32 in the run with the 
> instruction).
> *Later, not in this issue:* a repair turn, where the model gets the findings 
> and corrects its answer.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to