Explain this: the local model reads delivery failures, verdicts, logs and settings
ci / fork-checks (pull_request) Successful in 48s
ci / build (pull_request) Successful in 9m4s

A new method, inbuxa:Explanation/set, asks the node's local model for a
short plain-words reading of one thing an administrator is looking at:
a failed recipient in the queue, a Classify verdict, a log line or trace
event, or one setting with its saved value. The server builds the prompt
itself from stored data and the registry schema, never from text the
console sends, and grounds SMTP replies in RFC 3463 and RFC 5321.

What the model is never shown: secrets (including ones nested inside a
setting, like an AI model's HTTP auth), raw protocol events, and the
contents of any other event. A tag name that doesn't have a tag's shape is
refused before a model is asked.

Calls share the AI gate with spam classification, but mail always keeps
its slot, and Explain has its own hourly count per account and its own
on/off switch in inbuxa:AiLimits. The permission is sysAiExplain,
superuser only; tenant administrators can't use it. The session carries
an aiExplain flag so a console knows when to offer the button.

An install whose roles were stored before the permission existed gets it
added once, at start-up, to the roles that are administrators' alone,
not the User role their defaults share with every account. An operator
who removes it later isn't overruled.

Tests: unit tests in inbuxa-features and jmap, and ai_explain_tests
(run with --ignored) covering the acceptance tests and the upgrade.
This commit is contained in:
2026-09-26 00:52:51 -07:00
parent 96b54ede4e
commit d9a6db025b
40 changed files with 2562 additions and 32 deletions
+4
View File
@@ -2,6 +2,8 @@
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
*
* Modified by Coffey Labs in 2026 for INBUXA.
*/
// This file is auto-generated. Do not edit directly.
@@ -1726,6 +1728,8 @@ pub enum Permission {
LiveMetrics = 217,
LiveDeliveryTest = 218,
ScimAccess = 660,
// inbuxa: "Explain this" (ai-explain spec)
SysAiExplain = 661,
SysAccountGet = 219,
SysAccountCreate = 220,
SysAccountUpdate = 221,
+4 -1
View File
@@ -7072,6 +7072,7 @@ impl EnumImpl for Permission {
b"liveMetrics" => Permission::LiveMetrics,
b"liveDeliveryTest" => Permission::LiveDeliveryTest,
b"scimAccess" => Permission::ScimAccess,
b"sysAiExplain" => Permission::SysAiExplain,
b"sysAccountGet" => Permission::SysAccountGet,
b"sysAccountCreate" => Permission::SysAccountCreate,
b"sysAccountUpdate" => Permission::SysAccountUpdate,
@@ -7749,6 +7750,7 @@ impl EnumImpl for Permission {
Permission::LiveMetrics => "liveMetrics",
Permission::LiveDeliveryTest => "liveDeliveryTest",
Permission::ScimAccess => "scimAccess",
Permission::SysAiExplain => "sysAiExplain",
Permission::SysAccountGet => "sysAccountGet",
Permission::SysAccountCreate => "sysAccountCreate",
Permission::SysAccountUpdate => "sysAccountUpdate",
@@ -8419,6 +8421,7 @@ impl EnumImpl for Permission {
217 => Some(Permission::LiveMetrics),
218 => Some(Permission::LiveDeliveryTest),
660 => Some(Permission::ScimAccess),
661 => Some(Permission::SysAiExplain),
219 => Some(Permission::SysAccountGet),
220 => Some(Permission::SysAccountCreate),
221 => Some(Permission::SysAccountUpdate),
@@ -8863,7 +8866,7 @@ impl EnumImpl for Permission {
}
}
const COUNT: usize = 661;
const COUNT: usize = 662;
}
impl serde::Serialize for Permission {