The Robot Framework `Catenate` keyword treats 2+ consecutive spaces as
field separators and strips them, which breaks Python's mandatory
indentation when a nested `assert` follows a `for` line. As a result
the "TUI Help Command Groups By Namespace" test produced a script with
a de-indented `assert` body, causing an IndentationError under
`python -c` and the test to fail with rc=1.
Rewrite the namespace-presence check as a single-line list
comprehension over the expected group headers, mirroring the pattern
already used by the sibling "Lists All Catalogued Commands" test in
the same file. The check is semantically equivalent — both fail with
the same diagnostic message when a group header is missing — but the
flattened form survives Robot's argument tokenisation intact.
ISSUES CLOSED: #3434
Replace the hardcoded help string in TuiCommandRouter.handle() with a
dynamic lookup against SLASH_COMMAND_SPECS from slash_catalog.py.
Changes:
- Add _help_command(), _help_list_all(), _help_for_command() methods to
TuiCommandRouter
- /help (no args): iterates SLASH_COMMAND_SPECS, groups commands by
namespace (sorted alphabetically), renders all 70 commands with
descriptions in colon-namespaced format (e.g. persona:list)
- /help <command>: looks up the given command in SLASH_COMMAND_SPECS and
renders its full help (group, description)
- /help <unknown>: returns 'Unknown command: /<cmd>' message
- /help /persona:list (with leading slash): strips the slash and resolves
correctly
- Import defaultdict and SLASH_COMMAND_SPECS at module level
Tests:
- Update tui_commands_coverage.feature: replace old exact-match scenario
for help text with new dynamic-listing assertions
- Add tui_commands_coverage_steps.py: new 'should contain' step definition
- Add tui_help_command_full_catalog.feature: 12 BDD scenarios covering
/help no-args, /help <command>, /help <unknown>, namespace grouping,
colon-namespaced format, and regression against old hardcoded string
- Add tui_help_command_full_catalog_steps.py: step definitions for the
new feature (all-commands check, not-equal assertion)
- Add robot/tui_help_command.robot: 5 Robot Framework integration tests
verifying the help command via direct Python invocation and headless
TUI startup
Closes#3434
---
**Automated by CleverAgents Bot**
Supervisor: Implementation | Agent: ca-issue-worker