feat(7831): every record a session is shown, asks for or opens on its own is recorded per session, by kind
CI & Build / Plugin hooks (push) Successful in 18s
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 38s
CI & Build / Python tests (push) Successful in 1m59s
CI & Build / integration (push) Successful in 2m6s
CI & Build / Build & push image (push) Successful in 32s

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>
This commit is contained in:
2026-11-24 13:27:13 -05:00
co-authored by Claude Opus 5.5
parent 394f83427d
commit b0fab00fe2
21 changed files with 951 additions and 9 deletions
@@ -1718,6 +1718,17 @@ async def retrieval_summary(
out["rule_usage"] = rule_usage
out["system_usage"] = await _system_usage(user_id, since)
out["moment_usage"] = await moment_usage(user_id, since)
# How each non-rule record reached a session: pushed by a hook, returned
# by a search the session ran, or opened with nothing delivering it — and
# how many were opened each way. Its own guard, so a failure flags itself.
try:
from grimoire.services import record_deliveries
out["record_reach"] = (await record_deliveries.summary(user_id, days=days)
if user_id else None)
except Exception:
logger.exception("record reach read failed")
out["record_reach"] = None
out["record_reach_failed"] = True
# ── Judged lines ─────────────────────────────────────────────────────
#