feat(8118,8119): telemetry reads take a closed window, and every enter_project records whether it carried the family line
CI & Build / TypeScript typecheck (push) Successful in 37s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 17s
CI & Build / integration (push) Failing after 2m15s
CI & Build / Python tests (push) Successful in 2m23s
CI & Build / Build & push image (push) Skipped

#8119: retrieval_telemetry and list_rules(with_usage) take `since` and
`until` (ISO date or datetime) besides `days`. Every windowed count is
bounded at both ends: sources, note/rule/system/moment usage, record
reach, judged lines and the floor-moved check. A review read after its
period can now keep a later deploy out of its counts. A bad bound is
refused rather than widened.

#8118: enter_project writes one AppLog row (family / enter_project) per
entry: the project, whether the family line was shown, its counts, and
whether the readout failed. It is spawned, so the handshake does not wait.
retrieval_telemetry gains a `family_line` block: per project, entries,
entries that carried the line, first and last shown, and the latest
counts. Review #5132's "did the project's sessions see the line" is now
answerable from this deploy on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 00:01:19 -05:00
co-authored by Claude Opus 5.5
parent 0e946ffac8
commit 577a8e8621
12 changed files with 389 additions and 29 deletions
+5 -3
View File
@@ -34,7 +34,7 @@ from __future__ import annotations
import logging
from sqlalchemy import func, or_, select
from sqlalchemy import func, or_, select, true
from grimoire.models import async_session
from grimoire.models.retrieval_tuning import RetrievalTuningEvent
@@ -389,8 +389,9 @@ async def record_release_defaults() -> list[dict]:
return written
async def floor_moves_since(since) -> dict[str, str]:
"""Surfaces whose floor genuinely MOVED at or after `since`.
async def floor_moves_since(since, until=None) -> dict[str, str]:
"""Surfaces whose floor genuinely MOVED at or after `since` (and before
`until`, when given).
Genuinely: `old_value IS NOT NULL`, so a baseline row — which records a
default without changing it — does not read as a change. Returns surface ->
@@ -410,6 +411,7 @@ async def floor_moves_since(since) -> dict[str, str]:
RetrievalTuningEvent.dial == "floor",
RetrievalTuningEvent.old_value.isnot(None),
RetrievalTuningEvent.created_at >= since,
RetrievalTuningEvent.created_at < until if until is not None else true(),
)
.order_by(RetrievalTuningEvent.created_at.desc())
)