Files
hx/docs/adr/0015-permission-gate-ordering.md
T
johannesandClaude Sonnet 5.5 a94632ea3d chore: delete code comments, add ratchet lint and ADRs
Classify every comment as tautology, stale, excuse or decision record.
Tautology/stale/excuse comments are deleted (excuses filed as issues
#196-#236), decisions moved to docs/adr/0001-0034.

- scripts/lint-comments.sh + .comment-baseline: per-file comment count
  may only go down; wired into tests/all.sh
- .claude/skills/delete-comment: repeatable audit workflow
- cargo fmt applied to touched crates

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 13:37:32 +01:00

17 lines
888 B
Markdown

# Permission gate ordering and auto-mode fail-safe
Status: accepted
## Context
Parallel tool calls may each need a prompt, and auto mode layers rules, a classifier and an LLM judge.
## Decision
- Prompts are serialized behind one lock; after waiting, the stored rules are re-checked because the previous answer (e.g. "always") may already cover this call.
- In auto mode, dangerous calls are refused without a prompt, even when a stored "always" rule matches; safe calls run; the rest goes to the judge, then the user.
- The judge is a cheap model; any failure or unusable answer means "ask the user", never "allow".
## Consequences
A stored rule never overrides a danger block. Concurrent calls queue, so prompts are one at a time.
Code: crates/hx-core/src/tool.rs (`gate`, `gate_result`), crates/hx-core/src/lib.rs (`ToolState` prompt lock), crates/hx-core/src/danger.rs (`Judge`)