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

   _Claude Code on behalf of Claus Ibsen_
   
   [CAMEL-26695](https://issues.apache.org/jira/browse/CAMEL-26695), step 1: 
the actions of the Chaos screen. Steps 2 (adding a rule from the known rules of 
the catalog model) and 3 (chaos from the diagram, and the 🎲 marks) come in 
later PRs.
   
   ![Adding a chaos 
rule](https://raw.githubusercontent.com/apache/camel/CAMEL-26695-chaos-screen-actions/docs/user-manual/modules/ROOT/images/jbang/camel-tui-chaos-add.png)
   
   ### Keys on the Chaos screen
   | Key | Action | Sent to the integration as |
   |---|---|---|
   | `a` | add a rule, typed as one line | `chaos-add` |
   | `e` | change the selected rule; the line starts with the rule as it is | 
`chaos-change` |
   | `x` | remove the selected rule | `chaos-remove` |
   | `c` | clear: remove all rules (the report keeps what they did) | 
`chaos-clear` |
   | `R` | a new experiment: no rules and a new report, with the same seed | 
`chaos-clear --reset` |
   
   - **Confirmation:** each action asks for `y`, with the rule shown, like the 
other actions that change a running integration. Only the user answers it: a 
key sent by an MCP client is dropped ("a confirm dialog of the tab is open, and 
only the user answers it"). With the Confirm actions setting off, or while a 
tape drives the monitor, it does not ask.
   - **Results:**
     - Success shows a notification ("Added chaos rule r3").
     - A rule that is not valid comes back with the parser's reason, in a 
dialog.
     - A rule that matches nothing (often a typo) is added, and a dialog shows 
its warning with the endpoints that do exist.
     - From either dialog, `e` changes the rule.
   - **The request** is the `chaos` action of the CLI connector, as `camel cmd 
chaos-*` sends it, run in the background. The connector parses the rule as it 
parses `camel.chaos.rules`.
   
   ### Code
   - `ChaosControl` holds the dialogs (input, confirmation, result), the 
request and the outcome. `ChaosTab` passes it the keys, Esc and paste, plus the 
"confirming" and "text input" states (digit keys type into the rule instead of 
switching tabs).
   - The help page (`tui/help/chaos.md`) and `camel-jbang-tui-observe.adoc` 
describe the keys, with the screenshot above.
   
   ### Tests
   - New `ChaosControlTest` (9 tests):
     - add, change, remove, clear and reset, each with the request it sends;
     - Esc and `n` send nothing;
     - a refused rule shows its reason and can be changed;
     - a rule that matches nothing shows its warning, and `e` changes the rule 
that was added;
     - no question when Confirm actions is off;
     - no keys when chaos is off;
     - the footer.
   - The whole camel-jbang-plugin-tui suite: 2306 tests pass (1 skipped).
   - Live, a scratch TUI on the packaged plugin, against `camel run --chaos`:
     - the confirmation above (an MCP `y` was refused, as it should be);
     - with Confirm actions off: `a` with the typo `endpoint=seda:shiping*` 
added r3 and showed its warning; `x` removed it (checked with `camel get 
chaos`).
   
   🤖 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