Skip to content

Services & ownership

Partial

Current ownership includes direct Next app SQL and document jobs inside product-worker. Future boundaries are labelled.

Code and tests

Ownership follows the service that reads or changes a resource. The table distinguishes running processes from capabilities that still need implementation.

ComponentStatusResponsibility
Next appImplementedBrowser UI, Clerk sessions, same-origin gateway and some direct product database access
Product APIPartialWorkspace commands and authorization; some app routes still access product data directly
Product workerImplementedDurable task execution, document jobs, evidence checks and provider accounting
Document engineImplementedIngestion and export jobs inside the product worker
Separate document serviceTargetNo independent process or service contract is implemented
Document parserImplementedSeparate process for bounded parsing and OCR
Legal CorePartialSearch and pinned source reads are implemented; specialist analytics and classification execution remain incomplete
Corpus workerPartialPrepared source/global imports and indexing exist; full acquisition/enrichment pipelines do not
Public Legal APIPartialPreview facade; production integration management is incomplete
MCP adapterTargetNo implemented server in this repository

Private document jobs need the same tenant scope, revision checks and accounting as the task that requested them. Keeping those jobs inside the product worker lets them use the existing product transactions; the parser only receives the bytes it needs. It does not decide who may read a project.

Product-to-legal access goes through workload-authenticated HTTP. The separate legal database roles prevent a product query from bypassing legal publication and content checks. Enforcement is in services/legal-core-api/internal/auth/, corpus readable views and TestLegalBaseline in internal/migrations/postgres_integration_test.go.

DBOS and the model gateway are embedded worker packages. Durable execution explains committed work; Model gateway owns provider-call behavior. Moving all product SQL behind Product API is a target refactor, not an existing security guarantee.