Skip to content

CAMEL-24857, CAMEL-24858, CAMEL-24859: two validator rows and the reload outcome in camel_write_file, from the stepwise benchmark - #26640

Merged
davsclaus merged 5 commits into
mainfrom
fix/CAMEL-24857
Sep 21, 2026
Merged

davsclaus merged 5 commits into
mainfrom
fix/CAMEL-24857

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Description

Three findings of the stepwise half of the round-2 local-model benchmark (ten camel-jbang-examples built step by step through the camel-jbang-mcp server, five runs each). Together they were the cause of most systematic failures of the series: the model wrote something the validator accepted, the runtime rejected it on the reload, and the write tool had already said "written".

CAMEL-24857, a ${...} placeholder where {{...}} is meant. period: "${welcome.period}", period: ${properties:welcome.period} on an endpoint, start: ${order.first-number} on a bean property: Simple syntax for a property key. The endpoint checks and a new bean property check report it with the form to write:

Line 6: timer: period=${welcome.period} is a Simple expression, which an endpoint option is not evaluated as: a property placeholder is written {{key}}, so period: "{{welcome.period}}"

Only a property key in Simple syntax is reported (${welcome.period}, ${properties:x}): a value whose first segment is a Simple root (${body.id}, ${header.x}, ${date:...}, ${exception.message}) is a Simple expression and is left alone, as is the uri of toD, wireTap, enrich, pollEnrich, recipientList, routingSlip and dynamicRouter, which evaluate it as Simple. Seven of eight failures of two steps in the series were this shape.

CAMEL-24858, a required path option missing. uri: cron with only a schedule under parameters passed camel validate; camel run fails with "Option name is required when creating endpoint uri with syntax cron:name", and in dev mode the reload fails with a WARN. A from: or to: with a bare scheme, no path and no //, whose component has a required path option that is not among the parameters either, is reported with both places it can go. An explicit empty authority (infinispan:// with a custom listener) is a choice and is left alone, as are the intercept patterns (jms*).

CAMEL-24859, the reload outcome in the write tool. When an integration of the project is selected and runs in dev mode, camel_write_file remembers the newest reload record before the write, waits up to eight seconds for a newer one, and answers with it: reload.status reloaded, properties, failed with the cause (the first lines, no stack frames) and the validator's report the runtime logs next to a load failure (CAMEL-24851), or unknown when nothing came. The message says "FAILED to reload the file, the route is not running; fix the content and write again" for a failure. A write with no selected integration answers as before.

Two documentation examples had the placeholder slip (mongodb, mongodb-gridfs: database=${mongodb.database}) and one had a nameless direct endpoint in all three forms (spring-cloud-config, from("direct")): fixed, with their catalog copies. Upgrade guide note for the tool.

Tests

  • SourceValidatorPlaceholderTest: the endpoint option and bean property cases with the form to write, the dynamic EIP and {{...}} left alone, the missing name on cron reported and not reported when given in the uri or under parameters.
  • ReloadOutcomeTest on synthetic log records: the baseline before the write, a failed reload with the cause and the validator's report and no stack frames, a later successful reload.
  • All 228 tests of the ai package of camel-jbang-core green, including the documentation examples test that runs every YAML example of the docs through the checks (which is how the three doc slips surfaced).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj

…aceholder used as an endpoint option or bean property, and a required endpoint path option that is missing; camel_write_file reports the outcome of the reload in dev mode

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed three fixes (CAMEL-24857/24858/24859). The validation logic and reload-outcome design are sound; two small issues found.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

davsclaus and others added 2 commits September 21, 2026 08:10
…d wait, the HashSet import, and a test for the properties reload status

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after follow-up commits (090cfe1, faf5c43).

All three prior findings are addressed:

  • Monotonic clockawait() now uses Camel's StopWatch (nanoTime underneath), consistent with the rest of camel-jbang-core.
  • HashSet importjava.util.HashSet is now imported properly in EndpointChecks.java.
  • Properties reload testaPropertiesReloadIsReportedAsSuch covers the properties branch of classify().

One nit found in the new YamlLines.java code, same style as the HashSet issue that was just fixed.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

…l/dsl/jbang/core/commands/ai/YamlLines.java

Co-authored-by: Guillaume Nodet - AI Bot <gnodet+bot@gmail.com>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after commit 84a58e38.

The nit from the previous review (FQN java.util.SetSet) is half-fixed: the java.util.Set qualifier was dropped from the field declaration, but import java.util.Set; was not added to YamlLines.java. The file only imports java.util.regex.Matcher and java.util.regex.PatternSet is unresolved and the class will not compile.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after commit e2df029.

The open finding from the previous review is addressed: import java.util.Set; has been added to YamlLines.java and the file now compiles cleanly.

