Skip to content

feat(help): show mode in header; hide remediation-only commands in read-only mode#535

Merged
julesmcrt merged 1 commit into
mainfrom
jules.macret/help-mode-display
Jun 22, 2026
Merged

feat(help): show mode in header; hide remediation-only commands in read-only mode#535
julesmcrt merged 1 commit into
mainfrom
jules.macret/help-mode-display

Conversation

@julesmcrt

Copy link
Copy Markdown
Collaborator

Summary

  • The `help` header now shows the current execution mode: `rshell (v0.0.21) - read-only mode` or `- remediation mode`
  • Introduces `RemediationOnly bool` on the `Command` and `CommandMeta` structs so builtins can declare they require remediation mode
  • `truncate` is marked `RemediationOnly: true` — in read-only mode it moves from the enabled Commands table to the Disabled commands list, matching what actually happens when you try to run it
  • `RemediationMode bool` is added to `CallContext` and wired from `runner_exec.go`

Test plan

  • New scenarios `help_readonly_mode.yaml` and `help_remediation_mode.yaml` verify the mode string in the header
  • Updated `unrestricted_all_flag.yaml` runs in remediation mode so `truncate` stays in the enabled list and "All commands are allowed" still appears
  • Unit tests updated: `TestHelpListsAllCommands` and `TestHelpAllFlagNoRestrictions` use remediation mode; four `tableLines` calls broadened from `"Commands:"` to `"Commands"` prefix to handle both `Commands:` and `Commands (N of M enabled):` headers

🤖 Generated with Claude Code

… to disabled list

The help output now shows the current execution mode in the version
header (e.g. "rshell (v0.0.21) - read-only mode") so operators can
immediately tell which mode is active.

Builtins marked RemediationOnly (currently just truncate) are moved
from the enabled Commands table to the Disabled commands list when the
shell is in read-only mode, preventing the confusing situation where
a command appears enabled but fails when invoked.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@julesmcrt
julesmcrt marked this pull request as ready for review June 22, 2026 14:14
@julesmcrt
julesmcrt added this pull request to the merge queue Jun 22, 2026
Merged via the queue into main with commit 24e8730 Jun 22, 2026
41 checks passed
@julesmcrt
julesmcrt deleted the jules.macret/help-mode-display branch June 22, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants