Schema

Pydantic v2 models for request/response objects.

app.schema is now a package that re-exports the public model names for backward-compatible imports such as from app.schema import GenerateRequest. The models themselves are organized by domain submodule:

  • app.schema.axis — shared axis primitives and payloads

  • app.schema.generate — character-description generation and logging

  • app.schema.save — save/export/import request and response models

  • app.schema.analysis — signal-isolation and transformation-map models

  • app.schema.chat — chat translation and chat save/import models

  • app.schema.mud — mud-server proxy request and response models

app.schema

Domain-organised Pydantic v2 models for the Axis Descriptor Lab API.

This package replaces the previous monolithic app/schema.py module while preserving the original import surface. Existing imports such as from app.schema import AxisPayload remain valid because this package re-exports every public schema name from the domain submodules below.

Submodules

  • axis – shared axis primitives used across multiple endpoints.

  • generate – generate/log request and response models.

  • save – save/import and manifest models.

  • analysis – signal-isolation and transformation-map models.

  • chat – chat translation, chat save, and chat import models.

  • mud – mud-server proxy request and response models.

class app.schema.AxisPayload(*, axes, policy_hash, seed, world_id)[source]

Bases: BaseModel

The complete deterministic state object that drives a single descriptive generation. This is the “source of truth” handed to the LLM as a JSON string in the user turn.

axes is keyed by axis name (for example, “demeanor”) and stores AxisValue entries. policy_hash captures the SHA-256 digest of the policy rules in force when the payload was produced. seed records the deterministic RNG seed used to produce the scores, and world_id identifies the Pipe-Works world context.

classmethod axes_not_empty(v)[source]

Require at least one axis.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

axes: dict[str, AxisValue]
policy_hash: str
seed: int
world_id: str
class app.schema.AxisValue(*, label, score)[source]

Bases: BaseModel

A single named axis entry consisting of a human-readable label and a normalised score in [0, 1].

The label is the interpretive colour (e.g. “resentful”, “weary”). The score is the underlying deterministic value produced by the engine. Both are forwarded verbatim to the LLM; the LLM must not treat them as facts – they are tonal hints only.

classmethod label_not_empty(v)[source]

Ensure the label is not a blank string.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

label: str
score: float
class app.schema.ChatCharacterInput(*, axes, ooc_message, channel='say', active_axes=None, character_name=None)[source]

Bases: BaseModel

Axis profile and OOC message for a single character in a chat translation request.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

axes: dict[str, AxisValue]
ooc_message: str
channel: str
active_axes: list[str] | None
character_name: str | None
class app.schema.ChatImportResponse(*, folder_name, metadata, character_a=None, character_b=None, system_prompt, game_log_entries=<factory>, model, temperature, max_tokens, seed, manifest_valid, files, warnings=<factory>)[source]

Bases: BaseModel

Response body for POST /api/import_chat.

Contains everything the frontend needs to restore a chat translation session from an uploaded chat save-package zip.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

folder_name: str
metadata: dict[str, Any]
character_a: dict[str, Any] | None
character_b: dict[str, Any] | None
system_prompt: str
game_log_entries: list[dict[str, str]]
model: str
temperature: float
max_tokens: int
seed: int
manifest_valid: bool
files: list[str]
warnings: list[str]
class app.schema.ChatLogEntry(*, ch, channel, ooc_message=None, ic_text=None, model, ipc_id=None, status='success', error_detail=None, sent_at=None, duration_ms=None, input_hash=None, system_prompt_hash=None, system_prompt=None, output_hash=None)[source]

Bases: BaseModel

A single entry in the in-game chat log produced during live mode.

Captured when a per-character Send succeeds. Stored in chatState.gameLog on the frontend and serialised here for server-side persistence.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

ch: str
channel: str
ooc_message: str | None
ic_text: str | None
model: str
ipc_id: str | None
status: str
error_detail: str | None
sent_at: str | None
duration_ms: int | None
input_hash: str | None
system_prompt_hash: str | None
system_prompt: str | None
output_hash: str | None
class app.schema.ChatSaveRequest(*, entries, character_a=None, character_b=None, character_a_name=None, character_b_name=None, model, temperature=0.7, max_tokens=128, seed, system_prompt=None)[source]

