verbsplit reports menu navigation as its own navigation resolution so
that resolved keeps meaning "a verb was decided" for its callers; the
envelope folds the two into resolved + kind, which is the ratified
vocabulary. The union rather than four independent optionals, because these
fields co-vary and the intended consumers (LSP, MCP) narrow on them:
resolution === "resolved" must yield a command, and kind === "command"
must yield a verb, at compile time. Independently optional fields also
describe three shapes that cannot occur — a resolved statement with no
command, a menu with a verb, a refusal with a command.
Every variant declares the other variants' discriminants as ?: undefined,
so s.kind and s.command stay readable without narrowing first.
What the analyzer read, as a discriminated union.
verbsplitreports menu navigation as its ownnavigationresolution so thatresolvedkeeps meaning "a verb was decided" for its callers; the envelope folds the two intoresolved+kind, which is the ratified vocabulary. The union rather than four independent optionals, because these fields co-vary and the intended consumers (LSP, MCP) narrow on them:resolution === "resolved"must yield acommand, andkind === "command"must yield averb, at compile time. Independently optional fields also describe three shapes that cannot occur — a resolved statement with no command, a menu with a verb, a refusal with a command.Every variant declares the other variants' discriminants as
?: undefined, sos.kindands.commandstay readable without narrowing first.