Repository navigation
Releases
v0.2.0
@liasse/server 0.2.0
Minor Changes
-
57b9e49: A document in
needs_reviewsays what to review.GET /documents/:id?include=reviewandget_documentreturn areviewpart: the current threshold, the reasons the document is flagged (low_confidence,type_pending_extraction,type_fallback,type_untyped,reextraction_failed,flagged_at_settlement,rejected_values), and how sure the pipeline is of its type and of each core value and field, with the page and quote it was read from.A correction (
PATCH /documents/:id,update_document) takesconfirm, the core values or fields that are right as they are, each with the value it was read with: a confirmation never rewrites the value, makes it manual and clearsneeds_reviewlike a correction. A value that changed since it was read refuses the correction withvalue_changed.The web UI shows a flagged document with a "To review" card: the reasons in sentences, the type to accept or change, and each doubtful value to accept, reject or edit, sent as one correction; a change of type leaves the fields to the extraction for the new type.
-
7db033b: The state of consolidation runs can be followed:
GET /consolidation/runs(listConsolidationRunsin the SDK) lists the latest runs with their status, attempts and the error of a failed attempt. The Changes screen of the web UI shows where the latest run stands, follows it until it ends, says when it finished or failed, and reads the changes again.CONSOLIDATION_TRIGGERSandConsolidationTriggernow come from@liasse/contract/domain, no longer from@liasse/core/consolidation. -
3e9b8c4: A correction (
PATCH /documents/:id,update_document) can set or clearcore.key_dates, where it answeredunsupported_field. The list given replaces the key dates of the document in its core and in whatupcominganswers, in one transaction, and a later extraction keeps it. Each date is akind, adateand alabelof at most 200 characters, each kind once per date and at most 50 dates. The notice deadline of a renewal date is still computed from the notice period the document states: anotice_deadlinegiven next to a renewal date of such a document is refused (invalid_value).upcomingno longer flags ascomputeda date a person gave.key_datesstill cannot be confirmed; the refusal now says to give the dates incore.key_datesinstead.The notice period an extraction reads is now stored with the document (migration
0020): a document extracted before this version gets no notice deadline for the key dates a person gives until it is extracted again. -
12f6a23: The
entityfilter of search keeps the documents that name the entity in any entity field, incoreor in the fields of their type, each item of a list field included, where it readissuerandrecipientonly.GET /documents(listDocumentsof the SDK) takes the sameentityfilter, by the id of the entity. The document list of the web UI has an entity filter, picked by a name or an alias, which applies to the list and to its search. -
3e9b8c4: The
reviewpart of a document (GET /documents/:id?include=review,get_documentwithinclude: ["review"]) names the values the last extraction dropped:rejectionslists them bysection(core,fields,extra,facts,subjects,notice_period),name,reason(malformed,quote_not_found,quote_not_stating_value,invalid_value,invalid_key,duplicate_of_field,over_limit,unresolved_entity,sensitive_identifier,identifier_not_in_text) andcount, never the value or its quote. A document extracted before this change has only itsrejected_valuescount, and an emptyrejections.The extraction prompt says what each core field holds:
core.amountis only an amount due, invoiced or paid, never a share capital, a payroll or a coverage limit, and a field for a place of issuance, a registry or an authority is not filled with the address of a registered office, an establishment or the recipient. A value the model puts inextraunder the name of an empty field of the type is now read as that field, where it was dropped. -
16fa6f7: A graph of the archive.
GET /graph(graphof the SDK) answers the most recent documents with their types and parents, the subjects they are about and the entities they name, and the links found between documents, private documents only when asked. The web UI draws it on a Graph page: pan and zoom, hide a kind of node, and select a node to see what it is joined to and open its document or type. -
69d6c97: A consolidation run can be asked for by hand:
POST /consolidation/runs(requestConsolidationRunin the SDK) queues one at once, unless a run due at once already waits, and the Changes screen of the web UI has a "Run consolidation" button. -
c5747d8: MCP gains the surface REST had alone. Agents manage types:
create_typecreates a provisional type by hand,suggest_typedrafts one with the text model,request_consolidation_runasks for a consolidation run andlist_consolidation_runsfollows the latest ones. They also list documents (list_documents, with the filters ofGET /documents, theneeds_reviewqueue included), read the whole processing log of a document (list_document_events), delete a document (delete_document) and list subjects (list_subjects). Each tool calls the use case of its REST route and answers the same thing. -
3e9b8c4: Classification no longer files a document under an unrelated type. The model reuses a candidate only when it truly describes the document, and proposes a new type otherwise. A new type that cannot be created (daily quota reached, private document with an external embedder, proposal refused twice) leaves the document without a type, in
needs_review, instead of giving it the closest candidate with a confidence of 0: the type provenance and thereviewpart say why inrefusal(quota_exceeded,private_document,invalid_proposal,rejected_type), and theclassificationevent intype_refusal. The outcomefallbackis no longer assigned; documents classified before keep it.reclassify_document(POST /documents/:id/reclassify) whose new type cannot be created changes nothing: the document keeps its type, values and status, and a failedclassificationevent carries the reason as itserror_code. Withnew_type, a slug that names another existing type is refused instead of taken.The description of the MCP tool
create_typesays it is the way to file such a document: it is outside the daily quota of classification, andupdate_documentthen sets the type. The web UI says why a document has no type. -
8b07058: Require Node 22.12 or later on the 22 line, 24.22.3 or later on the 24 line, or 26.5.1 or later. Earlier Node 24, 25 and 26 releases bundle an undici whose
fetchcan throw an uncaughtEINVALfromsetTypeOfServiceon macOS when a new connection is reset, which ends the process (nodejs/undici#5547). The server now refuses to start on such a Node, with a message that names the supported versions.@liasse/contractand@liasse/sdkkeep Node 22.12 or later. -
c95f7a1: The first account is created from the web UI. While no account exists, each start prints a one-time setup token to stderr with the onboarding URL (
PUBLIC_URL/ui/).GET /api/setupsays whether setup is needed,POST /api/setup/checktries settings with the token, andPOST /api/setupcreates the account and saves the settings together, applied at once (getSetupStatus,checkSetupandcompleteSetupof the SDK). Attempts are limited to 5 a minute per client address, as for sign-in.Breaking:
AUTH_BOOTSTRAP_EMAILandAUTH_BOOTSTRAP_PASSWORDare no longer read: the server refuses to start while one is set, and names it. Remove them from.env(and from a Coolify application); an existing account is kept, and a new database is set up with the printed token. -
6910894: The type of a settled document can be decided again when the one it got is wrong:
POST /documents/:id/reclassifyanswers 202 with the document, the MCP toolreclassify_documentdoes the same, and the SDK hasreclassifyDocument. The request may carry ahint(cut to the length of an upload hint) andnew_type, which asks for a new type only. Areclassify_documentjob asks the model again without the rejected type, tells it that a person said that type is wrong and what they added, then changes the type as a manual correction does, with the provenance of the model, and queues the re-extraction that settles the document. A document that is notindexedorneeds_review, or has a processing, re-extraction or reclassification pending, is refused (document_not_settled); an unknown or deleted one is not found. The hint waits on the document (documents.reclassification_hint, blanked by a deletion), never in the job.@liasse/contractnow holds the definitions of the core fields (CORE_FIELDS,CORE_FIELD_NAMES,KEY_DATES_FIELDin/registry, no longer exported by@liasse/core/registry) andSETTLED_STATUSES(in/domain), and the edit tab of the web UI edits every core field with the editor of its definition, filled or not, and chooses the type of a document by hand, as a correction. -
3e9b8c4: The values of a settled document can be extracted again for the type it has, without changing or deciding its type again:
POST /documents/:id/reextractanswers 202 with the document, the MCP toolreextract_documentanswers its id and status, and the SDK hasreextractDocument. The request queues thereextract_documentjob under the row lock of the document, with the refusals of a reclassification (document_not_settledfor a document on its way, failed, or with a processing, re-extraction or reclassification pending); values corrected or confirmed by hand are kept.retry_documentis unchanged and still refuses any document that did not fail....
v0.1.0
@liasse/server 0.1.0
Minor Changes
-
edaa336: Authentication moves to better-auth: accounts with a password, database sessions that survive a restart, API keys, and OAuth 2.1 for MCP clients. The first account is created at startup from
AUTH_BOOTSTRAP_EMAILandAUTH_BOOTSTRAP_PASSWORDwhile no account exists;AUTH_SECRET(32 characters or more) andAUTH_SESSION_TTL(7d) configure the sessions.The REST API takes an API key as
Authorization: Bearer <key>or the session cookie, and a change made with the cookie needs theOriginofPUBLIC_URL./mcptakes an API key or an OAuth access token issued forPUBLIC_URL/mcp(whenPUBLIC_URLis https or on the loopback), never the cookie, and answers a refused request with the RFC 9728 challenge. The auth server answers under/api/authand its discovery documents under/.well-known; sign-in is limited to 5 attempts a minute per socket address.The web UI is always mounted under
/ui. It signs in with an email and a password, changes the password, creates, lists and revokes API keys, and holds the login and consent pages of the OAuth flow.@liasse/contractexportsAUTH_BASE_PATH,MIN_PASSWORD_LENGTHandMAX_PASSWORD_LENGTH.@liasse/corehas a newauthsubpath and a migration for the tables of better-auth. -
01cc23c: The server processes documents. It binds the pipeline: an uploaded or watched document is read, classified, extracted and indexed by the
process_documentjob,reextract_document,reindex_documentanddetect_linksrun too. At startup, a document on its way that no queued or running job will take further is failed with the codestale.PATCH /documents/:id,GET /subjectsandGET /upcominganswer instead of 501; only consolidation (GET /changes,POST /changes/:id) still answers 501, and the startup notice now says so.With
HINDSIGHT_URLset, ahindsight_syncjob is queued once a document is indexed, and in the transaction of a correction that flips itsprivateflag.The pipeline queues
detect_linksin the transaction that settles a document, and again after each re-extraction, so a superseded or terminated contract drops out ofupcomingand no longer counts in the state of its subject. The OpenAPI document describes the answers ofGET /subjectsandGET /upcoming(listSubjectsOutputSchemaandupcomingOutputSchemaare exported by@liasse/core/api).@liasse/core/testingexportsstartStubServer,chatCompletionandembeddings, for tests that answer model calls locally.listSubjects(@liasse/core/knowledge) lists the subjects a reader may see, oldest first, with their names and number of visible documents, filtered by kind and by a query read asgetSubjectreads it, at most 100 by default withtruncated.PipelineDepstakesonPrivacyChanged(tx, documentId), whichcorrectDocumentruns in its transaction when the correction changes the flag. -
d4503fb: Hybrid search ranks its full-text side with BM25 when ParadeDB
pg_search0.26 or later is created in the database. At startup,prepareFullTextRanking(@liasse/core/search) reads the installed version from the catalog, creates the BM25 indexchunks_bm25_idxwhen it is missing or stale, and returnsrankByBm25; without the extension it returnsrankByFullText(ts_rank_cd) and nothing changes, and with an older one a startup notice says why BM25 is not used. BM25 only orders the chunks: which ones match is still decided by the language-awaretsvectorquery. The index readsliasse_bm25_document(language, text), the lexemes ofliasse_tsvector, added by a migration.ApiContexttakesfullText, the rankersearchDocumentspasses tosearch.rankByFullTextis exported by@liasse/core/search. The index carries a signature of the pg_search version, of its definition and of the functions and text search configurations its lexemes come from, and a startup that finds another one builds it again. BM25 queries turn the planner warnings of pg_search off in their own transaction; no connection carries a pg_search setting.pnpm db:up:paradedbstarts a Postgres withpg_searchon127.0.0.1:54331andpnpm test:paradedbruns the BM25 tests against it. -
e2b7064: Consolidation keeps the type registry from drifting. A
consolidatejob runs every night at 03:00 UTC and after every 20 new documents settled: it puts similar types to the text model as merge candidates, promotes keys most documents of a type keep inextrato fields, stabilizes provisional types with five documents, proposes the removal of fields few documents of a large stable type fill, and proposes merges of entities and subjects that look like one.AUTO_APPLYdecides what applies without approval (none,safeby default,all). Applying a change moves the documents and their values in the transaction of the registry write, keeps every manual correction, and queues a re-extraction of each settled document from its stored text.GET /changeslists the pending changes andPOST /changes/:idapplies or rejects one, instead of answering 501.type_changesgains the kindremove_fieldand the columnsdecided_atandnote(migration0011). The answers of both routes are in@liasse/core/contract, and the SDK typeslistChangesanddecideChangewith them. -
9ba83bc: Liasse ships as a Docker image (
ghcr.io/wallforfry/liasse, amd64 and arm64) with poppler and the local embedder, anddocker-compose.ymlruns it with Postgres and pgvector. -
d3ba5e5:
ENTITY_ATTACH_SIMILARITYandENTITY_ARBITRATION_SIMILARITYset the thresholds of entity resolution by similarity (decimals from 0 to 1, arbitration not above attach); subjects use the same ones. The defaults become 1 and 0.80, measured with the default local embedder bypnpm eval:calibrate: similarity alone no longer attaches a mention, the text model decides every candidate from 0.80. Another embedder needs its own measure withpnpm eval:calibrate. -
354ebc9: Lay the foundation: validated configuration, the Postgres schema and migrations for the eleven tables, model ports with deterministic fakes, the untrusted-content prompt helper and a server exposing
GET /health. -
14d3f24: The web UI lists the MCP clients connected through OAuth (client id, name, redirect URIs, consented scopes, live tokens, dates) and revokes one after a confirmation. A revoked client loses its refresh tokens, consents and authorization codes not yet redeemed, and
/mcprefuses every access token issued to it before the revocation, even when the client registers again.The auth server answers
GET /api/auth/mcp-connections/listandPOST /api/auth/mcp-connections/revokefor a signed-in person;@liasse/contractexports their schemas and paths./mcpnow also refuses an access token whose client was removed, disabled or revoked.@liasse/corehas a migration for the tableoauth_client_revocations. -
ff7a0b5: Add the MCP server (
@liasse/mcp): the fourteen tools of the specification and thedoc://{id}andtypes://resources, over the use cases of@liasse/core/apithat REST calls. The server mounts it on/mcp(Streamable HTTP, stateless, behind the credentials of the API) and serves it on the standard streams with--stdio, exiting when its input ends. Tool descriptions flag document content as untrusted; failures carry the error codes of REST,not_implementedstanding for its 501.ingesttakes a base64 file;urlanswersnot_implementedfor now.@liasse/core/apigains thetimeline,recallandgetSubjectuse cases, which the server binds to the knowledge layer likeupcoming,idSchema,CORRECTED_PARTS,toApiErrorandinvalidRequest;@liasse/core/dbexportssqlStateOf. -
47cc651: Add the model provider adapters: text, vision and embedding models for Anthropic, OpenAI, Mistral, Gemini, Ollama and OpenAI-compatible servers through the Vercel AI SDK, with
LLM_TIMEOUTandEMBEDDING_TIMEOUT. The server prints a warning at startup when document content is sent to a cloud provider. -
02ab8b1: Each document keeps a processing log: every stage that succeeded and every attempt of its jobs that failed, with the stage, the status, the attempt, the error code and class, whether it is retried, the model, and counts such as the values the model returned that were rejected. Nothing read from the document is logged. The 100 most recent events are kept per document and removed with it.
GET /documents/:id/eventsanswers the log, the SDK reads it withlistDocumentEvents, the MCP toolget_statusadds it asevents, and the document page of the web UI shows it in a Processing tab. A re-extraction or a re-indexing that fails in a way another attempt cannot fix now ends its job at once, asprocess_documentdid. -
55ec70b: A model provider that refuses a call now says why. An event of the processing log of a document has
http_statusandprovider_code(the error type and code of the provider, a network code, ortimeout) and themodelof amodel_provider_failedfailure, and the Processing tab of the web UI shows them under the error code. Thejob_failedline of the server log names the class of the cause and, for a provider failure, its provider, model, HTTP status and code. A migration adds the two columns todocument_events. -
bcf30ea: Add the REST API and the server runtime.
@liasse/core/apiholds the use cases REST and MCP share (upload, read, list and delete a document, download its file, search, query, types, entities), with stable error codes and signed file URLs valid for 15 minutes. The server now builds itself from the configuration (migrations, storage check, embedder, workers, watched folder), authenticates every route but/health(with the API keys and sessions of the better-auth changeset), serves/metrics(Prometheus) and/openapi.json, logs on stderr only and drains requests and jobs on S...