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

   ## Why
   
   A follow-up to #31389. In a benchmark run with `qwen4:35b-a3b-nvfp4` on the 
camel-jbang-mcp server with #31389, two steps still ended at the 25 tool calls 
of the step without a write, in every run (12 of 12 each):
   
   1. **Writing a Citrus test.** The model searched the catalog tools for the 
Citrus YAML test DSL: `camel_catalog_find "citrus test yaml"`, 
`camel_catalog_sample name="citrus test"`, `camel_catalog_docs filter=citrus`. 
Nothing matched. Then it read section after section of the citrus component 
page, which is about a component used in routes, not about writing a test.
   2. **A POST with binding to a Java record.** The model asked 
`camel_catalog_doc kind=eip name=rest docPage="Rest DSL"` again and again, and 
`camel_catalog_docs filter=rest-dsl`. The rest EIP has no EIP page, and the 
Rest DSL pages of the user manual are not in the catalog.
   
   ## Changes
   
   - **Citrus YAML test DSL** (`CitrusTestDocs`):
     - `camel_catalog_doc name=citrus-test` describes it: where the file goes 
and how it runs, its keys, the actions, and a sample test.
     - `docPage=<action>` (`http:sendRequest`, `camel cli run`) gives the keys 
of one action as YAML, each with its type and description; `includeOptions=all` 
adds the advanced keys.
     - All of it comes from the test schema and the action catalog in 
`citrus-catalog-schema`, the jar the Citrus test checks already read 
(`CitrusTestChecks.read(version, file)`). So the answers improve when the 
Citrus descriptions do.
     - The places the model looked now answer: find (`citrus test`, `citrus 
yaml ...`), sample (`citrus test`), the citrus component answer (a pointer), a 
Citrus action as `docPage` of the citrus component, and `camel_catalog_docs` 
(lists `citrus-test`).
     - A test checks the sample test against the schema.
   - **Rest DSL pages:**
     - camel-jbang-core now packages `rest-dsl.adoc`, `rest-dsl-binding.adoc`, 
`rest-dsl-validation.adoc` and `rest-dsl-openapi.adoc` from the user manual.
     - `docPage` of a Rest DSL EIP (`rest`, `post`, `restConfiguration`, ...) 
or `name=rest-dsl` returns a section of these pages, with its source page.
     - The rest EIP answer names the sections, and `camel_catalog_docs` lists 
`rest-dsl`.
   - **User manual:** the heading "Binding to POJOs using" in 
`rest-dsl-binding.adoc` was cut off. It is now "Binding to POJOs using data 
formats".
   - The `camel_catalog_doc` descriptions and the MCP server instructions 
mention `citrus-test` and `rest-dsl`.
   
   ## Tests
   
   - New `CitrusTestDocsTest`, and `CatalogDocsTest` cases for the Rest DSL 
sections.
   - camel-jbang-core `ai` package: 1131 run, 0 failures (1 skipped). 
camel-jbang-mcp: 495 run, 0 failures.
   - Benchmark check with this change (the two examples, 3 rounds):
     - Citrus test step: 2/3 (before 0/12). All 3 runs wrote a test in 12-13 
calls; the failed one used a test variable as a `resource: file:` path.
     - POST binding step: 1/3 (before 0/12). The two failures still read the 
same section again and again.
     - The other steps of the two examples: 12/12.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF
   


-- 
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