Expand description
All aggregate operations over the CorTeX PostgresQL store are accessed through the connection of
a Backend object.
Structs§
- Backend
- Provides an interface to the Postgres task store
- Database
Url - The configured database URL, managed as Rocket state so background jobs open their own connection against the same database as the request pool (notably the test database in integration tests).
- Dataset
Export Outcome - The result of an
export_html_datasetrun — the archives written plus tallies, also the body of the*-manifest.jsonprovenance file written alongside them. - Message
Counts - True per-severity message totals for a task (the real counts, before the
DOCUMENT_MESSAGE_CAPsampling cap), so a forensic view can show “showing N of M”. - Report
Summary Row - One report row at a given grain: a
what(the drill-down report), a category-grain rollup (what = None, the “category” report), or the per-severity grand total (category = "",what = None). Distinct-task counts are computed by Postgres at each grain (they are not summable from a finer grain). Stored inreport_grain_cache, populated per scope on demand. - Rerun
Options - Options container for relevant fields in requesting a
(corpus, service)rerun - Sandbox
Outcome - The result of carving a sandbox: the new corpus plus how many entries it captured.
- Sandbox
Selection - The filter that defines a sandbox: a slice of the parent corpus addressed by independent,
intersected task-status and message (
severity/category/what) dimensions (Model C), plus optional entry/limit narrowing. Serialized verbatim into the sandbox corpus’sselectionJSON. - Task
Report Options - An options object describing a CorTeX report request
Enums§
- GroupBy
- How the per-paper HTML files are bucketed into output archives — the sole difference between the two scripts this replaces.
Constants§
- DOCUMENT_
MESSAGE_ CAP - Maximum messages loaded per severity for a single document’s forensic view. A hostile or
pathological document can carry millions of messages of one severity (observed in production: a
single arXiv task with 1.6M warnings); loading them all would allocate gigabytes and hang the
request — an unbounded per-request resource acquisition the design principles forbid. The view
is a sample bounded by this cap; the true per-severity totals are reported separately
(
MessageCounts) so the cap is transparent, never silent.
Functions§
- build_
pool - Builds a lazily-initialized connection pool: connections are established on first checkout, so this never blocks or fails at startup even if the database is momentarily unavailable.
- connection_
at - Constructs a new Task store representation from a Postgres DB address.
- create_
sandbox - Carves a sandbox corpus from
parentusingselection, entirely server-side: it inserts the sandboxcorporarow, then a singleINSERT INTO tasks (...) SELECT ... FROM tasks ...materializes aTODOtask per matched parent entry without ever loading the entries into the application. A 100k-entry carve therefore costs no client RAM and no per-row bind parameters (it sidesteps the 65535-parameter cap a client-side batch insert would hit); the whole carve is one transaction, so it is atomic (no half-built sandbox). Because the matchingSELECTover a large parent can take minutes to an hour, this is meant to run as a background job (corpus_sandbox). - default_
db_ address - The production database postgresql address, from the runtime
crate::configconfiguration - export_
html_ dataset - Export a corpus/service’s converted HTML into ZIP archives bucketed by
GroupBy. - from_
address - Constructs a Backend at a given address
- list_
task_ diffs - Prepares a template-friendly list of task differences
- summary_
task_ diffs - Prepares a template-friendly summary of task differences
- task_
messages - Worker-log messages attached to a
task— the forensic evidence behind that document’s conversion status — loaded through the Diesel-generated row structs (LogInfo…LogInvalid) via theirbelongs_to(Task)association, so the column mapping is compiler-checked. Each is returned as aLogRecordtrait object (which carries its ownseverity()/category()/what()/details()), in info → invalid order. - test_
db_ address - The test database postgresql address, from the runtime
crate::configconfiguration - testdb
- Constructs the default Backend struct for testing
Type Aliases§
- DbPool
- A pool of PostgreSQL connections (Diesel + r2d2).
- Pooled
Conn - A connection checked out from a
DbPool; dereferences to aPgConnection.