@@ -23,7 +23,7 @@ This file provides an overview of all modules in `aignostics_foundry_core`, thei
2323| ** user_agent** | Parameterised HTTP user-agent string builder | ` user_agent(project_name, version, repository_url) ` — builds ` {project_name}-python-sdk/{version} (…) ` string including platform info, current test, and GitHub Actions run URL |
2424| ** gui** | NiceGUI page helpers, auth decorators, and nav builder | ` GUINamespace ` (configurable page decorator namespace), ` gui ` (default singleton), ` page_public/authenticated/admin/internal/internal_admin ` decorators, ` get_gui_user ` , ` require_gui_user ` , ` BaseNavBuilder ` , ` NavItem ` , ` NavGroup ` , ` gui_get_nav_groups(*, context=None) ` , ` BasePageBuilder ` , ` gui_register_pages(*, context=None) ` , ` gui_run(*, context=None, …) ` ; constants ` WINDOW_SIZE ` , ` BROWSER_RECONNECT_TIMEOUT ` , ` RESPONSE_TIMEOUT ` |
2525| ** console** | Themed terminal output | Module-level ` console ` object (Rich ` Console ` ) with colour theme and ` _get_console() ` factory |
26- | ** foundry** | Project context injection | ` FoundryContext ` , ` FoundryContext.from_package() ` , ` set_context() ` , ` get_context() ` — centralised project-specific values (name, version, ` version_full ` , ` version_with_vcs_ref ` , environment, env files, URLs, ` python_version ` , runtime mode flags ` is_container ` , ` is_cli ` , ` is_test ` , ` is_library ` , ` database: DatabaseSettings \| None ` ) derived from package metadata and environment variables; ` from_package() ` populates ` database ` from ` {env_prefix}DB_* ` env vars when ` {env_prefix}DB_URL ` is present |
26+ | ** foundry** | Project context injection | ` PackageMetadata ` , ` FoundryContext ` , ` FoundryContext.from_package() ` , ` set_context() ` , ` get_context() ` — centralised project-specific values (name, version, ` version_full ` , ` version_with_vcs_ref ` , environment, env files, URLs, ` python_version ` , ` metadata: PackageMetadata ` (description, author_name, author_email), runtime mode flags ` is_container ` , ` is_cli ` , ` is_test ` , ` is_library ` , ` database: DatabaseSettings \| None ` ) derived from package metadata and environment variables; ` from_package() ` populates ` metadata ` from ` importlib.metadata ` and ` database ` from ` {env_prefix}DB_* ` env vars when ` {env_prefix}DB_URL ` is present |
2727| ** di** | Dependency injection | ` locate_subclasses(cls, *, context=None) ` , ` locate_implementations(cls, *, context=None) ` , ` load_modules(*, context=None) ` , ` discover_plugin_packages ` , ` clear_caches ` , ` PLUGIN_ENTRY_POINT_GROUP ` for plugin and subclass discovery |
2828| ** health** | Service health checks | ` Health ` model and ` HealthStatus ` enum for tree-structured health status |
2929| ** settings** | Pydantic settings loading | ` OpaqueSettings ` , ` load_settings ` , ` strip_to_none_before_validator ` , ` UNHIDE_SENSITIVE_INFO ` for env-based settings with secret masking and user-friendly validation errors; ` console ` , ` Panel ` , and ` Text ` are imported lazily inside ` load_settings ` (error path only) |
@@ -41,16 +41,25 @@ This file provides an overview of all modules in `aignostics_foundry_core`, thei
4141 application startup makes the context available everywhere in the library without threading values
4242 through call sites. Tests pass an explicit context override and never touch global state.
4343- ** Key Features** :
44+ - ` PackageMetadata(BaseModel) ` — frozen; fields: ` description: str = "" ` ,
45+ ` author_name: str | None = None ` , ` author_email: str | None = None ` ,
46+ ` repository_url: str = "" ` , ` documentation_url: str = "" ` .
47+ Constructor: ` PackageMetadata.from_name(package_name) ` — reads all five fields from
48+ ` importlib.metadata ` (`` Summary `` , `` Author-email `` , `` Project-URL `` ).
49+ Defaults to empty values for direct construction (e.g. in tests).
4450 - ` FoundryContext(BaseModel) ` — frozen; fields: ` name ` , ` version ` , ` version_full ` , ` version_with_vcs_ref ` , ` environment ` ,
45- ` env_file: list[Path] ` , ` repository_url ` , ` documentation_url ` , ` python_version ` (Python runtime
46- version string, e.g. ` "3.11.9" ` ), plus four runtime mode bool flags: ` is_container ` , ` is_cli ` ,
51+ ` env_file: list[Path] ` , ` env_prefix ` , ` python_version ` (Python runtime version string,
52+ e.g. ` "3.11.9" ` ), ` metadata: PackageMetadata ` (all package-derived fields: description,
53+ author, URLs; populated by ` from_package() ` via ` PackageMetadata.from_name() ` ; defaults to
54+ empty ` PackageMetadata() ` ), plus four runtime mode bool flags: ` is_container ` , ` is_cli ` ,
4755 ` is_test ` , ` is_library ` (all default ` False ` ), and ` database: DatabaseSettings | None `
4856 (populated by ` from_package() ` when ` {env_prefix}DB_URL ` is set; ` None ` otherwise).
4957 - ` FoundryContext.from_package(package_name) ` — classmethod that derives all values from
5058 ` importlib.metadata ` and environment variables (` {NAME}_ENVIRONMENT ` , ` VCS_REF ` , ` COMMIT_SHA ` ,
5159 ` BUILDER ` , ` BUILD_DATE ` , ` CI_RUN_ID ` , ` CI_RUN_NUMBER ` , ` {NAME}_ENV_FILE ` ,
5260 ` {NAME}_RUNNING_IN_CONTAINER ` , ` PYTEST_RUNNING_{NAME} ` ). Environment fallback chain:
5361 ` {NAME}_ENVIRONMENT ` → ` ENV ` → ` VERCEL_ENV ` → ` RAILWAY_ENVIRONMENT ` → ` "local" ` .
62+ Calls ` PackageMetadata.from_name(package_name) ` to populate ` ctx.metadata ` .
5463 Also checks ` {NAME}_DB_URL ` : when present, constructs ` DatabaseSettings(_env_prefix="{NAME}_DB_") `
5564 and stores it in ` ctx.database ` ; otherwise ` ctx.database ` is ` None ` .
5665 - ` set_context(ctx) ` — installs * ctx* as the process-level singleton.
0 commit comments