cadrumo.application.review.operator module

Operator-facing projections for the read-only review queue.

Projects ReviewQueue items into ReviewQueueRow records grouped in a ReviewQueueReport, carrying the active BucketId and the public BindingSourceKind selector vocabulary for CLI rendering.

class ReviewQueueRow(**data)[source]

Bases: BaseModel

CLI-ready read-only review queue row.

Parameters:

data (Any)

item_id: str
kind: str
source_kind: str | None
affected_object_id: str
bucket_id: BucketId
modelo: str | None
period: str | None
severity: ReviewSeverity
state: ReviewState
blocking: bool
reason: str
current_owner_surface: str
canonical_next_command: str
since: UtcInstant

The originating review item’s instant, carried under the same contract.

Every ReviewItem validates since as UTC-aware, and this projection is the only thing between that record and the wire. Declared as a bare datetime it re-admitted the naive and non-UTC values the canonical queue refuses, and cross-source sorting is only deterministic while every row’s instant is comparable.

summary: str
legal_refs: tuple[LegalRefId, ...]

Legal references (BOE permalinks or canonical IDs) justifying the finding.

Populated for modelo_finding items from the underlying references_rules. Empty for transaction / invoice items where the obligation is not directly grounded in a registry legal reference.

class ReviewQueueReport(**data)[source]

Bases: BaseModel

Read-only review queue report.

Parameters:

data (Any)

rows: tuple[ReviewQueueRow, ...]
project_review_queue(*, settings=None, kinds=(), source_kinds=(), state=ReviewState.PENDING, modelo=None, confidence_below=None, ports)[source]

Return a ReviewQueueReport using accepted source-kind vocabulary.

When confidence_below is set, the queue narrows to classified transactions whose classification_confidence is non-None and strictly below the threshold, so the operator can triage the lowest-confidence classifications first (see collect()). Invoice and finding rows carry no decision-confidence and are excluded while the filter is active.

Return type:

ReviewQueueReport

Parameters:
project_review_item(item_id, *, settings=None, ports)[source]

Return one review row by id.

Returns a ReviewQueueRow matching item_id.

Return type:

ReviewQueueRow

Parameters: