Fast exact search, cross-project knowledge, delivered rulings, short MCP instructions #236

Merged
bvandeusen merged 10 commits from dev into main 2026-11-28 18:24:23 -05:00
Owner

Milestone 669, "Knowledge reaches every project, work stays in its own: a fast exact search, cross-project recall ranked and labelled", plus related work. Every commit was green on dev; the head ddbfbab passed CI run 11152.

  • The exact search gets cheap (#8190; closes #6834). Migration 0139 stores embedding vectors inline (STORAGE MAIN) on the four embedding tables and rewrites the existing rows once, about 34k. The ranking scope carries ids and distances only, and chunk text is read for the winners.
  • The cannot_decline warning counts the cue gate's declines (#8192).
  • Knowledge crosses projects (#8191). Snippets, notes, processes and lessons from the user's other projects reach a session, ranked 0.05 below the project's own and labelled from <project>. Work stays in its project. The reach is editable in Settings › Moments.
  • Rulings reach the work (#8205, #8206). A System with rulings and no file patterns is flagged in enter_project and on its card. The guidance gives a ruling's for/not-for form, names the ruling in the code comment, and has a session read rulings before changing a constraint.
  • The MCP instructions shrink to 569 characters (#8211), with an 800-character budget.
  • The Claude Code plugin is MIT; the server stays AGPL-3.0-only.
  • The plugin is at version 2026.11.28.2315.

Deploy note: migration 0139 rewrites every vector row once at startup.

🤖 Generated with Claude Code

Milestone 669, "Knowledge reaches every project, work stays in its own: a fast exact search, cross-project recall ranked and labelled", plus related work. Every commit was green on dev; the head ddbfbab passed CI run 11152. - **The exact search gets cheap (#8190; closes #6834).** Migration 0139 stores embedding vectors inline (`STORAGE MAIN`) on the four embedding tables and rewrites the existing rows once, about 34k. The ranking scope carries ids and distances only, and chunk text is read for the winners. - **The cannot_decline warning counts the cue gate's declines (#8192).** - **Knowledge crosses projects (#8191).** Snippets, notes, processes and lessons from the user's other projects reach a session, ranked 0.05 below the project's own and labelled `from <project>`. Work stays in its project. The reach is editable in Settings › Moments. - **Rulings reach the work (#8205, #8206).** A System with rulings and no file patterns is flagged in `enter_project` and on its card. The guidance gives a ruling's for/not-for form, names the ruling in the code comment, and has a session read rulings before changing a constraint. - **The MCP instructions shrink to 569 characters (#8211)**, with an 800-character budget. - **The Claude Code plugin is MIT; the server stays AGPL-3.0-only.** - The plugin is at version 2026.11.28.2315. **Deploy note:** migration 0139 rewrites every vector row once at startup. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 10 commits 2026-11-28 18:24:19 -05:00
licence(7023): the Claude Code plugin is MIT; the server stays AGPL-3.0-only
CI & Build / Plugin hooks (push) Successful in 15s
CI & Build / TypeScript typecheck (push) Successful in 35s
CI & Build / Python tests (push) Successful in 2m20s
CI & Build / Python lint (push) Successful in 2s
CI & Build / integration (push) Successful in 2m15s
CI & Build / Build & push image (push) Successful in 21s
6cb61cdf84
The operator settled the split on 2026-11-09. The server is AGPL-3.0-only.
The plugin is a client adapter that people install into their own tooling,
so it is MIT. plugin/ now carries its own LICENSE, the manifest declares
MIT, and the README's Licence section names both. Plugin version minted
2026.11.28.1705.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
perf(8190): the exact search reads vectors from the row and text only for the winners
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 2m7s
CI & Build / integration (push) Failing after 2m15s
CI & Build / Build & push image (push) Skipped
efba891f5e
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(8192): a gated arm's declines include the calls its cue gate withheld
CI & Build / TypeScript typecheck (push) Successful in 37s
CI & Build / Plugin hooks (push) Successful in 15s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Python tests (push) Successful in 2m10s
CI & Build / integration (push) Successful in 2m15s
CI & Build / Build & push image (push) Successful in 21s
163d32859f
#8192 "The cannot_decline warning reads the result count from before the cue
gate, so a gated arm can never show a decline", step 3 of milestone 669.

auto_inject logs its ranked results before the cue gate decides, so a call
the gate silenced still reads as a hit, and cannot_decline fired on an arm
whose gate withholds most calls (since 11-23, gate_kept = 0 on 55 of 69,
40 of 44 and 71 of 84 calls a day, with result_count never 0).

The readout gains a `gate` block per source (gated_calls, declined_by_gate),
null where no row carried a gate decision, and cannot_decline counts
zero_result_calls plus declined_by_gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(8191): knowledge reaches a session from every project, ranked below its own and labelled
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Plugin hooks (push) Successful in 17s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Python tests (push) Failing after 2m0s
CI & Build / Build & push image (push) Canceled after 0s
CI & Build / integration (push) Canceled after 2m7s
30aa5cf1c6
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>
test(8191): the route list names the reach endpoint
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 2m11s
CI & Build / integration (push) Successful in 2m8s
CI & Build / Build & push image (push) Successful in 37s
98a959de4f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(8205): a System with rulings and no file patterns is flagged
CI & Build / TypeScript typecheck (push) Canceled after 0s
CI & Build / Plugin hooks (push) Canceled after 0s
CI & Build / Python lint (push) Canceled after 0s
CI & Build / Python tests (push) Canceled after 0s
CI & Build / integration (push) Canceled after 0s
CI & Build / Build & push image (push) Canceled after 0s
3e87df6c84
Its rulings reach no session: delivery is by path_patterns alone. enter_project
carries rulings_undelivered (absent when none) with the fix call, the Systems
list reads ruling_count, and the System card says so with a button to name
its files. A System without rulings is not flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(8206): a ruling says what a constraint is for and not for, and the comment names it
CI & Build / TypeScript typecheck (push) Successful in 34s
CI & Build / Plugin hooks (push) Successful in 18s
CI & Build / Python lint (push) Successful in 7s
CI & Build / Python tests (push) Failing after 1m58s
CI & Build / Build & push image (push) Canceled after 0s
CI & Build / integration (push) Canceled after 2m9s
9e3767f375
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>
fix(8205,8206): the new test helper no longer shadows _system, and using-grimoire fits its 350 lines
CI & Build / Plugin hooks (push) Successful in 15s
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 2m9s
CI & Build / integration (push) Successful in 2m11s
CI & Build / Build & push image (push) Successful in 31s
ff47a2b08b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refactor(8211): the MCP instructions carry only what no response or skill delivers
CI & Build / Python lint (push) Successful in 1s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / Python tests (push) Successful in 2m16s
CI & Build / TypeScript typecheck (push) Successful in 34s
CI & Build / integration (push) Successful in 1m58s
CI & Build / Build & push image (push) Successful in 21s
ddbfbabcd2
569 characters, from 1,600: what Grimoire is, enter_project first, ask
what_might_apply before a consequential act, search before building, the force
of each record kind, and that responses say what to do next. The rest is
enforced in responses or stated in a skill. The budget drops to 800, and the
guidance registry stops requiring index words for the topics that left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bvandeusen merged commit fedd3ff881 into main 2026-11-28 18:24:23 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledGrimoire#236