Skip to content

Types

The models check, produce and describe return, documented from denckring itself, the import path under the README's stability promise. Where they are defined, under denckring.core, is not.

Checking

denckring.Report

Bases: BaseModel

The result of checking a text. satisfied is always score == 1.0, enforced below rather than left as a constructor convention (P2-02).

estimated property

estimated: bool

Whether the verdict rests on anything this install estimated or left unjudged.

The one signal a caller deciding to leave a verdict unscored should read (audit B8). Until 0.3.2 it had two places to look and neither was enough alone: metrics["estimated_words"] is not under the stability promise, and on some rows counts what no Evidence records (proteus_verse and spoonerism count words read from spelling, definitional_expansion words no gloss resolved); evidence records what the metric does not (the rhyme endings of clerihew and rondeau, which report no such metric). True when either says so. A word left unjudged counts: definitional_expansion scores only the words its glosses resolve, so its verdict covers less of the text than it reads as covering, and describe calls its reading heuristic (ADR 0054). An ambiguous basis does not count: the word was looked up. multiple_constraint carries its constraints' evidence and counts, so a composite is estimated when any constraint inside it is.

Computed, not stored, so it cannot disagree with the report it describes, and added beside the other fields rather than changing any of them. It reads a metrics key the library owns; a caller reads this instead. N+7's ambiguous_words is not an estimate: it counts words a reading policy (ambiguous_nouns) decides, and the verdict states that policy.

evidence class-attribute instance-attribute

evidence: list[Evidence] = Field(default_factory=list)

metrics class-attribute instance-attribute

metrics: dict[str, float] = Field(default_factory=dict)

model_config class-attribute instance-attribute

model_config = ConfigDict(validate_assignment=True)

procedure instance-attribute

procedure: str

provenance class-attribute instance-attribute

provenance: Provenance | None = None

satisfied instance-attribute

satisfied: bool

score class-attribute instance-attribute

score: float = Field(ge=0.0, le=1.0)

violations class-attribute instance-attribute

violations: list[Violation] = Field(default_factory=list)

denckring.Violation

Bases: BaseModel

One place where a text fails a procedure.

expected instance-attribute

expected: str

found instance-attribute

found: str

note class-attribute instance-attribute

note: str | None = None

offset class-attribute instance-attribute

offset: int | None = None

rule instance-attribute

rule: str

denckring.Evidence

Bases: BaseModel

One measurement a verdict rests on, and how it was obtained.

metrics["estimated_words"] has carried the uncertainty since the beginning, and it carries it as a single number: a haiku report could say that two of its words were guessed and never which two. A reader repairing the line, or an auditor deciding whether to trust the verdict, needs the second thing.

basis is a closed set rather than a confidence score. The pack knows whether a count came out of a dictionary or was estimated, and that is the whole of what this field says. English has two estimates since 0.3.2, the spelling heuristic and a reading through a dictionary stem (awakes from awake), and both report estimated without saying which. Attaching 0.94 to either would invent a precision no measurement here supports, which is what the review that asked for this warned against in its own last paragraph.

