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
+27
View File
@@ -279,6 +279,33 @@ export interface AdherencePayload {
by_moment: MomentAdherenceRow[];
}
/** How a record arrived in front of a session. */
export type RecordWay = "pushed" | "asked" | "direct";
export interface WayCounts {
delivered: number;
opened: number;
}
export interface RecordReachKind {
/** `snippet`, `note`, `lesson`, `process`, or `task:<kind>`. */
kind: string;
ways: Record<RecordWay, WayCounts>;
sources: { way: RecordWay; source: string; delivered: number; opened: number }[];
}
export interface RecordReachPayload {
days: number;
sessions: number;
totals: Record<RecordWay, WayCounts>;
by_kind: RecordReachKind[];
}
/** How non-rule records reached sessions: pushed, asked for, or opened directly. */
export function getRecordReach(days = 30): Promise<RecordReachPayload> {
return apiGet(`/api/retrieval/record-reach?days=${days}`);
}
/** Whether the rules in force at each moment were followed there. */
export function getAdherence(days = 30): Promise<AdherencePayload> {
return apiGet(`/api/retrieval/adherence?days=${days}`);