Bases: BaseModel

Request body for POST /api/save_chat.

Saves a complete in-game chat log session to a timestamped folder under the configured writable save root, including optional character payloads and the system prompt.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

entries: list[ChatLogEntry]
character_a: dict[str, Any] | None
character_b: dict[str, Any] | None
character_a_name: str | None
character_b_name: str | None
model: str
temperature: float
max_tokens: int
seed: int
system_prompt: str | None
class app.schema.ChatSaveResponse(*, folder_name, files, timestamp)[source]

Bases: BaseModel

Response body for POST /api/save_chat.

Returns the save folder name and the list of files written.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

folder_name: str
files: list[str]
timestamp: str
class app.schema.ChatTranslationRequest(*, character_a=None, character_b=None, model, temperature=0.7, max_tokens=128, seed, prompt_name=None, system_prompt=None, ollama_host=None, strict_mode=True, max_output_chars=280, world_id=None)[source]

Bases: BaseModel

Request body for POST /api/translate_chat.

Translates OOC messages for one or two characters using the OOC→IC translation pipeline. Each character’s profile is built from its axes, filtered by active_axes, and rendered into the system prompt template before calling Ollama /api/chat.

at_least_one_character()[source]

Require at least one of character_a or character_b.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

character_a: ChatCharacterInput | None
character_b: ChatCharacterInput | None
model: str
temperature: float
max_tokens: int
seed: int
prompt_name: str | None
system_prompt: str | None
ollama_host: str | None
strict_mode: bool
max_output_chars: int
world_id: str | None
class app.schema.ChatTranslationResponse(*, character_a=None, character_b=None)[source]

Bases: BaseModel

Response body for POST /api/translate_chat.

Contains results for Character A and optionally Character B.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

character_a: ChatTranslationResult | None
character_b: ChatTranslationResult | None
class app.schema.ChatTranslationResult(*, ic_text, status, input_hash=None, system_prompt_hash=None, output_hash=None, ipc_id=None, model=None, error_detail=None)[source]

Bases: BaseModel

Result for a single character’s OOC→IC translation attempt.

ic_text is None when translation failed (status explains why). The IPC fields form the provenance chain for this translation.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

ic_text: str | None
status: str
input_hash: str | None
system_prompt_hash: str | None
output_hash: str | None
ipc_id: str | None
model: str | None
error_detail: str | None
class app.schema.DeltaRequest(*, baseline_text, current_text)[source]

Bases: BaseModel

Request body for POST /api/analyze-delta.

Accepts two plain-text strings (baseline and current) for signal isolation analysis. The backend runs both through the NLP pipeline (tokenise → lemmatise → filter stopwords) and returns the set difference as sorted word lists.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

baseline_text: str
current_text: str
class app.schema.DeltaResponse(*, removed, added)[source]

Bases: BaseModel

Response body for POST /api/analyze-delta.

Contains two alphabetically sorted lists of content lemmas that represent meaningful lexical differences between the baseline and current texts, after stopword removal and lemmatisation.

The lists are set differences, not positional diffs:

  • removed = content lemmas in A but absent from B.

  • added = content lemmas in B but absent from A.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

removed: list[str]
added: list[str]
class app.schema.GenerateRequest(*, payload, model, temperature=0.2, max_tokens=120, system_prompt=None, ollama_host=None)[source]

Bases: BaseModel

Full request body for POST /api/generate.

The frontend serialises its current in-memory state into this object and sends it to the backend, which forwards the payload to Ollama.

Optional fields allow the frontend to override per-request settings (model, temperature, token budget, custom system prompt) without restarting the server.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

payload: AxisPayload
model: str
temperature: float
max_tokens: int
system_prompt: str | None
ollama_host: str | None
class app.schema.GenerateResponse(*, text, model, temperature, usage=None, input_hash=None, system_prompt_hash=None, output_hash=None, ipc_id=None)[source]

Bases: BaseModel

Response body for POST /api/generate.

Carries the raw LLM output plus enough metadata to reconstruct the exact call for logging, diffing, and repeatability analysis.

