Skip to content

Releases

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 17 Nov 20:44
a019044

@liasse/server 0.2.0

Minor Changes

  • 57b9e49: A document in needs_review says what to review. GET /documents/:id?include=review and get_document return a review part: 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) takes confirm, 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 clears needs_review like a correction. A value that changed since it was read refuses the correction with value_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 (listConsolidationRuns in 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_TRIGGERS and ConsolidationTrigger now come from @liasse/contract/domain, no longer from @liasse/core/consolidation.

  • 3e9b8c4: A correction (PATCH /documents/:id, update_document) can set or clear core.key_dates, where it answered unsupported_field. The list given replaces the key dates of the document in its core and in what upcoming answers, in one transaction, and a later extraction keeps it. Each date is a kind, a date and a label of 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: a notice_deadline given next to a renewal date of such a document is refused (invalid_value). upcoming no longer flags as computed a date a person gave. key_dates still cannot be confirmed; the refusal now says to give the dates in core.key_dates instead.

    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 entity filter of search keeps the documents that name the entity in any entity field, in core or in the fields of their type, each item of a list field included, where it read issuer and recipient only. GET /documents (listDocuments of the SDK) takes the same entity filter, 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 review part of a document (GET /documents/:id?include=review, get_document with include: ["review"]) names the values the last extraction dropped: rejections lists them by section (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) and count, never the value or its quote. A document extracted before this change has only its rejected_values count, and an empty rejections.

    The extraction prompt says what each core field holds: core.amount is 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 in extra under 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 (graph of 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 (requestConsolidationRun in 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_type creates a provisional type by hand, suggest_type drafts one with the text model, request_consolidation_run asks for a consolidation run and list_consolidation_runs follows the latest ones. They also list documents (list_documents, with the filters of GET /documents, the needs_review queue 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 the review part say why in refusal (quota_exceeded, private_document, invalid_proposal, rejected_type), and the classification event in type_refusal. The outcome fallback is 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 failed classification event carries the reason as its error_code. With new_type, a slug that names another existing type is refused instead of taken.

    The description of the MCP tool create_type says it is the way to file such a document: it is outside the daily quota of classification, and update_document then 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 fetch can throw an uncaught EINVAL from setTypeOfService on 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/contract and @liasse/sdk keep 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/setup says whether setup is needed, POST /api/setup/check tries settings with the token, and POST /api/setup creates the account and saves the settings together, applied at once (getSetupStatus, checkSetup and completeSetup of the SDK). Attempts are limited to 5 a minute per client address, as for sign-in.

    Breaking: AUTH_BOOTSTRAP_EMAIL and AUTH_BOOTSTRAP_PASSWORD are 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/reclassify answers 202 with the document, the MCP tool reclassify_document does the same, and the SDK has reclassifyDocument. The request may carry a hint (cut to the length of an upload hint) and new_type, which asks for a new type only. A reclassify_document job 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 not indexed or needs_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/contract now holds the definitions of the core fields (CORE_FIELDS, CORE_FIELD_NAMES, KEY_DATES_FIELD in /registry, no longer exported by @liasse/core/registry) and SETTLED_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/reextract answers 202 with the document, the MCP tool reextract_document answers its id and status, and the SDK has reextractDocument. The request queues the reextract_document job under the row lock of the document, with the refusals of a reclassification (document_not_settled for a document on its way, failed, or with a processing, re-extraction or reclassification pending); values corrected or confirmed by hand are kept. retry_document is unchanged and still refuses any document that did not fail....

Read more

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 16 Nov 11:17
99c8b05

@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_EMAIL and AUTH_BOOTSTRAP_PASSWORD while no account exists; AUTH_SECRET (32 characters or more) and AUTH_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 the Origin of PUBLIC_URL. /mcp takes an API key or an OAuth access token issued for PUBLIC_URL/mcp (when PUBLIC_URL is https or on the loopback), never the cookie, and answers a refused request with the RFC 9728 challenge. The auth server answers under /api/auth and 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/contract exports AUTH_BASE_PATH, MIN_PASSWORD_LENGTH and MAX_PASSWORD_LENGTH. @liasse/core has a new auth subpath 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_document job, reextract_document, reindex_document and detect_links run too. At startup, a document on its way that no queued or running job will take further is failed with the code stale. PATCH /documents/:id, GET /subjects and GET /upcoming answer instead of 501; only consolidation (GET /changes, POST /changes/:id) still answers 501, and the startup notice now says so.

    With HINDSIGHT_URL set, a hindsight_sync job is queued once a document is indexed, and in the transaction of a correction that flips its private flag.

    The pipeline queues detect_links in the transaction that settles a document, and again after each re-extraction, so a superseded or terminated contract drops out of upcoming and no longer counts in the state of its subject. The OpenAPI document describes the answers of GET /subjects and GET /upcoming (listSubjectsOutputSchema and upcomingOutputSchema are exported by @liasse/core/api). @liasse/core/testing exports startStubServer, chatCompletion and embeddings, 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 as getSubject reads it, at most 100 by default with truncated. PipelineDeps takes onPrivacyChanged(tx, documentId), which correctDocument runs in its transaction when the correction changes the flag.

  • d4503fb: Hybrid search ranks its full-text side with BM25 when ParadeDB pg_search 0.26 or later is created in the database. At startup, prepareFullTextRanking (@liasse/core/search) reads the installed version from the catalog, creates the BM25 index chunks_bm25_idx when it is missing or stale, and returns rankByBm25; without the extension it returns rankByFullText (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-aware tsvector query. The index reads liasse_bm25_document(language, text), the lexemes of liasse_tsvector, added by a migration.

    ApiContext takes fullText, the ranker searchDocuments passes to search. rankByFullText is 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:paradedb starts a Postgres with pg_search on 127.0.0.1:54331 and pnpm test:paradedb runs the BM25 tests against it.

  • e2b7064: Consolidation keeps the type registry from drifting. A consolidate job 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 in extra to 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_APPLY decides what applies without approval (none, safe by 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 /changes lists the pending changes and POST /changes/:id applies or rejects one, instead of answering 501. type_changes gains the kind remove_field and the columns decided_at and note (migration 0011). The answers of both routes are in @liasse/core/contract, and the SDK types listChanges and decideChange with them.

  • 9ba83bc: Liasse ships as a Docker image (ghcr.io/wallforfry/liasse, amd64 and arm64) with poppler and the local embedder, and docker-compose.yml runs it with Postgres and pgvector.

  • d3ba5e5: ENTITY_ATTACH_SIMILARITY and ENTITY_ARBITRATION_SIMILARITY set 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 by pnpm eval:calibrate: similarity alone no longer attaches a mention, the text model decides every candidate from 0.80. Another embedder needs its own measure with pnpm 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 /mcp refuses every access token issued to it before the revocation, even when the client registers again.

    The auth server answers GET /api/auth/mcp-connections/list and POST /api/auth/mcp-connections/revoke for a signed-in person; @liasse/contract exports their schemas and paths. /mcp now also refuses an access token whose client was removed, disabled or revoked. @liasse/core has a migration for the table oauth_client_revocations.

  • ff7a0b5: Add the MCP server (@liasse/mcp): the fourteen tools of the specification and the doc://{id} and types:// resources, over the use cases of @liasse/core/api that 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_implemented standing for its 501. ingest takes a base64 file; url answers not_implemented for now. @liasse/core/api gains the timeline, recall and getSubject use cases, which the server binds to the knowledge layer like upcoming, idSchema, CORRECTED_PARTS, toApiError and invalidRequest; @liasse/core/db exports sqlStateOf.

  • 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_TIMEOUT and EMBEDDING_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/events answers the log, the SDK reads it with listDocumentEvents, the MCP tool get_status adds it as events, 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, as process_document did.

  • 55ec70b: A model provider that refuses a call now says why. An event of the processing log of a document has http_status and provider_code (the error type and code of the provider, a network code, or timeout) and the model of a model_provider_failed failure, and the Processing tab of the web UI shows them under the error code. The job_failed line 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 to document_events.

  • bcf30ea: Add the REST API and the server runtime. @liasse/core/api holds 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...

Read more