ambiguous (0.4.0, ADR 0054) is the dictionary listing more than one reading of the word, any one of which the checker would accept: every counted as 3 or 2 syllables, bog rhyming on either vowel. Looked up, not estimated, so it does not make a report estimated; it says the verdict may rest on a variant rather than the first form. dictionary now means the checker read the word one way. German evidence is never ambiguous: Wiktionary's list for a headword carries its inflected forms' transcriptions unmarked (du with deiner's), so German syllable counts, stress and rhyme read the first transcription only (ADR 0054, ADR 0057).

scope exists because the answer is not always about a word. French counts a line — a final mute e elides or counts depending on what follows, so summing citation forms undercounts systematically (ADR 0034) — and there is no per-word breakdown to report. Saying so is better than manufacturing one.

basis instance-attribute

basis: Literal['dictionary', 'ambiguous', 'estimated']

offset class-attribute instance-attribute

offset: int | None = None

scope class-attribute instance-attribute

scope: Literal['word', 'line'] = 'word'

subject instance-attribute

subject: str

value instance-attribute

value: str

Producing

denckring.Production

Bases: BaseModel

What a generator turned out. Report's counterpart for the other half.

check has returned a structured verdict since the beginning while apply returned a bare string, so a generator that found several valid answers had one place to put one of them. paragram scores every candidate it finds and discards all but the best; anagram found 47 covers of dormitory behind the one apply returns. This is where the rest go.

candidates class-attribute instance-attribute

candidates: list[Candidate] = Field(min_length=1)

metrics class-attribute instance-attribute

metrics: dict[str, float] = Field(default_factory=dict)

procedure instance-attribute

procedure: str

provenance class-attribute instance-attribute

provenance: Provenance | None = None

texts property

texts: list[str]

The candidates' texts, in the same order.

A computed_field and not a plain @property: apply --json and the MCP surface both read texts out of model_dump(), and a plain property is absent from it. Kept rather than removed because it is the shape every existing consumer already reads, and ADR 0026 made texts[0] the definition of apply.

truncated class-attribute instance-attribute

truncated: bool = False

Describing

denckring.Meta

Bases: BaseModel

A catalogue entry. The single source of truth for a procedure's description.

Frozen, with its list-shaped fields as tuples: catalogue.get() returns the same cached object to every caller (P2-01), so a mutable Meta let one caller's introspection silently change what a registered procedure requires for every future check() call. names, definitions and prompt_hints (and hint_omits) stay plain dicts — no demonstrated mutation path reached them, and freezing a dict field needs a different mechanism than a tuple swap; that residual is deliberate, not overlooked.

aliases class-attribute instance-attribute

aliases: tuple[str, ...] = Field(default_factory=tuple)

apply_requires class-attribute instance-attribute

apply_requires: tuple[str, ...] = Field(
    default_factory=tuple
)

attested class-attribute instance-attribute

attested: Attestation = 'codified'

attribution instance-attribute

attribution: Attribution

checkability instance-attribute

checkability: Checkability

definitions instance-attribute

definitions: dict[Lang, str]

deterministic class-attribute instance-attribute

deterministic: bool = True

family instance-attribute

family: Family

hidden_material class-attribute instance-attribute

hidden_material: tuple[str, ...] = Field(
    default_factory=tuple
)

hint_omits class-attribute instance-attribute

hint_omits: dict[str, str] = Field(default_factory=dict)

id instance-attribute

id: str

kind instance-attribute

kind: Kind

languages instance-attribute

languages: tuple[Lang, ...]

layer class-attribute instance-attribute

layer: Layer = 'verfahren'

model_config class-attribute instance-attribute

model_config = ConfigDict(frozen=True)

names instance-attribute

names: dict[Lang, str]

notes class-attribute instance-attribute

notes: str | None = None

prompt_hints class-attribute instance-attribute

prompt_hints: dict[Lang, str] = Field(default_factory=dict)

requires class-attribute instance-attribute

requires: tuple[str, ...] = Field(default_factory=tuple)

source instance-attribute

source: str

unique_answer class-attribute instance-attribute

unique_answer: bool = False

denckring.Description

Bases: BaseModel

Everything a model needs to use one procedure.

apply_missing instance-attribute

apply_missing: list[str]

apply_params instance-attribute

apply_params: dict[str, Any]

apply_requires instance-attribute

apply_requires: list[str]

checkability instance-attribute

checkability: str

checker_version instance-attribute

checker_version: int

constructive instance-attribute

constructive: bool

corpus instance-attribute

corpus: CorpusShare

definition instance-attribute

definition: str

family instance-attribute

family: str

hidden_material class-attribute instance-attribute

hidden_material: list[str] = Field(default_factory=list)

id instance-attribute

id: str

kind instance-attribute

kind: str

languages instance-attribute

languages: list[str]

metrics class-attribute instance-attribute

metrics: dict[str, str] = Field(default_factory=dict)

missing instance-attribute

missing: list[str]

name instance-attribute

name: str

params instance-attribute

params: dict[str, Any]

prompt_hints instance-attribute

prompt_hints: str | None

reading instance-attribute

reading: Reading

requires instance-attribute

requires: list[str]

rules class-attribute instance-attribute

rules: list[str] = Field(default_factory=list)

runnable instance-attribute

runnable: bool

runs_in instance-attribute

runs_in: list[str]

scholarly class-attribute instance-attribute

scholarly: Scholarly | None = None

unique_answer class-attribute instance-attribute

unique_answer: bool = False

untranslated instance-attribute

untranslated: list[str]

denckring.Counting

Bases: BaseModel

How a row that totals letter values counts them (ADR 0061 D4).

case_sensitive instance-attribute

case_sensitive: bool

case_switch class-attribute instance-attribute

case_switch: str | None = None

combine instance-attribute

combine: Literal['sum']

every_occurrence instance-attribute

every_occurrence: bool

folds instance-attribute

folds: str

model_config class-attribute instance-attribute

model_config = ConfigDict(frozen=True)

skipped instance-attribute

skipped: str

subtractive instance-attribute

subtractive: bool

values instance-attribute

values: dict[str, int]

denckring.Summary

Bases: BaseModel

One catalogue row, compact enough to list eighty of.

constructive instance-attribute

constructive: bool

definition instance-attribute

definition: str

family instance-attribute

family: str

id instance-attribute

id: str

kind instance-attribute

kind: str

name instance-attribute

name: str

runnable instance-attribute

runnable: bool

denckring.Scholarly

Bases: BaseModel

Where a procedure comes from. Returned only when asked for.

aliases instance-attribute

aliases: list[str]

attested instance-attribute

attested: str

attribution instance-attribute

attribution: str

notes instance-attribute

notes: str | None

source instance-attribute

source: str

denckring.CheckerChange

Bases: BaseModel

One entry of a row's checker history.

model_config class-attribute instance-attribute

model_config = ConfigDict(frozen=True)

reason instance-attribute

reason: str

since instance-attribute

since: str

version instance-attribute

version: int

denckring.Lang module-attribute

Lang = Literal['en', 'de', 'fr']

Language data

denckring.PackProvenance

Bases: BaseModel

Which pack answered, and what it was reading.

data class-attribute instance-attribute

data: dict[str, str] = Field(default_factory=dict)

digests class-attribute instance-attribute

digests: dict[str, str] = Field(default_factory=dict)

lang instance-attribute

lang: str

pack instance-attribute

pack: str

denckring.PosTag

Bases: NamedTuple

One token's reading in its sentence.

known is the honesty field and the reason this is a triple rather than a pair. A tagger answers for every token, including one it has never seen, by falling back on suffix and shape features — so unlike syllable_count's exact there is no tier at which the answer is looked up rather than modelled. What can be said is whether the form was in the training data at all, and a row that reports a violation on a token where it was not must say so. ADR 0045.

known instance-attribute

known: bool

upos instance-attribute

upos: str

verb_form instance-attribute

verb_form: VerbForm | None

The golden corpus

denckring.GoldenCase

Bases: BaseModel

One recorded example, positive or negative, for a procedure.

Published as denckring.GoldenCase and read through denckring.golden_cases, which documents the fields; the rest of this module stays internal.

lang class-attribute instance-attribute

lang: Lang = 'en'

max_score class-attribute instance-attribute

max_score: float | None = None

min_score class-attribute instance-attribute

min_score: float | None = None

name instance-attribute

name: str

params class-attribute instance-attribute

params: dict[str, Any] = Field(default_factory=dict)

procedure instance-attribute

procedure: str

provenance class-attribute instance-attribute

provenance: CaseProvenance = 'constructed'

requires class-attribute instance-attribute

requires: list[str] = Field(default_factory=list)

satisfied instance-attribute

satisfied: bool

source class-attribute instance-attribute

source: str | None = None

text instance-attribute

text: str

denckring.CorpusShare

Bases: BaseModel

How a row's golden cases divide by where their text came from (ADR 0062).

external_passing and external_failing split the externally sourced cases by the verdict each records, since a published near-miss is evidence about the reading too. Counted over every shipped case, whatever this install can run, so the answer is the same on every install. gap is the reason the evidence gap registry gives for the row, or None; the corpus guards keep it None on every row with an external case.

constructed instance-attribute

constructed: int

external_failing instance-attribute

external_failing: int

external_passing instance-attribute

external_passing: int

gap instance-attribute

gap: GapReason | None

model_config class-attribute instance-attribute

model_config = ConfigDict(frozen=True)

self_generated instance-attribute

self_generated: int