onnxruntime keeps a memory arena per run in flight and never returns it, so
overlapping requests grew the app a step at a time and it never came down:
measured in the live container, 32 concurrent callers reached 17.3 GB where
the same work one call at a time stayed flat at 1.07 GB. Every model call now
runs on a single worker thread, and the model loads with a thread pool capped
at 8 instead of one thread per host core.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
writing-records: the for/not-for form, naming a System's files so its
rulings reach an edit, and the comment at a constraint naming its ruling.
using-grimoire: read the area's rulings before changing a filter, gate or
default, and take a change that would undo one to the operator. The project
filter in embeddings now names its ruling, and the docstring that stretched
its reason to every kind is corrected. Plugin version minted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A per-kind reach beside the kind-by-moment table (setting record_reach,
default snippet/note/process/lesson) widens the passive note arms and their
slots to the user's other projects. A record from elsewhere gives up 0.05
before the floor and the ranking, and its line names the project. Work kinds
stay in their project, the visibility clause is unchanged, and an explicit
project search still means that project. Settings > Moments edits the reach.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 1 of milestone 669 "Knowledge reaches every project, work stays in its
own: a fast exact search, cross-project recall ranked and labelled", for
#6834 "auto_inject p90 latency has climbed since 10-23".
A search with no project in scope took about 1 s, because it ranked about
26k chunks exactly. Two costs on that path, neither of which changes a result:
- pgvector's vector type defaults to EXTERNAL storage, and a chunk row
(about 1.5 KB of vector plus its text) is over the 2 KB toast threshold,
so every vector sat in TOAST and each distance paid a lookup (151k buffer
hits for 26k rows). Migration 0139 sets STORAGE MAIN on the four
embedding tables and rewrites the existing rows once.
- The materialized scope carried every chunk's text beside its distance and
spilled the sort to disk. It now carries the id, chunk index and distance,
and the text is joined back for the rows that survive the cut.
Measured on the live corpus: 1,151 ms as before, 393 ms with the text out of
the scope, before the storage change.
The HNSW index stays out of the ranking. With pgvector 0.8's iterative
scan it returned 7 to 60 of the true 144 nearest chunks under a narrow
scope, at every setting tried.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The kind x moment table (services/record_kinds.py):
- every record search fires at a door: the operator message, or a
catalog moment (work.change for the write path);
- each door considers a set of kinds (snippet, note, lesson, process,
task:issue/work/spike/plan); a kind left out is never searched there;
- the shipped defaults are today's behaviour; a user's change is stored
per door, and putting a door back removes it.
Both note arms read it, replacing their fixed kind lists, and a reserved
slot whose kind is turned off is not reserved. The review re-run
searches the same kinds. Settings > Moments shows and edits the table,
with each cell's lines shown and opens from the record ledger.
list_moments returns it as record_kinds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 2 of the Scribe -> Grimoire rename.
- src/scribe -> src/grimoire, and every import, patch target, module path,
hypercorn entry point and `python -m grimoire.restore` with it; pyproject,
uv.lock and the frontend package are named grimoire.
- Image git.fabledsword.com/bvandeusen/fabledgrimoire; CI's Postgres service
runs as grimoire / grimoire_test.
- Compose files default the DB user, database and (prod) volume to grimoire,
each overridable from .env, so an install created as Scribe keeps its data
by setting POSTGRES_USER, POSTGRES_DB and PGDATA_VOLUME.
- Backups are written as grimoire-<ts>.tar with format grimoire-backup-tar.
Archives named scribe-* with the scribe-backup-tar manifest still restore
and are still counted at the destination (folder and S3), with tests.
- Exports, the MCP auth realm, the ASGI scope key and the persistent logger
carry the new name.
Kept on purpose: the secret-sealing key label stays "scribe.secrets.v1",
because every stored secret was derived under it.
Plugin identity (plugin name, hooks, env vars, .scribe marker, skills) is
step 3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>