mud_server.api.models_lab
Lab-facing API models for DB-first policy and translation workflows.
This module intentionally exports only models that back active /api/lab/*
routes. Legacy file-authoring draft models were removed as part of the DB-only
runtime transition, so clients interacting with this contract should assume:
Canonical policy state is resolved from SQLite policy tables.
Effective runtime behavior is selected through policy activations by scope.
Lab endpoints are diagnostic/authoring helpers on top of canonical DB data.
Classes
One axis value supplied by a lab client. |
|
Translation layer configuration snapshot for one world. |
|
One world entry shown in the lab world-selector. |
|
Response payload for |
|
DB-resolved image policy bundle for one world scope. |
|
Request payload for |
|
Response payload for |
|
Request payload for |
|
Response payload for |
Module Contents
- class mud_server.api.models_lab.LabAxisValue(/, **data)[source]
Bases:
pydantic.BaseModelOne axis value supplied by a lab client.
labelcarries the user-facing categorical name andscorecarries the deterministic numeric value used by downstream policy compilation.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- class mud_server.api.models_lab.LabWorldConfig(/, **data)[source]
Bases:
pydantic.BaseModelTranslation layer configuration snapshot for one world.
Returned to clients so they can inspect which runtime translation settings were actually applied by the server for the selected world.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- class mud_server.api.models_lab.LabWorldSummary(/, **data)[source]
Bases:
pydantic.BaseModelOne world entry shown in the lab world-selector.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- class mud_server.api.models_lab.LabWorldsResponse(/, **data)[source]
Bases:
pydantic.BaseModelResponse payload for
GET /api/lab/worlds.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- worlds: list[LabWorldSummary]
- class mud_server.api.models_lab.LabImagePolicyBundleResponse(/, **data)[source]
Bases:
pydantic.BaseModelDB-resolved image policy bundle for one world scope.
This payload mirrors the canonical image policy bundle contract consumed by integration clients. Path-like fields are informational identifiers retained for compatibility with existing clients; canonical resolution happens in DB.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- class mud_server.api.models_lab.LabTranslateRequest(/, **data)[source]
Bases:
pydantic.BaseModelRequest payload for
POST /api/lab/translate.prompt_template_overrideis request-local and never mutates canonical prompt policy rows. It exists to support one-off lab experimentation.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- axes: dict[str, LabAxisValue]
- class mud_server.api.models_lab.LabTranslateResponse(/, **data)[source]
Bases:
pydantic.BaseModelResponse payload for
POST /api/lab/translate.Includes both generated text and debugging context (rendered prompt, active prompt template, and world config) so operators can audit behavior.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- world_config: LabWorldConfig
- class mud_server.api.models_lab.LabImageCompileRequest(/, **data)[source]
Bases:
pydantic.BaseModelRequest payload for
POST /api/lab/compile-image-prompt.The request combines fixed traits, runtime axis values, and optional contextual tags. The server composes these inputs against activated policy objects to produce a deterministic image prompt bundle output.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- axes: dict[str, LabAxisValue]
- class mud_server.api.models_lab.LabImageCompileResponse(/, **data)[source]
Bases:
pydantic.BaseModelResponse payload for
POST /api/lab/compile-image-prompt.Returns selected policy object identities and deterministic hashes so downstream tools can trace exactly which canonical variants were used.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.