pipeworks_mud_mapper.services.description_validator
Deterministic validator for LLM-generated room descriptions.
This module implements the hard-rule validator described in
_working/description_validator.md. It enforces structural constraints
without rewriting or negotiating prose, in line with the Craft of Constraint
principle that authority lives outside the model.
Design goals: - Deterministic: same input yields same output. - Explainable: every failure is labeled and traceable to a rule. - Non-creative: the validator never edits or suggests replacements.
Classes
Result of validating a room description. |
Functions
Load validator rules from JSON config. |
|
|
Validate a description against hard rules. |
Module Contents
- class pipeworks_mud_mapper.services.description_validator.ValidationResult[source]
Result of validating a room description.
- hard_failures
Named hard rule failures (non-negotiable in the validator).
- Type:
list[str]
- soft_failures
Advisory failures for future expansion (currently unused).
- Type:
list[str]
- rule_hits
Tokens matched per rule, for UI staging visibility.
- Type:
dict[str,list[str]]
- pipeworks_mud_mapper.services.description_validator.load_validator_config()[source]
Load validator rules from JSON config.
Returns an empty dict on missing or invalid config to keep validation stable and non-failing in the UI path.