davsclaus opened a new pull request, #29514: URL: https://github.com/apache/camel/pull/29514
[CAMEL-26788](https://issues.apache.org/jira/browse/CAMEL-26788), step 7 of "let there be chaos" ([CAMEL-26760](https://issues.apache.org/jira/browse/CAMEL-26760)). **Stacked on #29501** (← #29499 ← #29498). It shows only its own commits. **1. Keep what an exploration found.** `camel cmd chaos-explore` writes: - `test/chaos/reports/explore-<time>.md`: the AI's report, the run (integration, budget, focus, model, seed) and the journal of the experiments; - `.json` next to it: the journal, the report and the scenarios, for tools and for combining several explorations later; - `test/chaos/explore-<time>-<n>.chaos`: each failed experiment as a scenario, with the hypothesis, the evidence and the note as comments, the seed, and its rules. `--no-save` leaves the files out. **2. Fixes from four recorded 10-minute runs** with a local model (qwen3.6 35B) against the chaos example shop, plus a Kafka refunds route without error handling (`--stub=kafka`). Each run showed a way an experiment could say nothing; each fix makes Camel catch it, so the model reads why and corrects itself: | Run | What went wrong | Fix | |---|---|---| | 1 | fed `direct:refunds`, which no route reads: 0 messages, hollow PASSes, and a false FAIL | an experiment refuses a feed that reaches no route, and lists the route ids and their from endpoints. In runs 2–4 the model corrected itself from that error | | 1 | tried to start a 2nd exploration through `cli_exec` | `chaos-explore` hides `cli_exec` as well as the start tool | | 2 | `endpoint=file:/parked` matched nothing, so PASS | the result of an experiment carries the "matches nothing" warnings, as `chaos-add` does (connector `experiment-begin`) | | 2 | `failed<=5` everywhere hid lost refunds | the playbook asks for 0, not a guess. Run 3 used `failed<=0` and `lost<=0` throughout and found the gap cleanly | | 3 | the dead letter channel down: the experiment PASSed while the report counted 116 lost | the bug is in camel-chaos (CAMEL-26789, #29512 against main). Here the playbook says how an experiment treats it | | 4 | `until=5m within=6m` with a 60s wait: 6 of 9 experiments INCONCLUSIVE | an experiment waits at least the longest `within=` of its rules (at most 10m) | | all | the report header read `chaos.camel.yaml parked.camel.yaml refunds.camel.yaml` | the integration is named by its CamelContext, as `camel get chaos` names it | **Run 3**, the cleanest one: ``` 1 PASS When payment returns 503, orders should retry and not lose messages (r1, ended after 41s) expect orders:failed<=0: met, 0 failed 3 FAIL When payment returns 503, refunds should handle errors gracefully (r3, ended after 6s) expect refunds:failed<=0: unmet, 5 failed ``` The AI read the errors itself: "HttpOperationFailedException - it has no error handling for the HTTP call to payment". Its hint was redelivery or a dead letter channel. The scenario it saved replays: `camel cmd chaos-load <file>` plus 20 refunds give `FAIL: route refunds: 7 exchanges failed within 40s, at most 0 expected`. **Tests** - `ChaosExploreTest`: the files saved, the scenario text, `--no-save`, the display name. - `ChaosExperimentRunTest`: the feed check, the warnings, the wait. - `LocalCliConnectorChaosActionTest`: the warnings at `experiment-begin`. - `CamelChaosActionTest`: the printed warnings. - camel-jbang-core: 2738 + 318 green. The 318 set needs port 8080 free; it errored while the demo shop ran on it. **Note for the merge:** #29512 adds a "lost at the dead letter channel" line to `ListChaos.printExperiment` on main. #29498 moves that method to `experimentLines`, so whichever merges second carries the line across. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS -- 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]
