Situated lessons arrived only at tool acts and in MCP replies, so a lesson
given a reply moment was accepted and never shown. The per-turn delivery now
carries lessons confirmed on reply.report, once per session, between the
turn's rules and its reply shape. reply.ask is known only after the reply is
written, so lesson_situations refuses it and leaves it out of the catalog the
pass and the lesson page offer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- backup v31 carries lesson_situations (full and per-user export, restored
through the note map);
- the lesson surfacing test now pins that the edit door's search leaves
lessons to their situation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each lesson can carry its situation: a moment of work (work.deliver,
work.finish, ...) or a typed trigger on the act (path, command, tool,
keyword, matched as rule triggers are). A pass proposes, a person judges:
- lesson_situations (migration 0137): one row per lesson, kind and value,
suggested / confirmed / rejected; `none` records that no situation fits;
- MCP: lessons_to_situate, propose_lesson_situations,
lesson_situation_proposals, judge_lesson_situations;
- Settings > Moments lists waiting proposals with Apply / Not this /
Apply all; a lesson page lists its situations and lets a writer add one
or take one off (kept as rejected, never proposed again).
Delivery: the moment doors (the plugin catch-all hook and MCP replies) add
the lessons whose confirmed moment the act reached or whose trigger it
matches. The plugin door shows each once per session, using the record
ledger, and records it as pushed (source lesson_situation); the tool filter
now includes the tools a lesson trigger listens on.
The edit door no longer finds lessons by meaning: lesson leaves the
work.change default kinds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The co-arrival recorder counted a lesson and a rule shown in one response
as evidence that the lesson is an instance of the rule, and asked the
reader to judge the pair once three situations had gathered. Two records
that resemble the same prompts arrive together whether or not one is an
instance of the other, and the outcome bore that out (2,317 pairs
suggested, 23 confirmed). It no longer runs:
- neither the prompt door nor the write path records co-arrivals or
carries a proposal line;
- a rule read lists the lessons judged against it, confirmed first, and a
lesson read the rules it was judged against: suggested rows stay in the
table and no read shows them;
- the lesson page and the rule editor drop the suggested section.
The situation-counting helpers stay; rule moment judgments use them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pointer before a payload:
- the notes arms fetch a few results past the menu; those that cleared
the floor but were held back by the gate, the band or the budget are
named by id per kind, with the call that opens each kind, in one line
("Also resembling this, not shown: ...") at the message and the write
path;
- they are recorded in the record ledger as `pointed`, so an open that
follows is counted apart from pushed lines;
- setting a task in progress returns records_in_area: the notes and open
issues tagged to the task's areas, by id (a work.start row in the
kind x moment table says which kinds; it answers in a tool reply, so it
is shown as unmeasured).
The static context says what a pointer line means. Plugin version minted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before a write, the write path now looks up issues by structure:
- an issue whose body or a log names the file (any status: a closed one
is the record of what was already tried there);
- an open issue tagged to an area whose path patterns cover the file.
At most two, listed first, withheld from the search by meaning, which
fills only what is left and only past the gate. Measured under
write_path_linked. The lookups follow the kind x moment table: no issue
lookup when issues are off at work.change, no nearby-snippet lookup when
snippets are.
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>
A ledger beside the rule deliveries (record_deliveries, migration 0136):
- every note, snippet, issue, lesson or process line a plugin door pushes
is recorded against the session, only when the payload kept it;
- a search the session runs itself records its results as asked, matched
to the server log of that call;
- an open is stamped on the delivery it followed, or recorded as direct
when nothing showed the record first.
The plugin reports opens and searches from the tool calls
(grimoire_record_read.sh). The readout is in retrieval_telemetry
(record_reach), at /api/retrieval/record-reach, and in Settings > Moments
as "How records reach the work". Plugin 2026.11.24.1827.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows without a plugin version are skipped by every open-rate reader and are
most of the table, so the correlated lookup runs on the rows recorded since
0133 only. Keeps the migration cheap on the live table, not just in CI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A delivery to a session that opened the rule within the open window is
stamped opened as it is written, and migration 0135 stamps the rows already
recorded the same way. The adherence readout, the ordering open rate and the
weighing pass read one definition: a rule read early in a long session is not
counted unread each time it is delivered later.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- writing-records.md: a new section on declaring enforcement (inform, hold,
enforce), the trigger a hold or refusal needs to name its act, and
salience. A rule with an exit is a hold; a rule with triggers stops only
the acts they match.
- moments.md: a held call is read and made again (unchanged if the rule does
not bear on it, with rule_misfired); a refused call is the operator's
boundary and moves only when they change the rule; a moment sends a few
lines in one order and drops the rest, so a quiet moment is not an empty
rulebook.
- The static context says a rule can hold or refuse a tool call.
- create_rule, create_project_rule and update_rule describe enforce as a
refusal every time that needs an act, and trigger-only holds.
- The cross-project guard words a rule edit on another project as the
operator's curation, naming the rule, and no longer suggests filing an
issue in its place.
_INSTRUCTIONS is at its 1,600-character cap and is left alone: holds and
refusals explain themselves when they fire. The guidance ownership test
registers the three new topics. Plugin 2026.11.23.2259.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Bash command was split into segments on every `&&`, `||`, `;`, `|` and
newline, including those inside quotes and the lines of a heredoc. A script
written with `python3 - <<EOF` that mentioned curl reached env.reach, and a
grep for "a && git push" reached work.deliver. The splitter now reads the
line as the shell does: separators inside quotes are text, a heredoc's body
is skipped through its end word (`<<-` strips leading tabs), and a
backslash-newline continues the line. Command triggers use the same split.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rule is in force at a moment of a session when it was delivered there.
Each (session, rule, place) now carries at most one verdict (rule_adherence,
migration 0134): followed, departed, broken or not applicable, with where it
came from:
- an enforce rule refusing the act: followed, recorded by the moment arm, and
never replaced;
- the session's own rule_outcome (applied, departed) and rule_misfired calls,
which the plugin's outcome hook now also posts with the session id
(/api/plugin/rule-verdict) onto the delivery being answered;
- a transcript review: adherence_to_judge lists what has no verdict yet, by
session, and judge_adherence records verdicts with their evidence.
rule_adherence (MCP) and /api/retrieval/adherence give the readout: sessions
in force, opened and each verdict per rule and per place. Settings > Moments
shows it in a "Were they followed" panel, beside each moment's delivered and
opened counts, and per rule inside each moment.
Verdicts are pruned with their deliveries and left out of backups like them.
Plugin 2026.11.23.2227.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dialog names how many changes across how many rules, and how many of
those rules will start holding or refusing the acts they govern. A refused
item is reported in a toast; the rest still apply.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rules 2, 4, 10 and 153 are set to hold and mounted on work.deliver. A
push to dev therefore stopped four times in a row, once for each of them,
although none of them governs a push to dev: their triggers (git push
origin main, git tag, pytest, pull_request_write) name the acts they do
govern.
A rule that has triggers now stops an act only when one of them matched it.
Reached by its moment alone, it is a line beside the work. A rule with no
triggers still holds wherever it is mounted, because the mount is all that
says where it applies. A mounted rule whose unscoped trigger also matched
now counts as reached by the trigger, so it ranks as triggered and may
stop the act.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each rule line a hook delivers now records the plugin version that asked for
it (the X-Grimoire-Plugin header every hook request sends). The open rate
used to order rules, and the delivery history the weighing pass reads,
count only deliveries that carry one.
A plugin before 2026.11.22.2312 never reported an open of a rule a hook had
just named, so every delivery made to such a session read as unopened. The
server shipped delivery recording from dev on 2026-11-22. The plugin ships
from main, and a running session keeps the plugin it started with, so those
sessions kept arriving. They are why opens read about 1 in 600. Existing
rows have no version and drop out of the rate; nothing is deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds rule_field_judgments (migration 0132), the rules_to_weigh / propose_rule_weights / rule_weight_proposals / judge_rule_weights tools, the routes and the Settings › Moments panel that confirms them. A value equal to the rule's own is recorded as agreed; a different one waits; enforce is refused for a rule no act reaches; a direct edit answers a waiting suggestion. Backup v30 carries the judgments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A rule set to enforce, reached by a mount or a trigger, refuses the tool
call in its own words every time (`act_decision`, `/moment` returns
`decision`, grimoire_moment.sh denies). Opening it does not lift it.
- A rule set to hold denies the call once until read, under the act
checkpoint's per-rule and per-session guard; file writes are never held.
- The reply hold, the reply backstop and the act checkpoint hold only on rules
declared hold or enforce (`rule_order.holds`). An inform rule is a line
beside the work.
- The prompt arm leaves rules that arrive at an act (mounted on a non-reply
moment, or with a tool/path/command trigger) to that act.
- The end-of-turn shape check no longer blocks: its note is kept for the next
prompt, carried as `carry` into the one fitted payload, and the stop after
that prompt records whether the lines were judged (noted /
judged_after_note / left_after_note).
- Rule editor and list copy say what hold and enforce now do. Plugin
2026.11.23.0005.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A record or preference found by resemblance alone is shown only when the
message's score beats all but a set share (default 10%) of the user's own
recent cues on that surface and project. The comparison set is the
best_available_score already logged per call, so the bar rises with the
store by construction and a fixed floor no longer decides. Too few cues to
judge by is silence; the searches still run and calibrate the gate.
- cue_gate: conformal bar, per (user, surface, project) with a user-wide
fallback, cached five minutes; readout for Settings.
- Notes arms (auto_inject, write_path) abstain unless the top line passes,
show at most two lines, and hold slots to the same bar and cap.
- Rule arms hold preference lines to the gate; rules are not gated.
- retrieval_logs gains gate_bar and gate_kept (migration 0131).
- Turns the harness wrote are refused server-side as well as in the plugin.
- Settings: the rate field and a per-surface readout of bar and how often
each surface spoke; GET /api/retrieval/gate.
- Replay test: on unrelated cues a fixed bar tuned to 5% on a 32-record
store fires ~97% on 2,048 records; the gate stays near 10% at both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A first mention whose rule had an empty statement fell through to the
reference form and lost its "may apply <where>" — for a trigger-fired rule,
the very clause that says which trigger fired. The full form now renders
with or without a statement. The integration helper flushes the request
buffer, as a door does once its payload is fitted. using-grimoire trimmed
back to its 350-line budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rule line on first mention now carries the rule's own statement, written as
a statement about the rule ("Rule 11 … may apply here; it binds: …") rather
than an instruction to go read it; a repeat or lower-ranked line is a
reference ("Also relevant: Rule 11 …"). Every line ends with where the session
stands with the rule and get_rule(id) for the full text.
services/hook_payload.py fits every injecting door's payload (prompt,
pre-tool rules, moment, write path) to the user's budget: parts in one order,
kept while they fit, dropped whole otherwise. A dropped part's ids leave the
response lists, so the plugin ledgers mark only what was shown, and rule
deliveries are buffered per request and written only for kept lines.
Budget: Settings, default 4,500 characters (the full core reply shape is
2,343 and a full rule line up to ~750, so 3,000 would have crowded the shape
out of most turns), clamped to 1,000-7,500 — under the lower of the two
recorded hook caps (10,000 in the docs, 8,000 read from an installed build).
check_plugin asserts the ceiling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The editor styled its trigger list through `.trigger-list .rule-chip`,
which re-spells the shared chip the guard keeps in one stylesheet; the
row now adds its own `.trigger-chip` for layout. The full-export test now
asserts the v29 rule_triggers section is present.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Triggers (migration 0130, table rule_triggers): a rule can name the act it
applies to, as a tool, a path glob, a command head or a keyword, checked
exactly against the act rather than by resemblance. With no moment a
trigger delivers its rule on any matching act, even one that reaches no
moment; scoped to a moment, it makes the rule's mount there conditional
on the act matching. A triggered line ranks above a mounted one in the
delivery order and names the trigger that fired. Writable through every
MCP and REST rule door, carried by backup (version 29), and edited in the
rule editor under "Acts that trigger it". The plugin's catch-all hook is
told which tools a trigger can reach.
Lifecycle: a rule's life in a session is one full line, one reminder,
then silence. A repeat whose latest delivery in the session was already a
reminder is left out of both rule arms. A rule that holds stays armed
until it is opened, an opened rule keeps its line, and a full delivery
(after a compaction or once the ledger ages it out) re-arms it. Read from
the delivery records, so it needs no new plugin ledger.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hook now names its session for the delivery record, and the plugin
blueprint binds it before every handler. The contract test pins both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every rule arm now ranks what it delivers with one function
(services/rule_order.py): enforcement, then salience, then how narrowly
the rule was reached, then first mention before reminder, then the
rule's own open rate at that moment, then similarity. A crowded moment
drops the same rules whichever arm brought them, and a rule that holds
is never cut for a line beside it.
The open rate comes from a new table, rule_deliveries (migration 0129):
one row per rule line a plugin session is shown, full or repeat, with the
open stamped on the latest delivery it followed. The plugin routes bind
the session per request; the prompt, pre-tool and write-path hooks now
send it, and the opened hook reports every open, with its acts only when
no hook had just named the rule. Rows are pruned daily after 180 days.
Also fixes the TypeScript check: the store's list row now carries the
new enforcement field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rule now carries what it does when it arrives, declared by its author
rather than guessed from a score: enforce (the act is checked), hold (the
reply or act waits for one read) or inform (a line beside the work, the
default). And a salience, high, normal or low, for ranking among rules of
the same enforcement at a crowded moment. A preference is always inform.
Migration 0128 adds both with CHECKs. Every door carries them: the
service, the MCP create and update tools, REST, backup and restore, and
the rule editor, which also marks holding and enforced rules in the list.
Unknown values are refused rather than mapped. Nothing reads them yet
beyond the record; the ordering function and the lifecycle come next in
this step, and step 5 decides who holds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cited #N, milestone N or rule N in a rendered body now reads as the
record's title followed by its number, muted, so a reader knows what is
cited without hovering. The stored text stays #N and the title is read at
render: every existing record benefits and an edited title shows wherever
it is cited. Titles past 60 characters are shortened at a word, with the
full kind, title and status in the tooltip. A reference whose paragraph
already names the record (a batch writes #9 "Step two") keeps the bare
number, as does one the reader cannot open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"step" is in the other-numbering word list ("step #3" is a position in
a plan), so "steps #5110" correctly stays plain. The case now tests the
range alone, and a second case pins the "step #3" reading.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A purely numeric #N is a record reference everywhere now. The tag
patterns (frontend utils/tags.ts, the editor decoration, the first-line
tag strip, tag autocomplete, backend utils/tags.py) leave digits alone,
so #3127 is no longer drawn as a tag chip linking to /notes?tag=3127.
- utils/recordRefs.ts links #N, milestone N and rule N in rendered
markdown, with the same patterns and other-numbering word list as
services/record_refs.py. A drift test reads the TS source and fails
when the two differ.
- v-record-refs (directives/recordRefs.ts) asks POST
/api/notes/resolve-refs once per body for what each id is. A link
gets the route for its kind (task, lesson, snippet, note, milestone,
rule) and its kind and title on hover. One the reader cannot open is
drawn as a dead reference, and missing vs not shared read the same.
Applied on every surface that renders markdown.
- /milestones/:id finds the project and opens its board at that
milestone (?milestone= expands it, scrolls to it and focuses it).
- Backlinks include records that cite #N in a body or a work log,
through readable_notes_clause instead of an owner-only filter, and
route by kind. The graph draws #N citations as dashed reference edges.
- create_note, create_task and add_task_log say which forms link.
There were no numeric tags to clean up: tags are stored only from the
explicit field, and none of the 200 most used is numeric.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
classify_shapes(repo=...) and the write-path hook looked only at live rows,
so a shape whose row had vanished got a second provisional row under the
same (project, repo, path, symbol, kind). The unique constraint refused it,
and the whole classify batch was lost as a tool error.
provisional_row() now finds the row under that identity, vanished or not.
A vanished row is revived with a reappeared event and keeps its judgment.
A new row is inserted inside a savepoint, so a concurrent insert of the
same identity falls back to that row instead of failing the transaction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>