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

   Let there be chaos, by hand, from the Chaos screen of the Camel TUI 
(CAMEL-26760). `L` opens a start dialog on the integration you look at: pick 
the rules to try and a budget, and the TUI tries them one at a time. This is 
the `L` key of the sketch. Step 8 (#29551) shipped only the read-only Explore 
view (`l`).
   
   **Stacked on #29576** (CAMEL-26820), which adds the file replay and the 
circuit breaker and `toD` suggestions this uses. Merge #29576 first.
   
   ![The start 
dialog](https://raw.githubusercontent.com/apache/camel/tui-chaos-explore-start/docs/user-manual/modules/ROOT/images/jbang/camel-tui-chaos-let-there-be.png)
   
   - **The dialog.**
     - It lists the integration's suggestions (the same as `w`), the most worth 
trying first, each with what should hold.
     - Picked to start with: three faults not tried yet, each kind once before 
a kind is tried again in another route, and then one pair (two faults at once).
     - A pick's route must get messages: by itself (a timer, or a route it is 
called from), or by **replaying the files a file route took**. Those routes are 
marked *replays 3 files*.
     - A route whose messages come from outside is marked *needs messages*. A 
dead letter channel is never picked on its own, as it fails only when another 
fault sends it a message.
     - Keys: Space picks, Left and Right change the budget (2m to 30m, 10m by 
default), Enter starts.
     - It says why it cannot start: nothing picked, or too many rules for the 
budget (each rule needs at least 30s).
   - **The run.** No AI and no external process: the TUI drives camel-chaos 
over the cli-connector.
     - It sends `explore-start`, then one experiment per picked rule 
(`ChaosExperimentRun` of camel-jbang-core, with a TUI adapter), then 
`explore-finish`.
     - Each rule gets its share of the time left: `until=` and `within=` are 
set to it, and a stall takes only `within=`.
     - A file route's files are put back while its rule runs.
     - The Explore view shows the run, with a 🎲 line saying which rule is tried 
and how much of its share is left. The selection follows the running experiment.
     - `x` stops the run, which removes its rules. camel-chaos ends the rules 
at the deadline, also when the TUI is gone.
   - Only one run at a time, and `L` says why when chaos is off.
   
   ![The 
result](https://raw.githubusercontent.com/apache/camel/tui-chaos-explore-start/docs/user-manual/modules/ROOT/images/jbang/camel-tui-chaos-let-there-be-done.png)
   
   Tried live on the bundled examples and on a small shop, which the polish 
commits come from:
   - **chaos example** (5m, the default picks): 3 PASS, and the pair (an outage 
while the dead letter channel fails) FAIL, with 2 orders lost at the dead 
letter channel.
   - **message-size**: 3 FAIL, with messages lost at the seda hand-off.
   - **shop** (a file route handing off over seda to a route that writes files, 
a circuit breaker around `direct:supplier`, and a `toD` HTTP call):
     - Five rules in 5m. The breaker outage and the `toD` 503 PASS, and "Fails 
to write" FAIL, with 3 failed in `ship`, which has no error handling.
     - The hand-off rule alone for 2m, the files replayed while it ran: 234 
messages from 3 files, and FAIL with 45 lost.
   
   These live runs also fixed things in camel-chaos: the default expectation, 
`fed`, the caller expectation, and the stall that never counted as fired (all 
in #29573), plus the breaker, `toD` and replay (in #29576).
   
   Tests: `ChaosExploreTest` (9) covers the picks, the keys and the budget, the 
share per rule, a run, stop, one run at a time, chaos off, and a file route 
replayed. All TUI tests pass (2495). Docs: the Explore section of the Chaos 
help (`help/chaos.md`, keys `L` and `x`) and `camel-jbang-tui-observe.adoc`, 
with the two screenshots.
   
   Next, as a separate step: an AI helper when F8 is set up. Shift+F8 explains 
the results, `t` turns an experiment into a test, and `d` lets the AI propose 
rules into the pick list.
   
   _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]

Reply via email to