Telemetry coverage, and the rule arms stop filtering to one tier #143

Merged
bvandeusen merged 4 commits from dev into main 2026-09-08 11:11:40 -04:00
Showing only changes of commit 0808e8259a - Show all commits
+9 -1
View File
@@ -706,11 +706,19 @@ async def test_coverage_is_per_source_because_the_table_is_older_than_its_arms(
UID = 990077 UID = 990077
now = datetime.now(timezone.utc) now = datetime.now(timezone.utc)
async with async_session() as s: async with async_session() as s:
# An old surface, recording since well before any window we ask for. # An old surface, recording since well before any window we ask for,
# AND still recording inside it. Both rows are needed: `complete_from`
# comes from the all-time query, but a source only gets a bucket at all
# if it has rows in the window, so the 90-day row alone would leave
# nothing to assert on.
s.add(RetrievalLog( s.add(RetrievalLog(
user_id=UID, source="auto_inject", result_count=1, user_id=UID, source="auto_inject", result_count=1,
created_at=now - timedelta(days=90), created_at=now - timedelta(days=90),
)) ))
s.add(RetrievalLog(
user_id=UID, source="auto_inject", result_count=1,
created_at=now - timedelta(days=1),
))
# A young arm, first written INSIDE the window below. # A young arm, first written INSIDE the window below.
s.add(RetrievalLog( s.add(RetrievalLog(
user_id=UID, source="pre_tool_rule", result_count=1, user_id=UID, source="pre_tool_rule", result_count=1,