"""Closed authority-grade vocabulary for modelo registry revisions.A registry revision declares one temporal selector, and that selector was for along time read as the answer to three different questions: which filing years theform legally applies to, which years the project holds evidence for, and whichyears a runtime surface may serve as filing authority. Nothing in the treedistinguished a revision that only knows *when a modelo is due* from one that cancompute its amounts and back an export. :class:`RegistryAuthorityGrade` closesthat vocabulary so the distinction is a typed declaration rather than aninference from how many fragments a revision happens to carry.The grade is *declared*, not derived - and only in one direction. Demotion is afact the corpus can compute: a revision whose formula family is empty cannotclaim to calculate. Promotion is an attestation about evidence a human has read,so no program, migration or bulk command may raise a revision's grade. Thedeclaration is therefore a claim registry validation checks against the familiesthe revision actually resolves; a grade that outruns them refuses at build, whichis what keeps the field from being aspirational.Absence is the fail-closed ungraded state, read through:data:`UNDECLARED_REGISTRY_AUTHORITY_GRADE`: an undeclared revision reaches only:attr:`RegistryAuthorityGrade.APPLICABILITY` scope, so it stays a visiblebacklog entry rather than a silent pass. Absence is deliberately NOT the samevalue as a declared ``applicability`` grade even though both read as the samescope - one is a claim somebody made, the other is the absence of one, and alater corpus-completeness check needs to tell them apart.This enum is deliberately distinct from the review vocabulary in:mod:`.revision_review`, which is easy to confuse with it: ``RevisionReviewStatus``records *who has signed off* on a revision, and this enum records *how far therevision's authority reaches*. A revision can be operator-reviewed and still onlycarry applicability data; a revision can carry a complete calculation closure andnever have been reviewed. Neither implies the other, so they are two fields.Hydration happens at the registry loader boundary: registry TOML stays free-formand the ``revision.toml`` token is coerced into a member before strict schemavalidation, so an unknown grade fails registry load rather than a downstreambranch on a string."""from__future__importannotationsfromenumimportStrEnum
[docs]classRegistryAuthorityGrade(StrEnum):"""How far one modelo registry revision's declared authority reaches. The members form a ladder of increasing claim, each rung requiring everything the rung below it requires. Which families a rung demands is a question about *dispositions*, not raw population - a family may be honestly resolved as not applicable, with a reason and legal references - so an informative modelo carrying export layouts and no formulas can legitimately reach :attr:`FILING`. Registry build validation owns that rule; this enum owns only the vocabulary. """APPLICABILITY="applicability""""The revision knows when the modelo is due and to whom it applies. Scheduling and deadline reach only. This is also the scope an undeclared grade reads as, per :data:`UNDECLARED_REGISTRY_AUTHORITY_GRADE`. """CALCULATION="calculation""""The revision can additionally compute the modelo's amounts. Everything :attr:`APPLICABILITY` asserts, plus a resolved calculation closure wherever the formula family applies. """FILING="filing""""The revision can additionally back a filing draft and its export. The top rung: everything the lower rungs assert, with every family the revision enrols resolved rather than left pending evidence. """
UNDECLARED_REGISTRY_AUTHORITY_GRADE:RegistryAuthorityGrade=RegistryAuthorityGrade.APPLICABILITY"""The scope an undeclared ``authority_grade`` reads as - the fail-closed floor.Reading absence as the LOWEST rung rather than the highest is what makes thefield safe to land optional: a revision nobody has graded confers schedulingreach and nothing more, so an ungraded corpus degrades to advisory visibilityinstead of silently presenting every revision as filing authority. Named hererather than open-coded as ``grade or APPLICABILITY`` at each consumer, so thefloor is one decision and a later change to it cannot land half-swept."""__all__=["UNDECLARED_REGISTRY_AUTHORITY_GRADE","RegistryAuthorityGrade"]