aeat.application.registry._corpus module

Application services for registry corpus projections.

Citation services project TopicCatalogue entries and reviewed registry legal references into operator-facing reports. Manual services project extracted manual parts, rules, and verification results. Manual verification can receive a ValidatedRegistryAuthority so manual casilla references are checked against the same validated registry authority as runtime registry workflows.

All services are local and read-only: they load bundled topic, registry, and manual catalogues, then return strict report records for the CLI layer. They do not fetch manuals, mutate registry TOML, or emit bucket events.

class RegistryManualId(*values)[source]

Bases: StrEnum

Manual identifiers approved for the registry manual operator surface.

These values intentionally narrow the wider ManualId domain to the manual families exposed by aeat app registry manuals.

RENTA
IVA
class RegistryTopicProjection(**data)[source]

Bases: BaseModel

Resolved Topic content exposed by registry corpus services.

Topic projections attach localized explanatory text and related legal refs to citation and manual reports without widening those report contracts to the full TopicCatalogue.

Parameters:
  • slug (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • title (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • body (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • see_also (tuple[Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)], ...])

  • legal_refs (tuple[LegalRefId, ...])

slug: _ProjectionText
title: _ProjectionText
body: _ProjectionText
see_also: tuple[_ProjectionText, ...]
legal_refs: tuple[LegalRefId, ...]
class RegistryCitationReferenceProjection(**data)[source]

Bases: BaseModel

One legal document row in the registry citations surface.

The row is derived from reviewed registry LegalReference entries grouped by document id, preserving the document id for article lookup and topic cross-linking.

Parameters:
  • id (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • kind (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • number (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • title (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • published_at (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=10, max_length=None, pattern=None, ascii_only=None)])

  • boe_id (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • boe_url (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • tags (tuple[Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)], ...])

  • articulo_count (int)

  • short_title (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • topic_slugs (tuple[Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)], ...])

id: _ProjectionText
kind: _ProjectionText
number: _ProjectionText
title: _ProjectionText
published_at: _ProjectionDateText
boe_id: _ProjectionText
boe_url: _ProjectionText
tags: tuple[_ProjectionText, ...]
articulo_count: int
short_title: _ProjectionText
topic_slugs: tuple[_ProjectionText, ...]
class RegistryCitationArticleProjection(**data)[source]

Bases: BaseModel

One cited article projection in the registry citations surface.

Built from the current reviewed registry LegalReference entry and its bundled authoritative corpus permalink.

Parameters:
  • numero (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • titulo (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • summary (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • permalink (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

  • cite (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])

numero: _ProjectionText
titulo: _ProjectionText
summary: _ProjectionText
cite: _ProjectionText
class RegistryCitationsListCommand(**data)[source]

Bases: BaseModel

Application command for listing registry citations.

Parameters:

tag (str | None)

tag: str | None
class RegistryCitationShowCommand(**data)[source]

Bases: BaseModel

Application command for showing one registry citation.

Parameters:
  • legal_id (str)

  • articulo (str | None)

legal_id: str
articulo: str | None
class RegistryCitationsListReport(**data)[source]

Bases: BaseModel

Typed report for registry citation listing.

Carries rendered RegistryTopicProjection rows and RegistryCitationReferenceProjection rows from the reviewed legal catalogue.

Parameters:
operation: str
reference_count: int
tag_filter: str | None
topic_count: int
topics: tuple[RegistryTopicProjection, ...]
references: tuple[RegistryCitationReferenceProjection, ...]
class RegistryCitationShowReport(**data)[source]

Bases: BaseModel

Typed report for a single registry citation lookup.

Carries one RegistryCitationReferenceProjection, optional article detail, and related RegistryTopicProjection rows.

Parameters:
operation: str
reference: RegistryCitationReferenceProjection
articulo: RegistryCitationArticleProjection | None
related_topics: tuple[RegistryTopicProjection, ...]
class RegistryCorpusIssueProjection(**data)[source]

Bases: BaseModel

Normalized issue row for registry corpus verification reports.

Used by citation verification and manual verification so CLI payloads carry one stable issue shape even though the underlying domain issues come from different registry and corpus verifiers.

Parameters:
  • level (str)

  • code (str)

  • message (str)

  • reference_id (str | None)

level: str
code: str
message: str
reference_id: str | None
class RegistryCitationsVerificationReport(**data)[source]

Bases: BaseModel

Typed report for registry citation corpus verification.

Parameters:
operation: str
reference_count: int
issue_count: int
issues: tuple[RegistryCorpusIssueProjection, ...]
passed: bool
topic_count: int
topics: tuple[RegistryTopicProjection, ...]
class RegistryManualPartProjection(**data)[source]

Bases: BaseModel

One discovered local ManualPart row.

Parameters:
manual_id: str
year: int
part: str
root: str
class RegistryManualsListCommand(**data)[source]

Bases: BaseModel

Application command for listing registry manuals.

Parameters:
manual: RegistryManualId | None
year: int | None
class RegistryManualShowCommand(**data)[source]

Bases: BaseModel

Application command for showing one registry manual.

Parameters:
manual: RegistryManualId
year: int
part: ManualPart
section: str | None
class RegistryManualRulesCommand(**data)[source]

Bases: BaseModel

Application command for listing registry manual rules.

Parameters:
manual: RegistryManualId
year: int
part: ManualPart
kind: str | None
class RegistryManualVerifyCommand(**data)[source]

Bases: BaseModel

Application command for verifying one registry manual part.

Parameters:
manual: RegistryManualId
year: int
part: ManualPart
class RegistryManualsListReport(**data)[source]

Bases: BaseModel

Typed report for registry manual listing.

Carries discovered RegistryManualPartProjection rows plus topic projections shared with the citation surfaces.

Parameters:
operation: str
manual_filter: str | None
year_filter: int | None
part_count: int
parts: tuple[RegistryManualPartProjection, ...]
topic_count: int
topics: tuple[RegistryTopicProjection, ...]
class RegistryManualSectionProjection(**data)[source]

Bases: BaseModel

One extracted manual section projection.

Parameters:
  • section_id (str)

  • title (str)

  • rule_count (int)

  • paragraph_count (int)

section_id: str
title: str
rule_count: int
paragraph_count: int
class RegistryManualShowReport(**data)[source]

Bases: BaseModel

Typed report for one manual lookup.

When extracted structure is absent, manifest metadata still populates the report with structure_available=False and zero section/chapter counts.

Parameters:
operation: str
manual_id: str
year: int
part: str
title: str | None
source_pdf_url: str
chapter_count: int
section_count: int
structure_available: bool
section: RegistryManualSectionProjection | None
topic_count: int
topics: tuple[RegistryTopicProjection, ...]
class RegistryManualRuleProjection(**data)[source]

Bases: BaseModel

One manual rule projection.

references_casillas preserves typed ManualCasillaReference values so verification can cross-check the rule against ValidatedRegistryAuthority.

Parameters:
rule_id: str
kind: str
section_id: str
references_casillas: tuple[ManualCasillaReference, ...]
class RegistryManualRulesReport(**data)[source]

Bases: BaseModel

Typed report for manual rule listing.

Projects manual rules into RegistryManualRuleProjection rows while preserving typed ManualCasillaReference references for registry cross-checking.

Parameters:
operation: str
manual_id: str
year: int
part: str
kind_filter: str | None
structure_available: bool
rule_count: int
rules: tuple[RegistryManualRuleProjection, ...]
topic_count: int
topics: tuple[RegistryTopicProjection, ...]
class RegistryManualVerificationReport(**data)[source]

Bases: BaseModel

Typed report for manual corpus verification.

Summarizes a ManualVerificationReport as normalized RegistryCorpusIssueProjection rows for the application surface.

Parameters:
operation: str
manual_id: str
year: int
part: str
issue_count: int
error_count: int
warning_count: int
passed: bool
issues: tuple[RegistryCorpusIssueProjection, ...]
topic_count: int
topics: tuple[RegistryTopicProjection, ...]
list_registry_citations(command=None, *, topic_catalogue=None, locale=None)[source]

Return topic-backed citation references from the reviewed legal catalogue.

Returns a RegistryCitationsListReport.

Return type:

RegistryCitationsListReport

Parameters:
show_registry_citation(command, *, topic_catalogue=None, locale=None)[source]

Return one topic-backed citation reference from the reviewed legal catalogue.

Returns a RegistryCitationShowReport with the matched legal document and optional article detail.

Return type:

RegistryCitationShowReport

Parameters:
verify_registry_citations(*, topic_catalogue=None, locale=None)[source]

Verify the reviewed legal catalogue and return a RegistryCitationsVerificationReport.

Return type:

RegistryCitationsVerificationReport

Parameters:
list_registry_manuals(command=None, *, settings=None, topic_catalogue=None, locale=None)[source]

Return discovered local manual parts as a RegistryManualsListReport.

Return type:

RegistryManualsListReport

Parameters:
show_registry_manual(command, *, settings=None, topic_catalogue=None, locale=None)[source]

Return one local manual part as a RegistryManualShowReport.

Return type:

RegistryManualShowReport

Parameters:
list_registry_manual_rules(command, *, settings=None, topic_catalogue=None, locale=None)[source]

Return manual rules as a typed application report.

Returns a RegistryManualRulesReport with the matched rules and whether the manual structure was available for lookup.

Return type:

RegistryManualRulesReport

Parameters:
verify_registry_manual(command, *, settings=None, registry_authority=None, topic_catalogue=None, locale=None)[source]

Verify one local manual part and return a typed application report.

Parameters:
Return type:

RegistryManualVerificationReport

Returns a RegistryManualVerificationReport with verification findings for the requested manual part.

registry_manual_id(value)[source]

Resolve an operator-facing registry manual id.

Returns a RegistryManualId.

Return type:

RegistryManualId

Parameters:

value (str | RegistryManualId | ManualId)