Repository navigation
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 SIGTERM. New variablePUBLIC_URL: the origin signed file URLs start with.@liasse/core/formatsis now the one definition of each accepted format for ingestion and text extraction; an email that starts with a byte order mark or blank lines is refused. Routes of features that are not merged yet (PATCH /documents/:id,/subjects,/upcoming,/changes) answer 501. -
47ba878: A failed document can be processed again without uploading its file:
POST /documents/:id/retryanswers 202 with the document queued from the start, the MCP toolretry_documentdoes the same, and the SDK hasretryDocument. Both refuse a document that did not fail (document_not_failed) and an unknown or deleted one (document_not_found). A retry gives the watched folder its tries back, as an upload of the same bytes does. The document page of the web UI shows a Retry button on a failed document. -
3b95f94: Every key on the wire is snake_case. The knowledge answers that were camelCase are renamed:
documentCountisdocument_countinGET /subjectsandget_subject,nextDatesisnext_datesinget_subject, and the facts oftimelineandrecallcarryvalid_from,valid_toanddocument_id, plusentity_idsandsubject_idsinrecall. The SDK types follow, since they are those of@liasse/core/contract. A test of the contract fails on any key of a request or an answer that is not snake_case. -
4b7c202:
TRUSTED_PROXIESlists the reverse proxies in front of the server (addresses, CIDR ranges and the keywordcloudflare). From one of them, the sign-in rate limit counts the client named by the right-most untrusted address ofX-Forwarded-For, or byCF-Connecting-IPwhen Cloudflare received the request, so one client behind the proxy no longer locks every other one out. Empty by default: the socket address stays the client. The Coolify compose file trusts the private networks of its proxy. -
c0a2f44:
POST /typescreates a type by hand,provisionallike one the pipeline creates, judged by the naming rules, primitives and two-level hierarchy of the registry under its lock; a refusal answers 400 with the code of the registry. The daily quota of new types does not refuse it. The SDK gainscreateType, and the web UI a Types page that lists the types with their status, fields and document counts, shows each type, and creates one. -
ccd3c27: The web UI is a single-page application,
@liasse/web, made with Vite, React and shadcn components: document list with status, type and privacy filters, the review queue, the document page with its correction and deletion, search, upload and the consolidation changes, in a sidebar layout with a command palette (Cmd or Ctrl+K), toasts and a light or dark theme. It calls the REST API through the SDK with the session cookie and renders document content as text only.The server serves its build under
/uiand refuses to start without it;GET /redirects there. The policy of/uiadmits the scripts and stylesheets of the build and a per-request style nonce, neverunsafe-inlineorunsafe-eval.@liasse/contractexportsCSP_NONCE_META_PROPERTY, andcreateLiasseClienttakessession: truefor a page served by the server. -
9ba86d3: Add the web UI under
/ui: document list, document page with its text and original file, search, upload, theneeds_reviewqueue with a correction form, and the approval of consolidation changes. It applies the use cases of@liasse/core/apiand treats everything read from documents as text. Access goes through the accounts of the auth server (see the better-auth changeset).
Patch Changes
-
7c4ca7d: Move the contract into its own package,
@liasse/contract, which depends onzodalone. Installing@liasse/sdkno longer installs@liasse/coreand its server dependencies (Postgres, the ONNX runtime, the AI SDK, pdfjs): the SDK depends on@liasse/contractandzodonly. The root entry holds the schemas and types of every request and answer, formerly@liasse/core/contract, which is removed. The pure modules they are built from move with them and are no longer exported by@liasse/core: enumerations, shared schemas, values, limits, languages and currencies are in@liasse/contract/domain(formerly in@liasse/core/domain), the query DSL and its errors in@liasse/contract/query, field primitives andResultin@liasse/contract/registry, entity list options in@liasse/contract/entitiesand the search input in@liasse/contract/search. -
324364a: Add the regression harness of the evaluation set:
pnpm eval:runingests the corpus into a throwaway instance with the configured models, has an agent answer the 20 questions through the MCP tools, scores both and writes a report;pnpm eval:compareputs reports side by side;pnpm eval:calibratemeasures the entity similarity thresholds with the configured embedder.@liasse/serverexportscreateRuntimeas@liasse/server/runtime. Scoring: a negation no longer reaches past the end of a sentence and reaches three words, a failure reason names five unwanted documents at most, and the bank statement may linkpaysto the car-park ticket. -
42ae909: Follow-ups of the foundation reviews:
migraterefuses a journal that lists the same migration (same content, same date) twice.- A model provider that cannot be reached fails with the network code (
ECONNREFUSED,ENOTFOUND) instead of no code, and a provider error reports both its type and its code.LLM_BASE_URLandEMBEDDING_BASE_URLare refused when they carry a?or a#. The startup lookup of a self-hosted endpoint gives up after three seconds, and the privacy warning says when the name did not resolve. - The currency list gains
XADand losesCNX. Type slugs may carry the short forms of months again (data_set,seguro_mar), and are refused the name of an organisation of two letters (bp_invoice).
-
d0a82db: A forget no longer clears the record that the Hindsight bank may hold facts of a document while a retain of that document may still land.
documents.hindsight_retain_until, added by migration0009, records until when a retain can reach Hindsight (the longest its request can take, retries included, now stated byHindsightClient.requestWindowMs); a forget within that bound is sent, keeps the record and throwsHindsightRetainInFlightError, and the job runs again once the bound has passed. A retain whose sync lost its lock, or whose process died, can no longer leave facts in the bank with nothing to forget them.A handler can defer its job without spending an attempt by throwing
DeferJobError(@liasse/core/jobs), optionally with a delay; the workers report it throughonJobDeferredinstead ofonJobFailed. Thehindsight_synchandler defers a sync that finds another in progress, one that lost its lock and a forget a retain may still overtake. The server logs these asjob_deferred, and logs the facts the detector kept out of Hindsight ashindsight_facts_withheld, with their count and nothing that names the document. -
a7247ec: Releases are cut by Changesets: merging the version pull request tags
v<version>, publishes a GitHub release with the changelog and the image tags<version>,<major>.<minor>andlatest. The README starts in 5 minutes,docs/deployment.mdcovers the rest of a deployment, andexamples/holds MCP client configurations and REST calls. -
3c8ac16: On shutdown, a keep-alive connection that was busy when the listener closed no longer goes on serving requests until the grace period cuts it: a request received after the close is answered with
Connection: close, which ends the connection. -
76f76b4: Add the TypeScript SDK.
createLiasseClient({ baseUrl, token, fetch?, timeoutMs? })covers every REST route, uploads with the nativeFormDataandBlob, parses every answer against the schemas of the server and rejects withLiasseApiError(status, stable code, request id, details) when the API refuses a request. The schemas and types of requests and answers move from@liasse/core/apito the new@liasse/core/contract, which loads nothing but Zod when imported. The answers of/subjectsand/upcomingand the references they hold (untrustedText,documentRefSchema,subjectRefSchema) are defined there too, and no longer exported by@liasse/core/apiand@liasse/core/knowledge. -
Updated dependencies [edaa336]
-
Updated dependencies [01cc23c]
-
Updated dependencies [d4503fb]
-
Updated dependencies [d91c225]
-
Updated dependencies [e2b7064]
-
Updated dependencies [7c4ca7d]
-
Updated dependencies [2e9decd]
-
Updated dependencies [018bd6f]
-
Updated dependencies [d3ba5e5]
-
Updated dependencies [c3665e3]
-
Updated dependencies [42ae909]
-
Updated dependencies [354ebc9]
-
Updated dependencies [d0a82db]
-
Updated dependencies [1251350]
-
Updated dependencies [03482cf]
-
Updated dependencies [28e5c9d]
-
Updated dependencies [14d3f24]
-
Updated dependencies [ff7a0b5]
-
Updated dependencies [faa8bc9]
-
Updated dependencies [47cc651]
-
Updated dependencies [027f193]
-
Updated dependencies [02ab8b1]
-
Updated dependencies [55ec70b]
-
Updated dependencies [08bbea2]
-
Updated dependencies [bcf30ea]
-
Updated dependencies [47ba878]
-
Updated dependencies [a7ccb4a]
-
Updated dependencies [3b95f94]
-
Updated dependencies [2eb4f51]
-
Updated dependencies [4b7c202]
-
Updated dependencies [1e5abde]
-
Updated dependencies [c0a2f44]
-
Updated dependencies [76f76b4]
-
Updated dependencies [f4ff6f1]
-
Updated dependencies [ccd3c27]
-
Updated dependencies [9ba86d3]
- @liasse/core@0.1.0
- @liasse/web@0.1.0
- @liasse/contract@0.1.0
- @liasse/mcp@0.1.0
@liasse/web 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. -
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. -
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. -
c0a2f44:
POST /typescreates a type by hand,provisionallike one the pipeline creates, judged by the naming rules, primitives and two-level hierarchy of the registry under its lock; a refusal answers 400 with the code of the registry. The daily quota of new types does not refuse it. The SDK gainscreateType, and the web UI a Types page that lists the types with their status, fields and document counts, shows each type, and creates one. -
ccd3c27: The web UI is a single-page application,
@liasse/web, made with Vite, React and shadcn components: document list with status, type and privacy filters, the review queue, the document page with its correction and deletion, search, upload and the consolidation changes, in a sidebar layout with a command palette (Cmd or Ctrl+K), toasts and a light or dark theme. It calls the REST API through the SDK with the session cookie and renders document content as text only.The server serves its build under
/uiand refuses to start without it;GET /redirects there. The policy of/uiadmits the scripts and stylesheets of the build and a per-request style nonce, neverunsafe-inlineorunsafe-eval.@liasse/contractexportsCSP_NONCE_META_PROPERTY, andcreateLiasseClienttakessession: truefor a page served by the server.
Patch Changes
- f4ff6f1: The Type field of the document correction form is a searchable list of the registry's types, matched by slug, alias or description, instead of free text that the server refused when no type had that slug.
@liasse/eval 0.1.0
Minor Changes
- 324364a: Add the regression harness of the evaluation set:
pnpm eval:runingests the corpus into a throwaway instance with the configured models, has an agent answer the 20 questions through the MCP tools, scores both and writes a report;pnpm eval:compareputs reports side by side;pnpm eval:calibratemeasures the entity similarity thresholds with the configured embedder.@liasse/serverexportscreateRuntimeas@liasse/server/runtime. Scoring: a negation no longer reaches past the end of a sentence and reaches three words, a failure reason names five unwanted documents at most, and the bank statement may linkpaysto the car-park ticket. - c3665e3: Add the public evaluation set (
@liasse/eval): 50 synthetic documents of one fictitious household with their ground truth, 20 reference questions, a deterministic generator and pure scoring functions. The synthetic builders of@liasse/core/testinggain what it needs:buildSyntheticPdfwrites text in WinAnsiEncoding (the euro sign reads back) and image-only pages from a JPEG, andbuildSyntheticDocxcan store its parts uncompressed.
@liasse/contract 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. -
7c4ca7d: Move the contract into its own package,
@liasse/contract, which depends onzodalone. Installing@liasse/sdkno longer installs@liasse/coreand its server dependencies (Postgres, the ONNX runtime, the AI SDK, pdfjs): the SDK depends on@liasse/contractandzodonly. The root entry holds the schemas and types of every request and answer, formerly@liasse/core/contract, which is removed. The pure modules they are built from move with them and are no longer exported by@liasse/core: enumerations, shared schemas, values, limits, languages and currencies are in@liasse/contract/domain(formerly in@liasse/core/domain), the query DSL and its errors in@liasse/contract/query, field primitives andResultin@liasse/contract/registry, entity list options in@liasse/contract/entitiesand the search input in@liasse/contract/search. -
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. -
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. -
c0a2f44:
POST /typescreates a type by hand,provisionallike one the pipeline creates, judged by the naming rules, primitives and two-level hierarchy of the registry under its lock; a refusal answers 400 with the code of the registry. The daily quota of new types does not refuse it. The SDK gainscreateType, and the web UI a Types page that lists the types with their status, fields and document counts, shows each type, and creates one. -
ccd3c27: The web UI is a single-page application,
@liasse/web, made with Vite, React and shadcn components: document list with status, type and privacy filters, the review queue, the document page with its correction and deletion, search, upload and the consolidation changes, in a sidebar layout with a command palette (Cmd or Ctrl+K), toasts and a light or dark theme. It calls the REST API through the SDK with the session cookie and renders document content as text only.The server serves its build under
/uiand refuses to start without it;GET /redirects there. The policy of/uiadmits the scripts and stylesheets of the build and a per-request style nonce, neverunsafe-inlineorunsafe-eval.@liasse/contractexportsCSP_NONCE_META_PROPERTY, andcreateLiasseClienttakessession: truefor a page served by the server.
@liasse/core 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. -
7c4ca7d: Move the contract into its own package,
@liasse/contract, which depends onzodalone. Installing@liasse/sdkno longer installs@liasse/coreand its server dependencies (Postgres, the ONNX runtime, the AI SDK, pdfjs): the SDK depends on@liasse/contractandzodonly. The root entry holds the schemas and types of every request and answer, formerly@liasse/core/contract, which is removed. The pure modules they are built from move with them and are no longer exported by@liasse/core: enumerations, shared schemas, values, limits, languages and currencies are in@liasse/contract/domain(formerly in@liasse/core/domain), the query DSL and its errors in@liasse/contract/query, field primitives andResultin@liasse/contract/registry, entity list options in@liasse/contract/entitiesand the search input in@liasse/contract/search. -
018bd6f: Add entity resolution (
@liasse/core/entities):resolveEntityattaches a mention to an entity by strong identifier, normalized name, then similarity (attached above 0.92, arbitrated by the text model from 0.80), or creates it;listEntitiesandgetEntityread entities with their document count;mergeEntities,proposeEntityMergeandfindMergeCandidatesmerge duplicates throughmerge_entitychanges. IBANs and card numbers are stored as their last four characters and an HMAC-SHA-256 keyed fromFILE_URL_SECRET: changing that secret makes the stored ones unknown to resolution until they are met again.findSensitiveIdentifiersandredactSensitiveIdentifiersfind and mask them in a text. Entity names are now compared on the letters and digits of every script, not only the Latin ones. -
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. -
d0a82db: A forget no longer clears the record that the Hindsight bank may hold facts of a document while a retain of that document may still land.
documents.hindsight_retain_until, added by migration0009, records until when a retain can reach Hindsight (the longest its request can take, retries included, now stated byHindsightClient.requestWindowMs); a forget within that bound is sent, keeps the record and throwsHindsightRetainInFlightError, and the job runs again once the bound has passed. A retain whose sync lost its lock, or whose process died, can no longer leave facts in the bank with nothing to forget them.A handler can defer its job without spending an attempt by throwing
DeferJobError(@liasse/core/jobs), optionally with a delay; the workers report it throughonJobDeferredinstead ofonJobFailed. Thehindsight_synchandler defers a sync that finds another in progress, one that lost its lock and a forget a retain may still overtake. The server logs these asjob_deferred, and logs the facts the detector kept out of Hindsight ashindsight_facts_withheld, with their count and nothing that names the document. -
1251350: Add the optional Hindsight sync (
@liasse/core/hindsight). WithHINDSIGHT_URLset, ahindsight_syncjob retains the facts of a document in the bankHINDSIGHT_BANKunder the document id, one line per fact ([doc:<id>] <fact> (valid_from ...)), and never its text, title, summary or fields. A retain after a re-extraction replaces the previous one; a document that is deleted, flagged private or left without facts is deleted from Hindsight. WithoutHINDSIGHT_URLnothing is queued and no request can be made.createHindsightIntegrationgives the server the hook to call, the handler to register, the per-kind concurrency to apply andrequeueForgets, to call at startup for the forgets that are still owed;describeHindsightgives the line of the startup privacy summary. The integration requires a detector of sensitive identifiers (isSensitive): a fact it flags is left out, and the count is reported throughonFactsWithheld.documents.hindsight_held_sincerecords, before any request, that a bank may hold facts of a document, and survives deletion;documents.hindsight_sent_hashrecords the facts Hindsight confirmed. Migration0008adds both.HINDSIGHT_URLfollows the rule of the model base URLs: http or https, without credentials, query string or fragment.withReservedConnection(@liasse/core/db) runs a function on one connection of the pool, kept for it alone.deleteDocumenttakes an optionalonDeleted(tx, document)that runs in the transaction of the deletion. -
03482cf: Add ingestion: file storage on disk or on any S3-compatible server,
ingestFilewith format detection from the content and deduplication by SHA-256, a job queue on Postgres, and a watched folder. Deleting a document leaves a tombstone (statusdeleted) and removes the stored file through a retried job, queued again at startup if it gave up. Two migrations add that status and the columnshint,watch_requeuesandfile_deleted_attodocuments.MAX_FILE_SIZEcaps an ingested file (50 MB by default). Thes3driver now requiresS3_ACCESS_KEY_IDandS3_SECRET_ACCESS_KEY, and readsS3_REQUEST_TIMEOUTandS3_MIN_UPLOAD_RATE. -
28e5c9d: Add the knowledge layer (
@liasse/core/knowledge).prepareKnowledgeandpersistKnowledgestore the key dates, the facts and the subjects of a document in its write transaction: the notice deadline is computed from the renewal date and the notice period (a calendar subtraction, never the model's date; an invalid period is dropped alone and counted), subjects are resolved like entities (plate, vehicle identification number, IBAN, a contract number of its issuer, or an address with its house number and postal code, then label, then similarity with arbitration) under the lock of the entities, and an IBAN or a card number left in a fact is masked. A private document may attach to a subject but adds nothing to it, and a subject only private documents named is shown to no reader who did not ask for them; a subject no live document concerns is blanked.mergeSubjects,proposeSubjectMergeandfindSubjectMergeCandidatesmerge duplicate subjects throughmerge_subjectchanges.detectLinks, queued as thedetect_linksjob, asks the text model once about the candidate documents and writes the links it keeps with both documents locked;documents.statefollows from the links, a document has one superseder, an amendment follows the state of the contract it amends, and deleting a document gives the documents it superseded or terminated their state back. Merges lock the documents they rewrite in id order.upcoming,timeline,recallandgetSubjectare the logic of the four knowledge tools.document_linksgains the trace columns (model,quote,schema_version,page) andsubjectsaprivateflag: run the migration. -
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. -
027f193: Add the document pipeline (
@liasse/core/pipeline): theprocess_documenthandler takes a document fromreceivedtoindexedorneeds_review(text extracted in a child process under a memory and a CPU limit, classification against the 8 closest types, one extraction call for the fields, the key dates, the facts and the candidate subjects), with quote verification, per-field provenance, sensitive identifier masking and a confidence. Alsoreextract_documentandreindex_documentjobs,correctDocumentfor manual corrections, andfailAbandonedDocumentsfor startup. It binds entity resolution, sensitive identifier masking and indexing; the similarity thresholds of entity resolution can be set by the caller. Reading a PDF given as a NodeBufferno longer fails. -
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. -
08bbea2: Add the structured query DSL (
@liasse/core/query):runQueryparses a JSON query, resolves every field path against the type registry and compiles it to one parameterized statement. It supports the operators=,!=,<,<=,>,>=,in,containsandexists, the aggregatescount,sum,min,maxandavgwithgroup_by,select,order_by,limitandoffset, and answers an unknown field with the fields that exist. Private documents are left out unlessinclude_privateis set, and deleted documents are never returned. An aggregate value or a numeric group key is a JSON number when a double holds it exactly and the string of its exact decimal form otherwise. Errors and warnings are capped at 20 each, and a database failure is thrown as aQueryExecutionErrorthat carries no statement.documents.provenanceis keyed by the bare field name, and the entity a field was resolved to is read fromprovenance.<field>.entity_id(entityIdProvenancePathin@liasse/core/domain); the provenance of a list field is an array with one entry per item.migratenow refuses a Postgres server older than 16 with aPostgresVersionError: structured queries rely onpg_input_is_valid. -
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 SIGTERM. New variablePUBLIC_URL: the origin signed file URLs start with.@liasse/core/formatsis now the one definition of each accepted format for ingestion and text extraction; an email that starts with a byte order mark or blank lines is refused. Routes of features that are not merged yet (PATCH /documents/:id,/subjects,/upcoming,/changes) answer 501. -
47ba878: A failed document can be processed again without uploading its file:
POST /documents/:id/retryanswers 202 with the document queued from the start, the MCP toolretry_documentdoes the same, and the SDK hasretryDocument. Both refuse a document that did not fail (document_not_failed) and an unknown or deleted one (document_not_found). A retry gives the watched folder its tries back, as an upload of the same bytes does. The document page of the web UI shows a Retry button on a failed document. -
a7ccb4a: Add local embeddings and hybrid search: a multilingual ONNX embedder that runs in a child process ended when idle (
@liasse/core/embeddings, model files inEMBEDDING_CACHE_DIR), chunking sized to the embedder's input window,indexDocumentandsearch(@liasse/core/search), with language-aware full text. Requires pgvector 0.8 or later, checked at startup. -
3b95f94: Every key on the wire is snake_case. The knowledge answers that were camelCase are renamed:
documentCountisdocument_countinGET /subjectsandget_subject,nextDatesisnext_datesinget_subject, and the facts oftimelineandrecallcarryvalid_from,valid_toanddocument_id, plusentity_idsandsubject_idsinrecall. The SDK types follow, since they are those of@liasse/core/contract. A test of the contract fails on any key of a request or an answer that is not snake_case. -
2eb4f51: Add
@liasse/core/text:extractTextreads the text layer of PDFs, DOCX files and emails, and transcribes scanned PDFs (rendered bypdftoppmat 200 dpi) and JPEG, PNG and HEIC images with the vision model.MAX_VISION_PAGEScaps the pages of a scanned PDF sent to the vision model. -
4b7c202:
TRUSTED_PROXIESlists the reverse proxies in front of the server (addresses, CIDR ranges and the keywordcloudflare). From one of them, the sign-in rate limit counts the client named by the right-most untrusted address ofX-Forwarded-For, or byCF-Connecting-IPwhen Cloudflare received the request, so one client behind the proxy no longer locks every other one out. Empty by default: the socket address stays the client. The Coolify compose file trusts the private networks of its proxy. -
1e5abde: Add the evolving type registry (
@liasse/core/registry): field primitives with their definition, stored JSON Schema and value schemas, enforced naming rules, and transactional operations to create, resolve, list and change types under the daily quota. The document count of a type is now computed fromdocuments, and thedoc_types.doc_countcolumn is dropped.SCHEMA_LANGUAGEnow accepts onlyen,fr,de,esorit: the registry refuses the month names of that language in type slugs, and any other value fails at startup. -
c0a2f44:
POST /typescreates a type by hand,provisionallike one the pipeline creates, judged by the naming rules, primitives and two-level hierarchy of the registry under its lock; a refusal answers 400 with the code of the registry. The daily quota of new types does not refuse it. The SDK gainscreateType, and the web UI a Types page that lists the types with their status, fields and document counts, shows each type, and creates one. -
76f76b4: Add the TypeScript SDK.
createLiasseClient({ baseUrl, token, fetch?, timeoutMs? })covers every REST route, uploads with the nativeFormDataandBlob, parses every answer against the schemas of the server and rejects withLiasseApiError(status, stable code, request id, details) when the API refuses a request. The schemas and types of requests and answers move from@liasse/core/apito the new@liasse/core/contract, which loads nothing but Zod when imported. The answers of/subjectsand/upcomingand the references they hold (untrustedText,documentRefSchema,subjectRefSchema) are defined there too, and no longer exported by@liasse/core/apiand@liasse/core/knowledge. -
9ba86d3: Add the web UI under
/ui: document list, document page with its text and original file, search, upload, theneeds_reviewqueue with a correction form, and the approval of consolidation changes. It applies the use cases of@liasse/core/apiand treats everything read from documents as text. Access goes through the accounts of the auth server (see the better-auth changeset).
Patch Changes
-
d91c225: The classification of a document no longer fails with
model_provider_failed(HTTP 400,invalid_request_error:invalid_json_schemaon OpenAI) once a document type exists. Its output schema was a union of the two decisions, sent as aoneOfat the root, which OpenAI refuses; it is now one object whose members only one decision uses, read back into the same two decisions. -
2e9decd: The process of the local embedding model serves one request at a time, in the order they arrive: two jobs that embed at once no longer run their batches side by side in one ONNX Runtime process, so its memory peak stays the one of a single batch whatever
WORKERSsays. Answers still go back by request id, and the idle stop is unchanged. -
c3665e3: Add the public evaluation set (
@liasse/eval): 50 synthetic documents of one fictitious household with their ground truth, 20 reference questions, a deterministic generator and pure scoring functions. The synthetic builders of@liasse/core/testinggain what it needs:buildSyntheticPdfwrites text in WinAnsiEncoding (the euro sign reads back) and image-only pages from a JPEG, andbuildSyntheticDocxcan store its parts uncompressed. -
42ae909: Follow-ups of the foundation reviews:
migraterefuses a journal that lists the same migration (same content, same date) twice.- A model provider that cannot be reached fails with the network code (
ECONNREFUSED,ENOTFOUND) instead of no code, and a provider error reports both its type and its code.LLM_BASE_URLandEMBEDDING_BASE_URLare refused when they carry a?or a#. The startup lookup of a self-hosted endpoint gives up after three seconds, and the privacy warning says when the name did not resolve. - The currency list gains
XADand losesCNX. Type slugs may carry the short forms of months again (data_set,seguro_mar), and are refused the name of an organisation of two letters (bp_invoice).
-
faa8bc9: Two entity or subject merges decided at the same time no longer deadlock when applying one rewrites the other: a decision on such a merge now takes the entity lock before the row of its change.
-
Updated dependencies [edaa336]
-
Updated dependencies [7c4ca7d]
-
Updated dependencies [14d3f24]
-
Updated dependencies [02ab8b1]
-
Updated dependencies [55ec70b]
-
Updated dependencies [c0a2f44]
-
Updated dependencies [ccd3c27]
- @liasse/contract@0.1.0
@liasse/mcp 0.1.0
Minor Changes
-
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. -
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. -
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. -
47ba878: A failed document can be processed again without uploading its file:
POST /documents/:id/retryanswers 202 with the document queued from the start, the MCP toolretry_documentdoes the same, and the SDK hasretryDocument. Both refuse a document that did not fail (document_not_failed) and an unknown or deleted one (document_not_found). A retry gives the watched folder its tries back, as an upload of the same bytes does. The document page of the web UI shows a Retry button on a failed document. -
3b95f94: Every key on the wire is snake_case. The knowledge answers that were camelCase are renamed:
documentCountisdocument_countinGET /subjectsandget_subject,nextDatesisnext_datesinget_subject, and the facts oftimelineandrecallcarryvalid_from,valid_toanddocument_id, plusentity_idsandsubject_idsinrecall. The SDK types follow, since they are those of@liasse/core/contract. A test of the contract fails on any key of a request or an answer that is not snake_case.
Patch Changes
- 7c4ca7d: Move the contract into its own package,
@liasse/contract, which depends onzodalone. Installing@liasse/sdkno longer installs@liasse/coreand its server dependencies (Postgres, the ONNX runtime, the AI SDK, pdfjs): the SDK depends on@liasse/contractandzodonly. The root entry holds the schemas and types of every request and answer, formerly@liasse/core/contract, which is removed. The pure modules they are built from move with them and are no longer exported by@liasse/core: enumerations, shared schemas, values, limits, languages and currencies are in@liasse/contract/domain(formerly in@liasse/core/domain), the query DSL and its errors in@liasse/contract/query, field primitives andResultin@liasse/contract/registry, entity list options in@liasse/contract/entitiesand the search input in@liasse/contract/search. - Updated dependencies [edaa336]
- Updated dependencies [01cc23c]
- Updated dependencies [d4503fb]
- Updated dependencies [d91c225]
- Updated dependencies [e2b7064]
- Updated dependencies [7c4ca7d]
- Updated dependencies [2e9decd]
- Updated dependencies [018bd6f]
- Updated dependencies [d3ba5e5]
- Updated dependencies [c3665e3]
- Updated dependencies [42ae909]
- Updated dependencies [354ebc9]
- Updated dependencies [d0a82db]
- Updated dependencies [1251350]
- Updated dependencies [03482cf]
- Updated dependencies [28e5c9d]
- Updated dependencies [14d3f24]
- Updated dependencies [ff7a0b5]
- Updated dependencies [faa8bc9]
- Updated dependencies [47cc651]
- Updated dependencies [027f193]
- Updated dependencies [02ab8b1]
- Updated dependencies [55ec70b]
- Updated dependencies [08bbea2]
- Updated dependencies [bcf30ea]
- Updated dependencies [47ba878]
- Updated dependencies [a7ccb4a]
- Updated dependencies [3b95f94]
- Updated dependencies [2eb4f51]
- Updated dependencies [4b7c202]
- Updated dependencies [1e5abde]
- Updated dependencies [c0a2f44]
- Updated dependencies [76f76b4]
- Updated dependencies [ccd3c27]
- Updated dependencies [9ba86d3]
- @liasse/core@0.1.0
- @liasse/contract@0.1.0
@liasse/sdk 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. -
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. -
7c4ca7d: Move the contract into its own package,
@liasse/contract, which depends onzodalone. Installing@liasse/sdkno longer installs@liasse/coreand its server dependencies (Postgres, the ONNX runtime, the AI SDK, pdfjs): the SDK depends on@liasse/contractandzodonly. The root entry holds the schemas and types of every request and answer, formerly@liasse/core/contract, which is removed. The pure modules they are built from move with them and are no longer exported by@liasse/core: enumerations, shared schemas, values, limits, languages and currencies are in@liasse/contract/domain(formerly in@liasse/core/domain), the query DSL and its errors in@liasse/contract/query, field primitives andResultin@liasse/contract/registry, entity list options in@liasse/contract/entitiesand the search input in@liasse/contract/search. -
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. -
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. -
47ba878: A failed document can be processed again without uploading its file:
POST /documents/:id/retryanswers 202 with the document queued from the start, the MCP toolretry_documentdoes the same, and the SDK hasretryDocument. Both refuse a document that did not fail (document_not_failed) and an unknown or deleted one (document_not_found). A retry gives the watched folder its tries back, as an upload of the same bytes does. The document page of the web UI shows a Retry button on a failed document. -
3b95f94: Every key on the wire is snake_case. The knowledge answers that were camelCase are renamed:
documentCountisdocument_countinGET /subjectsandget_subject,nextDatesisnext_datesinget_subject, and the facts oftimelineandrecallcarryvalid_from,valid_toanddocument_id, plusentity_idsandsubject_idsinrecall. The SDK types follow, since they are those of@liasse/core/contract. A test of the contract fails on any key of a request or an answer that is not snake_case. -
c0a2f44:
POST /typescreates a type by hand,provisionallike one the pipeline creates, judged by the naming rules, primitives and two-level hierarchy of the registry under its lock; a refusal answers 400 with the code of the registry. The daily quota of new types does not refuse it. The SDK gainscreateType, and the web UI a Types page that lists the types with their status, fields and document counts, shows each type, and creates one. -
76f76b4: Add the TypeScript SDK.
createLiasseClient({ baseUrl, token, fetch?, timeoutMs? })covers every REST route, uploads with the nativeFormDataandBlob, parses every answer against the schemas of the server and rejects withLiasseApiError(status, stable code, request id, details) when the API refuses a request. The schemas and types of requests and answers move from@liasse/core/apito the new@liasse/core/contract, which loads nothing but Zod when imported. The answers of/subjectsand/upcomingand the references they hold (untrustedText,documentRefSchema,subjectRefSchema) are defined there too, and no longer exported by@liasse/core/apiand@liasse/core/knowledge. -
ccd3c27: The web UI is a single-page application,
@liasse/web, made with Vite, React and shadcn components: document list with status, type and privacy filters, the review queue, the document page with its correction and deletion, search, upload and the consolidation changes, in a sidebar layout with a command palette (Cmd or Ctrl+K), toasts and a light or dark theme. It calls the REST API through the SDK with the session cookie and renders document content as text only.The server serves its build under
/uiand refuses to start without it;GET /redirects there. The policy of/uiadmits the scripts and stylesheets of the build and a per-request style nonce, neverunsafe-inlineorunsafe-eval.@liasse/contractexportsCSP_NONCE_META_PROPERTY, andcreateLiasseClienttakessession: truefor a page served by the server.