Reviewed the new code introduced in this push:

  • checkSimplePlaceholders / checkRequiredPathOptions (EndpointChecks.java): logic is correct. The DYNAMIC_URI_EIPS guard correctly exempts toD, wireTap, enrich, pollEnrich, recipientList, routingSlip, and dynamicRouter. The DOTTED_KEY regex correctly excludes single-segment expressions (${body}, ${date:now:yyyy}) and all SIMPLE_ROOTS keys. The required-path-options check correctly ignores bare-authority URIs (infinispan://) and only fires on from/to EIPs.
  • validateBeanPropertyPlaceholders (BeanRefChecks.java): the indentation-tracking state machine handles nested beans blocks, multiple bean entries in the same list, and top-level properties: keys (not inside a beans: block) correctly.
  • ReloadOutcome: the newest-first ordering from LogFileReader.build is handled correctly. The sinceKey comparison prevents false positives from pre-write reload records. The validator-report lookup (j = i+1..i+4) correctly picks up the YamlLoadFailureReport ERROR record that precedes the FileWatcher WARN in newest-first order. Tests cover baseline, failed-with-report, properties, and reloaded-after-failed cases.
  • Static analysis: the synchronized-without-volatile ast-grep finding on EndpointChecks.java is a false positive — defaultCatalog is declared volatile (line 247). All other findings (broad-exception-catch, mutable-collection-return) are pre-existing and unrelated to this PR.

No new issues. All three CAMEL-24857/24858/24859 fixes are sound.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-mongodb-gridfs
  • components/camel-mongodb
  • components/camel-spring-parent/camel-spring-cloud-config
  • docs
  • dsl/camel-jbang/camel-jbang-core

🔬 Scalpel shadow comparison — Scalpel: 11 of 692 tested, 24 compile-only — current: 11 all tested

Maveniverse Scalpel detected 38 affected modules (current approach: 11).

Skip-tests mode would test 11 modules (6 direct + 8 downstream), skip tests for 24 (generated code, meta-modules)

⚠️ Modules only in Scalpel (27)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component
Modules Scalpel would test (11)
  • camel-catalog ← catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mongodb-component.adoc, catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mongodb-gridfs-component.adoc, catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/spring-cloud-config.adoc
  • camel-jbang-core ← dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringTools.java, dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/BeanRefChecks.java, dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/EndpointChecks.java, dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/ReloadOutcome.java, dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/YamlLines.java, dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/ReloadOutcomeTest.java, dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidatorPlaceholderTest.java
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-route-parser ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-jbang-core
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-mongodb ← components/camel-mongodb/src/main/docs/mongodb-component.adoc
  • camel-mongodb-gridfs ← components/camel-mongodb-gridfs/src/main/docs/mongodb-gridfs-component.adoc
  • camel-spring-cloud-config ← components/camel-spring-parent/camel-spring-cloud-config/src/main/docs/spring-cloud-config.adoc
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • docs ← docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
Modules with tests skipped (24)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 2 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (38 modules, 5m 5s total)

Total reactor time: 5m 5s

Module Duration Status
Camel :: Launcher 50.8s SUCCESS
Camel :: JBang :: MCP 38.7s SUCCESS
Camel :: JBang :: Plugin :: TUI 31.4s SUCCESS
Camel :: MongoDB GridFS 25.6s SUCCESS
Camel :: Catalog :: Camel Catalog 21.7s SUCCESS
Camel :: Component DSL 21.2s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 14.5s SUCCESS
Camel :: Docs 14.4s SUCCESS
Camel :: Kamelet Main 8.0s SUCCESS
Camel :: Catalog :: Camel Route Parser 7.9s SUCCESS
Camel :: JBang :: Plugin :: Testing 7.6s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 7.5s SUCCESS
Camel :: Spring Cloud Config 7.4s SUCCESS
Camel :: YAML DSL :: Validator 7.3s SUCCESS
Camel :: YAML DSL :: Deserializers 6.3s SUCCESS
Camel :: All Components Sync point 4.9s SUCCESS
Camel :: JBang :: Plugin :: Validate 4.7s SUCCESS
Camel :: YAML DSL :: Maven Plugins 3.4s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 3.3s SUCCESS
Camel :: Catalog :: Maven 3.0s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 2.3s SUCCESS
Camel :: Assembly 2.0s SUCCESS
Camel :: Coverage 1.7s SUCCESS
Camel :: JBang :: Plugin :: Edit 1.6s SUCCESS
Camel :: Endpoint DSL :: Support 1.5s SUCCESS
Camel :: JBang :: Integration tests 1.0s SUCCESS
Camel :: JBang :: Plugin :: Generate 1.0s SUCCESS
Camel :: JBang :: Main 1.0s SUCCESS
Camel :: Catalog :: Console 0.9s SUCCESS
Camel :: Catalog :: Dummy Component 0.9s SUCCESS
Camel :: JBang :: Plugin :: MCP 0.8s SUCCESS
Camel :: Launcher :: Container 0.7s SUCCESS
Camel :: JBang :: Plugin :: Route Parser 0.6s SUCCESS
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a
Camel :: MongoDB n/a
Camel :: YAML DSL n/a

Top 20 slowest modules:

  • Camel :: Launcher (50.8s)
  • Camel :: JBang :: MCP (38.7s)
  • Camel :: JBang :: Plugin :: TUI (31.4s)
  • Camel :: MongoDB GridFS (25.6s)
  • Camel :: Catalog :: Camel Catalog (21.7s)
  • Camel :: Component DSL (21.2s)
  • Camel :: JBang :: Plugin :: Kubernetes (14.5s)
  • Camel :: Docs (14.4s)
  • Camel :: Kamelet Main (8.0s)
  • Camel :: Catalog :: Camel Route Parser (7.9s)
  • Camel :: JBang :: Plugin :: Testing (7.6s)
  • Camel :: Catalog :: Camel Report Maven Plugin (7.5s)
  • Camel :: Spring Cloud Config (7.4s)
  • Camel :: YAML DSL :: Validator (7.3s)
  • Camel :: YAML DSL :: Deserializers (6.3s)
  • Camel :: All Components Sync point (4.9s)
  • Camel :: JBang :: Plugin :: Validate (4.7s)
  • Camel :: YAML DSL :: Maven Plugins (3.4s)
  • Camel :: YAML DSL :: Validator Maven Plugin (3.3s)
  • Camel :: Catalog :: Maven (3.0s)

⚙️ View full build and test results

@davsclaus
davsclaus merged commit 5b9cf8f into main Sep 21, 2026
6 checks passed
@davsclaus
davsclaus deleted the fix/CAMEL-24857 branch September 21, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants