Skip to content
Open Saka

reflect

The database’s own declarations, such as its roles, properties, and Flows, as read-only roles to query.

Properties inherit visibility from their roles; user aliases do not confer provider authority.

Write these names after reflect::, as in reflect::DeclarationKind.

DeclarationKind

set enum DeclarationKind = {Def, Let, Val, Var, Proc, Set, Bnd, QSet, Qnt, Rep, Lex, Lexer, QLex, Reg, Peg, Parser, Mod, Role, Prop, Namespace}

The source declaration form, independent of aliases and overlapping role membership.

DeclarationModifier

set enum DeclarationModifier = {Enum, Lin, Rec}

Authored declaration modifiers; visibility and attributes are not modifiers.

DeclarationOrigin

set enum DeclarationOrigin = {User, Standard}

Declaration ownership: user catalog or edition-owned standard library, never the alias target’s origin.

Declaration

role Declaration

Installed roots and source-owned declarations, including private declarations and aliases.

Module

role Module

Actual root, inline, and derived Modules. Each shares its Declaration ref and UUID. Module aliases are declarations but are not members of this role.

Declaration::name

prop Declaration::name! str

Decoded local name, excluding namespace and property-owner prefixes. Roots use their canonical registry key or standard specifier; names need not be unique.

Declaration::qualified_name

prop Declaration::qualified_name! str

Canonical escaped name relative to the owning Module, including namespace and property qualification. Roots use their canonical key; aliases use their own destination name. Names need not be unique.

Declaration::kind

prop Declaration::kind! DeclarationKind

The exact source declaration kind, or an alias’s selected kind. Roots have kind Mod. Namespace includes namespace aliases; Mod includes owned and aliased Modules. Let has no live entries because only live-admissible declarations are reflected.

Declaration::is_alias

prop Declaration::is_alias! bool

True exactly for use entries; false for roots. Aliases describe their own entries without expanding targets.

Declaration::origin

prop Declaration::origin! DeclarationOrigin

Ownership provenance; a user alias to a standard declaration still has origin User. This is not an editability or write-authority flag.

Declaration::modifier

prop Declaration::modifier* DeclarationModifier

One member per applicable authored enum or lin modifier. Roots and aliases have no modifier occurrences; other unmodified declarations also have an empty Bag.

Declaration::parent

prop Declaration::parent? Declaration

Immediate containment: the role of a property or declared member, an entry’s namespace, or its containing Module. Roots have no parent; every non-root entry has exactly one. Alias targets never supply parenthood; a parent is never an alias.

Declaration::module

prop Declaration::module? Declaration & Module

Owning source Module for each non-root entry, including inline/derived Modules and aliases. Roots have no owner. Unlike parent, this skips namespaces and owning roles.