fix(ia): wire canalhandia.ia.privado gate, tighten subcommand hijack

Review of Task 11 (commit 5f616d3) flagged a blocking spec regression:
canalhandia.ia.privado was declared (default: true) but never checked --
ia(sender, args, isPrivate) only checked canalhandia.ia, so /iap silently
required canalhandia.ia and the privado perm did nothing.

Per operator decision, /ia and /iap are now separate gates, both default
op, so LuckPerms can grant them independently (operator + permitted only,
not everyone). /ia needs canalhandia.ia; /iap needs
canalhandia.ia.privado.

Also fixes three should-fix findings:
- Subcommand hijack is no longer greedy: perfil and feedback only hijack
  when the second token is one they act on (a known profile key, or "ruim"),
  so "/ia perfil do servidor" and "/ia feedback do mapa?" fall through and
  are asked. corrigir stays greedy (a correction always reads the rest).
- AiProfile.isValid tells a real key from the PRECISO fallback, so /ia perfil
  blah no longer silently switches to PRECISO.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
marcos
2026-08-06 03:54:01 +00:00
parent 5f616d3d99
commit a3b2e7dd27
3 changed files with 40 additions and 13 deletions
+2 -2
View File
@@ -90,8 +90,8 @@ permissions:
description: Permite usar /ia. Padrão op; o LuckPerms pode conceder a outros.
default: op
canalhandia.ia.privado:
description: Permite perguntar em privado com /iap.
default: true
description: Permite perguntar em privado com /iap. Padrão op; o LuckPerms pode conceder a outros.
default: op
canalhandia.ia.corrigir:
description: Permite registrar correções para as respostas da IA.
default: op