The four hash fields (input_hash, system_prompt_hash, output_hash, ipc_id) form the Interpretive Provenance Chain (IPC) — a complete fingerprint of every variable that influenced the generation. Together they enable drift detection and reproducibility audits.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

text: str
model: str
temperature: float
usage: dict[str, Any] | None
input_hash: str | None
system_prompt_hash: str | None
output_hash: str | None
ipc_id: str | None
class app.schema.ImportResponse(*, folder_name, metadata, payload, system_prompt, output=None, baseline=None, model, temperature, max_tokens, manifest_valid, files, warnings=<factory>)[source]

Bases: BaseModel

Response body for POST /api/import.

Contains everything the frontend needs to fully restore session state from an uploaded save-package zip file. The backend parses the zip, validates manifest checksums (if present), and extracts plain text from the Markdown files so the frontend can populate the UI directly without any further parsing.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

folder_name: str
metadata: dict[str, Any]
payload: AxisPayload
system_prompt: str
output: str | None
baseline: str | None
model: str
temperature: float
max_tokens: int
manifest_valid: bool
files: list[str]
warnings: list[str]
class app.schema.IndicatorConfig(*, compression_ratio=2.0, expansion_ratio=2.0, min_tokens=2, modality_density_threshold=0.3, enabled=None)[source]

Bases: BaseModel

Optional tuning parameters for micro-indicator detection.

Sent as an optional field in TransformationMapRequest. When absent, conservative defaults apply. All thresholds are designed to minimise false positives — users can loosen them for exploratory use.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

compression_ratio: float
expansion_ratio: float
min_tokens: int
modality_density_threshold: float
enabled: list[str] | None
class app.schema.LogEntry(*, input_hash, payload, output, model, temperature, max_tokens, timestamp, system_prompt_hash=None, output_hash=None, ipc_id=None)[source]

Bases: BaseModel

Schema for a single structured log record written by POST /api/log.

Captures everything needed to reproduce a run and detect drift across repeated calls with the same seed / policy hash. input_hash groups runs that should be identical, payload stores the full deterministic input, and the remaining fields capture the generated output plus the runtime parameters and timestamp needed for later audit or drift analysis.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

input_hash: str
payload: AxisPayload
output: str
model: str
temperature: float
max_tokens: int
timestamp: str
system_prompt_hash: str | None
output_hash: str | None
ipc_id: str | None
class app.schema.ManifestFileEntry(*, sha256, role, size_bytes)[source]

Bases: BaseModel

A single file’s entry in the save-package manifest.

Provides the SHA-256 checksum, role classification, and byte size for one file within a save folder. Used inside the manifest section of metadata.json to make save packages self-describing and verifiable.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sha256: str | None
role: str
size_bytes: int
class app.schema.MudCompileImagePromptRequest(*, world_id, species='goblin', gender='male', axes, world_context=<factory>, occupation_signals=<factory>, model_id=None, aspect_ratio=None, seed=None)[source]

Bases: BaseModel

Request body for POST /api/mud/compile-image-prompt.

This mirrors the mud server’s canonical image compile request while intentionally keeping the surface minimal for the lab’s phase-1 canonical mode.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

world_id: str
species: str
gender: str
axes: dict[str, AxisValue]
world_context: list[str]
occupation_signals: list[str]
model_id: str | None
aspect_ratio: str | None
seed: int | None
class app.schema.MudImagePolicyBundleResponse(*, world_id, policy_schema=None, policy_bundle_id=None, policy_bundle_version=None, policy_hash, composition_order=<factory>, required_runtime_inputs=<factory>, missing_components=<factory>)[source]

Bases: BaseModel

Response body for GET /api/mud/world-image-policy-bundle/{world_id}.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

world_id: str
policy_schema: str | None
policy_bundle_id: str | None
policy_bundle_version: int | str | None
policy_hash: str
composition_order: list[str]
required_runtime_inputs: list[str]
missing_components: list[str]
class app.schema.MudLoginRequest(*, username, password)[source]

Bases: BaseModel

Request body for POST /api/mud/login.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

username: str
password: str
class app.schema.MudLoginResponse(*, authenticated, role=None, message=None)[source]

Bases: BaseModel

Response body for POST /api/mud/login.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

authenticated: bool
role: str | None
message: str | None
class app.schema.MudModeOption(*, key, label, translation_mode, server_url=None)[source]

Bases: BaseModel

One runtime-selectable chat translation mode.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

key: str
label: str
translation_mode: str
server_url: str | None
class app.schema.MudModeRequest(*, mode_key, server_url=None)[source]

Bases: BaseModel

Request body for POST /api/mud/mode.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

mode_key: str
server_url: str | None
class app.schema.MudModeResponse(*, mode_key, translation_mode, active_server_url=None, available_modes)[source]

Bases: BaseModel

Response body for GET and POST /api/mud/mode.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

mode_key: str
translation_mode: str
active_server_url: str | None
available_modes: list[MudModeOption]
class app.schema.MudPipelineBootstrapResponse(*, world_id, world_summary=<factory>, policy_bundle, policy_source=None, runtime_options=<factory>, required_fields=<factory>)[source]

Bases: BaseModel

Response body for GET /api/mud/pipeline-build/bootstrap/{world_id}.

This aggregated payload keeps the frontend stateless by returning all stage-1 and stage-2 inputs in one call.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

world_id: str
world_summary: dict[str, Any]
policy_bundle: MudImagePolicyBundleResponse
policy_source: MudPipelinePolicySource | None
runtime_options: MudPipelineRuntimeOptions
required_fields: list[str]
class app.schema.MudPipelineGenerateConditionAxisEntityInputs(*, species, identity)[source]

Bases: BaseModel

Entity input block for canonical condition-axis generation.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

species: str
identity: MudPipelineGenerateConditionAxisIdentityInputs
class app.schema.MudPipelineGenerateConditionAxisIdentityInputs(*, gender)[source]

Bases: BaseModel

Identity input block for canonical condition-axis generation.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

gender: str
class app.schema.MudPipelineGenerateConditionAxisInputs(*, entity)[source]

Bases: BaseModel

Runtime inputs wrapper for canonical condition-axis generation.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

entity: MudPipelineGenerateConditionAxisEntityInputs
class app.schema.MudPipelineGenerateConditionAxisRequest(*, world_id, seed=None, inputs)[source]

Bases: BaseModel

Request body for POST /api/mud/pipeline-build/generate-condition-axis.

This contract mirrors the mud server canonical route and includes strict runtime identity inputs used by policy validation.

seed may be omitted (or null) to request server-side random seeding.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

world_id: str
seed: int | None
inputs: MudPipelineGenerateConditionAxisInputs
class app.schema.MudPipelinePolicySource(*, source_kind, source_label, source_path=None, reference=None)[source]

Bases: BaseModel

Truthful source metadata for Policy Bundle display surfaces.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

source_kind: Literal['mud_server_canonical', 'local_world', 'lab_only', 'legacy', 'offline', 'unknown']
source_label: str
source_path: str | None
reference: MudPipelinePolicySourceReference | None
class app.schema.MudPipelinePolicySourceReference(*, world_id, policy_bundle_id=None, policy_bundle_version=None, policy_hash, served_via='/api/mud/pipeline-build/bootstrap/{world_id}')[source]

Bases: BaseModel

Canonical reference metadata for one resolved policy source.

This model deliberately avoids filesystem assumptions for remote policy sources. It identifies the policy bundle by deterministic IDs and hashes so UI surfaces can remain truthful across local vs remote environments.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

world_id: str
policy_bundle_id: str | None
policy_bundle_version: int | str | None
policy_hash: str
served_via: str
class app.schema.MudPipelineResolveRequest(*, world_id, species='goblin', gender='male', axes, world_context=<factory>, occupation_signals=<factory>)[source]

Bases: BaseModel

Request body for POST /api/mud/pipeline-build/resolve-image-selection.

The request intentionally excludes generation-only controls so the response can represent pre-prompt selection/resolve state for stages 5-7.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

