davsclaus opened a new pull request, #29480: URL: https://github.com/apache/camel/pull/29480
[CAMEL-26774](https://issues.apache.org/jira/browse/CAMEL-26774), step 5a of "let there be chaos" ([CAMEL-26760](https://issues.apache.org/jira/browse/CAMEL-26760)), built on the exploration journal of #29466. An agent that explores chaos tries one thing at a time: a hypothesis, the rules that test it, and an expectation that decides it. camel-chaos now keeps these experiments in the journal of the exploration. **camel-chaos** - `ChaosManager.beginExperiment(hypothesis, rules)` needs a running exploration and at least one `expect=` among the rules. The rules are added together (all or none), and the counts per route are read. One experiment is open at a time. - `endExperiment(note)` reads what came of it **before** it removes its rules, because removing a rule cancels its pending expectation. It records the per-route difference of the counts, the faults of each rule, and the state and value of each expectation. - Verdicts: - `FAIL`: an expectation is unmet. - `PASS`: all expectations are met. - `PENDING`: still open and undecided. - `INCONCLUSIVE`: ended before an expectation was decided. - An experiment still open when the exploration finishes, or reaches its deadline, is ended with it (`endedBy` `finished` or `deadline`). Its rules count in the exploration's `removed`. - The report has `experiments` in the `exploration` JSON, and a text section. **CLI connector**: the `chaos` action gets `experiment-begin` (`hypothesis`, `rule`) and `experiment-end` (`note`). **CLI**: `camel get chaos --report` prints the experiments under the exploration: ``` experiments: 1 FAIL an order never fails (r1, r2, ended after 1m4s) expect orders:failed<=0: unmet, 9 failed routes: orders 41 completed, 9 failed note: orders has no error handler ``` **Docs**: an "Experiments" part in the chaos doc (copied to the catalog). **Tests**: `ChaosExperimentTest` (FakeClock: fail, pass, pending, inconclusive, the guards, and the deadline and finish), `LocalCliConnectorChaosActionTest.anExperimentBeginsAndEnds`, and `ListChaosTest`. camel-chaos runs 821 tests, all green on top of main. Next (step 5b): one experiment per call, with its traffic through `camel cmd send --repeat` (#29459) and the wait for the verdict, as `camel cmd chaos-experiment` plus the AI and MCP tools. _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]
