semantics

This commit is contained in:
2026-05-26 09:30:41 +03:00
parent 1e7bcecaea
commit 9ffa8af1dc
623 changed files with 28045 additions and 26557 deletions

View File

@@ -1,11 +1,11 @@
# #region ApiRoutesModule [C:5] [TYPE Module] [SEMANTICS api, package, router, lazy, import]
# @BRIEF Provide lazy route module loading to avoid heavyweight imports during tests.
# @LAYER: API
# @LAYER API
# @RELATION CALLS -> [ApiRoutesGetAttr]
# @RELATION BINDS_TO -> [Route_Group_Contracts]
# @PRE: FastAPI app initialized, route modules available in package
# @POST: Route modules are lazily loadable via __getattr__
# @INVARIANT: Only names listed in __all__ are importable via __getattr__.
# @PRE FastAPI app initialized, route modules available in package
# @POST Route modules are lazily loadable via __getattr__
# @INVARIANT Only names listed in __all__ are importable via __getattr__.
# #region Route_Group_Contracts [C:3] [TYPE Block]
# @BRIEF Declare the canonical route-module registry used by lazy imports and app router inclusion.
@@ -14,8 +14,8 @@
# @RELATION DEPENDS_ON -> [SettingsRouter]
# @RELATION DEPENDS_ON -> [ReportsRouter]
# @RELATION DEPENDS_ON -> [LlmRoutes]
# @SIDE_EFFECT: Registers route group imports via __getattr__
# @DATA_CONTRACT: Package -> RouterModule mapping
# @SIDE_EFFECT Registers route group imports via __getattr__
# @DATA_CONTRACT Package -> RouterModule mapping
__all__ = [
"admin",
"admin_api_keys",
@@ -47,8 +47,8 @@ __all__ = [
# #region ApiRoutesGetAttr [C:3] [TYPE Function]
# @BRIEF Lazily import route module by attribute name.
# @RELATION DEPENDS_ON -> [ApiRoutesModule]
# @PRE: name is module candidate exposed in __all__.
# @POST: Returns imported submodule or raises AttributeError.
# @PRE name is module candidate exposed in __all__.
# @POST Returns imported submodule or raises AttributeError.
def __getattr__(name):
if name in __all__:
import importlib