From 361f7595c89020eccc3c8badf0df24be43c7bf48 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 10 Oct 2026 21:21:03 +0000 Subject: [PATCH 1/3] docs: list backups in Settings, the Safari clipper and prompt marking as built #263, #283 and #302 merged, so the README lists them as built, the web clipper guide names Safari as built, and the updates guide says the backups page is built while the upgrade page is in progress. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS --- README.md | 31 +++++++++++++++++-------------- docs/updates.md | 4 ++-- docs/web-clipper.md | 2 +- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 566d87e1c..a81941318 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,9 @@ Everything below is built and merged. Work that is still in a pull request is li at a time, from a link list or a bookmarks file, by API or by asking the assistant; and import videos and podcasts by their address (off by default). ([Sensors](docs/sensors.md), [processing](docs/processing.md), [import webhooks](docs/api.md#import-webhooks)) -- **Clip from the browser.** The Lens web clipper for Chrome and Edge turns a page, a selection or a part you pick - into Markdown, lets you look it over, and sends it to a namespace. New releases reach installed copies through the - browser's store or a self-hosted update file. ([Web clipper](docs/web-clipper.md)) +- **Clip from the browser.** The Lens web clipper for Chrome, Edge and Safari turns a page, a selection or a part you + pick into Markdown, lets you look it over, and sends it to a namespace. New releases reach installed copies through + the browser's store or a self-hosted update file. ([Web clipper](docs/web-clipper.md)) - **Understand it.** Transcription and speaker recognition, text on screen and in scans, faces (off by default), entities and topics in a knowledge graph you can explore, query with Cypher or SPARQL, and see as it was at any version. Find what is most like a passage, a resource, a topic or an entity, and, with anytopdf, photos by what @@ -94,15 +94,20 @@ Everything below is built and merged. Work that is still in a pull request is li - **See what it costs.** An activity ledger of every model call, with reports, charts and budgets that cap spending. Routine choices go to small decision models, and the LLM only when it adds value. ([Activity and costs](docs/activity.md), [budgets](docs/budgets.md)) -- **Keep it up to date.** Lens checks for a new release once a day and tells admins by email or a notification. It - backs the database up and upgrades itself through a small agent on the machine, from the API; nothing installs - unless an admin says so. ([Updates and backups](docs/updates.md)) +- **Keep it up to date and backed up.** Lens checks for a new release once a day and tells admins by email or a + notification, and upgrades itself through a small agent on the machine, from the API; nothing installs unless an + admin says so. Settings › Backups takes, lists, downloads and restores backups, takes them on any schedule, and can + copy each one, encrypted, to a storage connection. ([Updates and backups](docs/updates.md), + [backups](docs/database.md#backups)) - **Watch it run.** OpenTelemetry traces and metrics, and a Prometheus `/metrics` endpoint with a sample Grafana dashboard. Both are off until you turn them on, and send nothing anywhere else. ([Telemetry](docs/telemetry.md), [Prometheus](docs/prometheus.md)) -- **Stay private.** Passkeys instead of passwords, encryption at rest with a key per namespace, roles per namespace, - and an audit log. Reach it from anywhere through a Cloudflare tunnel with nothing opened on your router. - ([Encryption](docs/encryption.md), [access](docs/access.md), [remote access](docs/remote-access.md)) +- **Stay private and safe.** Passkeys instead of passwords, encryption at rest with a key per namespace, roles per + namespace, and an audit log. What the assistant reads (recordings, documents, web pages, tool results) reaches the + model marked as data, not instructions. Reach Lens from anywhere through a Cloudflare tunnel with nothing opened on + your router. ([Encryption](docs/encryption.md), [access](docs/access.md), + [prompt injection](docs/assistant.md#third-party-content-and-prompt-injection), + [remote access](docs/remote-access.md)) - **Use open standards.** RDF and Dublin Core for every record, OAuth for apps and OpenID Connect sign-in, MCP, MQTT, IIIF for publishing, OpenTelemetry and Prometheus for monitoring, and an optional Fedora mirror. ([Linked data](docs/rdf.md), [IIIF](docs/iiif.md), [Fedora](docs/fedora.md)) @@ -124,9 +129,8 @@ These are open pull requests, not yet part of Lens: - **Costs:** a budget meter in the top bar and a Costs page ([#275](https://github.com/adeelahmad/lense/pull/275)), and an overall AI budget with soft and hard limits asked for in setup ([#281](https://github.com/adeelahmad/lense/pull/281)). -- **Upgrades and backups in the web app:** an upgrade page with live steps that rolls back when the new version doesn't - start ([#262](https://github.com/adeelahmad/lense/pull/262)), and restore, download links and scheduled backups - ([#263](https://github.com/adeelahmad/lense/pull/263)). +- **Upgrades in the web app:** an upgrade page with live steps that rolls back when the new version doesn't start + ([#262](https://github.com/adeelahmad/lense/pull/262)). - **Running it:** HTTPS with certificates from Let's Encrypt or ZeroSSL ([#289](https://github.com/adeelahmad/lense/pull/289)), structured logs with a log viewer and syslog output ([#284](https://github.com/adeelahmad/lense/pull/284)), built-in usage analytics @@ -134,8 +138,7 @@ These are open pull requests, not yet part of Lens: ([#297](https://github.com/adeelahmad/lense/pull/297)). - **People:** email invitations, and removing someone for good ([#286](https://github.com/adeelahmad/lense/pull/286)). - **Lens.app for macOS:** a menu-bar app that carries microsandbox ([#280](https://github.com/adeelahmad/lense/pull/280)). -- **The web clipper** for Firefox ([#282](https://github.com/adeelahmad/lense/pull/282)) and Safari - ([#283](https://github.com/adeelahmad/lense/pull/283)). +- **The web clipper for Firefox** ([#282](https://github.com/adeelahmad/lense/pull/282)). - **Files:** assets shown as folders and files by namespace and collection ([#290](https://github.com/adeelahmad/lense/pull/290)) and shared read-only over NFS ([#295](https://github.com/adeelahmad/lense/pull/295)); items called assets unless they are audio or video diff --git a/docs/updates.md b/docs/updates.md index 56e4d8600..a1ddcd754 100644 --- a/docs/updates.md +++ b/docs/updates.md @@ -1,8 +1,8 @@ # Updates and backups Lens tells admins when a new release is out, backs the database up, and installs the release from the web app, so -upgrading never needs a terminal. Status: **built** (the check, backups and upgrades from the API and the agent); -the web app's banner and Settings page come in their own change. +upgrading never needs a terminal. Status: **built** (the check, upgrades from the API and the agent, and backups in +Settings › Backups); the web app's upgrade page is **in progress**. ## The check diff --git a/docs/web-clipper.md b/docs/web-clipper.md index aaac3269b..bbb18234e 100644 --- a/docs/web-clipper.md +++ b/docs/web-clipper.md @@ -1,6 +1,6 @@ # Web clipper -**Status: built (Chrome and Edge); Firefox and Safari in progress.** Every browser's build comes from the same code; +**Status: built (Chrome, Edge and Safari); Firefox in progress.** Every browser's build comes from the same code; each gets a target in `extensions/browser/targets/`. The Lens web clipper is a browser extension that turns what you're reading into Markdown and sends it to your Lens, From ef5213e73984c14439a4eaa716716675f83c303d Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 10 Oct 2026 21:34:12 +0000 Subject: [PATCH 2/3] fix(store): run again when SurrealDB says a transaction retry is required On a busy server SurrealDB 3 answers "Transaction retry required: snapshot is older than the commit oracle's GC window". The store didn't count that as retryable, so a request (or a test's schema setup) failed instead of running the statements again, as it already does for write conflicts. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS --- fastapi_backend/app/domain/store.py | 5 +- .../tests/domain/test_store_retry.py | 67 +++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 fastapi_backend/tests/domain/test_store_retry.py diff --git a/fastapi_backend/app/domain/store.py b/fastapi_backend/app/domain/store.py index 68fa7364e..d0f733069 100644 --- a/fastapi_backend/app/domain/store.py +++ b/fastapi_backend/app/domain/store.py @@ -604,9 +604,10 @@ def _plain(v): def _retryable(err): - """SurrealDB's optimistic transactions fail with a write conflict when two touch the same record at once.""" + """SurrealDB's optimistic transactions fail with a write conflict when two touch the same record at once, and ask + for a retry when a transaction's snapshot is older than the commit oracle's GC window (a busy server).""" m = str(err) - return "can be retried" in m or "Transaction conflict" in m or "Write conflict" in m + return "can be retried" in m or "Transaction conflict" in m or "Write conflict" in m or "retry required" in m def _lost(err): diff --git a/fastapi_backend/tests/domain/test_store_retry.py b/fastapi_backend/tests/domain/test_store_retry.py new file mode 100644 index 000000000..9ea38b49c --- /dev/null +++ b/fastapi_backend/tests/domain/test_store_retry.py @@ -0,0 +1,67 @@ +"""SurrealDB asks for some transactions to be run again (a write conflict, a snapshot older than the commit oracle's +GC window on a busy server); the store runs them again instead of failing.""" + +from __future__ import annotations + +import pytest + +from app.domain import store + +GC = "There was a problem with a transaction: Transaction retry required: snapshot is older than the commit oracle's GC window" + + +class _Conn: + """A stand-in server connection: its first `failures` answers are SurrealDB's retry error, then OK.""" + + socket = None + + def __init__(self, failures): + self.failures, self.calls = failures, 0 + + def query_raw(self, sql, v): + self.calls += 1 + if self.calls <= self.failures: + return {"result": [{"status": "ERR", "result": GC}]} + return {"result": [{"status": "OK", "result": []}]} + + def query(self, sql, v): + self.calls += 1 + if self.calls <= self.failures: + raise RuntimeError(GC) + return [1] + + +def _db(conn): + d = store.DB.__new__(store.DB) + d.url, d.embedded = "ws://test", False + d._pool = store.queue.LifoQueue() + d._all = [conn] + d._pool.put(conn) + return d + + +@pytest.fixture(autouse=True) +def _no_wait(monkeypatch): + monkeypatch.setattr(store, "_backoff", lambda attempt: None) + + +def test_a_snapshot_older_than_the_gc_window_is_retried(): + assert store._retryable(GC) + c = _Conn(failures=2) + _db(c).run(["DEFINE INDEX IF NOT EXISTS field_space ON field FIELDS space"], transaction=False) + assert c.calls == 3 + c = _Conn(failures=1) + assert _db(c).values("SELECT 1") == [1] + assert c.calls == 2 + + +def test_other_errors_still_fail_at_once(): + class _Bad(_Conn): + def query_raw(self, sql, v): + self.calls += 1 + return {"result": [{"status": "ERR", "result": "Parse error: unexpected token"}]} + + c = _Bad(failures=0) + with pytest.raises(RuntimeError, match="Parse error"): + _db(c).run(["SELEC 1"], transaction=False) + assert c.calls == 1 From 5a76485444786b70e8a0f116b7864972653a52d8 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 10 Oct 2026 21:34:53 +0000 Subject: [PATCH 3/3] docs: list the budget meter and Costs page as built #275 merged, so it moves from "In progress" to the feature list. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a81941318..0cf065eea 100644 --- a/README.md +++ b/README.md @@ -92,8 +92,9 @@ Everything below is built and merged. Work that is still in a pull request is li notifications to webhooks, Slack, Discord and Matterbridge. ([Processing](docs/processing.md#workflows-and-the-canvas), [notifications](docs/notifications.md)) - **See what it costs.** An activity ledger of every model call, with reports, charts and budgets that cap spending. - Routine choices go to small decision models, and the LLM only when it adds value. - ([Activity and costs](docs/activity.md), [budgets](docs/budgets.md)) + A meter in the top bar shows spend against the budget, and the Costs page breaks it down by day, model and what + cost most. Routine choices go to small decision models, and the LLM only when it adds value. + ([Activity and costs](docs/activity.md), [budgets](docs/budgets.md#the-meter-and-the-costs-page)) - **Keep it up to date and backed up.** Lens checks for a new release once a day and tells admins by email or a notification, and upgrades itself through a small agent on the machine, from the API; nothing installs unless an admin says so. Settings › Backups takes, lists, downloads and restores backups, takes them on any schedule, and can @@ -126,8 +127,7 @@ These are open pull requests, not yet part of Lens: - **Chat channels:** a built-in Telegram bot on a shared channel layer ([#293](https://github.com/adeelahmad/lense/pull/293)) and a Slack app over Socket Mode ([#287](https://github.com/adeelahmad/lense/pull/287)), without Matterbridge. -- **Costs:** a budget meter in the top bar and a Costs page ([#275](https://github.com/adeelahmad/lense/pull/275)), - and an overall AI budget with soft and hard limits asked for in setup +- **Budget in setup:** an overall AI budget with soft and hard limits, asked for in setup ([#281](https://github.com/adeelahmad/lense/pull/281)). - **Upgrades in the web app:** an upgrade page with live steps that rolls back when the new version doesn't start ([#262](https://github.com/adeelahmad/lense/pull/262)).