davsclaus opened a new pull request, #29338: URL: https://github.com/apache/camel/pull/29338
_Claude Code on behalf of Claus Ibsen_ [CAMEL-26608](https://issues.apache.org/jira/browse/CAMEL-26608), the first step of the chaos screen: the read-only screen. It follows the design agreed for CAMEL-26608 (sections 1 and 8; the actions, the recipes form, chaos from the diagram and the AI parts come in later PRs).  *A live run of the chaos demo app with four rules: 503s from the stock service (30%) with `expect=orders:handled<=0`, shipping drops in bursts (`rate=burst:5s/20s`), a flapping poller (`stall repeat=3`, already done) and a jittered step delay. The expectation failed as soon as an order went to the dead letter channel.* ### The screen **More ▸ Observability ▸ Chaos.** It is listed only when the integration has the `chaos` dev console (camel-chaos), as Circuit Breaker is listed only with resilience4j. - **Verdict strip:** PASS or FAIL with the first reason, the messages lost, the expectations (met / unmet / pending) and the faults in the last minute. The title has the seed. - **Rules table:** one row per current rule. - TARGET shows an `endpoint=` target as just its URI, and the others as `route poller`. - FAULT has its parameters. - RATE is the observed rate next to the rule's own: `28% of 30%`, `26% of 5s in 20s`, `round 3 of 3`. - FIRED and LAST. - FAULTS/S is a 60-second **sparkline**. - EFFECT is compact: `✓` completed, `↩` recovered, `⇩` handled, `✗` failed, `…` in flight. - NOTE says when the rule ends or starts, its bursts, what a stall or lifecycle rule does to its route, and skipped faults. - **The selected rule:** its faults/s sparkline, rate, matches and note; the effect as a bar with the counts in words; the expectation with its time left; the skip reasons; and its recent faults (fault, hook, endpoint or step, route, short exchange id). - **Routes:** the counts of the report (DONE, FAIL, KEPT, HAND, REDEL). - **Badge:** while a rule injects faults (or the verdict failed), the title bar shows `🎲 chaos 3 rules · FAIL` on every screen, and the More menu shows it next to Chaos. A failure made on purpose then isn't debugged as a real one. - **Empty states:** no camel-chaos (how to get it), chaos off (the console's reason), no rules (how to add one). - **AI tools:** `tui_get_table` tab `Chaos` returns the rules with their rate, effect, expectation and note. The AI panel's chaos guidance now points at it. The screen only reads the `chaos` section that the status file already has every second, so camel-chaos needs no change. 🎲 is the chaos icon, since ⚡ is Circuit Breaker's. ### Code - `ChaosInfo` parses the chaos section leniently, so a camel-chaos of another version leaves fields unknown instead of failing. - `ChaosTab` is the screen. Registration follows Circuit Breaker: `TabRegistry`, `TuiIcons.TAB_CHAOS`, a help page (`tui/help/chaos.md`), and the More-menu badge. - The title-bar badge is built in `ChaosTab.headerBadge`, so `CamelMonitor` keeps its size (`SourceSizeTest`). - Docs: a Chaos section with the screenshot in `camel-jbang-tui-observe.adoc`, and Chaos in the More menu list of `camel-jbang-tui.adoc`. ### Tests - `ChaosTabRenderTest` (8 tests) renders the screen from a status as camel-chaos writes it: - the verdict, the rules, the detail and the routes; - the status parser; - the empty states; - the badge; - the table JSON; - the sparkline and rate helpers. - The whole camel-jbang-plugin-tui suite: 2295 tests pass (1 skipped). - Live: a scratch TUI on the packaged plugin, against `camel run --chaos` with the rules added through `camel cmd chaos-add`. That run took the screenshot above. `~/.m2` was put back to main's jars afterwards. 🤖 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]
