Skip to content

Errors

Every failure mode in denckring is one of these. None of them is silent: each carries a stable code, a human-readable message, and a detail() dict for a caller that would rather not parse English out of the message.

Each is importable from denckring itself (from denckring import InvalidParams), and this page documents them from there: that is the path under the README's stability promise, and denckring.core.errors, where they are defined, is not. A class keeps its name, its place under DenckringError and its code; the message wording may change.

denckring.DenckringError

Bases: Exception

Base class for every error the library raises.

code is a stable string rather than the class name, so renaming a class does not break a client reading the JSON. to_dict is what an agentic caller sees instead of a traceback.

code class-attribute instance-attribute

code: str = ''

detail

detail() -> dict[str, Any]

Machine-readable specifics. Subclasses override; the base has none.

to_dict

to_dict() -> dict[str, Any]

denckring.UnknownProcedure

UnknownProcedure(procedure_id: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_procedure'

procedure_id instance-attribute

procedure_id = procedure_id

suggestions instance-attribute

suggestions = _near(procedure_id)

detail

detail() -> dict[str, Any]

denckring.UnknownLanguage

UnknownLanguage(lang: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_language'

lang instance-attribute

lang = lang

detail

detail() -> dict[str, Any]

denckring.MissingCapability

MissingCapability(
    procedure_id: str, lang: str, capability: str
)

Bases: DenckringError

capability instance-attribute

capability = capability

code class-attribute instance-attribute

code = 'missing_capability'

lang instance-attribute

lang = lang

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.InvalidParams

InvalidParams(procedure_id: str, message: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'invalid_params'

message instance-attribute

message = message

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.DuplicateProcedure

DuplicateProcedure(procedure_id: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'duplicate_procedure'

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.UnknownDevice

UnknownDevice(
    device_id: str, available: list[str] | None = None
)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_device'

device_id instance-attribute

device_id = device_id

detail

detail() -> dict[str, Any]

denckring.UnsettablePhrase

UnsettablePhrase(syllables: int, covered: list[int])

Bases: DenckringError

code class-attribute instance-attribute

code = 'unsettable_phrase'

syllables instance-attribute

syllables = syllables

detail

detail() -> dict[str, Any]

denckring.InputTooLong

InputTooLong(
    procedure_id: str,
    given: int,
    limit: int,
    unit: str = "letters",
)

Bases: DenckringError

A generator that searches refuses input it cannot search in reasonable time.

Raised rather than returning a poor result, so a caller learns the limit instead of silently receiving something the procedure could not really do.

unit names what was counted, and defaults to what every caller counted when this was written. proteus_verse rearranges words, and a message telling its caller it can rearrange nine letters would be precisely and confidently wrong about the limit it just hit.

code class-attribute instance-attribute

code = 'input_too_long'

given instance-attribute

given = given

limit instance-attribute

limit = limit

procedure_id instance-attribute

procedure_id = procedure_id

unit instance-attribute

unit = unit

detail

detail() -> dict[str, Any]

denckring.TextTooLong

TextTooLong(given: int, limit: int)

Bases: DenckringError

A service boundary refuses text past a configured size, defense in depth alongside each procedure's own algorithmic fixes (review P2-06) — not a claim that the library itself is bounded; check()/apply() called directly have no such limit.

code class-attribute instance-attribute

code = 'text_too_long'

given instance-attribute

given = given

limit instance-attribute

limit = limit

detail

detail() -> dict[str, Any]

denckring.InputTooShort

InputTooShort(procedure_id: str, needed: str, found: str)

Bases: DenckringError

The input could not feed the procedure.

The counterpart to InputTooLong, and the honest form of what four generators used to do instead: return the input unchanged, which reads exactly like a procedure that ran and had no effect. needed and found are separate fields rather than one sentence, so a caller reading the JSON learns what to change without parsing English out of message.

Raised wherever a generator has too few units to work on, whatever the unit is — lines, sentences, words, slots, entries. That is deliberately one code rather than a per-procedure choice: a caller retrying on input_too_short should not have to know that spoonerism once called two-few-words something else. NoCandidateWord keeps the narrower meaning it was built for: enough units were present and none of them was suitable.

code class-attribute instance-attribute

code = 'input_too_short'

found instance-attribute

found = found

needed instance-attribute

needed = needed

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.DegenerateOutput

DegenerateOutput(
    procedure_id: str, observed: str = IDENTICAL
)

Bases: DenckringError

apply produced its own input, its input's letters again, or nothing at all.

Raised rather than returned, for the reason diastic raises NoCandidateWord rather than returning "": handing back text that misrepresents what the procedure did is the failure, not a mild version of success. Usually it means the input could not feed the procedure.

One error for these observations, because a caller cannot act very differently on them — each means the returned text says nothing about what the procedure did. IDENTICAL, COPY and EMPTY are waived by the same allow_identity; NOTHING is not — see below. The empty case is the more dangerous of the two waivable ones: BaseProcedure._report scores an empty text 1.0, so melting_text returning "" was a satisfied report on a text that was never written.

The message says what was observed and stops there. It does not say the procedure did not run, because the guard cannot tell that from a procedure that ran and drew the identity — which is not a corner case: recombination on two sentences draws the identity permutation for half of all seeds, and boustrophedon turning 'aba' recovers 'aba'. Claiming the stronger thing would be this class committing the fault it exists to catch.

NOTHING is the one exception to that carefulness, and to the waiver: _produce returning [] is not a candidate the procedure judged and rejected, it is the procedure returning no candidate at all, so apply raises this directly rather than through _guard_degenerate — before allow_identity is even consulted. allow_identity exists for a caller who wants the degenerate-but-real result a procedure found; an empty list is not a result, so there is nothing for that flag to waive.

COPY class-attribute instance-attribute

COPY = "the input's letters in the input's order"

EMPTY class-attribute instance-attribute

EMPTY = 'empty text from input that was not empty'

IDENTICAL class-attribute instance-attribute

IDENTICAL = 'text identical to its input'

NOTHING class-attribute instance-attribute

NOTHING = 'nothing at all'

code class-attribute instance-attribute

code = 'degenerate_output'

observed instance-attribute

observed = observed

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.NoCandidateWord

NoCandidateWord(
    procedure_id: str, reason: str | None = None
)

Bases: DenckringError

A generator that needs a real word refuses rather than returning none.

Raised rather than returning text with no candidate in it: silence there would let a caller believe something had been produced when nothing was available to produce it from. reason names what, specifically, offered nothing — a lexicon swap for paragram, a source word for diastic and mesostic — because "no candidate word" alone does not say what a caller should do differently. Left unset, the message is paragram's original one, the first and for a while the only caller.

LEXICON_DEFAULT class-attribute instance-attribute

LEXICON_DEFAULT = "found no one-letter swap of any word into a word the lexicon knows. Try a different text, or check it instead of generating from it."

code class-attribute instance-attribute

code = 'no_candidate_word'

procedure_id instance-attribute

procedure_id = procedure_id

reason instance-attribute

reason = reason or self.LEXICON_DEFAULT

detail

detail() -> dict[str, Any]

reason is in here, not only inside message.

The whole point of giving this error a reason was that an agentic caller learns the true cause — a source word for diastic, a lexicon swap for paragram — and a caller reading the JSON could reach it only by parsing English out of message, which is the thing to_dict exists to avoid.

denckring.MalformedTable

MalformedTable(reason: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'malformed_table'

denckring.MalformedCorpus

MalformedCorpus(reason: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'malformed_corpus'

denckring.MalformedDevice

MalformedDevice(path: str, reason: str)

Bases: DenckringError

A device file exists under a valid id, but its content cannot be read.

Raised instead of letting the underlying YAML or Pydantic error escape. Both quote fragments of the file's own content in their default message — harmless for a device this package ships, not harmless for one read from DENCKRING_DEVICE_PATH, which is arbitrary user-authored YAML. reason is deliberately short and holds nothing read from the file itself: a parser exception's class name, or a count of validation errors, never a value out of the document.

code class-attribute instance-attribute

code = 'malformed_device'

path instance-attribute

path = path

detail

detail() -> dict[str, Any]

denckring.MalformedFigure

MalformedFigure(path: str, reason: str)

Bases: DenckringError

The same failure mode as MalformedDevice, for a figure file.

code class-attribute instance-attribute

code = 'malformed_figure'

path instance-attribute

path = path

detail

detail() -> dict[str, Any]

denckring.UnknownFigure

UnknownFigure(
    figure_id: str, available: list[str] | None = None
)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_figure'

figure_id instance-attribute

figure_id = figure_id

detail

detail() -> dict[str, Any]

denckring.UnknownLevel

UnknownLevel(
    figure_id: str, level: str, available: list[str]
)

Bases: DenckringError

code class-attribute instance-attribute

code = 'unknown_level'

level instance-attribute

level = level

detail

detail() -> dict[str, Any]

denckring.DuplicatePack

DuplicatePack(lang: str, first: str, second: str)

Bases: DenckringError

code class-attribute instance-attribute

code = 'duplicate_pack'

lang instance-attribute

lang = lang

detail

detail() -> dict[str, Any]

denckring.NotConstructive

NotConstructive(procedure_id: str)

Bases: DenckringError

Asked to generate with a procedure that only checks.

The MCP tool built this dict by hand and returned it, which meant one failure mode in this package was not a DenckringError and could not be caught with the others. kind says whether the form admits a generator; constructive in describe says whether this install has one.

code class-attribute instance-attribute

code = 'not_constructive'

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.NoPromptHint

NoPromptHint(procedure_id: str, lang: str)

Bases: DenckringError

A prompt hint was asked for in a language the row has none in.

describe falls back to English and names the substitution in untranslated. prompt_hint returns a bare string with no channel to say so, and a prompt in the wrong language is a different prompt, so it refuses rather than falling back (ADR 0050).

code class-attribute instance-attribute

code = 'no_prompt_hint'

lang instance-attribute

lang = lang

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.UnsetHintParameter

UnsetHintParameter(procedure_id: str, param: str)

Bases: DenckringError

A hint names a parameter whose value, after validation, is None.

None is a real value to a checker — "inferred from the text" — and is valid there, so this is not InvalidParams. It is only a sentence that cannot be written: the hint states the value, and there is none to state (ADR 0050).

code class-attribute instance-attribute

code = 'unset_hint_parameter'

param instance-attribute

param = param

procedure_id instance-attribute

procedure_id = procedure_id

detail

detail() -> dict[str, Any]

denckring.NotWordLocal

NotWordLocal(
    procedure_id: str,
    scope: str,
    unset: list[str] | None = None,
)

Bases: DenckringError

admits or witness was asked of a row that does not judge each word alone.

Answering anyway would be a guess: on a line-scoped row a word has no verdict of its own, and on a tautogram with its initial unset the verdict on a word depends on the text's first. unset names the parameters whose stating would make the row word-local, so a caller knows whether a retry can work.

code class-attribute instance-attribute

code = 'not_word_local'

procedure_id instance-attribute

procedure_id = procedure_id

scope instance-attribute

scope = scope

unset instance-attribute

unset = list(unset or [])

detail

detail() -> dict[str, Any]