Skip to main content

Module models

Module models 

Source
Expand description

Backend models and traits for the CorTeX “Task store”

Structs§

AuditEntry
A recorded admin action (the read model for the audit view). Not Serialize directly — like the other timestamped models, the JSON/API surface uses a DTO with a formatted-string at (chrono’s serde feature is intentionally off crate-wide).
Corpus
A minimal description of a document collection. Defined by a name, path and simple/complex file system setup.
DiffStatusFilter
A collection of filters for task status history reports
DiffStatusRow
A single report row for the diff-summary feature
HistoricalRun
Historical (Corpus, Service) run records
HistoricalTask
Historical (Corpus, Service) run records
HistoricalTaskReport
A reportable historical task
LogError
An error message, as per the LaTeXML convention
LogFatal
A fatal message, as per the LaTeXML convention
LogInfo
An info/debug message, as per the LaTeXML convention
LogInvalid
An invalid message, as per the LaTeXML convention
LogWarning
A warning message, as per the LaTeXML convention
NewAuditEntry
An admin action to record.
NewCorpus
Insertable Corpus struct
NewHistoricalRun
A new task, to be inserted into CorTeX
NewHistoricalTask
A new task, to be inserted into CorTeX
NewLogError
A new, insertable, error message
NewLogFatal
A new, insertable, fatal message
NewLogInfo
A new, insertable, info/debug message
NewLogInvalid
A new, insertable, invalid message
NewLogWarning
A new, insertable, warning message
NewSandboxCorpus
Insertable for a sandbox corpus — a NewCorpus plus the parent link and the filter predicate that defines it. Kept separate from NewCorpus so ordinary corpus creation (the import path, and dozens of test fixtures) stays a 4-field literal; the two sandbox columns are nullable, so a plain NewCorpus insert simply leaves them NULL.
NewService
Insertable struct for Service
NewTask
A new task, to be inserted into CorTeX
NewTaskRuntime
A new, insertable per-task conversion runtime — the denormalized twin of the Info:runtime_ms:<N> log row, with the task’s service_id inlined so the per-service runtime report aggregates without a tasks join. Written on the finalize path (mark_done).
NewWorkerMetadata
Metadata collection for workers, updated by the dispatcher upon zmq transactions
RunMetadata
A JSON-friendly data structure, used for the frontend reports
RunMetadataStack
A JSON-friendly data structure, used for vega-lite Stack figures https://vega.github.io/vega-lite/docs/stack.html
Service
A CorTeX processing service
Session
A server-side admin session.
Task
A CorTeX task, for a given corpus-service pair
TaskRunMetadata
A single report row for the diff-historical feature
WebauthnCredential
An enrolled passkey row. credential is the serialized Passkey (public key + signature counter + metadata) — public data only.
WebauthnUser
A WebAuthn user: the stable handle credentials are bound to, one per admin owner.
WorkerMetadata
Metadata collection for workers, updated by the dispatcher upon zmq transactions
WorkerMetadataSender
A cloneable, non-blocking handle the ventilator and sink use to enqueue worker-metadata events. Sends never block the dispatch hot loop: if the background writer is saturated the event is dropped (see [METADATA_QUEUE_BOUND]).

Constants§

SESSION_TTL_DAYS
How long a session is valid from creation. Absolute expiry — no per-request sliding write, so an authenticated request costs one indexed lookup and zero writes (performance).

Traits§

LogRecord
Log actor trait, assumes already Identifiable (for id())

Functions§

iso_utc_system
Formats a SystemTime as an RFC 3339 UTC timestamp (seconds precision) — the zone-unambiguous form the UI localizes to the viewer’s zone (public/js/localtime.js); empty timestamps render as an empty cell.
lower
SQL LOWER(), for case-insensitive corpus-name matching in find_by_name.
start_metadata_writer
Spawns the single background worker-metadata writer and returns a cloneable WorkerMetadataSender. The writer drains events and applies the race-free upserts on pooled connections; it exits cleanly once every sender has dropped. This bounds metadata bookkeeping to one thread regardless of dispatch rate — replacing the unbounded thread-per-event spawn (KNOWN_ISSUES D-1) — while keeping the DB work off the dispatch hot path.

Type Aliases§

HistoricalReportOverview
A historical overview contains the list of labels for all dates where a snapshot was taken, followed by pairs of reports for tasks at the previous date and current date chosen.
StatusChangeMatrix
The result of HistoricalTask::status_change_matrix: the available snapshot-date labels (newest first) and the (previous_status, current_status, task_count) transition cells.
lower
The return type of lower()