mud_server.axis.types
Immutable result types for the axis resolution engine.
These frozen dataclasses represent the inputs and outputs of a single mechanical resolution step — the permanent record of what happened when two characters interacted. They flow between the resolver functions, the engine, and the JSONL ledger.
Design note: all score values stored here reflect the post-clamping state (i.e. clamped to [0.0, 1.0]). The engine clamps before writing; these types never carry out-of-range floats.
Classes
The result of a resolver function for one axis and one entity. |
|
The axis mutations produced for one entity during an interaction. |
|
The complete result of one mechanical axis resolution. |
Module Contents
- class mud_server.axis.types.AxisDelta[source]
The result of a resolver function for one axis and one entity.
new_scoreanddeltareflect the actual changes applied to the database after clamping, not the raw resolver output. A character whose health is already at0.0would showdelta = 0.0here even though the resolver returned-0.01.- axis_name
Name of the axis that was (potentially) mutated, e.g.
"demeanor"or"health".
- old_score
Score read from the database before this resolution. Always in [0.0, 1.0] for valid DB rows.
- new_score
Score written to the database after clamping. Always in [0.0, 1.0].
- delta
Actual applied change =
new_score - old_score. May be smaller in magnitude than the resolver’s raw delta if clamping was needed (e.g. health floor at0.0).
- class mud_server.axis.types.EntityResolution[source]
The axis mutations produced for one entity during an interaction.
- character_id
Database primary key of the character.
- character_name
Display name at resolution time (informational; not re-read after resolution completes).
- class mud_server.axis.types.AxisResolutionResult[source]
The complete result of one mechanical axis resolution.
Returned by
resolve_chat_interaction()after all ledger writes and database mutations are committed.The
ipc_hashis the authoritative fingerprint of this interaction. It incorporates the world, channel, both character IDs, and the pre-interaction axis snapshot. Passing it to the translation service enables deterministic rendering.- Note on
ipc_hashcomputation (deviation from plan): compute_ipc_id()requires asystem_prompt_hashstring — a concept that has no meaning in a purely mechanical resolution (there is no LLM call). Instead,compute_payload_hash()is used directly on the resolution payload dict. This is documented in_compute_resolution_hash(). When the translation service uses theipc_hashfor deterministic Ollama seeding, it callscompute_ipc_id()with this hash as theinput_hash, which is the intended design.
- ipc_hash
SHA-256 hex digest of the mechanical resolution payload (
compute_payload_hashoutput).
- world_id
World in which the interaction occurred.
- channel
Chat channel (
"say","yell","whisper").
- speaker
EntityResolutionfor the character who spoke.
- listener
EntityResolutionfor the character who received the message.
- axis_snapshot_before
Pre-interaction scores for the axes that participate in the resolution (i.e. axes with non-
no_effectresolvers). Shape:{str(character_id): {axis_name: score}}. Stored in both the DB event ledger and the JSONL ledger for audit and replay purposes.
- speaker: EntityResolution
- listener: EntityResolution
- Note on