world_id: str
species: str
gender: str
axes: dict[str, AxisValue]
world_context: list[str]
occupation_signals: list[str]
class app.schema.MudPipelineResolveResponse(*, selected_blocks, descriptor_layer=None, tone_profile=None, composition_order=<factory>, policy_hash, axis_hash, compiler_input_hash)[source]

Bases: BaseModel

Response body for POST /api/mud/pipeline-build/resolve-image-selection.

This response intentionally omits the compiled prompt text so stage-5/6/7 UI state can be rendered without coupling to stage-8 side effects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

selected_blocks: MudPipelineSelectedBlocks
descriptor_layer: str | None
tone_profile: str | None
composition_order: list[str]
policy_hash: str
axis_hash: str
compiler_input_hash: str
class app.schema.MudPipelineRuntimeOptions(*, species=<factory>, gender=<factory>, world_context_tags=<factory>, occupation_tags=<factory>)[source]

Bases: BaseModel

Runtime option sets used by Pipeline Build stage controls.

The bootstrap endpoint uses this model to expose optional selector values without forcing the frontend to infer them from world configuration files.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

species: list[str]
gender: list[str]
world_context_tags: list[str]
occupation_tags: list[str]
class app.schema.MudPipelineSelectedBlocks(*, species_canon_block=None, clothing_block=<factory>)[source]

Bases: BaseModel

Selected block IDs returned by the resolve preview endpoint.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

species_canon_block: str | None
clothing_block: dict[str, str | None]
class app.schema.MudSelectWorldRequest(*, world_id)[source]

Bases: BaseModel

Request body for POST /api/mud/select-world.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

world_id: str
class app.schema.MudSessionResponse(*, authenticated, role=None, selected_world_id=None, mode_key, translation_mode, active_server_url=None)[source]

Bases: BaseModel

Response body for GET /api/mud/session.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

authenticated: bool
role: str | None
selected_world_id: str | None
mode_key: str
translation_mode: str
active_server_url: str | None
class app.schema.SaveRequest(*, payload, output=None, baseline=None, payload_name=None, model, temperature=0.2, max_tokens=120, system_prompt, transformation_map=None, diff_change_pct=None)[source]

Bases: BaseModel

Full request body for POST /api/save.

The frontend collects all in-memory state at the moment the user clicks Save and sends it here. The backend writes individual files to a timestamped subfolder under the configured writable save root.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

payload: AxisPayload
output: str | None
baseline: str | None
payload_name: str | None
model: str
temperature: float
max_tokens: int
system_prompt: str
transformation_map: list[TransformationMapRow] | None
diff_change_pct: int | None
class app.schema.SaveResponse(*, folder_name, files, input_hash, timestamp, system_prompt_hash=None, output_hash=None, ipc_id=None)[source]

Bases: BaseModel

Response body for POST /api/save.

Returns the save folder name and the list of files written so the frontend can display a confirmation message in the status bar.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

folder_name: str
files: list[str]
input_hash: str
timestamp: str
system_prompt_hash: str | None
output_hash: str | None
ipc_id: str | None
class app.schema.TransformationMapRequest(*, baseline_text, current_text, include_all=False, indicator_config=None)[source]

Bases: BaseModel

Request body for POST /api/transformation-map.

Accepts two plain-text strings (baseline and current) for clause-level alignment analysis. The backend runs sentence-aware alignment followed by token-level diffing to extract replacement pairs, then classifies each row with structural micro-indicators.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

baseline_text: str
current_text: str
include_all: bool
indicator_config: IndicatorConfig | None
class app.schema.TransformationMapResponse(*, rows)[source]

Bases: BaseModel

Response body for POST /api/transformation-map.

Contains a list of clause-level replacement pairs extracted by sentence-aware alignment and token-level diffing.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

rows: list[TransformationMapRow]
class app.schema.TransformationMapRow(*, removed, added, indicators=<factory>)[source]

Bases: BaseModel

A single clause-level replacement pair with optional micro-indicators.

The indicators field contains zero or more structural pattern labels computed by the micro_indicators module. Each label is a deterministic heuristic tag such as "compression", "embodiment shift", or "intensity ↑".

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

removed: str
added: str
indicators: list[str]