Expand description
Backend models and traits for the CorTeX “Task store”
Structs§
- Audit
Entry - A recorded admin action (the read model for the audit view). Not
Serializedirectly — like the other timestamped models, the JSON/API surface uses a DTO with a formatted-stringat(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.
- Diff
Status Filter - A collection of filters for task status history reports
- Diff
Status Row - A single report row for the diff-summary feature
- Historical
Run - Historical
(Corpus, Service)run records - Historical
Task - Historical
(Corpus, Service)run records - Historical
Task Report - A reportable historical task
- LogError
- An error message, as per the
LaTeXMLconvention - LogFatal
- A fatal message, as per the
LaTeXMLconvention - LogInfo
- An info/debug message, as per the
LaTeXMLconvention - LogInvalid
- An invalid message, as per the
LaTeXMLconvention - LogWarning
- A warning message, as per the
LaTeXMLconvention - NewAudit
Entry - An admin action to record.
- NewCorpus
- Insertable
Corpusstruct - NewHistorical
Run - A new task, to be inserted into
CorTeX - NewHistorical
Task - A new task, to be inserted into
CorTeX - NewLog
Error - A new, insertable, error message
- NewLog
Fatal - A new, insertable, fatal message
- NewLog
Info - A new, insertable, info/debug message
- NewLog
Invalid - A new, insertable, invalid message
- NewLog
Warning - A new, insertable, warning message
- NewSandbox
Corpus - Insertable for a sandbox corpus — a
NewCorpusplus the parent link and the filter predicate that defines it. Kept separate fromNewCorpusso ordinary corpus creation (the import path, and dozens of test fixtures) stays a 4-field literal; the two sandbox columns are nullable, so a plainNewCorpusinsert simply leaves themNULL. - NewService
- Insertable struct for
Service - NewTask
- A new task, to be inserted into
CorTeX - NewTask
Runtime - A new, insertable per-task conversion runtime — the denormalized twin of the
Info:runtime_ms:<N>log row, with the task’sservice_idinlined so the per-service runtime report aggregates without atasksjoin. Written on the finalize path (mark_done). - NewWorker
Metadata - Metadata collection for workers, updated by the dispatcher upon zmq transactions
- RunMetadata
- A JSON-friendly data structure, used for the frontend reports
- RunMetadata
Stack - A JSON-friendly data structure, used for vega-lite Stack figures https://vega.github.io/vega-lite/docs/stack.html
- Service
- A
CorTeXprocessing service - Session
- A server-side admin session.
- Task
- A
CorTeXtask, for a given corpus-service pair - Task
RunMetadata - A single report row for the diff-historical feature
- Webauthn
Credential - An enrolled passkey row.
credentialis the serializedPasskey(public key + signature counter + metadata) — public data only. - Webauthn
User - A WebAuthn user: the stable handle credentials are bound to, one per admin
owner. - Worker
Metadata - Metadata collection for workers, updated by the dispatcher upon zmq transactions
- Worker
Metadata Sender - 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
SystemTimeas 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 infind_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§
- Historical
Report Overview - 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.
- Status
Change Matrix - 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()