davsclaus opened a new pull request, #26379:
URL: https://github.com/apache/camel/pull/26379
The write-time checks behind `camel_validate_source`, `camel_write_file` and
`camel validate source`, each with a message that says what to write. Found one
by one over twenty benchmark runs of a local model against the Camel MCP server
(CAMEL-24698); 55 of the 117 findings of that series are here, and each check
is what a person writing the same file by hand needs.
**YAML routes** (after the schema):
- Endpoints: every URI against the catalog; invented options with the option
meant (`repeatCount` on `cron:`, `body=` on `timer:`, `fileName` on a read); a
`file:` include that is not a regular expression; a producer-only component in
`from:`; several endpoints in one `to:`.
- Simple: every `simple:` value and log message parsed by the catalog, as a
predicate where the EIP takes one (through the `expression:` wrapper);
`${size}` inside an aggregate points to `CamelAggregatedSize`; a placeholder
used as a logical operand is skipped, any other is validated (supersedes
#26350).
- Headers: a `Camel*` header a component never sets, against the components'
header metadata, with the nearest name; the timer's counter, name, period and
time are exchange properties, and `${header.CamelTimerCounter}` says so.
- Bean references: every bean the YAML refers to is declared (in the file, a
sibling YAML, or a `@BindToRegistry` class in the directory); a class is
compiled to learn its interfaces and public methods, so a strategy that does
not implement what the option needs, a POJO with several methods and no
`method:`, an inner class, a class named like its interface, are reported; the
built-in implementations of an interface come from the catalog's bean metadata.
- Resources: an `xslt:` stylesheet or a template that is not in the
directory.
**Java:** compiled in memory with the JDK compiler against the CLI
classpath, one message per diagnostic; a null-branch dereference in an
aggregation strategy; `exchange.setHeader` points to the message; prose lines.
**XSLT and XML:** the stylesheet compiles (Saxon when present, else the JDK,
with the 2.0/3.0 hint); the XML parses; prose after the root element.
**application.properties:** unknown `camel.*` options with the option meant,
an endpoint option set on the component, invented switches
(`durationStrictCheck`, `camel.resilience4j.enabled`), the log level, a value
with a unit, prose lines, cross-group options.
**Catalog:** `camel_catalog_find kind=bean` and `camel_catalog_doc` for a
bean (name, type or interface; `PojoBeanModel.interfaceType` in
camel-tooling-model); `camel_catalog_doc` answers with the `camel.<group>.*`
main options for a group name (`resilience4j`, `health`, `metrics`).
**Structure:** `SourceValidator` keeps the public entry points and the
`BeanDeclarations` record; the checks are in `JavaChecks`, `XmlChecks`,
`HeaderChecks`, `BeanRefChecks`, `PropertiesChecks`, `SimpleChecks`,
`EndpointChecks`, with the YAML line helpers in `YamlLines` (one commit, no
behaviour change). A further format, an XML DSL check against the XSD, JSON,
Kamelets, is one class plus one line in `isValidatableFile`.
Six commits: the checks, `interfaceType`, the split, the placeholder guard,
the timer exchange-property hint, tighter tool descriptions (the full tool
prefix stays within its token budget).
Tests: `SourceValidator*Test` (6 classes, 82), `AuthoringToolsTest`,
`CatalogDocsTest`, `TransformToolsTest`, `SourceEditAssistValidateTest`,
`AiPanelPromptBudgetTest`. 24 files.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
--
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]