permissions: remove broken client-side gate; add backend design doc
The terminal-TUI permission gate was a race: _execute_tools_with_sink
emits ToolStarted and starts the tool on the backend immediately, so by
the time the client dialog appeared the destructive action had already
run -- 'deny' could only stop the session, not un-execute the tool. It
also existed only in the terminal TUI (webclient/android had nothing),
and the system-prompt 'Strict Confirmation' nudge was an unreliable
duplicate.

Remove the broken machinery for a clean slate and plan the real
replacement from zero:

- delete clients/terminal/tui/permissions.py, screens/permission_dialog.py
  and their tests
- strip tui_app.py (engine, _deny_tool, _show_permission_dialog,
  _confirm_shell_command, _stop_session_worker, on_permission_request,
  tool_started gate) and the PermissionRequest TUI event; !cmd now runs
  directly (user-typed, no agent gate)
- drop the 'Strict Confirmation' prompt rule from navi_code/developer/
  tool_developer
- add docs/permissions.md: authoritative backend gate design (engine +
  registry + event + endpoint + agent gate + postgres policy + global
  rules config, sub-agents gated) -- design only, not yet implemented
- update docs/index.md, navi_code_cli.md, profiles.md, testing.md

Until Phase 1 lands there is no destructive-action confirmation -- a
conscious period without the false security of the old race-gate.
1 parent b1693d3 commit b8bb30d582653cc0998fc5ca9e01011e7b50c44f
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 1 day ago
Showing 14 changed files
View
clients/terminal/tui/events.py
View
clients/terminal/tui/permissions.py 100644 → 0
View
clients/terminal/tui/screens/permission_dialog.py 100644 → 0
View
clients/terminal/tui/tui_app.py
View
docs/index.md
View
docs/navi_code_cli.md
View
docs/permissions.md 0 → 100644
View
docs/profiles.md
View
docs/testing.md
View
navi/profiles/developer/system_prompt.txt
View
navi/profiles/navi_code/system_prompt.txt
View
navi/profiles/tool_developer/system_prompt.txt
View
tests/clients/test_permission_dialog.py 100644 → 0
View
tests/clients/test_permissions.py 100644 → 0