Shell Heuristics · application docs

publisher · enricher-v2 · corpus

postcrimedb schema

The canonical datastore is ParadeDB / Postgres postcrimedb (.181), schema postcrime (plus stats). 23 tables, 22 foreign keys. documents is the hub — almost everything references it.

Interactive diagram: open the schema viewer ↗ — drag table cards, pan/zoom, layout saved locally. Focus a subset with ?focus=<table> (e.g. ?focus=cases) or ?tables=a,b,c. Static renders also live in docs/schema/*.svg and docs/postcrime-schema.{svg,pdf,mmd,dbml}. Regenerate with bun run scripts/build-schema-viewer.ts.

Full model

case_facts30026 rows● document_idbigintdefendants_jsontextfirst_act_datetextplea_datetextsentence_datetextmonetary_amountbigintmonetary_currencytextnotestextextracted_attextcases2665 rows● case_numbertextcaptiontextcourttext↗ document_idintegerslugtextcourt_codetextjurisdictiontextjurisdiction_typetextnature_of_suittextplaintifftextdefendants_jsonjsonbdefendant_countbigintlead_entitytextschemetextscheme_slugtextclaims_jsonjsonb+20 more…defendant_dispositions19986 rows● document_idbigint● defendant_nametext↗ entity_idbigintroletextdefendant_classtextdisposition_typetextcharge_datetextdisposition_datetextcharge_counttexttop_chargetextprison_monthstextprobation_monthsbigintsupervised_release_monthsbiginthome_confinement_monthsbigintcooperationtextacceptance_of_responsibilitytext+6 more…doc_chunk_meta1381740 rows● chunk_idinteger↗ document_idintegerchunk_indexintegertext_previewtextspan_startintegerspan_endintegerdoc_chunks1381740 rows● chunk_idinteger↗ document_idintegerembeddingUSER-DEFINEDdoc_page_summaries150 rows● idinteger↗ document_idintegerpage_indexintegerpage_texttextsummarytextchar_countintegerprocessed_attextdocuments37619 rows● idinteger↗ source_idintegerurltextkindtexttitletextpublished_attext↗ case_numbertextcaptiontextrelease_numbertextfetched_attexthttp_statusintegersha256textcontent_typetextbyte_sizebigintbody_pathtextpdf_pathtext+71 more…documents_processing_log0 rows● log_idbigint↗ doc_idbigintstagetextstarted_attextended_attextstatustexterrortextduration_msbigintchunksbigintmetadatatextenrichments11470 rows● doc_idinteger● enrichment_nametextvalue_texttextvalue_jsontextmodeltextprompt_versionintegercreated_atbigintentities231264 rows● idbigintnametextkindtextnormtextmatters2618 rows● matter_idbigintslugtexttitletext↗ primary_case_numbertextlead_entitytextdoc_countbigintcreated_atbigintmentions157491 rows● idbigint↗ document_idbigint↗ entity_idbigint↗ ticker_idtextroletextspan_startbigintspan_endbigintmeta0 rows● keytextvaluetextschema_version0 rows● vbigintscheme_edgar_rules25 rows● idbigintscheme_slugtextscheme_labeltextedgar_formstextmethodtexttargettextmaps_to_heuristictextrationaletextsources3 rows● idintegernametextbase_urltexttask_state7981 rows● tasktext● target_keytextstatustextattemptsbigintlast_errortextlast_tstimestamp_with_time_zonewatermarktimestamp_with_time_zonenext_eligible_attimestamp_with_time_zonetickers0 rows● idintegersymboltextexchangetexttriples432836 rows● idinteger↗ document_idintegersubjecttextverbtextobjecttextconfidencerealtriples_attempts0 rows● document_idbigintattemptsbigintlast_errortextbody_lengthbigintlast_attempted_attexturls40094 rows● urltext↗ source_idintegerkindtextstatetextattemptsintegerlast_errortextenqueued_attextupdated_attextworkflow_runs485917 rows● workflowtext● document_idbigintstatustextattemptsbigintlast_errortextlast_attempt_attextresult_summarytextpanels36 rows● panel_idtextversionintegergenerated_attimestamp_with_time_zonegenerated_at_epochbigintparamsjsonbdatajsonbmetajsonbloaded_attimestamp_with_time_zone

Documents core

The crawl/ingest surface: documents (the hub) with its sources, the urls crawl queue, per-page OCR summaries, and the processing log.

doc_page_summaries150 rows● idinteger↗ document_idintegerpage_indexintegerpage_texttextsummarytextchar_countintegerprocessed_attextdocuments37619 rows● idinteger↗ source_idintegerurltextkindtexttitletextpublished_attextcase_numbertextcaptiontextrelease_numbertextfetched_attexthttp_statusintegersha256textcontent_typetextbyte_sizebigintbody_pathtextpdf_pathtext+71 more…documents_processing_log0 rows● log_idbigint↗ doc_idbigintstagetextstarted_attextended_attextstatustexterrortextduration_msbigintchunksbigintmetadatatextsources3 rows● idintegernametextbase_urltexturls40094 rows● urltext↗ source_idintegerkindtextstatetextattemptsintegerlast_errortextenqueued_attextupdated_attext

Search & vectors

BM25 full-text lives on documents (pg_search); semantic search on doc_chunks.embedding (pgvector, 768-dim) with doc_chunk_meta holding the chunk spans/preview.

doc_chunk_meta1381740 rows● chunk_idinteger↗ document_idintegerchunk_indexintegertext_previewtextspan_startintegerspan_endintegerdoc_chunks1381740 rows● chunk_idinteger↗ document_idintegerembeddingUSER-DEFINEDdocuments37619 rows● idintegersource_idintegerurltextkindtexttitletextpublished_attextcase_numbertextcaptiontextrelease_numbertextfetched_attexthttp_statusintegersha256textcontent_typetextbyte_sizebigintbody_pathtextpdf_pathtext+71 more…

Entities & mentions

Canonical entities (deduped by norm,kind), mentions linking entities and tickers to documents.

documents37619 rows● idintegersource_idintegerurltextkindtexttitletextpublished_attextcase_numbertextcaptiontextrelease_numbertextfetched_attexthttp_statusintegersha256textcontent_typetextbyte_sizebigintbody_pathtextpdf_pathtext+71 more…entities231264 rows● idbigintnametextkindtextnormtextmentions157491 rows● idbigint↗ document_idbigint↗ entity_idbigint↗ ticker_idtextroletextspan_startbigintspan_endbiginttickers0 rows● idintegersymboltextexchangetext

Defendant dispositions

Per-defendant outcomes (plea/verdict/settlement/sanctions) keyed by (document_id, defendant_name), resolved to entities where possible.

defendant_dispositions19986 rows● document_idbigint● defendant_nametext↗ entity_idbigintroletextdefendant_classtextdisposition_typetextcharge_datetextdisposition_datetextcharge_counttexttop_chargetextprison_monthstextprobation_monthsbigintsupervised_release_monthsbiginthome_confinement_monthsbigintcooperationtextacceptance_of_responsibilitytext+6 more…documents37619 rows● idintegersource_idintegerurltextkindtexttitletextpublished_attextcase_numbertextcaptiontextrelease_numbertextfetched_attexthttp_statusintegersha256textcontent_typetextbyte_sizebigintbody_pathtextpdf_pathtext+71 more…entities231264 rows● idbigintnametextkindtextnormtext

Cases & matters

The normalized cases (plaintiff/defendant/jurisdiction/claims/amounts), matters grouping related cases, and case_facts extracted dates/amounts.

case_facts30026 rows● document_idbigintdefendants_jsontextfirst_act_datetextplea_datetextsentence_datetextmonetary_amountbigintmonetary_currencytextnotestextextracted_attextcases2665 rows● case_numbertextcaptiontextcourttext↗ document_idintegerslugtextcourt_codetextjurisdictiontextjurisdiction_typetextnature_of_suittextplaintifftextdefendants_jsonjsonbdefendant_countbigintlead_entitytextschemetextscheme_slugtextclaims_jsonjsonb+20 more…documents37619 rows● idintegersource_idintegerurltextkindtexttitletextpublished_attext↗ case_numbertextcaptiontextrelease_numbertextfetched_attexthttp_statusintegersha256textcontent_typetextbyte_sizebigintbody_pathtextpdf_pathtext+71 more…matters2618 rows● matter_idbigintslugtexttitletext↗ primary_case_numbertextlead_entitytextdoc_countbigintcreated_atbigint

Triples

Subject–verb–object extractions in triples, with triples_attempts tracking per-document extraction state.

documents37619 rows● idintegersource_idintegerurltextkindtexttitletextpublished_attextcase_numbertextcaptiontextrelease_numbertextfetched_attexthttp_statusintegersha256textcontent_typetextbyte_sizebigintbody_pathtextpdf_pathtext+71 more…triples432836 rows● idinteger↗ document_idintegersubjecttextverbtextobjecttextconfidencerealtriples_attempts0 rows● document_idbigintattemptsbigintlast_errortextbody_lengthbigintlast_attempted_attext

Enrichment

Generic enrichments key/value store, workflow_runs gating, and task_state (the enrich-runner lifecycle).

documents37619 rows● idintegersource_idintegerurltextkindtexttitletextpublished_attextcase_numbertextcaptiontextrelease_numbertextfetched_attexthttp_statusintegersha256textcontent_typetextbyte_sizebigintbody_pathtextpdf_pathtext+71 more…enrichments11470 rows● doc_idinteger● enrichment_nametextvalue_texttextvalue_jsontextmodeltextprompt_versionintegercreated_atbiginttask_state7981 rows● tasktext● target_keytextstatustextattemptsbigintlast_errortextlast_tstimestamp_with_time_zonewatermarktimestamp_with_time_zonenext_eligible_attimestamp_with_time_zoneworkflow_runs485917 rows● workflowtext● document_idbigintstatustextattemptsbigintlast_errortextlast_attempt_attextresult_summarytext