using AcDream.UI.Abstractions;
using AcDream.UI.Abstractions.Panels.Chat;
namespace AcDream.UI.Abstractions.Tests.Panels.Chat;
///
/// Campaign CH slice CH4 (2026-08-09): pins acdream's complete chat-command
/// surface against the retail registry enumeration in
/// docs/research/2026-08-09-chat-retail-command-registry.md §2/§4 —
/// 130 verbs registered by InitializeCommands +
/// StartupTurbineChatSystem, plus the 22 unregistered
/// ChannelSystem::GetChannelID fallback tags (152 total).
///
///
/// Every verb has an explicit :
///
/// - — executes locally (typed client
/// command, chat alias, channel send, or local presentation).
/// - — retail registers it with a NULL
/// function pointer (verified byte-level in the registry doc); it can
/// never execute in retail OR acdream. Typing it bare reaches the server
/// as literal text.
/// - — a real retail verb
/// acdream has not yet ported (TS-68/TS-69/TS-70, or the deliberate
/// @loadfile product decision); falls through to ACE as literal text.
///
/// The FIRST test enforces that every verb resolves to the RIGHT status.
/// The SECOND enforces the ownership rule in reverse: nothing in
/// or
/// exists that ISN'T in this registry (no invented verbs slip back in).
///
///
public sealed class RetailCommandRegistryConformanceTests
{
private enum Status { Implemented, HelpOnly, ServerPassthrough }
private sealed record Entry(Status Status, params string[] Verbs);
///
/// The complete 152-verb registry, one entry per retail handler (or
/// per fallback-tag family), transcribed directly from the
/// command-registry doc's §2 tables. Verb-string counts per section
/// were cross-checked against the doc's own §4 totals (130 + 22 = 152;
/// the Turbine §2.4 net-new count here is exactly 14, matching the
/// doc's "15 added, 14 net-new (a replaced)" note) before this test
/// was written.
///
private static readonly Entry[] Registry =
[
// §2.1 Help / group nodes (9)
new(Status.Implemented, "help", "?"),
new(Status.HelpOnly, "commands"),
new(Status.HelpOnly, "allegiances"),
new(Status.HelpOnly, "channels"),
new(Status.HelpOnly, "chatting"),
new(Status.HelpOnly, "death"),
new(Status.HelpOnly, "status"),
new(Status.HelpOnly, "text"),
// §2.2 Local chat routing (31)
new(Status.Implemented, "say", "s"),
new(Status.Implemented, "tell", "t", "send", "whisper", "w"),
new(Status.Implemented, "reply", "r", "rp"),
new(Status.HelpOnly, "mr"),
new(Status.HelpOnly, "pr"),
new(Status.Implemented, "retell", "rt"),
new(Status.Implemented, "chat"),
new(Status.Implemented, "notell"),
new(Status.Implemented, "join"),
new(Status.Implemented, "leave"),
new(Status.Implemented, "index"),
new(Status.Implemented, "clist"),
new(Status.Implemented, "on"),
new(Status.Implemented, "off"),
new(Status.Implemented, "title"),
new(Status.ServerPassthrough, "log"), // TS-69
new(Status.Implemented, "clear"),
new(Status.Implemented, "filter"),
new(Status.Implemented, "unfilter"),
new(Status.Implemented, "messagetypes", "message_types", "msgtypes", "msg_types"),
new(Status.ServerPassthrough, "loadfile"), // deliberate — doc §3 "explicitly do NOT implement"
// §2.3 Chat channels (20)
new(Status.Implemented, "a", "ab"),
new(Status.Implemented, "co-vassals", "covassals", "covassal", "c"),
new(Status.Implemented, "monarch", "m"),
new(Status.Implemented, "patron", "p"),
new(Status.Implemented, "vassals", "vassal", "v"),
new(Status.Implemented, "fellowship", "fellows", "fellow", "f", "group", "g", "party"),
// §2.3 fallback: 22 GetChannelID tags with NO registered verb (22)
new(Status.Implemented, "av", "av1", "advocate", "advocate1"),
new(Status.Implemented, "av2", "advocate2"),
new(Status.Implemented, "av3", "advocate3"),
new(Status.Implemented, "abuse"),
new(Status.Implemented, "ad", "admin"),
new(Status.Implemented, "au", "audit"),
new(Status.Implemented, "sent", "sentinel"),
new(Status.Implemented, "celestialhand", "celhan"),
new(Status.Implemented, "eldrytchweb", "eldweb"),
new(Status.Implemented, "radiantblood", "radblo"),
new(Status.Implemented, "ol"),
// §2.4 Turbine chat, 14 net-new (a already counted in §2.3) (14)
new(Status.Implemented, "guild", "gu"),
new(Status.Implemented, "general", "cg"),
new(Status.Implemented, "trade", "ct"),
new(Status.Implemented, "lfg", "clfg"),
new(Status.Implemented, "roleplay", "crp"),
new(Status.Implemented, "society", "soc"),
new(Status.Implemented, "olthoi", "o"),
// §2.5 Allegiance management (6; "ab" already counted in §2.3)
new(Status.Implemented, "allegiance", "all"),
new(Status.Implemented, "alh", "ah"),
new(Status.ServerPassthrough, "motd"), // TS-68
new(Status.Implemented, "speaker"),
// §2.5b Housing (7)
new(Status.Implemented, "house", "hou"),
new(Status.Implemented, "hor", "hr"),
new(Status.Implemented, "hom", "hoa"),
new(Status.Implemented, "hslist"),
// §2.6 Death / recall / PK (17)
new(Status.Implemented, "lifestone", "lif", "ls"),
new(Status.Implemented, "marketplace", "mar", "mp"),
new(Status.Implemented, "pkarena", "pka"),
new(Status.Implemented, "pklarena", "pla"),
new(Status.Implemented, "pklite", "pkl"),
new(Status.Implemented, "die"),
new(Status.Implemented, "corpse", "cor"),
new(Status.Implemented, "consent"),
new(Status.Implemented, "permit"),
// §2.7 Status / display (8)
new(Status.Implemented, "age"),
new(Status.Implemented, "birth"),
new(Status.ServerPassthrough, "day"), // TS-69 — no sky/time-of-day override hook
new(Status.Implemented, "endurance"),
new(Status.Implemented, "framerate"),
new(Status.Implemented, "loc"),
new(Status.Implemented, "version"),
new(Status.ServerPassthrough, "render"), // TS-69 — no SmartBox equivalent
// §2.8 Interface layout, emotes, social, components (18)
new(Status.Implemented, "saveui"),
new(Status.Implemented, "loadui"),
new(Status.Implemented, "saveautoui"),
new(Status.Implemented, "loadautoui"),
new(Status.Implemented, "lockui"),
new(Status.Implemented, "emote", "e", "em", "me"),
new(Status.Implemented, "emotes"),
new(Status.Implemented, "afk"),
new(Status.Implemented, "friends"),
new(Status.Implemented, "friends_add"),
new(Status.Implemented, "friends_remove"),
new(Status.Implemented, "squelch"),
new(Status.Implemented, "unsquelch"),
new(Status.Implemented, "fillcomps"),
];
private static readonly HashSet CatalogVerbs =
new(RetailClientCommandCatalog.KnownVerbs, StringComparer.OrdinalIgnoreCase);
private static bool IsExecutable(string verb)
{
if (verb is "help" or "?")
return true; // local presentation — not a catalog/parser entry.
if (CatalogVerbs.Contains(verb))
return true;
if (ChatInputParser.IsKnownVerb("/" + verb))
return true;
if (RetailChannelTagTable.IsUnregisteredFallbackTag(verb))
return true;
return false;
}
public static IEnumerable