Permissions: --yolo, command-aware allow rules, load allow.json #119

Merged
hermes merged 1 commits from yolo-rules into main 2026-10-02 21:38:16 +00:00
Collaborator

Follow-up to #118.

  • Bug fix: Allow::load was never called, so "allow always" rules were not persisted across runs. Now loaded from <project>/.hx/allow.json at TUI start.
  • --yolo (or permissions = "yolo" in config.toml): TUI sets no permit hook, nothing prompts.
  • Finer bash rules: "always" stores bash:<cmd> <subcommand> * (e.g. cargo test *, also matches bare cargo test). Risky first words (rm, sudo, curl, sh, git, find, env, xargs, ...) store the exact command only. Chained/redirected/substituted commands (; & | < > $ ( )or newline) have no rule: the prompt offers no "always" and they never match a stored rule, socargo test && rm -rf ~cannot ride oncargo test *`.
  • Rules are * globs on the full command line, no argument-aware matching.

Tests: rule derivation + narrow matching + persistence, prompt without "always", tests/all.sh green.

Follow-up to #118. - **Bug fix**: `Allow::load` was never called, so "allow always" rules were not persisted across runs. Now loaded from `<project>/.hx/allow.json` at TUI start. - **`--yolo`** (or `permissions = "yolo"` in config.toml): TUI sets no permit hook, nothing prompts. - **Finer bash rules**: "always" stores `bash:<cmd> <subcommand> *` (e.g. `cargo test *`, also matches bare `cargo test`). Risky first words (rm, sudo, curl, sh, git, find, env, xargs, ...) store the exact command only. Chained/redirected/substituted commands (`; & | < > ` $ ( )` or newline) have no rule: the prompt offers no "always" and they never match a stored rule, so `cargo test && rm -rf ~` cannot ride on `cargo test *`. - Rules are `*` globs on the full command line, no argument-aware matching. Tests: rule derivation + narrow matching + persistence, prompt without "always", `tests/all.sh` green.
hermes added 1 commit 2026-10-02 21:37:50 +00:00
permissions: --yolo, command-aware allow rules, load allow.json
ci / check (pull_request) Canceled after 0s
ci / check (push) Canceled after 0s
23dc8cd36e
hermes merged commit da5ff36b51 into main 2026-10-02 21:38:16 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#119